Commit f002ad35 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bart.bkbits.net/ide-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 7bda0fae 48a59b60
...@@ -132,7 +132,7 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector ...@@ -132,7 +132,7 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
nsectors.all = (u16) rq->nr_sectors; nsectors.all = (u16) rq->nr_sectors;
if (hwif->no_lba48_dma && lba48 && dma) { if (hwif->no_lba48_dma && lba48 && dma) {
if (rq->sector + rq->nr_sectors > 1ULL << 28) if (block + rq->nr_sectors > 1ULL << 28)
dma = 0; dma = 0;
} }
...@@ -253,8 +253,7 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector ...@@ -253,8 +253,7 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
/* FIXME: ->OUTBSYNC ? */ /* FIXME: ->OUTBSYNC ? */
hwif->OUTB(command, IDE_COMMAND_REG); hwif->OUTB(command, IDE_COMMAND_REG);
pre_task_out_intr(drive, rq); return pre_task_out_intr(drive, rq);
return ide_started;
} }
} }
EXPORT_SYMBOL_GPL(__ide_do_rw_disk); EXPORT_SYMBOL_GPL(__ide_do_rw_disk);
......
...@@ -227,7 +227,9 @@ EXPORT_SYMBOL_GPL(ide_build_sglist); ...@@ -227,7 +227,9 @@ EXPORT_SYMBOL_GPL(ide_build_sglist);
* the PRD table that the IDE layer wants to be fed. The code * the PRD table that the IDE layer wants to be fed. The code
* knows about the 64K wrap bug in the CS5530. * knows about the 64K wrap bug in the CS5530.
* *
* Returns 0 if all went okay, returns 1 otherwise. * Returns the number of built PRD entries if all went okay,
* returns 0 otherwise.
*
* May also be invoked from trm290.c * May also be invoked from trm290.c
*/ */
...@@ -631,7 +633,7 @@ int __ide_dma_end (ide_drive_t *drive) ...@@ -631,7 +633,7 @@ int __ide_dma_end (ide_drive_t *drive)
EXPORT_SYMBOL(__ide_dma_end); EXPORT_SYMBOL(__ide_dma_end);
/* returns 1 if dma irq issued, 0 otherwise */ /* returns 1 if dma irq issued, 0 otherwise */
int __ide_dma_test_irq (ide_drive_t *drive) static int __ide_dma_test_irq(ide_drive_t *drive)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
u8 dma_stat = hwif->INB(hwif->dma_status); u8 dma_stat = hwif->INB(hwif->dma_status);
...@@ -650,8 +652,6 @@ int __ide_dma_test_irq (ide_drive_t *drive) ...@@ -650,8 +652,6 @@ int __ide_dma_test_irq (ide_drive_t *drive)
drive->name, __FUNCTION__); drive->name, __FUNCTION__);
return 0; return 0;
} }
EXPORT_SYMBOL(__ide_dma_test_irq);
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
int __ide_dma_bad_drive (ide_drive_t *drive) int __ide_dma_bad_drive (ide_drive_t *drive)
...@@ -784,7 +784,7 @@ EXPORT_SYMBOL(__ide_dma_timeout); ...@@ -784,7 +784,7 @@ EXPORT_SYMBOL(__ide_dma_timeout);
/* /*
* Needed for allowing full modular support of ide-driver * Needed for allowing full modular support of ide-driver
*/ */
int ide_release_dma_engine (ide_hwif_t *hwif) static int ide_release_dma_engine(ide_hwif_t *hwif)
{ {
if (hwif->dmatable_cpu) { if (hwif->dmatable_cpu) {
pci_free_consistent(hwif->pci_dev, pci_free_consistent(hwif->pci_dev,
...@@ -796,7 +796,7 @@ int ide_release_dma_engine (ide_hwif_t *hwif) ...@@ -796,7 +796,7 @@ int ide_release_dma_engine (ide_hwif_t *hwif)
return 1; return 1;
} }
int ide_release_iomio_dma (ide_hwif_t *hwif) static int ide_release_iomio_dma(ide_hwif_t *hwif)
{ {
if ((hwif->dma_extra) && (hwif->channel == 0)) if ((hwif->dma_extra) && (hwif->channel == 0))
release_region((hwif->dma_base + 16), hwif->dma_extra); release_region((hwif->dma_base + 16), hwif->dma_extra);
...@@ -820,7 +820,7 @@ int ide_release_dma (ide_hwif_t *hwif) ...@@ -820,7 +820,7 @@ int ide_release_dma (ide_hwif_t *hwif)
return ide_release_iomio_dma(hwif); return ide_release_iomio_dma(hwif);
} }
int ide_allocate_dma_engine (ide_hwif_t *hwif) static int ide_allocate_dma_engine(ide_hwif_t *hwif)
{ {
hwif->dmatable_cpu = pci_alloc_consistent(hwif->pci_dev, hwif->dmatable_cpu = pci_alloc_consistent(hwif->pci_dev,
PRD_ENTRIES * PRD_BYTES, PRD_ENTRIES * PRD_BYTES,
...@@ -830,14 +830,13 @@ int ide_allocate_dma_engine (ide_hwif_t *hwif) ...@@ -830,14 +830,13 @@ int ide_allocate_dma_engine (ide_hwif_t *hwif)
return 0; return 0;
printk(KERN_ERR "%s: -- Error, unable to allocate%s DMA table(s).\n", printk(KERN_ERR "%s: -- Error, unable to allocate%s DMA table(s).\n",
(hwif->dmatable_cpu == NULL) ? " CPU" : "", hwif->cds->name, !hwif->dmatable_cpu ? " CPU" : "");
hwif->cds->name);
ide_release_dma_engine(hwif); ide_release_dma_engine(hwif);
return 1; return 1;
} }
int ide_mapped_mmio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int ports) static int ide_mapped_mmio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int ports)
{ {
printk(KERN_INFO " %s: MMIO-DMA ", hwif->name); printk(KERN_INFO " %s: MMIO-DMA ", hwif->name);
...@@ -852,7 +851,7 @@ int ide_mapped_mmio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int port ...@@ -852,7 +851,7 @@ int ide_mapped_mmio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int port
return 0; return 0;
} }
int ide_iomio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int ports) static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int ports)
{ {
printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx", printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx",
hwif->name, base, base + ports - 1); hwif->name, base, base + ports - 1);
...@@ -881,10 +880,7 @@ int ide_iomio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int ports) ...@@ -881,10 +880,7 @@ int ide_iomio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int ports)
return 0; return 0;
} }
/* static int ide_dma_iobase(ide_hwif_t *hwif, unsigned long base, unsigned int ports)
*
*/
int ide_dma_iobase (ide_hwif_t *hwif, unsigned long base, unsigned int ports)
{ {
if (hwif->mmio == 2) if (hwif->mmio == 2)
return ide_mapped_mmio_dma(hwif, base,ports); return ide_mapped_mmio_dma(hwif, base,ports);
......
...@@ -585,7 +585,7 @@ static void idefloppy_input_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, uns ...@@ -585,7 +585,7 @@ static void idefloppy_input_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, uns
count = min(bvec->bv_len, bcount); count = min(bvec->bv_len, bcount);
data = bvec_kmap_irq(bvec, &flags); data = bvec_kmap_irq(bvec, &flags);
atapi_input_bytes(drive, data, count); drive->hwif->atapi_input_bytes(drive, data, count);
bvec_kunmap_irq(data, &flags); bvec_kunmap_irq(data, &flags);
bcount -= count; bcount -= count;
...@@ -619,7 +619,7 @@ static void idefloppy_output_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, un ...@@ -619,7 +619,7 @@ static void idefloppy_output_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, un
count = min(bvec->bv_len, bcount); count = min(bvec->bv_len, bcount);
data = bvec_kmap_irq(bvec, &flags); data = bvec_kmap_irq(bvec, &flags);
atapi_output_bytes(drive, data, count); drive->hwif->atapi_output_bytes(drive, data, count);
bvec_kunmap_irq(data, &flags); bvec_kunmap_irq(data, &flags);
bcount -= count; bcount -= count;
......
...@@ -555,7 +555,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, u8 stat) ...@@ -555,7 +555,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, u8 stat)
err = ide_dump_status(drive, msg, stat); err = ide_dump_status(drive, msg, stat);
if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL) if ((rq = HWGROUP(drive)->rq) == NULL)
return ide_stopped; return ide_stopped;
/* retry only "normal" I/O: */ /* retry only "normal" I/O: */
...@@ -933,6 +933,7 @@ void ide_stall_queue (ide_drive_t *drive, unsigned long timeout) ...@@ -933,6 +933,7 @@ void ide_stall_queue (ide_drive_t *drive, unsigned long timeout)
if (timeout > WAIT_WORSTCASE) if (timeout > WAIT_WORSTCASE)
timeout = WAIT_WORSTCASE; timeout = WAIT_WORSTCASE;
drive->sleep = timeout + jiffies; drive->sleep = timeout + jiffies;
drive->sleeping = 1;
} }
EXPORT_SYMBOL(ide_stall_queue); EXPORT_SYMBOL(ide_stall_queue);
...@@ -972,18 +973,18 @@ static inline ide_drive_t *choose_drive (ide_hwgroup_t *hwgroup) ...@@ -972,18 +973,18 @@ static inline ide_drive_t *choose_drive (ide_hwgroup_t *hwgroup)
} }
do { do {
if ((!drive->sleep || time_after_eq(jiffies, drive->sleep)) if ((!drive->sleeping || time_after_eq(jiffies, drive->sleep))
&& !elv_queue_empty(drive->queue)) { && !elv_queue_empty(drive->queue)) {
if (!best if (!best
|| (drive->sleep && (!best->sleep || 0 < (signed long)(best->sleep - drive->sleep))) || (drive->sleeping && (!best->sleeping || time_before(drive->sleep, best->sleep)))
|| (!best->sleep && 0 < (signed long)(WAKEUP(best) - WAKEUP(drive)))) || (!best->sleeping && time_before(WAKEUP(drive), WAKEUP(best))))
{ {
if (!blk_queue_plugged(drive->queue)) if (!blk_queue_plugged(drive->queue))
best = drive; best = drive;
} }
} }
} while ((drive = drive->next) != hwgroup->drive); } while ((drive = drive->next) != hwgroup->drive);
if (best && best->nice1 && !best->sleep && best != hwgroup->drive && best->service_time > WAIT_MIN_SLEEP) { if (best && best->nice1 && !best->sleeping && best != hwgroup->drive && best->service_time > WAIT_MIN_SLEEP) {
long t = (signed long)(WAKEUP(best) - jiffies); long t = (signed long)(WAKEUP(best) - jiffies);
if (t >= WAIT_MIN_SLEEP) { if (t >= WAIT_MIN_SLEEP) {
/* /*
...@@ -992,10 +993,9 @@ static inline ide_drive_t *choose_drive (ide_hwgroup_t *hwgroup) ...@@ -992,10 +993,9 @@ static inline ide_drive_t *choose_drive (ide_hwgroup_t *hwgroup)
*/ */
drive = best->next; drive = best->next;
do { do {
if (!drive->sleep if (!drive->sleeping
/* FIXME: use time_before */ && time_before(jiffies - best->service_time, WAKEUP(drive))
&& 0 < (signed long)(WAKEUP(drive) - (jiffies - best->service_time)) && time_before(WAKEUP(drive), jiffies + t))
&& 0 < (signed long)((jiffies + t) - WAKEUP(drive)))
{ {
ide_stall_queue(best, min_t(long, t, 10 * WAIT_MIN_SLEEP)); ide_stall_queue(best, min_t(long, t, 10 * WAIT_MIN_SLEEP));
goto repeat; goto repeat;
...@@ -1058,14 +1058,17 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) ...@@ -1058,14 +1058,17 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
hwgroup->busy = 1; hwgroup->busy = 1;
drive = choose_drive(hwgroup); drive = choose_drive(hwgroup);
if (drive == NULL) { if (drive == NULL) {
unsigned long sleep = 0; int sleeping = 0;
unsigned long sleep = 0; /* shut up, gcc */
hwgroup->rq = NULL; hwgroup->rq = NULL;
drive = hwgroup->drive; drive = hwgroup->drive;
do { do {
if (drive->sleep && (!sleep || 0 < (signed long)(sleep - drive->sleep))) if (drive->sleeping && (!sleeping || time_before(drive->sleep, sleep))) {
sleeping = 1;
sleep = drive->sleep; sleep = drive->sleep;
}
} while ((drive = drive->next) != hwgroup->drive); } while ((drive = drive->next) != hwgroup->drive);
if (sleep) { if (sleeping) {
/* /*
* Take a short snooze, and then wake up this hwgroup again. * Take a short snooze, and then wake up this hwgroup again.
* This gives other hwgroups on the same a chance to * This gives other hwgroups on the same a chance to
...@@ -1105,7 +1108,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) ...@@ -1105,7 +1108,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
} }
hwgroup->hwif = hwif; hwgroup->hwif = hwif;
hwgroup->drive = drive; hwgroup->drive = drive;
drive->sleep = 0; drive->sleeping = 0;
drive->service_start = jiffies; drive->service_start = jiffies;
if (blk_queue_plugged(drive->queue)) { if (blk_queue_plugged(drive->queue)) {
...@@ -1311,7 +1314,7 @@ void ide_timer_expiry (unsigned long data) ...@@ -1311,7 +1314,7 @@ void ide_timer_expiry (unsigned long data)
/* local CPU only, /* local CPU only,
* as if we were handling an interrupt */ * as if we were handling an interrupt */
local_irq_disable(); local_irq_disable();
if (hwgroup->poll_timeout != 0) { if (hwgroup->polling) {
startstop = handler(drive); startstop = handler(drive);
} else if (drive_is_ready(drive)) { } else if (drive_is_ready(drive)) {
if (drive->waiting_for_dma) if (drive->waiting_for_dma)
...@@ -1439,8 +1442,7 @@ irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs) ...@@ -1439,8 +1442,7 @@ irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs)
return IRQ_NONE; return IRQ_NONE;
} }
if ((handler = hwgroup->handler) == NULL || if ((handler = hwgroup->handler) == NULL || hwgroup->polling) {
hwgroup->poll_timeout != 0) {
/* /*
* Not expecting an interrupt from this drive. * Not expecting an interrupt from this drive.
* That means this could be: * That means this could be:
......
...@@ -184,16 +184,6 @@ void default_hwif_mmiops (ide_hwif_t *hwif) ...@@ -184,16 +184,6 @@ void default_hwif_mmiops (ide_hwif_t *hwif)
EXPORT_SYMBOL(default_hwif_mmiops); EXPORT_SYMBOL(default_hwif_mmiops);
void default_hwif_transport (ide_hwif_t *hwif)
{
hwif->ata_input_data = ata_input_data;
hwif->ata_output_data = ata_output_data;
hwif->atapi_input_bytes = atapi_input_bytes;
hwif->atapi_output_bytes = atapi_output_bytes;
}
EXPORT_SYMBOL(default_hwif_transport);
u32 ide_read_24 (ide_drive_t *drive) u32 ide_read_24 (ide_drive_t *drive)
{ {
u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG); u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
...@@ -202,8 +192,6 @@ u32 ide_read_24 (ide_drive_t *drive) ...@@ -202,8 +192,6 @@ u32 ide_read_24 (ide_drive_t *drive)
return (hcyl<<16)|(lcyl<<8)|sect; return (hcyl<<16)|(lcyl<<8)|sect;
} }
EXPORT_SYMBOL(ide_read_24);
void SELECT_DRIVE (ide_drive_t *drive) void SELECT_DRIVE (ide_drive_t *drive)
{ {
if (HWIF(drive)->selectproc) if (HWIF(drive)->selectproc)
...@@ -240,7 +228,7 @@ void QUIRK_LIST (ide_drive_t *drive) ...@@ -240,7 +228,7 @@ void QUIRK_LIST (ide_drive_t *drive)
* of the sector count register location, with interrupts disabled * of the sector count register location, with interrupts disabled
* to ensure that the reads all happen together. * to ensure that the reads all happen together.
*/ */
void ata_vlb_sync (ide_drive_t *drive, unsigned long port) static void ata_vlb_sync(ide_drive_t *drive, unsigned long port)
{ {
(void) HWIF(drive)->INB(port); (void) HWIF(drive)->INB(port);
(void) HWIF(drive)->INB(port); (void) HWIF(drive)->INB(port);
...@@ -250,7 +238,7 @@ void ata_vlb_sync (ide_drive_t *drive, unsigned long port) ...@@ -250,7 +238,7 @@ void ata_vlb_sync (ide_drive_t *drive, unsigned long port)
/* /*
* This is used for most PIO data transfers *from* the IDE interface * This is used for most PIO data transfers *from* the IDE interface
*/ */
void ata_input_data (ide_drive_t *drive, void *buffer, u32 wcount) static void ata_input_data(ide_drive_t *drive, void *buffer, u32 wcount)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
u8 io_32bit = drive->io_32bit; u8 io_32bit = drive->io_32bit;
...@@ -272,7 +260,7 @@ void ata_input_data (ide_drive_t *drive, void *buffer, u32 wcount) ...@@ -272,7 +260,7 @@ void ata_input_data (ide_drive_t *drive, void *buffer, u32 wcount)
/* /*
* This is used for most PIO data transfers *to* the IDE interface * This is used for most PIO data transfers *to* the IDE interface
*/ */
void ata_output_data (ide_drive_t *drive, void *buffer, u32 wcount) static void ata_output_data(ide_drive_t *drive, void *buffer, u32 wcount)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
u8 io_32bit = drive->io_32bit; u8 io_32bit = drive->io_32bit;
...@@ -299,7 +287,7 @@ void ata_output_data (ide_drive_t *drive, void *buffer, u32 wcount) ...@@ -299,7 +287,7 @@ void ata_output_data (ide_drive_t *drive, void *buffer, u32 wcount)
* extra byte allocated for the buffer. * extra byte allocated for the buffer.
*/ */
void atapi_input_bytes (ide_drive_t *drive, void *buffer, u32 bytecount) static void atapi_input_bytes(ide_drive_t *drive, void *buffer, u32 bytecount)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
...@@ -316,9 +304,7 @@ void atapi_input_bytes (ide_drive_t *drive, void *buffer, u32 bytecount) ...@@ -316,9 +304,7 @@ void atapi_input_bytes (ide_drive_t *drive, void *buffer, u32 bytecount)
hwif->INSW(IDE_DATA_REG, ((u8 *)buffer)+(bytecount & ~0x03), 1); hwif->INSW(IDE_DATA_REG, ((u8 *)buffer)+(bytecount & ~0x03), 1);
} }
EXPORT_SYMBOL(atapi_input_bytes); static void atapi_output_bytes(ide_drive_t *drive, void *buffer, u32 bytecount)
void atapi_output_bytes (ide_drive_t *drive, void *buffer, u32 bytecount)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
...@@ -335,7 +321,15 @@ void atapi_output_bytes (ide_drive_t *drive, void *buffer, u32 bytecount) ...@@ -335,7 +321,15 @@ void atapi_output_bytes (ide_drive_t *drive, void *buffer, u32 bytecount)
hwif->OUTSW(IDE_DATA_REG, ((u8*)buffer)+(bytecount & ~0x03), 1); hwif->OUTSW(IDE_DATA_REG, ((u8*)buffer)+(bytecount & ~0x03), 1);
} }
EXPORT_SYMBOL(atapi_output_bytes); void default_hwif_transport(ide_hwif_t *hwif)
{
hwif->ata_input_data = ata_input_data;
hwif->ata_output_data = ata_output_data;
hwif->atapi_input_bytes = atapi_input_bytes;
hwif->atapi_output_bytes = atapi_output_bytes;
}
EXPORT_SYMBOL(default_hwif_transport);
/* /*
* Beginning of Taskfile OPCODE Library and feature sets. * Beginning of Taskfile OPCODE Library and feature sets.
...@@ -437,6 +431,7 @@ void ide_fix_driveid (struct hd_driveid *id) ...@@ -437,6 +431,7 @@ void ide_fix_driveid (struct hd_driveid *id)
#endif #endif
} }
/* FIXME: exported for use by the USB storage (isd200.c) code only */
EXPORT_SYMBOL(ide_fix_driveid); EXPORT_SYMBOL(ide_fix_driveid);
void ide_fixstring (u8 *s, const int bytecount, const int byteswap) void ide_fixstring (u8 *s, const int bytecount, const int byteswap)
...@@ -1028,14 +1023,14 @@ static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive) ...@@ -1028,14 +1023,14 @@ static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive)
return ide_started; return ide_started;
} }
/* end of polling */ /* end of polling */
hwgroup->poll_timeout = 0; hwgroup->polling = 0;
printk("%s: ATAPI reset timed-out, status=0x%02x\n", printk("%s: ATAPI reset timed-out, status=0x%02x\n",
drive->name, stat); drive->name, stat);
/* do it the old fashioned way */ /* do it the old fashioned way */
return do_reset1(drive, 1); return do_reset1(drive, 1);
} }
/* done polling */ /* done polling */
hwgroup->poll_timeout = 0; hwgroup->polling = 0;
return ide_stopped; return ide_stopped;
} }
...@@ -1095,7 +1090,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive) ...@@ -1095,7 +1090,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
printk("\n"); printk("\n");
} }
} }
hwgroup->poll_timeout = 0; /* done polling */ hwgroup->polling = 0; /* done polling */
return ide_stopped; return ide_stopped;
} }
...@@ -1112,7 +1107,7 @@ static void check_dma_crc(ide_drive_t *drive) ...@@ -1112,7 +1107,7 @@ static void check_dma_crc(ide_drive_t *drive)
#endif #endif
} }
void pre_reset (ide_drive_t *drive) static void pre_reset(ide_drive_t *drive)
{ {
DRIVER(drive)->pre_reset(drive); DRIVER(drive)->pre_reset(drive);
...@@ -1170,6 +1165,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi) ...@@ -1170,6 +1165,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
udelay (20); udelay (20);
hwif->OUTB(WIN_SRST, IDE_COMMAND_REG); hwif->OUTB(WIN_SRST, IDE_COMMAND_REG);
hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
hwgroup->polling = 1;
__ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL); __ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
return ide_started; return ide_started;
...@@ -1210,6 +1206,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi) ...@@ -1210,6 +1206,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
/* more than enough time */ /* more than enough time */
udelay(10); udelay(10);
hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
hwgroup->polling = 1;
__ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL); __ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL);
/* /*
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <linux/ide.h> #include <linux/ide.h>
/* Add your devices here :)) */ /* Add your devices here :)) */
struct pnp_device_id idepnp_devices[] = { static struct pnp_device_id idepnp_devices[] = {
/* Generic ESDI/IDE/ATA compatible hard disk controller */ /* Generic ESDI/IDE/ATA compatible hard disk controller */
{.id = "PNP0600", .driver_data = 0}, {.id = "PNP0600", .driver_data = 0},
{.id = ""} {.id = ""}
......
...@@ -841,7 +841,11 @@ int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif) ...@@ -841,7 +841,11 @@ int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)
if (fixup) if (fixup)
fixup(hwif); fixup(hwif);
hwif_init(hwif); if (!hwif_init(hwif)) {
printk(KERN_INFO "%s: failed to initialize IDE interface\n",
hwif->name);
return -1;
}
if (hwif->present) { if (hwif->present) {
u16 unit = 0; u16 unit = 0;
......
...@@ -2439,7 +2439,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, ...@@ -2439,7 +2439,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
tape->dsc_polling_start = jiffies; tape->dsc_polling_start = jiffies;
tape->dsc_polling_frequency = tape->best_dsc_rw_frequency; tape->dsc_polling_frequency = tape->best_dsc_rw_frequency;
tape->dsc_timeout = jiffies + IDETAPE_DSC_RW_TIMEOUT; tape->dsc_timeout = jiffies + IDETAPE_DSC_RW_TIMEOUT;
} else if ((signed long) (jiffies - tape->dsc_timeout) > 0) { } else if (time_after(jiffies, tape->dsc_timeout)) {
printk(KERN_ERR "ide-tape: %s: DSC timeout\n", printk(KERN_ERR "ide-tape: %s: DSC timeout\n",
tape->name); tape->name);
if (rq->cmd[0] & REQ_IDETAPE_PC2) { if (rq->cmd[0] & REQ_IDETAPE_PC2) {
......
...@@ -851,8 +851,8 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task) ...@@ -851,8 +851,8 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
hwif->OUTB(taskfile->high_cylinder, IDE_HCYL_REG); hwif->OUTB(taskfile->high_cylinder, IDE_HCYL_REG);
/* /*
* (ks) In the flagged taskfile approch, we will used all specified * (ks) In the flagged taskfile approch, we will use all specified
* registers and the register value will not be changed. Except the * registers and the register value will not be changed, except the
* select bit (master/slave) in the drive_head register. We must make * select bit (master/slave) in the drive_head register. We must make
* sure that the desired drive is selected. * sure that the desired drive is selected.
*/ */
......
...@@ -333,7 +333,7 @@ static void __init init_ide_data (void) ...@@ -333,7 +333,7 @@ static void __init init_ide_data (void)
* Returns a guessed speed in MHz. * Returns a guessed speed in MHz.
*/ */
int ide_system_bus_speed (void) static int ide_system_bus_speed(void)
{ {
static struct pci_device_id pci_default[] = { static struct pci_device_id pci_default[] = {
{ PCI_DEVICE(PCI_ANY_ID, PCI_ANY_ID) }, { PCI_DEVICE(PCI_ANY_ID, PCI_ANY_ID) },
...@@ -414,7 +414,7 @@ struct seq_operations ide_drivers_op = { ...@@ -414,7 +414,7 @@ struct seq_operations ide_drivers_op = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc_ide_root; struct proc_dir_entry *proc_ide_root;
ide_proc_entry_t generic_subdriver_entries[] = { static ide_proc_entry_t generic_subdriver_entries[] = {
{ "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL }, { "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL },
{ NULL, 0, NULL, NULL } { NULL, 0, NULL, NULL }
}; };
...@@ -1675,7 +1675,7 @@ static int __initdata is_chipset_set[MAX_HWIFS]; ...@@ -1675,7 +1675,7 @@ static int __initdata is_chipset_set[MAX_HWIFS];
* *
* Remember to update Documentation/ide.txt if you change something here. * Remember to update Documentation/ide.txt if you change something here.
*/ */
int __init ide_setup (char *s) static int __init ide_setup(char *s)
{ {
int i, vals[3]; int i, vals[3];
ide_hwif_t *hwif; ide_hwif_t *hwif;
...@@ -2261,7 +2261,7 @@ struct bus_type ide_bus_type = { ...@@ -2261,7 +2261,7 @@ struct bus_type ide_bus_type = {
/* /*
* This is gets invoked once during initialization, to set *everything* up * This is gets invoked once during initialization, to set *everything* up
*/ */
int __init ide_init (void) static int __init ide_init(void)
{ {
printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n"); printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
devfs_mk_dir("ide"); devfs_mk_dir("ide");
...@@ -2308,7 +2308,7 @@ int __init ide_init (void) ...@@ -2308,7 +2308,7 @@ int __init ide_init (void)
} }
#ifdef MODULE #ifdef MODULE
char *options = NULL; static char *options = NULL;
module_param(options, charp, 0); module_param(options, charp, 0);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
...@@ -209,7 +209,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq ...@@ -209,7 +209,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
#define CS_CHECK(fn, ret) \ #define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
void ide_config(dev_link_t *link) static void ide_config(dev_link_t *link)
{ {
client_handle_t handle = link->handle; client_handle_t handle = link->handle;
ide_info_t *info = link->priv; ide_info_t *info = link->priv;
......
obj-$(CONFIG_BLK_DEV_ADMA100) += adma100.o
obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o
obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o
obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o
......
/*
* linux/drivers/ide/pci/adma100.c -- basic support for Pacific Digital ADMA-100 boards
*
* Created 09 Apr 2002 by Mark Lord
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#include <linux/mm.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <asm/io.h>
void __init ide_init_adma100 (ide_hwif_t *hwif)
{
unsigned long phy_admctl = pci_resource_start(hwif->pci_dev, 4) + 0x80 + (hwif->channel * 0x20);
void *v_admctl;
hwif->autodma = 0; // not compatible with normal IDE DMA transfers
hwif->dma_base = 0; // disable DMA completely
hwif->io_ports[IDE_CONTROL_OFFSET] += 4; // chip needs offset of 6 instead of 2
v_admctl = ioremap_nocache(phy_admctl, 1024); // map config regs, so we can turn on drive IRQs
*((unsigned short *)v_admctl) &= 3; // enable aIEN; preserve PIO mode
iounmap(v_admctl); // all done; unmap config regs
}
#ifndef ADMA_100_H
#define ADMA_100_H
#include <linux/config.h>
#include <linux/pci.h>
#include <linux/ide.h>
extern void init_setup_pdcadma(struct pci_dev *, ide_pci_device_t *);
extern unsigned int init_chipset_pdcadma(struct pci_dev *, const char *);
extern void init_hwif_pdcadma(ide_hwif_t *);
extern void init_dma_pdcadma(ide_hwif_t *, unsigned long);
static ide_pci_device_t pdcadma_chipsets[] __devinitdata = {
{
.vendor = PCI_VENDOR_ID_PDC,
.device = PCI_DEVICE_ID_PDC_1841,
.name = "ADMA100",
.init_setup = init_setup_pdcadma,
.init_chipset = init_chipset_pdcadma,
.init_hwif = init_hwif_pdcadma,
.init_dma = init_dma_pdcadma,
.channels = 2,
.autodma = NODMA,
.bootable = OFF_BOARD,
}
}
#endif /* ADMA_100_H */
...@@ -56,7 +56,7 @@ static void it8172_tune_drive (ide_drive_t *drive, u8 pio) ...@@ -56,7 +56,7 @@ static void it8172_tune_drive (ide_drive_t *drive, u8 pio)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
int is_slave = (hwif->drives[1] == drive); int is_slave = (&hwif->drives[1] == drive);
unsigned long flags; unsigned long flags;
u16 drive_enables; u16 drive_enables;
u32 drive_timing; u32 drive_timing;
...@@ -94,7 +94,7 @@ static void it8172_tune_drive (ide_drive_t *drive, u8 pio) ...@@ -94,7 +94,7 @@ static void it8172_tune_drive (ide_drive_t *drive, u8 pio)
} }
pci_write_config_word(dev, 0x40, drive_enables); pci_write_config_word(dev, 0x40, drive_enables);
spin_unlock_irqrestore(&ide_lock, flags) spin_unlock_irqrestore(&ide_lock, flags);
} }
static u8 it8172_dma_2_pio (u8 xfer_rate) static u8 it8172_dma_2_pio (u8 xfer_rate)
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <linux/ide.h> #include <linux/ide.h>
static u8 it8172_ratemask(ide_drive_t *drive); static u8 it8172_ratemask(ide_drive_t *drive);
static u8 it8172_ratefilter(ide_drive_t *drive, u8 speed);
static void it8172_tune_drive(ide_drive_t *drive, u8 pio); static void it8172_tune_drive(ide_drive_t *drive, u8 pio);
static u8 it8172_dma_2_pio(u8 xfer_rate); static u8 it8172_dma_2_pio(u8 xfer_rate);
static int it8172_tune_chipset(ide_drive_t *drive, u8 xferspeed); static int it8172_tune_chipset(ide_drive_t *drive, u8 xferspeed);
...@@ -14,14 +13,12 @@ static int it8172_tune_chipset(ide_drive_t *drive, u8 xferspeed); ...@@ -14,14 +13,12 @@ static int it8172_tune_chipset(ide_drive_t *drive, u8 xferspeed);
static int it8172_config_chipset_for_dma(ide_drive_t *drive); static int it8172_config_chipset_for_dma(ide_drive_t *drive);
#endif #endif
static void init_setup_it8172(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_it8172(struct pci_dev *, const char *); static unsigned int init_chipset_it8172(struct pci_dev *, const char *);
static void init_hwif_it8172(ide_hwif_t *); static void init_hwif_it8172(ide_hwif_t *);
static ide_pci_device_t it8172_chipsets[] __devinitdata = { static ide_pci_device_t it8172_chipsets[] __devinitdata = {
{ /* 0 */ { /* 0 */
.name = "IT8172G", .name = "IT8172G",
.init_setup = init_setup_it8172,
.init_chipset = init_chipset_it8172, .init_chipset = init_chipset_it8172,
.init_hwif = init_hwif_it8172, .init_hwif = init_hwif_it8172,
.channels = 2, .channels = 2,
......
...@@ -348,11 +348,6 @@ static void __init init_hwif_opti621 (ide_hwif_t *hwif) ...@@ -348,11 +348,6 @@ static void __init init_hwif_opti621 (ide_hwif_t *hwif)
hwif->drives[1].autodma = hwif->autodma; hwif->drives[1].autodma = hwif->autodma;
} }
static int __init init_setup_opti621 (struct pci_dev *dev, ide_pci_device_t *d)
{
return ide_setup_pci_device(dev, d);
}
static int __devinit opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id) static int __devinit opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
return ide_setup_pci_device(dev, &opti621_chipsets[id->driver_data]); return ide_setup_pci_device(dev, &opti621_chipsets[id->driver_data]);
......
...@@ -5,13 +5,11 @@ ...@@ -5,13 +5,11 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ide.h> #include <linux/ide.h>
static int init_setup_opti621(struct pci_dev *, ide_pci_device_t *);
static void init_hwif_opti621(ide_hwif_t *); static void init_hwif_opti621(ide_hwif_t *);
static ide_pci_device_t opti621_chipsets[] __devinitdata = { static ide_pci_device_t opti621_chipsets[] __devinitdata = {
{ /* 0 */ { /* 0 */
.name = "OPTI621", .name = "OPTI621",
.init_setup = init_setup_opti621,
.init_hwif = init_hwif_opti621, .init_hwif = init_hwif_opti621,
.channels = 2, .channels = 2,
.autodma = AUTODMA, .autodma = AUTODMA,
...@@ -19,7 +17,6 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = { ...@@ -19,7 +17,6 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = {
.bootable = ON_BOARD, .bootable = ON_BOARD,
},{ /* 1 */ },{ /* 1 */
.name = "OPTI621X", .name = "OPTI621X",
.init_setup = init_setup_opti621,
.init_hwif = init_hwif_opti621, .init_hwif = init_hwif_opti621,
.channels = 2, .channels = 2,
.autodma = AUTODMA, .autodma = AUTODMA,
......
...@@ -530,20 +530,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif) ...@@ -530,20 +530,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
hwif->drives[0].autodma = hwif->autodma; hwif->drives[0].autodma = hwif->autodma;
} }
/**
* init_setup_piix - callback for IDE initialize
* @dev: PIIX PCI device
* @d: IDE pci info
*
* Enable the xp fixup for the PIIX controller and then perform
* a standard ide PCI setup
*/
static int __devinit init_setup_piix(struct pci_dev *dev, ide_pci_device_t *d)
{
return ide_setup_pci_device(dev, d);
}
/** /**
* piix_init_one - called when a PIIX is found * piix_init_one - called when a PIIX is found
* @dev: the piix device * @dev: the piix device
...@@ -557,7 +543,7 @@ static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_ ...@@ -557,7 +543,7 @@ static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_
{ {
ide_pci_device_t *d = &piix_pci_info[id->driver_data]; ide_pci_device_t *d = &piix_pci_info[id->driver_data];
return d->init_setup(dev, d); return ide_setup_pci_device(dev, d);
} }
/** /**
......
...@@ -5,14 +5,12 @@ ...@@ -5,14 +5,12 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ide.h> #include <linux/ide.h>
static int init_setup_piix(struct pci_dev *, ide_pci_device_t *);
static unsigned int __devinit init_chipset_piix(struct pci_dev *, const char *); static unsigned int __devinit init_chipset_piix(struct pci_dev *, const char *);
static void init_hwif_piix(ide_hwif_t *); static void init_hwif_piix(ide_hwif_t *);
#define DECLARE_PIIX_DEV(name_str) \ #define DECLARE_PIIX_DEV(name_str) \
{ \ { \
.name = name_str, \ .name = name_str, \
.init_setup = init_setup_piix, \
.init_chipset = init_chipset_piix, \ .init_chipset = init_chipset_piix, \
.init_hwif = init_hwif_piix, \ .init_hwif = init_hwif_piix, \
.channels = 2, \ .channels = 2, \
...@@ -32,7 +30,6 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = { ...@@ -32,7 +30,6 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = {
{ /* 2 */ { /* 2 */
.name = "MPIIX", .name = "MPIIX",
.init_setup = init_setup_piix,
.init_hwif = init_hwif_piix, .init_hwif = init_hwif_piix,
.channels = 2, .channels = 2,
.autodma = NODMA, .autodma = NODMA,
......
...@@ -669,7 +669,8 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d) ...@@ -669,7 +669,8 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d)
printk(KERN_INFO "%s: %s Bus-Master DMA disabled\n", printk(KERN_INFO "%s: %s Bus-Master DMA disabled\n",
hwif->name, d->name); hwif->name, d->name);
probe_hwif_init(hwif); if (probe_hwif_init(hwif))
return -EIO;
/* Create /proc/ide entries */ /* Create /proc/ide entries */
create_proc_ide_interfaces(); create_proc_ide_interfaces();
......
...@@ -590,7 +590,7 @@ static int siimage_reset_poll (ide_drive_t *drive) ...@@ -590,7 +590,7 @@ static int siimage_reset_poll (ide_drive_t *drive)
if ((hwif->INL(SATA_STATUS_REG) & 0x03) != 0x03) { if ((hwif->INL(SATA_STATUS_REG) & 0x03) != 0x03) {
printk(KERN_WARNING "%s: reset phy dead, status=0x%08x\n", printk(KERN_WARNING "%s: reset phy dead, status=0x%08x\n",
hwif->name, hwif->INL(SATA_STATUS_REG)); hwif->name, hwif->INL(SATA_STATUS_REG));
HWGROUP(drive)->poll_timeout = 0; HWGROUP(drive)->polling = 0;
return ide_started; return ide_started;
} }
return 0; return 0;
......
...@@ -152,7 +152,7 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne ...@@ -152,7 +152,7 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne
} }
count = min(pc->sg->length - pc->b_count, bcount); count = min(pc->sg->length - pc->b_count, bcount);
buf = page_address(pc->sg->page) + pc->sg->offset; buf = page_address(pc->sg->page) + pc->sg->offset;
atapi_input_bytes (drive, buf + pc->b_count, count); drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count);
bcount -= count; pc->b_count += count; bcount -= count; pc->b_count += count;
if (pc->b_count == pc->sg->length) { if (pc->b_count == pc->sg->length) {
pc->sg++; pc->sg++;
...@@ -174,7 +174,7 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign ...@@ -174,7 +174,7 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
} }
count = min(pc->sg->length - pc->b_count, bcount); count = min(pc->sg->length - pc->b_count, bcount);
buf = page_address(pc->sg->page) + pc->sg->offset; buf = page_address(pc->sg->page) + pc->sg->offset;
atapi_output_bytes (drive, buf + pc->b_count, count); drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count);
bcount -= count; pc->b_count += count; bcount -= count; pc->b_count += count;
if (pc->b_count == pc->sg->length) { if (pc->b_count == pc->sg->length) {
pc->sg++; pc->sg++;
...@@ -481,7 +481,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -481,7 +481,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
if (pc->sg) if (pc->sg)
idescsi_input_buffers(drive, pc, temp); idescsi_input_buffers(drive, pc, temp);
else else
atapi_input_bytes(drive, pc->current_position, temp); drive->hwif->atapi_input_bytes(drive, pc->current_position, temp);
printk(KERN_ERR "ide-scsi: transferred %d of %d bytes\n", temp, bcount.all); printk(KERN_ERR "ide-scsi: transferred %d of %d bytes\n", temp, bcount.all);
} }
pc->actually_transferred += temp; pc->actually_transferred += temp;
...@@ -541,7 +541,7 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive) ...@@ -541,7 +541,7 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive)
/* Set the interrupt routine */ /* Set the interrupt routine */
ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry);
/* Send the actual packet */ /* Send the actual packet */
atapi_output_bytes(drive, scsi->pc->c, 12); drive->hwif->atapi_output_bytes(drive, scsi->pc->c, 12);
if (test_bit (PC_DMA_OK, &pc->flags)) { if (test_bit (PC_DMA_OK, &pc->flags)) {
set_bit (PC_DMA_IN_PROGRESS, &pc->flags); set_bit (PC_DMA_IN_PROGRESS, &pc->flags);
hwif->dma_start(drive); hwif->dma_start(drive);
......
...@@ -187,11 +187,7 @@ typedef unsigned char byte; /* used everywhere */ ...@@ -187,11 +187,7 @@ typedef unsigned char byte; /* used everywhere */
* Timeouts for various operations: * Timeouts for various operations:
*/ */
#define WAIT_DRQ (HZ/10) /* 100msec - spec allows up to 20ms */ #define WAIT_DRQ (HZ/10) /* 100msec - spec allows up to 20ms */
#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
#define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */ #define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */
#else
#define WAIT_READY (HZ/10) /* 100msec - should be instantaneous */
#endif /* CONFIG_APM || CONFIG_APM_MODULE */
#define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */ #define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */
#define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ #define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */
#define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */ #define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */
...@@ -721,6 +717,7 @@ typedef struct ide_drive_s { ...@@ -721,6 +717,7 @@ typedef struct ide_drive_s {
* 3=64-bit * 3=64-bit
*/ */
unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */
unsigned sleeping : 1; /* 1=sleeping & sleep field valid */
u8 quirk_list; /* considered quirky, set for a specific host */ u8 quirk_list; /* considered quirky, set for a specific host */
u8 init_speed; /* transfer rate set at boot */ u8 init_speed; /* transfer rate set at boot */
...@@ -937,7 +934,9 @@ typedef struct hwgroup_s { ...@@ -937,7 +934,9 @@ typedef struct hwgroup_s {
/* BOOL: protects all fields below */ /* BOOL: protects all fields below */
volatile int busy; volatile int busy;
/* BOOL: wake us up on timer expiry */ /* BOOL: wake us up on timer expiry */
int sleeping; int sleeping : 1;
/* BOOL: polling active & poll_timeout field valid */
int polling : 1;
/* current drive */ /* current drive */
ide_drive_t *drive; ide_drive_t *drive;
/* ptr to current hwif in linked-list */ /* ptr to current hwif in linked-list */
...@@ -1297,11 +1296,6 @@ extern void SELECT_INTERRUPT(ide_drive_t *); ...@@ -1297,11 +1296,6 @@ extern void SELECT_INTERRUPT(ide_drive_t *);
extern void SELECT_MASK(ide_drive_t *, int); extern void SELECT_MASK(ide_drive_t *, int);
extern void QUIRK_LIST(ide_drive_t *); extern void QUIRK_LIST(ide_drive_t *);
extern void ata_input_data(ide_drive_t *, void *, u32);
extern void ata_output_data(ide_drive_t *, void *, u32);
extern void atapi_input_bytes(ide_drive_t *, void *, u32);
extern void atapi_output_bytes(ide_drive_t *, void *, u32);
extern int drive_is_ready(ide_drive_t *); extern int drive_is_ready(ide_drive_t *);
extern int wait_for_ready(ide_drive_t *, int /* timeout */); extern int wait_for_ready(ide_drive_t *, int /* timeout */);
...@@ -1340,14 +1334,6 @@ extern int taskfile_lib_get_identify(ide_drive_t *drive, u8 *); ...@@ -1340,14 +1334,6 @@ extern int taskfile_lib_get_identify(ide_drive_t *drive, u8 *);
extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout); extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout);
ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, sector_t block); ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, sector_t block);
/*
* ide_system_bus_speed() returns what we think is the system VESA/PCI
* bus speed (in MHz). This is used for calculating interface PIO timings.
* The default is 40 for known PCI systems, 50 otherwise.
* The "idebus=xx" parameter can be used to override this value.
*/
extern int ide_system_bus_speed(void);
/* /*
* ide_stall_queue() can be used by a drive to give excess bandwidth back * ide_stall_queue() can be used by a drive to give excess bandwidth back
* to the hwgroup by sleeping for timeout jiffies. * to the hwgroup by sleeping for timeout jiffies.
...@@ -1361,7 +1347,6 @@ extern void do_ide_request(request_queue_t *); ...@@ -1361,7 +1347,6 @@ extern void do_ide_request(request_queue_t *);
extern void ide_init_subdrivers(void); extern void ide_init_subdrivers(void);
extern struct block_device_operations ide_fops[]; extern struct block_device_operations ide_fops[];
extern ide_proc_entry_t generic_subdriver_entries[];
extern int ata_attach(ide_drive_t *); extern int ata_attach(ide_drive_t *);
...@@ -1458,7 +1443,6 @@ extern int __ide_dma_check(ide_drive_t *); ...@@ -1458,7 +1443,6 @@ extern int __ide_dma_check(ide_drive_t *);
extern int ide_dma_setup(ide_drive_t *); extern int ide_dma_setup(ide_drive_t *);
extern void ide_dma_start(ide_drive_t *); extern void ide_dma_start(ide_drive_t *);
extern int __ide_dma_end(ide_drive_t *); extern int __ide_dma_end(ide_drive_t *);
extern int __ide_dma_test_irq(ide_drive_t *);
extern int __ide_dma_lostirq(ide_drive_t *); extern int __ide_dma_lostirq(ide_drive_t *);
extern int __ide_dma_timeout(ide_drive_t *); extern int __ide_dma_timeout(ide_drive_t *);
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment