diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-05-12 21:05:59 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-05-12 21:05:59 +0000 |
commit | ba2dacab305c598cd4c34a604f8e276bf5bab5ff (patch) | |
tree | 78670a0139bf4d5ace617b29b7eba82bbc74d602 /drivers/cdrom | |
parent | b77bf69998121e689c5e86cc5630d39a0a9ee6ca (diff) |
Merge with Linux 2.3.99-pre7 and various other bits.
Diffstat (limited to 'drivers/cdrom')
-rw-r--r-- | drivers/cdrom/cdrom.c | 32 | ||||
-rw-r--r-- | drivers/cdrom/cm206.c | 2 | ||||
-rw-r--r-- | drivers/cdrom/optcd.c | 33 | ||||
-rw-r--r-- | drivers/cdrom/sbpcd.c | 6 | ||||
-rw-r--r-- | drivers/cdrom/sjcd.c | 2 |
5 files changed, 34 insertions, 41 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 715dbe139..ceb94b7e5 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -199,11 +199,22 @@ home now. -- Clear header length in mode_select unconditionally. -- Removed the register_disk() that was added, not needed here. + + 3.08 May 1, 2000 - Jens Axboe <axboe@suse.de> + -- Fix direction flag in setup_send_key and setup_report_key. This + gave some SCSI adapters problems. + -- Always return -EROFS for write opens + -- Convert to module_init/module_exit style init and remove some + of the #ifdef MODULE stuff + -- Fix several dvd errors - DVD_LU_SEND_ASF should pass agid, + DVD_HOST_SEND_RPC_STATE did not set buffer size in cdb, and + dvd_do_auth passed uninitialized data to drive because init_cdrom_command + did not clear a 0 sized buffer. -------------------------------------------------------------------------*/ -#define REVISION "Revision: 3.07" -#define VERSION "Id: cdrom.c 3.07 2000/02/02" +#define REVISION "Revision: 3.08" +#define VERSION "Id: cdrom.c 3.08 2000/05/01" /* 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: */ @@ -432,17 +443,6 @@ struct cdrom_device_info *cdrom_find_device(kdev_t dev) while (cdi != NULL && cdi->dev != dev) cdi = cdi->next; - /* we need to find the device this way when IDE devices such - * as /dev/hdc2 are opened. SCSI drives will be found above and - * so will /dev/hdc, for instance. - */ - if (cdi == NULL) { - kdev_t cd_dev = MKDEV(MAJOR(dev), MINOR(dev) | CD_PART_MASK); - cdi = topCdromPtr; - while (cdi != NULL && cdi->dev != cd_dev) - cdi = cdi->next; - } - return cdi; } @@ -834,7 +834,7 @@ static int cdrom_media_changed(kdev_t dev) /* This talks to the VFS, which doesn't like errors - just 1 or 0. * Returning "0" is always safe (media hasn't been changed). Do that * if the low-level cdrom driver dosn't support media changed. */ - if (cdi->ops->media_changed == NULL) + if (cdi == NULL || cdi->ops->media_changed == NULL) return 0; if (!CDROM_CAN(CDC_MEDIA_CHANGED)) return 0; @@ -994,6 +994,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai) struct cdrom_generic_command cgc; struct cdrom_device_ops *cdo = cdi->ops; + memset(buf, 0, sizeof(buf)); init_cdrom_command(&cgc, buf, 0, CGC_DATA_READ); switch (ai->type) { @@ -1052,7 +1053,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai) case DVD_LU_SEND_ASF: cdinfo(CD_DVD, "entering DVD_LU_SEND_ASF\n"); - setup_report_key(&cgc, ai->lsasf.asf, 5); + setup_report_key(&cgc, ai->lsasf.agid, 5); if ((ret = cdo->generic_packet(cdi, &cgc))) return ret; @@ -1113,6 +1114,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai) case DVD_HOST_SEND_RPC_STATE: cdinfo(CD_DVD, "entering DVD_HOST_SEND_RPC_STATE\n"); setup_send_key(&cgc, 0, 6); + buf[1] = 6; buf[4] = ai->hrpcs.pdrc; if ((ret = cdo->generic_packet(cdi, &cgc))) diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c index 1d2d600a0..45af24484 100644 --- a/drivers/cdrom/cm206.c +++ b/drivers/cdrom/cm206.c @@ -1420,7 +1420,7 @@ int __init cm206_init(void) #ifdef MODULE -void __init parse_options(void) +static void __init parse_options(void) { int i; for (i=0; i<2; i++) { diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c index 9a1672037..ad190c6ef 100644 --- a/drivers/cdrom/optcd.c +++ b/drivers/cdrom/optcd.c @@ -265,23 +265,18 @@ inline static int flag_low(int flag, unsigned long timeout) /* Timed waiting for status or data */ static int sleep_timeout; /* max # of ticks to sleep */ static DECLARE_WAIT_QUEUE_HEAD(waitq); -static struct timer_list delay_timer = {NULL, NULL, 0, 0, NULL}; - -#define SET_TIMER(func, jifs) \ - delay_timer.expires = jiffies+(jifs); \ - delay_timer.function = (void *) (func); \ - add_timer(&delay_timer); -#define CLEAR_TIMER del_timer(&delay_timer) +static void sleep_timer(unsigned long data); +static struct timer_list delay_timer = {function: sleep_timer}; /* Timer routine: wake up when desired flag goes low, or when timeout expires. */ -static void sleep_timer(void) +static void sleep_timer(unsigned long data) { int flags = inb(STATUS_PORT) & FL_STDT; if (flags == FL_STDT && --sleep_timeout > 0) { - SET_TIMER(sleep_timer, HZ/100); /* multi-statement macro */ + mod_timer(&delay_timer, jiffies + HZ/100); /* multi-statement macro */ } else wake_up(&waitq); } @@ -297,7 +292,7 @@ static int sleep_flag_low(int flag, unsigned long timeout) sleep_timeout = timeout; flag_high = inb(STATUS_PORT) & flag; if (flag_high && sleep_timeout > 0) { - SET_TIMER(sleep_timer, HZ/100); + mod_timer(&delay_timer, jiffies + HZ/100); sleep_on(&waitq); flag_high = inb(STATUS_PORT) & flag; } @@ -1079,15 +1074,11 @@ static volatile int error = 0; /* %% do something with this?? */ static int tries; /* ibid?? */ static int timeout = 0; -static struct timer_list req_timer = {NULL, NULL, 0, 0, NULL}; +static void poll(unsigned long data); +static struct timer_list req_timer = {function: poll}; -#define SET_REQ_TIMER(func, jifs) \ - req_timer.expires = jiffies+(jifs); \ - req_timer.function = (void *) (func); \ - add_timer(&req_timer); -#define CLEAR_REQ_TIMER del_timer(&req_timer) -static void poll(void) +static void poll(unsigned long data) { static volatile int read_count = 1; int flags; @@ -1363,7 +1354,7 @@ static void poll(void) } } - SET_REQ_TIMER(poll, HZ/100); + mod_timer(&req_timer, jiffies + HZ/100); } @@ -1401,7 +1392,7 @@ static void do_optcd_request(request_queue_t * q) timeout = READ_TIMEOUT; tries = 5; /* %% why not start right away?? */ - SET_REQ_TIMER(poll, HZ/100); + mod_timer(&req_timer, jiffies + HZ/100); } break; } @@ -1945,8 +1936,8 @@ static int opt_release(struct inode *ip, struct file *fp) status = exec_cmd(COMOPEN); DEBUG((DEBUG_VFS, "exec_cmd COMOPEN: %02x", -status)); } - CLEAR_TIMER; - CLEAR_REQ_TIMER; + del_timer(&delay_timer); + del_timer(&req_timer); } MOD_DEC_USE_COUNT; return 0; diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index 4c88dacc2..01dd94bf5 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -764,10 +764,10 @@ static struct { unsigned long cli_sti; /* for saving the processor flags */ #endif /*==========================================================================*/ -static struct timer_list delay_timer = { NULL, NULL, 0, 0, mark_timeout_delay}; -static struct timer_list data_timer = { NULL, NULL, 0, 0, mark_timeout_data}; +static struct timer_list delay_timer = { function: mark_timeout_delay}; +static struct timer_list data_timer = { function: mark_timeout_data}; #if 0 -static struct timer_list audio_timer = { NULL, NULL, 0, 0, mark_timeout_audio}; +static struct timer_list audio_timer = { function: mark_timeout_audio}; #endif /*==========================================================================*/ /* diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c index 5182d415d..5b8db1278 100644 --- a/drivers/cdrom/sjcd.c +++ b/drivers/cdrom/sjcd.c @@ -153,7 +153,7 @@ static struct sjcd_stat statistic; /* * Timer. */ -static struct timer_list sjcd_delay_timer = { NULL, NULL, 0, 0, NULL }; +static struct timer_list sjcd_delay_timer = { function: NULL }; #define SJCD_SET_TIMER( func, tmout ) \ ( sjcd_delay_timer.expires = jiffies+tmout, \ |