diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-08 00:53:00 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-08 00:53:00 +0000 |
commit | b8553086288629b4efb77e97f5582e08bc50ad65 (patch) | |
tree | 0a19bd1c21e148f35c7a0f76baa4f7a056b966b0 /drivers/ide | |
parent | 75b6d92f2dd5112b02f4e78cf9f35f9825946ef0 (diff) |
Merge with 2.4.0-test3-pre4.
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/hd.c | 27 | ||||
-rw-r--r-- | drivers/ide/ide-cd.c | 11 | ||||
-rw-r--r-- | drivers/ide/ide-probe.c | 23 | ||||
-rw-r--r-- | drivers/ide/ide.c | 4 |
4 files changed, 44 insertions, 21 deletions
diff --git a/drivers/ide/hd.c b/drivers/ide/hd.c index 6fd109c83..698112b35 100644 --- a/drivers/ide/hd.c +++ b/drivers/ide/hd.c @@ -105,6 +105,24 @@ static int hd_sizes[MAX_HD<<6]; static int hd_blocksizes[MAX_HD<<6]; static int hd_hardsectsizes[MAX_HD<<6]; +static struct timer_list device_timer; + +#define SET_TIMER \ + do { \ + mod_timer(&device_timer, jiffies + TIMEOUT_VALUE); \ + } while (0) + +#define CLEAR_TIMER del_timer(&device_timer); + +#undef SET_INTR + +#define SET_INTR(x) \ +if ((DEVICE_INTR = (x)) != NULL) \ + SET_TIMER; \ +else \ + CLEAR_TIMER; + + #if (HD_DELAY > 0) unsigned long last_req; @@ -471,7 +489,7 @@ static void recal_intr(void) * This is another of the error-routines I don't know what to do with. The * best idea seems to just set reset, and start all over again. */ -static void hd_times_out(void) +static void hd_times_out(unsigned long dummy) { unsigned int dev; @@ -527,7 +545,7 @@ static void hd_request(void) if (DEVICE_INTR) return; repeat: - timer_active &= ~(1<<HD_TIMER); + del_timer(&device_timer); sti(); INIT_REQUEST; if (reset) { @@ -683,7 +701,7 @@ static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs) void (*handler)(void) = DEVICE_INTR; DEVICE_INTR = NULL; - timer_active &= ~(1<<HD_TIMER); + del_timer(&device_timer); if (!handler) handler = unexpected_hd_interrupt; handler(); @@ -814,7 +832,8 @@ int __init hd_init(void) read_ahead[MAJOR_NR] = 8; /* 8 sector (4kB) read-ahead */ hd_gendisk.next = gendisk_head; gendisk_head = &hd_gendisk; - timer_table[HD_TIMER].fn = hd_times_out; + init_timer(&device_timer); + device_timer.function = hd_times_out; hd_geninit(); return 0; } diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 53f6b5a9e..e8e67d549 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -1768,6 +1768,9 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) if (stat) toc->capacity = 0x1fffff; + HWIF(drive)->gd->sizes[drive->select.b.unit << PARTN_BITS] = (toc->capacity * SECTORS_PER_FRAME) >> (BLOCK_SIZE_BITS - 9); + drive->part[0].nr_sects = toc->capacity * SECTORS_PER_FRAME; + /* Remember that we've read this stuff. */ CDROM_STATE_FLAGS (drive)->toc_valid = 1; @@ -2066,11 +2069,11 @@ int ide_cdrom_get_last_session (struct cdrom_device_info *cdi, struct request_sense sense; int ret; - toc = info->toc; - if (!CDROM_STATE_FLAGS(drive)->toc_valid || toc == NULL) + if (!CDROM_STATE_FLAGS(drive)->toc_valid || info->toc == NULL) if ((ret = cdrom_read_toc(drive, &sense))) return ret; + toc = info->toc; ms_info->addr.lba = toc->last_session_lba; ms_info->xa_flag = toc->xa_flag; @@ -2614,11 +2617,10 @@ static ide_module_t ide_cdrom_module = { /* options */ char *ignore = NULL; -#ifdef MODULE MODULE_PARM(ignore, "s"); MODULE_DESCRIPTION("ATAPI CD-ROM Driver"); -void __exit ide_cdrom_exit(void) +static void __exit ide_cdrom_exit(void) { ide_drive_t *drive; int failed = 0; @@ -2630,7 +2632,6 @@ void __exit ide_cdrom_exit(void) } ide_unregister_module (&ide_cdrom_module); } -#endif /* MODULE */ int ide_cdrom_init(void) { diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index dd5f660fe..168895fb5 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -580,6 +580,17 @@ static void save_match (ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match) #endif /* MAX_HWIFS > 1 */ /* + * init request queue + */ +static void ide_init_queue(ide_drive_t *drive) +{ + request_queue_t *q = &drive->queue; + + q->queuedata = HWGROUP(drive); + blk_init_queue(q, do_ide_request); +} + +/* * This routine sets up the irq for an ide interface, and creates a new * hwgroup for the irq/hwif if none was previously assigned. * @@ -677,6 +688,7 @@ static int init_irq (ide_hwif_t *hwif) hwgroup->drive = drive; drive->next = hwgroup->drive->next; hwgroup->drive->next = drive; + ide_init_queue(drive); } if (!hwgroup->hwif) { hwgroup->hwif = HWIF(hwgroup->drive); @@ -780,16 +792,13 @@ static void init_gendisk (ide_hwif_t *hwif) (hwif->channel && hwif->mate) ? hwif->mate->index : hwif->index, hwif->channel, unit, hwif->drives[unit].lun); hwif->drives[unit].de = - devfs_mk_dir (ide_devfs_handle, name, 0, NULL); + devfs_mk_dir (ide_devfs_handle, name, NULL); } } } static int hwif_init (ide_hwif_t *hwif) { - request_queue_t *q; - unsigned int unit; - if (!hwif->present) return 0; if (!hwif->irq) { @@ -840,12 +849,6 @@ static int hwif_init (ide_hwif_t *hwif) read_ahead[hwif->major] = 8; /* (4kB) */ hwif->present = 1; /* success */ - for (unit = 0; unit < MAX_DRIVES; ++unit) { - q = &hwif->drives[unit].queue; - q->queuedata = hwif->hwgroup; - blk_init_queue(q, do_ide_request); - } - #if (DEBUG_SPINLOCK > 0) { static int done = 0; diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index b9aa05d4d..c9c3cb120 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -2023,6 +2023,7 @@ void ide_unregister (unsigned int index) drive->id = NULL; } drive->present = 0; + blk_cleanup_queue(&drive->queue); } if (d->present) hwgroup->drive = d; @@ -2048,7 +2049,6 @@ void ide_unregister (unsigned int index) kfree(blksize_size[hwif->major]); kfree(max_sectors[hwif->major]); kfree(max_readahead[hwif->major]); - blk_cleanup_queue(BLK_DEFAULT_QUEUE(hwif->major)); blk_dev[hwif->major].data = NULL; blk_dev[hwif->major].queue = NULL; blksize_size[hwif->major] = NULL; @@ -3594,7 +3594,7 @@ int __init ide_init (void) if (!banner_printed) { printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n"); - ide_devfs_handle = devfs_mk_dir (NULL, "ide", 3, NULL); + ide_devfs_handle = devfs_mk_dir (NULL, "ide", NULL); system_bus_speed = ide_system_bus_speed(); banner_printed = 1; } |