summaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cdrom')
-rw-r--r--drivers/cdrom/aztcd.c65
-rw-r--r--drivers/cdrom/cdrom.c53
-rw-r--r--drivers/cdrom/cdu31a.c42
-rw-r--r--drivers/cdrom/cm206.c33
-rw-r--r--drivers/cdrom/gscd.c44
-rw-r--r--drivers/cdrom/isp16.c38
-rw-r--r--drivers/cdrom/isp16.h1
-rw-r--r--drivers/cdrom/mcd.c41
-rw-r--r--drivers/cdrom/mcdx.c35
-rw-r--r--drivers/cdrom/optcd.c39
-rw-r--r--drivers/cdrom/sbpcd.c37
-rw-r--r--drivers/cdrom/sjcd.c33
-rw-r--r--drivers/cdrom/sonycd535.c37
13 files changed, 351 insertions, 147 deletions
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c
index 4c03f4917..d560fa6a4 100644
--- a/drivers/cdrom/aztcd.c
+++ b/drivers/cdrom/aztcd.c
@@ -158,6 +158,11 @@
V2.60 Implemented Auto-Probing; made changes for kernel's 2.1.xx blocksize
Adaption to linux kernel > 2.1.0
Werner Zimmermann, Nov 29, 97
+
+ November 1999 -- Make kernel-parameter implementation work with 2.3.x
+ Removed init_module & cleanup_module in favor of
+ module_init & module_exit.
+ Torben Mathiasen <tmm@image.dk>
*/
#include <linux/version.h>
@@ -351,11 +356,10 @@ static int aztGetDiskInfo(void);
static int aztGetToc(int multi);
/* Kernel Interface Functions */
-void aztcd_setup(char *str, int *ints);
static int check_aztcd_media_change(kdev_t full_dev);
static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg);
static void azt_transfer(void);
-static void do_aztcd_request(void);
+static void do_aztcd_request(request_queue_t *);
static void azt_invalidate_buffers(void);
int aztcd_open(struct inode *ip, struct file *fp);
@@ -365,11 +369,8 @@ static void aztcd_release(struct inode * inode, struct file * file);
static int aztcd_release(struct inode * inode, struct file * file);
#endif
-int aztcd_init(void);
-#ifdef MODULE
- int init_module(void);
- void cleanup_module(void);
-#endif MODULE
+int aztcd_init(void);
+
static struct file_operations azt_fops = {
NULL, /* lseek - default */
block_read, /* read - general block-dev read */
@@ -1084,17 +1085,25 @@ static int aztGetToc(int multi)
Kernel Interface Functions
##########################################################################
*/
-#ifdef AZT_KERNEL_PRIOR_2_1
-void aztcd_setup(char *str, int *ints)
-#else
-void __init aztcd_setup(char *str, int *ints)
-#endif
-{ if (ints[0] > 0)
- azt_port = ints[1];
- if (ints[0] > 1)
- azt_cont = ints[2];
+
+#ifndef MODULE
+static int __init aztcd_setup(char *str)
+{
+ int ints[4];
+
+ (void)get_options(str, ARRAY_SIZE(ints), ints);
+
+ if (ints[0] > 0)
+ azt_port = ints[1];
+ if (ints[1] > 1)
+ azt_cont = ints[2];
+ return 1;
}
+__setup("aztcd=", aztcd_setup);
+
+#endif /* !MODULE */
+
/*
* Checking if the media has been changed
*/
@@ -1478,7 +1487,7 @@ static void azt_transfer(void)
}
}
-static void do_aztcd_request(void)
+static void do_aztcd_request(request_queue_t * q)
{
#ifdef AZT_TEST
printk(" do_aztcd_request(%ld+%ld) Time:%li\n", CURRENT -> sector, CURRENT -> nr_sectors,jiffies);
@@ -1614,11 +1623,7 @@ static int aztcd_release(struct inode * inode, struct file * file)
* Test for presence of drive and initialize it. Called at boot time.
*/
-#ifdef AZT_KERNEL_PRIOR_2_1
-int aztcd_init(void)
-#else
int __init aztcd_init(void)
-#endif
{ long int count, max_count;
unsigned char result[50];
int st;
@@ -1798,7 +1803,7 @@ int __init aztcd_init(void)
MAJOR_NR);
return -EIO;
}
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
#ifndef AZT_KERNEL_PRIOR_2_1
blksize_size[MAJOR_NR] = aztcd_blocksizes;
#endif
@@ -1815,14 +1820,7 @@ int __init aztcd_init(void)
return (0);
}
-#ifdef MODULE
-
-int init_module(void)
-{
- return aztcd_init();
-}
-
-void cleanup_module(void)
+void __exit aztcd_exit(void)
{
if ((unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL))
{ printk("What's that: can't unregister aztcd\n");
@@ -1836,8 +1834,11 @@ void cleanup_module(void)
release_region(azt_port,4); /*proprietary interface*/
printk(KERN_INFO "aztcd module released.\n");
}
-#endif MODULE
+#ifdef MODULE
+module_init(aztcd_init);
+#endif
+module_exit(aztcd_exit);
/*##########################################################################
Aztcd State Machine: Controls Drive Operating State
@@ -2283,5 +2284,3 @@ static void azt_bin2bcd(unsigned char *p)
static int azt_bcd2bin(unsigned char bcd)
{ return (bcd >> 4) * 10 + (bcd & 0xF);
}
-
-
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 536c94a44..d952ecf4b 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -186,11 +186,15 @@
-- Added setup of write mode for packet writing.
-- Fixed CDDA ripping with cdda2wav - accept much larger requests of
number of frames and split the reads in blocks of 8.
+
+ 3.05 Dec 13, 1999 - Jens Axboe <axboe@image.dk>
+ -- Added support for changing the region of DVD drives.
+ -- Added sense data to generic command.
-------------------------------------------------------------------------*/
-#define REVISION "Revision: 3.05"
-#define VERSION "Id: cdrom.c 3.05 1999/10/24"
+#define REVISION "Revision: 3.06"
+#define VERSION "Id: cdrom.c 3.06 1999/12/13"
/* I use an error-log mask to give fine grain control over the type of
messages dumped to the system logs. The available masks include: */
@@ -1072,6 +1076,31 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
return ret;
break;
+ /* Get region settings */
+ case DVD_LU_SEND_RPC_STATE:
+ cdinfo(CD_DVD, "entering DVD_LU_SEND_RPC_STATE\n");
+ setup_report_key(&cgc, 0, 8);
+
+ if ((ret = cdo->generic_packet(cdi, &cgc)))
+ return ret;
+
+ ai->lrpcs.type = (buf[4] >> 6) & 3;
+ ai->lrpcs.vra = (buf[4] >> 3) & 7;
+ ai->lrpcs.ucca = buf[4] & 7;
+ ai->lrpcs.region_mask = buf[5];
+ ai->lrpcs.rpc_scheme = buf[6];
+ break;
+
+ /* Set region settings */
+ case DVD_HOST_SEND_RPC_STATE:
+ cdinfo(CD_DVD, "entering DVD_HOST_SEND_RPC_STATE\n");
+ setup_send_key(&cgc, 0, 6);
+ buf[4] = ai->hrpcs.pdrc;
+
+ if ((ret = cdo->generic_packet(cdi, &cgc)))
+ return ret;
+ break;
+
default:
cdinfo(CD_WARNING, "Invalid DVD key ioctl (%d)\n", ai->type);
return -ENOTTY;
@@ -1528,6 +1557,9 @@ int cdrom_ioctl(struct inode *ip, struct file *fp,
if (!CDROM_CAN(CDC_LOCK))
return -EDRIVE_CANT_DO_THIS;
keeplocked = arg ? 1 : 0;
+ /* don't unlock the door on multiple opens */
+ if ((cdi->use_count != 1) && !arg)
+ return -EBUSY;
return cdo->lock_door(cdi, arg);
}
@@ -1861,14 +1893,19 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
case CDROMPLAYTRKIND: {
struct cdrom_ti ti;
struct cdrom_tocentry entry;
+ struct cdrom_tochdr tochdr;
cdinfo(CD_DO_IOCTL, "entering CDROMPLAYTRKIND\n");
IOCTL_IN(arg, struct cdrom_ti, ti);
entry.cdte_format = CDROM_MSF;
/* get toc entry for start and end track */
- entry.cdte_track = ti.cdti_trk0;
- if (cdi->ops->audio_ioctl(cdi, CDROMREADTOCENTRY, &entry))
+ if (cdo->audio_ioctl(cdi, CDROMREADTOCHDR, &tochdr))
+ return -EINVAL;
+ entry.cdte_track = ti.cdti_trk1 + 1;
+ if (entry.cdte_track > tochdr.cdth_trk1)
+ return -EINVAL;
+ if (cdo->audio_ioctl(cdi, CDROMREADTOCENTRY, &entry))
return -EINVAL;
cgc.cmd[3] = entry.cdte_addr.msf.minute;
@@ -1876,7 +1913,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
cgc.cmd[5] = entry.cdte_addr.msf.frame;
entry.cdte_track = ti.cdti_trk1;
- if (cdi->ops->audio_ioctl(cdi, CDROMREADTOCENTRY, &entry))
+ if (cdo->audio_ioctl(cdi, CDROMREADTOCENTRY, &entry))
return -EINVAL;
cgc.cmd[6] = entry.cdte_addr.msf.minute;
@@ -2020,6 +2057,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
case CDROM_SEND_PACKET: {
__u8 *userbuf, copy = 0;
+ struct request_sense *sense;
if (!CDROM_CAN(CDC_GENERIC_PACKET))
return -ENOSYS;
cdinfo(CD_DO_IOCTL, "entering CDROM_SEND_PACKET\n");
@@ -2027,6 +2065,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
copy = !!cgc.buflen;
userbuf = cgc.buffer;
cgc.buffer = NULL;
+ sense = cgc.sense;
if (userbuf != NULL && copy) {
/* usually commands just copy data one way, i.e.
* we send a buffer to the drive and the command
@@ -2057,6 +2096,10 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
ret = cdo->generic_packet(cdi, &cgc);
if (copy && !ret)
__copy_to_user(userbuf, cgc.buffer, cgc.buflen);
+ /* copy back sense data */
+ if (ret && sense != NULL)
+ if (copy_to_user(sense, cgc.sense, sizeof(struct request_sense)))
+ ret = -EFAULT;
kfree(cgc.buffer);
return ret;
}
diff --git a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c
index edb90ee76..24e7a5c26 100644
--- a/drivers/cdrom/cdu31a.c
+++ b/drivers/cdrom/cdu31a.c
@@ -142,6 +142,11 @@
* <kodis@jagunet.com>. Work begun on fixing driver to
* work under 2.1.X. Added temporary extra printks
* which seem to slow it down enough to work.
+ *
+ * 9 November 1999 -- Make kernel-parameter implementation work with 2.3.x
+ * Removed init_module & cleanup_module in favor of
+ * module_init & module_exit.
+ * Torben Mathiasen <tmm@image.dk>
*/
#include <linux/major.h>
@@ -1641,7 +1646,7 @@ read_data_block(char *buffer,
* data access on a CD is done sequentially, this saves a lot of operations.
*/
static void
-do_cdu31a_request(void)
+do_cdu31a_request(request_queue_t * q)
{
int block;
int nblock;
@@ -3317,11 +3322,15 @@ get_drive_configuration(unsigned short base_io,
#ifndef MODULE
/*
* Set up base I/O and interrupts, called from main.c.
+
*/
-void __init
-cdu31a_setup(char *strings,
- int *ints)
+
+static int __init cdu31a_setup(char *strings)
{
+ int ints[4];
+
+ (void)get_options(strings, ARRAY_SIZE(ints), ints);
+
if (ints[0] > 0)
{
cdu31a_port = ints[1];
@@ -3341,7 +3350,12 @@ cdu31a_setup(char *strings,
printk("CDU31A: Unknown interface type: %s\n", strings);
}
}
+
+ return 1;
}
+
+__setup("cdu31a=", cdu31a_setup);
+
#endif
static int cdu31a_block_size;
@@ -3497,7 +3511,7 @@ cdu31a_init(void)
is_a_cdu31a = strcmp("CD-ROM CDU31A", drive_config.product_id) == 0;
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
read_ahead[MAJOR_NR] = CDU31A_READAHEAD;
cdu31a_block_size = 1024; /* 1kB default block size */
/* use 'mount -o block=2048' */
@@ -3539,16 +3553,9 @@ errout3:
return -EIO;
}
-#ifdef MODULE
-int
-init_module(void)
-{
- return cdu31a_init();
-}
-
-void
-cleanup_module(void)
+void __exit
+cdu31a_exit(void)
{
if (unregister_cdrom(&scd_info))
{
@@ -3567,4 +3574,9 @@ cleanup_module(void)
release_region(cdu31a_port,4);
printk(KERN_INFO "cdu31a module released.\n");
}
-#endif MODULE
+
+#ifdef MODULE
+module_init(cdu31a_init);
+#endif
+module_exit(cdu31a_exit);
+
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c
index 3ab0533f8..e600d81d0 100644
--- a/drivers/cdrom/cm206.c
+++ b/drivers/cdrom/cm206.c
@@ -151,6 +151,11 @@ History:
24 jan 1998 Removed the cm206_disc_status() function, as it was now dead
code. The Uniform CDROM driver now provides this functionality.
+
+9 Nov. 1999 Make kernel-parameter implementation work with 2.3.x
+ Removed init_module & cleanup_module in favor of
+ module_init & module_exit.
+ Torben Mathiasen <tmm@image.dk>
*
* Parts of the code are based upon lmscd.c written by Kai Petzke,
* sbpcd.c written by Eberhard Moenkeberg, and mcd.c by Martin
@@ -209,6 +214,8 @@ static int auto_probe=1; /* Yes, why not? */
static int cm206_base = CM206_BASE;
static int cm206_irq = CM206_IRQ;
+static int cm206[2] = {0,0}; /* for compatible `insmod' parameter passing */
+
MODULE_PARM(cm206_base, "i"); /* base */
MODULE_PARM(cm206_irq, "i"); /* irq */
MODULE_PARM(cm206, "1-2i"); /* base,irq or irq,base */
@@ -801,7 +808,7 @@ int try_adapter(int sector)
/* This is not a very smart implementation. We could optimize for
consecutive block numbers. I'm not convinced this would really
bring down the processor load. */
-static void do_cm206_request(void)
+static void do_cm206_request(request_queue_t * q)
{
long int i, cd_sec_no;
int quarter, error;
@@ -1394,7 +1401,7 @@ int __init cm206_init(void)
cleanup(3);
return -EIO;
}
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
blksize_size[MAJOR_NR] = cm206_blocksizes;
read_ahead[MAJOR_NR] = 16; /* reads ahead what? */
init_bh(CM206_BH, cm206_bh);
@@ -1411,7 +1418,6 @@ int __init cm206_init(void)
#ifdef MODULE
-static int cm206[2] = {0,0}; /* for compatible `insmod' parameter passing */
void __init parse_options(void)
{
@@ -1428,7 +1434,7 @@ void __init parse_options(void)
}
}
-int init_module(void)
+int __cm206_init(void)
{
parse_options();
#if !defined(AUTO_PROBE_MODULE)
@@ -1437,19 +1443,26 @@ int init_module(void)
return cm206_init();
}
-void cleanup_module(void)
+void __exit cm206_exit(void)
{
cleanup(4);
printk(KERN_INFO "cm206 removed\n");
}
+
+module_init(__cm206_init);
+module_exit(cm206_exit);
#else /* !MODULE */
/* This setup function accepts either `auto' or numbers in the range
* 3--11 (for irq) or 0x300--0x370 (for base port) or both. */
-void __init cm206_setup(char *s, int *p)
+
+static int __init cm206_setup(char *s)
{
- int i;
+ int i, p[4];
+
+ (void)get_options(s, ARRAY_SIZE(p), p);
+
if (!strcmp(s, "auto")) auto_probe=1;
for(i=1; i<=p[0]; i++) {
if (0x300 <= p[i] && i<= 0x370 && p[i] % 0x10 == 0) {
@@ -1461,8 +1474,12 @@ void __init cm206_setup(char *s, int *p)
auto_probe = 0;
}
}
+ return 1;
}
-#endif /* MODULE */
+
+__setup("cm206=", cm206_setup);
+
+#endif /* !MODULE */
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -D__SMP__ -pipe -fno-strength-reduce -m486 -DCPU=486 -D__SMP__ -DMODULE -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h -c -o cm206.o cm206.c"
diff --git a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c
index 07c36f51b..a305c1443 100644
--- a/drivers/cdrom/gscd.c
+++ b/drivers/cdrom/gscd.c
@@ -31,6 +31,13 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ --------------------------------------------------------------------
+
+ 9 November 1999 -- Make kernel-parameter implementation work with 2.3.x
+ Removed init_module & cleanup_module in favor of
+ module_init & module_exit.
+ Torben Mathiasen <tmm@image.dk>
*/
@@ -86,7 +93,8 @@ static void gscd_bin2bcd (unsigned char *p);
/* Schnittstellen zum Kern/FS */
-static void do_gscd_request (void);
+static void do_gscd_request (request_queue_t *);
+static void __do_gscd_request (void);
static int gscd_ioctl (struct inode *, struct file *, unsigned int, unsigned long);
static int gscd_open (struct inode *, struct file *);
static int gscd_release (struct inode *, struct file *);
@@ -194,14 +202,24 @@ static int check_gscd_med_chg (kdev_t full_dev)
}
-void __init gscd_setup (char *str, int *ints)
+#ifndef MODULE
+/* Using new interface for kernel-parameters */
+
+static int __init gscd_setup (char *str)
{
+ int ints[2];
+ (void)get_options(str, ARRAY_SIZE(ints), ints);
+
if (ints[0] > 0)
{
gscd_port = ints[1];
}
+ return 1;
}
+__setup("gscd=", gscd_setup);
+
+#endif
static int gscd_ioctl (struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg)
{
@@ -260,7 +278,12 @@ long offs;
* I/O request routine called from Linux kernel.
*/
-static void do_gscd_request (void)
+static void do_gscd_request (request_queue_t * q)
+{
+ __do_gscd_request();
+}
+
+static void __do_gscd_request (void)
{
unsigned int block,dev;
unsigned int nsect;
@@ -355,7 +378,7 @@ char cmd[] = { CMD_READ, 0x80, 0,0,0, 0,1 }; /* cmd mode M-S-F secth sectl */
end_request(1);
}
}
- SET_TIMER(do_gscd_request, 1);
+ SET_TIMER(__do_gscd_request, 1);
}
@@ -957,9 +980,8 @@ unsigned int AX;
}
#endif
-#ifdef MODULE
/* Init for the Module-Version */
-int init_module (void)
+int init_gscd(void)
{
long err;
@@ -978,7 +1000,7 @@ long err;
}
}
-void cleanup_module (void)
+void __exit exit_gscd(void)
{
if ((unregister_blkdev(MAJOR_NR, "gscd" ) == -EINVAL))
@@ -990,7 +1012,11 @@ void cleanup_module (void)
release_region (gscd_port,4);
printk(KERN_INFO "GoldStar-module released.\n" );
}
-#endif
+
+#ifdef MODULE
+module_init(init_gscd);
+#endif
+module_exit(exit_gscd);
/* Test for presence of drive and initialize it. Called only at boot time. */
@@ -1060,7 +1086,7 @@ int result;
return -EIO;
}
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
blksize_size[MAJOR_NR] = gscd_blocksizes;
read_ahead[MAJOR_NR] = 4;
diff --git a/drivers/cdrom/isp16.c b/drivers/cdrom/isp16.c
index 7b0701707..c2859f450 100644
--- a/drivers/cdrom/isp16.c
+++ b/drivers/cdrom/isp16.c
@@ -11,6 +11,11 @@
* Removed sound configuration.
* Added "module" support.
*
+ * 9 November 1999 -- Make kernel-parameter implementation work with 2.3.x
+ * Removed init_module & cleanup_module in favor of
+ * module_init & module_exit.
+ * Torben Mathiasen <tmm@image.dk>
+ *
* Detect cdrom interface on ISP16 sound card.
* Configure cdrom interface.
*
@@ -69,17 +74,20 @@ MODULE_PARM(isp16_cdrom_base, "i");
MODULE_PARM(isp16_cdrom_irq, "i");
MODULE_PARM(isp16_cdrom_dma, "i");
MODULE_PARM(isp16_cdrom_type, "s");
-int init_module(void);
-void cleanup_module(void);
+void isp16_exit(void);
#endif
#define ISP16_IN(p) (outb(isp16_ctrl,ISP16_CTRL_PORT), inb(p))
#define ISP16_OUT(p,b) (outb(isp16_ctrl,ISP16_CTRL_PORT), outb(b,p))
+#ifndef MODULE
-void __init
-isp16_setup(char *str, int *ints)
+static int
+__init isp16_setup(char *str)
{
+ int ints[4];
+
+ (void)get_options(str, ARRAY_SIZE(ints), ints);
if ( ints[0] > 0 )
isp16_cdrom_base = ints[1];
if ( ints[0] > 1 )
@@ -88,8 +96,14 @@ isp16_setup(char *str, int *ints)
isp16_cdrom_dma = ints[3];
if ( str )
isp16_cdrom_type = str;
+
+ return 1;
}
+__setup("isp16=", isp16_setup);
+
+#endif /* MODULE */
+
/*
* ISP16 initialisation.
*
@@ -307,15 +321,15 @@ isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
return(0);
}
-#ifdef MODULE
-int init_module(void)
-{
- return isp16_init();
-}
-
-void cleanup_module(void)
+void __exit isp16_exit(void)
{
release_region(ISP16_IO_BASE, ISP16_IO_SIZE);
printk(KERN_INFO "ISP16: module released.\n");
}
-#endif /* MODULE */
+
+#ifdef MODULE
+module_init(isp16_init);
+#endif
+module_exit(isp16_exit);
+
+
diff --git a/drivers/cdrom/isp16.h b/drivers/cdrom/isp16.h
index 9945bb34c..7fc74b8e4 100644
--- a/drivers/cdrom/isp16.h
+++ b/drivers/cdrom/isp16.h
@@ -71,5 +71,4 @@
#define ISP16_IO_BASE 0xF8D
#define ISP16_IO_SIZE 5 /* ports used from 0xF8D up to 0xF91 */
-void isp16_setup(char *str, int *ints);
int isp16_init(void);
diff --git a/drivers/cdrom/mcd.c b/drivers/cdrom/mcd.c
index 81f9bd762..cbb2a27cd 100644
--- a/drivers/cdrom/mcd.c
+++ b/drivers/cdrom/mcd.c
@@ -68,6 +68,13 @@
November 1997 -- ported to the Uniform CD-ROM driver by Erik Andersen.
March 1999 -- made io base and irq CONFIG_ options (Tigran Aivazian).
+
+ November 1999 -- Make kernel-parameter implementation work with 2.3.x
+ Removed init_module & cleanup_module in favor of
+ module_init & module_exit.
+ Torben Mathiasen <tmm@image.dk>
+
+
*/
#include <linux/module.h>
@@ -229,9 +236,13 @@ static struct cdrom_device_info mcd_info = {
"mcd", /* name of the device type */
};
-
-void __init mcd_setup(char *str, int *ints)
+#ifndef MODULE
+static int __init mcd_setup(char *str)
{
+ int ints[9];
+
+ (void)get_options(str, ARRAY_SIZE(ints), ints);
+
if (ints[0] > 0)
mcd_port = ints[1];
if (ints[0] > 1)
@@ -240,8 +251,13 @@ void __init mcd_setup(char *str, int *ints)
if (ints[0] > 2)
mitsumi_bug_93_wait = ints[3];
#endif /* WORK_AROUND_MITSUMI_BUG_93 */
+
+ return 1;
}
+__setup("mcd=", mcd_setup);
+
+#endif /* MODULE */
static int mcd_media_changed(struct cdrom_device_info * cdi, int disc_nr)
{
@@ -648,7 +664,7 @@ mcd_interrupt(int irq, void *dev_id, struct pt_regs * regs)
static void
-do_mcd_request(void)
+do_mcd_request(request_queue_t * q)
{
#ifdef TEST2
printk(" do_mcd_request(%ld+%ld)\n", CURRENT -> sector, CURRENT -> nr_sectors);
@@ -1127,7 +1143,7 @@ static void mcd_release(struct cdrom_device_info * cdi)
/* This routine gets called during initialization if things go wrong,
- * and is used in cleanup_module as well. */
+ * and is used in mcd_exit as well. */
static void cleanup(int level)
{
switch (level) {
@@ -1179,7 +1195,7 @@ int __init mcd_init(void)
}
blksize_size[MAJOR_NR] = mcd_blocksizes;
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
read_ahead[MAJOR_NR] = 4;
/* check for card */
@@ -1635,14 +1651,15 @@ Toc[i].diskTime.min, Toc[i].diskTime.sec, Toc[i].diskTime.frame);
return limit > 0 ? 0 : -1;
}
-#ifdef MODULE
-int init_module(void)
-{
- return mcd_init();
-}
-void cleanup_module(void)
+void __exit mcd_exit(void)
{
cleanup(3);
}
-#endif MODULE
+
+#ifdef MODULE
+module_init(mcd_init);
+#endif
+module_exit(mcd_exit);
+
+
diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c
index fa3f36310..32ae52497 100644
--- a/drivers/cdrom/mcdx.c
+++ b/drivers/cdrom/mcdx.c
@@ -44,6 +44,10 @@
* Marcin Dalecki (improved performance, shortened code)
* ... somebody forgotten?
*
+ * 9 November 1999 -- Make kernel-parameter implementation work with 2.3.x
+ * Removed init_module & cleanup_module in favor of
+ * module_init & module_exit.
+ * Torben Mathiasen <tmm@image.dk>
*/
@@ -208,10 +212,8 @@ struct s_drive_stuff {
/* declared in blk.h */
int mcdx_init(void);
-void do_mcdx_request(void);
+void do_mcdx_request(request_queue_t * q);
-/* already declared in init/main */
-void mcdx_setup(char *, int *);
/* Indirect exported functions. These functions are exported by their
addresses, such as mcdx_open and mcdx_close in the
@@ -521,7 +523,7 @@ static int mcdx_audio_ioctl(struct cdrom_device_info * cdi, unsigned int cmd,
}
}
-void do_mcdx_request()
+void do_mcdx_request(request_queue_t * q)
{
int dev;
struct s_drive_stuff *stuffp;
@@ -770,12 +772,21 @@ static int mcdx_media_changed(struct cdrom_device_info * cdi, int disc_nr)
return 1;
}
-void __init mcdx_setup(char *str, int *pi)
+#ifndef MODULE
+static int __init mcdx_setup(char *str)
{
+ int pi[4];
+ (void)get_options(str, ARRAY_SIZE(pi), pi);
+
if (pi[0] > 0) mcdx_drive_map[0][0] = pi[1];
if (pi[0] > 1) mcdx_drive_map[0][1] = pi[2];
+ return 1;
}
+__setup("mcdx=", mcdx_setup);
+
+#endif
+
/* DIRTY PART ******************************************************/
static void mcdx_delay(struct s_drive_stuff *stuff, long jifs)
@@ -953,10 +964,10 @@ mcdx_talk (
}
/* MODULE STUFF ***********************************************************/
-#ifdef MODULE
+
EXPORT_NO_SYMBOLS;
-int init_module(void)
+int __mcdx_init(void)
{
int i;
int drives = 0;
@@ -976,7 +987,7 @@ int init_module(void)
return 0;
}
-void cleanup_module(void)
+void __exit mcdx_exit(void)
{
int i;
@@ -1009,7 +1020,11 @@ void cleanup_module(void)
#endif
}
-#endif MODULE
+#ifdef MODULE
+module_init(__mcdx_init);
+#endif
+module_exit(mcdx_exit);
+
/* Support functions ************************************************/
@@ -1116,7 +1131,7 @@ int __init mcdx_init_drive(int drive)
return 1;
}
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
read_ahead[MAJOR_NR] = READ_AHEAD;
blksize_size[MAJOR_NR] = mcdx_blocksizes;
diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c
index 68a22cbd1..4fd96706d 100644
--- a/drivers/cdrom/optcd.c
+++ b/drivers/cdrom/optcd.c
@@ -57,6 +57,11 @@
thanks to Luke McFarlane. Also tidied up some
printk behaviour. ISP16 initialization
is now handled by a separate driver.
+
+ 09-11-99 Make kernel-parameter implementation work with 2.3.x
+ Removed init_module & cleanup_module in favor of
+ module_init & module_exit.
+ Torben Mathiasen <tmm@image.dk>
*/
/* Includes */
@@ -1360,7 +1365,7 @@ static void poll(void)
}
-static void do_optcd_request(void)
+static void do_optcd_request(request_queue_t * q)
{
DEBUG((DEBUG_REQUEST, "do_optcd_request(%ld+%ld)",
CURRENT -> sector, CURRENT -> nr_sectors));
@@ -2020,14 +2025,23 @@ static struct file_operations opt_fops = {
NULL /* revalidate */
};
-
+#ifndef MODULE
/* Get kernel parameter when used as a kernel driver */
-void __init optcd_setup(char *str, int *ints)
+static int optcd_setup(char *str)
{
+ int ints[4];
+ (void)get_options(str, ARRAY_SIZE(ints), ints);
+
if (ints[0] > 0)
optcd_port = ints[1];
+
+ return 1;
}
+__setup("optcd=", optcd_setup);
+
+#endif MODULE
+
/* Test for presence of drive and initialize it. Called at boot time
or during module initialisation. */
int __init optcd_init(void)
@@ -2067,7 +2081,7 @@ int __init optcd_init(void)
hardsect_size[MAJOR_NR] = &hsecsize;
blksize_size[MAJOR_NR] = &blksize;
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
read_ahead[MAJOR_NR] = 4;
request_region(optcd_port, 4, "optcd");
@@ -2076,14 +2090,7 @@ int __init optcd_init(void)
}
-#ifdef MODULE
-int init_module(void)
-{
- return optcd_init();
-}
-
-
-void cleanup_module(void)
+void __exit optcd_exit(void)
{
if (unregister_blkdev(MAJOR_NR, "optcd") == -EINVAL) {
printk(KERN_ERR "optcd: what's that: can't unregister\n");
@@ -2092,4 +2099,10 @@ void cleanup_module(void)
release_region(optcd_port, 4);
printk(KERN_INFO "optcd: module released.\n");
}
-#endif MODULE
+
+#ifdef MODULE
+module_init(optcd_init);
+#endif
+module_exit(optcd_exit);
+
+
diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c
index 3e704b0d8..42fa4d62b 100644
--- a/drivers/cdrom/sbpcd.c
+++ b/drivers/cdrom/sbpcd.c
@@ -307,6 +307,11 @@
* 4.62 Fix a bug where playing audio left the drive in an unusable state.
* Heiko Eissfeldt <heiko@colossus.escape.de>
*
+ * November 1999 -- Make kernel-parameter implementation work with 2.3.x
+ * Removed init_module & cleanup_module in favor of
+ * module_init & module_exit.
+ * Torben Mathiasen <tmm@image.dk>
+ *
*
* TODO
* implement "read all subchannel data" (96 bytes per frame)
@@ -324,6 +329,7 @@
#include <linux/module.h>
+#include <linux/version.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/mm.h>
@@ -4794,7 +4800,7 @@ static inline void sbpcd_end_request(struct request *req, int uptodate) {
/*
* I/O request routine, called from Linux kernel.
*/
-static void DO_SBPCD_REQUEST(void)
+static void DO_SBPCD_REQUEST(request_queue_t * q)
{
u_int block;
u_int nsect;
@@ -5457,12 +5463,15 @@ static struct cdrom_device_info sbpcd_info = {
* bytes above).
*
*/
+
#if (SBPCD_ISSUE-1)
-static void __init sbpcd_setup(const char *s, int *p)
+static int sbpcd_setup(char *s)
#else
-void __init sbpcd_setup(const char *s, int *p)
+int sbpcd_setup(char *s)
#endif
{
+ int p[4];
+ (void)get_options(s, ARRAY_SIZE(p), p);
setup_done++;
msg(DBG_INI,"sbpcd_setup called with %04X,%s\n",p[1], s);
sbpro_type=0; /* default: "LaserMate" */
@@ -5494,7 +5503,13 @@ void __init sbpcd_setup(const char *s, int *p)
}
}
else CDi_data=sbpcd_ioaddr+2;
+
+ return 1;
}
+
+__setup("sbpcd=", sbpcd_setup);
+
+
/*==========================================================================*/
/*
* Sequoia S-1000 CD-ROM Interface Configuration
@@ -5569,7 +5584,7 @@ static int __init config_spea(void)
* Called once at boot or load time.
*/
#ifdef MODULE
-int init_module(void)
+int __init __SBPCD_INIT(void)
#else
int __init SBPCD_INIT(void)
#endif MODULE
@@ -5616,7 +5631,7 @@ int __init SBPCD_INIT(void)
else if (sbpcd[port_index+1]==1) type=str_sb;
else if (sbpcd[port_index+1]==3) type=str_t16;
else type=str_lm;
- sbpcd_setup(type, addr);
+ sbpcd_setup((char *)type);
#if DISTRIBUTION
msg(DBG_INF,"Scanning 0x%X (%s)...\n", CDo_command, type);
#endif DISTRIBUTION
@@ -5725,7 +5740,7 @@ int __init SBPCD_INIT(void)
goto init_done;
#endif MODULE
}
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
read_ahead[MAJOR_NR] = buffers * (CD_FRAMESIZE / 512);
request_region(CDo_command,4,major_name);
@@ -5808,7 +5823,7 @@ int __init SBPCD_INIT(void)
}
/*==========================================================================*/
#ifdef MODULE
-void cleanup_module(void)
+void sbpcd_exit(void)
{
int j;
@@ -5833,6 +5848,14 @@ void cleanup_module(void)
}
msg(DBG_INF, "%s module released.\n", major_name);
}
+
+
+#ifdef MODULE
+module_init(__SBPCD_INIT) /*HACK!*/;
+#endif
+module_exit(sbpcd_exit);
+
+
#endif MODULE
/*==========================================================================*/
/*
diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c
index 35697369f..92bb0b736 100644
--- a/drivers/cdrom/sjcd.c
+++ b/drivers/cdrom/sjcd.c
@@ -49,6 +49,10 @@
* the previous version of this driver. Coded added by Anthony Barbachan
* from bugfix tip originally suggested by Alan Cox.
*
+ * November 1999 -- Make kernel-parameter implementation work with 2.3.x
+ * Removed init_module & cleanup_module in favor of
+ * module_init & module_exit.
+ * Torben Mathiasen <tmm@image.dk>
*/
#define SJCD_VERSION_MAJOR 1
@@ -163,12 +167,21 @@ static int sjcd_cleanup(void);
* Set up device, i.e., use command line data to set
* base address.
*/
-void __init sjcd_setup( char *str, int *ints )
+#ifndef MODULE
+static int __init sjcd_setup( char *str)
{
+ int ints[2];
+ (void)get_options(str, ARRAY_SIZE(ints), ints);
if (ints[0] > 0)
sjcd_base = ints[1];
+
+ return 1;
}
+__setup("sjcd=", sjcd_setup);
+
+#endif
+
/*
* Special converters.
*/
@@ -1272,7 +1285,7 @@ static void sjcd_poll( void ){
SJCD_SET_TIMER( sjcd_poll, 1 );
}
-static void do_sjcd_request( void ){
+static void do_sjcd_request( request_queue_t * q ){
#if defined( SJCD_TRACE )
printk( "SJCD: do_sjcd_request(%ld+%ld)\n",
CURRENT->sector, CURRENT->nr_sectors );
@@ -1475,7 +1488,7 @@ int __init sjcd_init( void ){
return( -EIO );
}
- blk_dev[ MAJOR_NR ].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
read_ahead[ MAJOR_NR ] = 4;
if( check_region( sjcd_base, 4 ) ){
@@ -1577,18 +1590,18 @@ sjcd_cleanup(void)
return(0);
}
-#ifdef MODULE
-
-int init_module(void)
-{
- return sjcd_init();
-}
-void cleanup_module(void)
+void __exit sjcd_exit(void)
{
if ( sjcd_cleanup() )
printk( "SJCD: module: cannot be removed.\n" );
else
printk(KERN_INFO "SJCD: module: removed.\n");
}
+
+#ifdef MODULE
+module_init(sjcd_init);
#endif
+module_exit(sjcd_exit);
+
+
diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c
index 79bad95de..10e693c47 100644
--- a/drivers/cdrom/sonycd535.c
+++ b/drivers/cdrom/sonycd535.c
@@ -31,6 +31,11 @@
* More changes to support CDU-510/515 series
* (Claudio Porfiri<C.Porfiri@nisms.tei.ericsson.se>)
*
+ * November 1999 -- Make kernel-parameter implementation work with 2.3.x
+ * Removed init_module & cleanup_module in favor of
+ * module_init & module_exit.
+ * Torben Mathiasen <tmm@image.dk>
+ *
* Things to do:
* - handle errors and status better, put everything into a single word
* - use interrupts (code mostly there, but a big hole still missing)
@@ -781,7 +786,7 @@ size_to_buf(unsigned int size, Byte *buf)
* data access on a CD is done sequentially, this saves a lot of operations.
*/
static void
-do_cdu535_request(void)
+do_cdu535_request(request_queue_t * q)
{
unsigned int dev;
unsigned int read_size;
@@ -1601,7 +1606,7 @@ sony535_init(void)
MAJOR_NR, CDU535_MESSAGE_NAME);
return -EIO;
}
- blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
blksize_size[MAJOR_NR] = &sonycd535_block_size;
read_ahead[MAJOR_NR] = 8; /* 8 sector (4kB) read-ahead */
@@ -1648,6 +1653,7 @@ sony535_init(void)
}
#ifndef MODULE
+
/*
* accept "kernel command line" parameters
* (added by emoenke@gwdg.de)
@@ -1657,9 +1663,11 @@ sony535_init(void)
*
* the address value has to be the existing CDROM port address.
*/
-void __init
-sonycd535_setup(char *strings, int *ints)
+static int __init
+sonycd535_setup(char *strings)
{
+ int ints[3];
+ (void)get_options(strings, ARRAY_SIZE(ints), ints);
/* if IRQ change and default io base desired,
* then call with io base of 0
*/
@@ -1671,17 +1679,16 @@ sonycd535_setup(char *strings, int *ints)
if ((strings != NULL) && (*strings != '\0'))
printk(CDU535_MESSAGE_NAME
": Warning: Unknown interface type: %s\n", strings);
+
+ return 1;
}
-#else /* MODULE */
+__setup("sonycd535=", sonycd535_setup);
-int init_module(void)
-{
- return sony535_init();
-}
+#endif /* MODULE */
-void
-cleanup_module(void)
+void __exit
+sony535_exit(void)
{
int i;
@@ -1696,4 +1703,10 @@ cleanup_module(void)
else
printk(KERN_INFO CDU535_HANDLE " module released\n");
}
-#endif /* MODULE */
+
+#ifdef MODULE
+module_init(sony535_init);
+#endif
+module_exit(sony535_exit);
+
+