Commit 4a58bd1a authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] 2.5.11 IDE 46

- Remove the specific CONFIG_IDEDMA_PCI_WIP in favor of using the generic
   CONFIG_EXPERIMENTAL tag. (Pointed out by Vojtech Pavlik).

- Change the signature of the IRQ handler to take the request directly as a
   parameter. This doesn't blow the code up but makes it much more obvious and
   finally it's reducing the number of side effects of the hwgroup->rq field.

- A second sharp look after the above change allowed us to remove the wrq field
   from the hwgroup struct. It's just not used at all.

- Change the signature of the end_request member of struct ata_operations to
   take the request as a second argument. Similar for __ide_end_request()
   and ide_end_request().

- Remove BUG_ON() items just before ide_set_handler(). The check in
   ide_set_handler is clever enough now.

- Remove the rq subfield from ide-scsi packet structure. We have now the
   request context always in place. Same for floppy.

- Let the timer expiry function take the request as a direct argument.

Yes I know those changes are extensive. But they are a necessary step
in between for the following purposes:

- Consolidate the whole ATA/ATAPI stuff on passing a single unified request
   handling object. Because after eliminating those side effects it's far easier
   to see what's passed where.

- Minimizing the amount of side effects in the overall code. That's a good
   thing anyway and it *doesn't* cost us neither performance nor space, since
   the stack depths are small anyway here.

- Minimizing the usage of hwgroup - which should go away if possible.
parent b960fa03
...@@ -252,7 +252,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -252,7 +252,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -409,7 +409,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -409,7 +409,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_OFFBOARD=y CONFIG_BLK_DEV_OFFBOARD=y
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -460,7 +460,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -460,7 +460,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -687,7 +687,7 @@ static int config_drive_for_dma (ide_drive_t *drive) ...@@ -687,7 +687,7 @@ static int config_drive_for_dma (ide_drive_t *drive)
/* /*
* etrax_dma_intr() is the handler for disk read/write DMA interrupts * etrax_dma_intr() is the handler for disk read/write DMA interrupts
*/ */
static ide_startstop_t etrax_dma_intr (ide_drive_t *drive) static ide_startstop_t etrax_dma_intr (struct ata_device *drive, struct request *rq)
{ {
int i, dma_stat; int i, dma_stat;
byte stat; byte stat;
...@@ -699,11 +699,9 @@ static ide_startstop_t etrax_dma_intr (ide_drive_t *drive) ...@@ -699,11 +699,9 @@ static ide_startstop_t etrax_dma_intr (ide_drive_t *drive)
stat = GET_STAT(); /* get drive status */ stat = GET_STAT(); /* get drive status */
if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) {
if (!dma_stat) { if (!dma_stat) {
struct request *rq;
rq = HWGROUP(drive)->rq;
for (i = rq->nr_sectors; i > 0;) { for (i = rq->nr_sectors; i > 0;) {
i -= rq->current_nr_sectors; i -= rq->current_nr_sectors;
ide_end_request(drive, 1); ide_end_request(drive, rq, 1);
} }
return ide_stopped; return ide_stopped;
} }
......
...@@ -263,7 +263,6 @@ CONFIG_IDEDMA_PCI_AUTO=y ...@@ -263,7 +263,6 @@ CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_BLK_DEV_IDE_TCQ is not set # CONFIG_BLK_DEV_IDE_TCQ is not set
# CONFIG_BLK_DEV_IDE_TCQ_DEFAULT is not set # CONFIG_BLK_DEV_IDE_TCQ_DEFAULT is not set
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -233,7 +233,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -233,7 +233,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_IDEDMA_PCI_AUTO is not set
# CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -212,7 +212,6 @@ CONFIG_BLK_DEV_ADMA=y ...@@ -212,7 +212,6 @@ CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_IDEDMA_PCI_AUTO is not set
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -212,7 +212,6 @@ CONFIG_BLK_DEV_ADMA=y ...@@ -212,7 +212,6 @@ CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_IDEDMA_PCI_AUTO is not set
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -227,7 +227,6 @@ CONFIG_BLK_DEV_IDEPCI=y ...@@ -227,7 +227,6 @@ CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_IDEDMA_PCI_AUTO is not set
# CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_BLK_DEV_IDEDMA is not set
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -292,7 +292,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -292,7 +292,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -255,7 +255,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -255,7 +255,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -238,7 +238,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -238,7 +238,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_IDEDMA_PCI_AUTO is not set
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -242,7 +242,6 @@ CONFIG_BLK_DEV_IDEPCI=y ...@@ -242,7 +242,6 @@ CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_IDEDMA_PCI_AUTO is not set
# CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_BLK_DEV_IDEDMA is not set
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -236,7 +236,6 @@ CONFIG_BLK_DEV_IDEPCI=y ...@@ -236,7 +236,6 @@ CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_IDEDMA_PCI_AUTO is not set
# CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_BLK_DEV_IDEDMA is not set
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -245,7 +245,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -245,7 +245,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -249,7 +249,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -249,7 +249,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_IDEDMA_PCI_AUTO is not set
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -212,7 +212,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -212,7 +212,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_IDEDMA_PCI_AUTO is not set
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -255,7 +255,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -255,7 +255,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -289,7 +289,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -289,7 +289,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_IDEDMA_ONLYDISK=y CONFIG_IDEDMA_ONLYDISK=y
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -214,7 +214,6 @@ CONFIG_IDEDMA_PCI_AUTO=y ...@@ -214,7 +214,6 @@ CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_BLK_DEV_IDE_TCQ is not set # CONFIG_BLK_DEV_IDE_TCQ is not set
# CONFIG_BLK_DEV_IDE_TCQ_DEFAULT is not set # CONFIG_BLK_DEV_IDE_TCQ_DEFAULT is not set
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC62XX_TUNING is not set
......
...@@ -299,13 +299,6 @@ CONFIG_IDEDMA_IVB ...@@ -299,13 +299,6 @@ CONFIG_IDEDMA_IVB
It is normally safe to answer Y; however, the default is N. It is normally safe to answer Y; however, the default is N.
CONFIG_IDEDMA_PCI_WIP
If you enable this you will be able to use and test highly
developmental projects. If you say N, the configurator will
simply skip those options.
It is SAFEST to say N to this question.
CONFIG_BLK_DEV_PDC_ADMA CONFIG_BLK_DEV_PDC_ADMA
Please read the comments at the top of <file:drivers/ide/ide-pci.c>. Please read the comments at the top of <file:drivers/ide/ide-pci.c>.
......
...@@ -47,18 +47,17 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then ...@@ -47,18 +47,17 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
dep_bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Enable DMA only for disks ' CONFIG_IDEDMA_ONLYDISK $CONFIG_IDEDMA_PCI_AUTO dep_bool ' Enable DMA only for disks ' CONFIG_IDEDMA_ONLYDISK $CONFIG_IDEDMA_PCI_AUTO
define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' ATA Work(s) In Progress (EXPERIMENTAL)' CONFIG_IDEDMA_PCI_WIP $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL dep_bool ' Good-Bad DMA Model-Firmware (EXPERIMENTAL)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_EXPERIMENTAL
dep_bool ' Good-Bad DMA Model-Firmware (WIP)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_IDEDMA_PCI_WIP
dep_bool ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' AEC62XX Tuning support' CONFIG_AEC62XX_TUNING $CONFIG_BLK_DEV_AEC62XX dep_mbool ' AEC62XX Tuning support' CONFIG_AEC62XX_TUNING $CONFIG_BLK_DEV_AEC62XX
dep_bool ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3 dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3 $CONFIG_EXPERIMENTAL
dep_bool ' AMD and nVidia chipset support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' AMD and nVidia chipset support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' CMD64X chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' CMD64X chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' CY82C693 chipset support' CONFIG_BLK_DEV_CY82C693 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' CY82C693 chipset support' CONFIG_BLK_DEV_CY82C693 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Cyrix CS5530 MediaGX chipset support' CONFIG_BLK_DEV_CS5530 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' Cyrix CS5530 MediaGX chipset support' CONFIG_BLK_DEV_CS5530 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' HPT34X AUTODMA support (WIP)' CONFIG_HPT34X_AUTODMA $CONFIG_BLK_DEV_HPT34X $CONFIG_IDEDMA_PCI_WIP dep_mbool ' HPT34X AUTODMA support (EXPERMENTAL)' CONFIG_HPT34X_AUTODMA $CONFIG_BLK_DEV_HPT34X $CONFIG_EXPERIMENTAL
dep_bool ' HPT366 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' HPT366 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Intel and Efar (SMsC) chipset support' CONFIG_BLK_DEV_PIIX $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' Intel and Efar (SMsC) chipset support' CONFIG_BLK_DEV_PIIX $CONFIG_BLK_DEV_IDEDMA_PCI
if [ "$CONFIG_MIPS_ITE8172" = "y" -o "$CONFIG_MIPS_IVR" = "y" ]; then if [ "$CONFIG_MIPS_ITE8172" = "y" -o "$CONFIG_MIPS_IVR" = "y" ]; then
...@@ -67,7 +66,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then ...@@ -67,7 +66,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
fi fi
dep_bool ' NS87415 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' NS87415 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_EXPERIMENTAL dep_bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_EXPERIMENTAL
dep_mbool ' Pacific Digital A-DMA support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC_ADMA $CONFIG_IDEDMA_PCI_WIP dep_mbool ' Pacific Digital A-DMA support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC_ADMA $CONFIG_EXPERIMENTAL
dep_bool ' PROMISE PDC202{46|62|65|67|68|69|70} support' CONFIG_BLK_DEV_PDC202XX $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' PROMISE PDC202{46|62|65|67|68|69|70} support' CONFIG_BLK_DEV_PDC202XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX
dep_bool ' Special FastTrak Feature' CONFIG_PDC202XX_FORCE $CONFIG_BLK_DEV_PDC202XX dep_bool ' Special FastTrak Feature' CONFIG_PDC202XX_FORCE $CONFIG_BLK_DEV_PDC202XX
......
...@@ -437,7 +437,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -437,7 +437,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->channel->autodma) { if (id && (id->capability & 1) && drive->channel->autodma) {
/* Consult the list of known "bad" drives */ /* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive)) { if (ide_dmaproc(ide_dma_bad_drive, drive, NULL)) {
dma_func = ide_dma_off; dma_func = ide_dma_off;
goto fast_ata_pio; goto fast_ata_pio;
} }
...@@ -459,7 +459,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -459,7 +459,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (dma_func != ide_dma_on) if (dma_func != ide_dma_on)
goto no_dma_set; goto no_dma_set;
} }
} else if (ide_dmaproc(ide_dma_good_drive, drive)) { } else if (ide_dmaproc(ide_dma_good_drive, drive, NULL)) {
if (id->eide_dma_time > 150) { if (id->eide_dma_time > 150) {
goto no_dma_set; goto no_dma_set;
} }
...@@ -476,13 +476,13 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -476,13 +476,13 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
no_dma_set: no_dma_set:
aec62xx_tune_drive(drive, 5); aec62xx_tune_drive(drive, 5);
} }
return drive->channel->dmaproc(dma_func, drive); return drive->channel->udma(dma_func, drive, NULL);
} }
/* /*
* aec62xx_dmaproc() initiates/aborts (U)DMA read/write operations on a drive. * aec62xx_dmaproc() initiates/aborts (U)DMA read/write operations on a drive.
*/ */
int aec62xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive) int aec62xx_dmaproc (ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
switch (func) { switch (func) {
case ide_dma_check: case ide_dma_check:
...@@ -507,7 +507,7 @@ int aec62xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -507,7 +507,7 @@ int aec62xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
default: default:
break; break;
} }
return ide_dmaproc(func, drive); /* use standard DMA stuff */ return ide_dmaproc(func, drive, rq); /* use standard DMA stuff */
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
#endif /* CONFIG_AEC62XX_TUNING */ #endif /* CONFIG_AEC62XX_TUNING */
...@@ -542,17 +542,17 @@ unsigned int __init ata66_aec62xx(struct ata_channel *hwif) ...@@ -542,17 +542,17 @@ unsigned int __init ata66_aec62xx(struct ata_channel *hwif)
void __init ide_init_aec62xx(struct ata_channel *hwif) void __init ide_init_aec62xx(struct ata_channel *hwif)
{ {
#ifdef CONFIG_AEC62XX_TUNING #ifdef CONFIG_AEC62XX_TUNING
hwif->tuneproc = &aec62xx_tune_drive; hwif->tuneproc = aec62xx_tune_drive;
hwif->speedproc = &aec62xx_tune_chipset; hwif->speedproc = aec62xx_tune_chipset;
#ifdef CONFIG_BLK_DEV_IDEDMA # ifdef CONFIG_BLK_DEV_IDEDMA
if (hwif->dma_base) if (hwif->dma_base)
hwif->dmaproc = &aec62xx_dmaproc; hwif->udma = aec62xx_dmaproc;
hwif->highmem = 1; hwif->highmem = 1;
#else /* !CONFIG_BLK_DEV_IDEDMA */ # else
hwif->drives[0].autotune = 1; hwif->drives[0].autotune = 1;
hwif->drives[1].autotune = 1; hwif->drives[1].autotune = 1;
#endif /* CONFIG_BLK_DEV_IDEDMA */ # endif
#endif /* CONFIG_AEC62XX_TUNING */ #endif
} }
void __init ide_dmacapable_aec62xx(struct ata_channel *hwif, unsigned long dmabase) void __init ide_dmacapable_aec62xx(struct ata_channel *hwif, unsigned long dmabase)
......
...@@ -437,11 +437,11 @@ static int ali15x3_config_drive_for_dma(ide_drive_t *drive) ...@@ -437,11 +437,11 @@ static int ali15x3_config_drive_for_dma(ide_drive_t *drive)
byte can_ultra_dma = ali15x3_can_ultra(drive); byte can_ultra_dma = ali15x3_can_ultra(drive);
if ((m5229_revision<=0x20) && (drive->type != ATA_DISK)) if ((m5229_revision<=0x20) && (drive->type != ATA_DISK))
return hwif->dmaproc(ide_dma_off_quietly, drive); return hwif->udma(ide_dma_off_quietly, drive, NULL);
if ((id != NULL) && ((id->capability & 1) != 0) && hwif->autodma) { if ((id != NULL) && ((id->capability & 1) != 0) && hwif->autodma) {
/* Consult the list of known "bad" drives */ /* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive)) { if (ide_dmaproc(ide_dma_bad_drive, drive, NULL)) {
dma_func = ide_dma_off; dma_func = ide_dma_off;
goto fast_ata_pio; goto fast_ata_pio;
} }
...@@ -463,7 +463,7 @@ static int ali15x3_config_drive_for_dma(ide_drive_t *drive) ...@@ -463,7 +463,7 @@ static int ali15x3_config_drive_for_dma(ide_drive_t *drive)
if (dma_func != ide_dma_on) if (dma_func != ide_dma_on)
goto no_dma_set; goto no_dma_set;
} }
} else if (ide_dmaproc(ide_dma_good_drive, drive)) { } else if (ide_dmaproc(ide_dma_good_drive, drive, NULL)) {
if (id->eide_dma_time > 150) { if (id->eide_dma_time > 150) {
goto no_dma_set; goto no_dma_set;
} }
...@@ -480,10 +480,10 @@ static int ali15x3_config_drive_for_dma(ide_drive_t *drive) ...@@ -480,10 +480,10 @@ static int ali15x3_config_drive_for_dma(ide_drive_t *drive)
no_dma_set: no_dma_set:
config_chipset_for_pio(drive); config_chipset_for_pio(drive);
} }
return hwif->dmaproc(dma_func, drive); return hwif->udma(dma_func, drive, NULL);
} }
static int ali15x3_dmaproc (ide_dma_action_t func, ide_drive_t *drive) static int ali15x3_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
switch(func) { switch(func) {
case ide_dma_check: case ide_dma_check:
...@@ -495,7 +495,7 @@ static int ali15x3_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -495,7 +495,7 @@ static int ali15x3_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
default: default:
break; break;
} }
return ide_dmaproc(func, drive); /* use standard DMA stuff */ return ide_dmaproc(func, drive, rq); /* use standard DMA stuff */
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -672,14 +672,14 @@ void __init ide_init_ali15x3(struct ata_channel *hwif) ...@@ -672,14 +672,14 @@ void __init ide_init_ali15x3(struct ata_channel *hwif)
hwif->tuneproc = &ali15x3_tune_drive; hwif->tuneproc = &ali15x3_tune_drive;
hwif->drives[0].autotune = 1; hwif->drives[0].autotune = 1;
hwif->drives[1].autotune = 1; hwif->drives[1].autotune = 1;
hwif->speedproc = &ali15x3_tune_chipset; hwif->speedproc = ali15x3_tune_chipset;
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
if ((hwif->dma_base) && (m5229_revision >= 0x20)) { if ((hwif->dma_base) && (m5229_revision >= 0x20)) {
/* /*
* M1543C or newer for DMAing * M1543C or newer for DMAing
*/ */
hwif->dmaproc = &ali15x3_dmaproc; hwif->udma = ali15x3_dmaproc;
hwif->autodma = 1; hwif->autodma = 1;
} }
......
...@@ -282,7 +282,7 @@ static void amd74xx_tune_drive(ide_drive_t *drive, unsigned char pio) ...@@ -282,7 +282,7 @@ static void amd74xx_tune_drive(ide_drive_t *drive, unsigned char pio)
* else to the default ide_dmaproc(). * else to the default ide_dmaproc().
*/ */
int amd74xx_dmaproc(ide_dma_action_t func, ide_drive_t *drive) int amd74xx_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
if (func == ide_dma_check) { if (func == ide_dma_check) {
...@@ -301,7 +301,7 @@ int amd74xx_dmaproc(ide_dma_action_t func, ide_drive_t *drive) ...@@ -301,7 +301,7 @@ int amd74xx_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
? ide_dma_on : ide_dma_off_quietly; ? ide_dma_on : ide_dma_off_quietly;
} }
return ide_dmaproc(func, drive); return ide_dmaproc(func, drive, rq);
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -433,13 +433,13 @@ void __init ide_init_amd74xx(struct ata_channel *hwif) ...@@ -433,13 +433,13 @@ void __init ide_init_amd74xx(struct ata_channel *hwif)
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
if (hwif->dma_base) { if (hwif->dma_base) {
hwif->highmem = 1; hwif->highmem = 1;
hwif->dmaproc = &amd74xx_dmaproc; hwif->udma = amd74xx_dmaproc;
#ifdef CONFIG_IDEDMA_AUTO # ifdef CONFIG_IDEDMA_AUTO
if (!noautodma) if (!noautodma)
hwif->autodma = 1; hwif->autodma = 1;
#endif # endif
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif
} }
/* /*
......
...@@ -777,13 +777,13 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive) ...@@ -777,13 +777,13 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
can_ultra_100 = 0; can_ultra_100 = 0;
break; break;
default: default:
return hwif->dmaproc(ide_dma_off, drive); return hwif->udma(ide_dma_off, drive, NULL);
} }
if ((id != NULL) && ((id->capability & 1) != 0) && if ((id != NULL) && ((id->capability & 1) != 0) &&
hwif->autodma && (drive->type == ATA_DISK)) { hwif->autodma && (drive->type == ATA_DISK)) {
/* Consult the list of known "bad" drives */ /* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive)) { if (ide_dmaproc(ide_dma_bad_drive, drive, NULL)) {
dma_func = ide_dma_off; dma_func = ide_dma_off;
goto fast_ata_pio; goto fast_ata_pio;
} }
...@@ -805,7 +805,7 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive) ...@@ -805,7 +805,7 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
if (dma_func != ide_dma_on) if (dma_func != ide_dma_on)
goto no_dma_set; goto no_dma_set;
} }
} else if (ide_dmaproc(ide_dma_good_drive, drive)) { } else if (ide_dmaproc(ide_dma_good_drive, drive, NULL)) {
if (id->eide_dma_time > 150) { if (id->eide_dma_time > 150) {
goto no_dma_set; goto no_dma_set;
} }
...@@ -822,10 +822,10 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive) ...@@ -822,10 +822,10 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
no_dma_set: no_dma_set:
config_chipset_for_pio(drive, 1); config_chipset_for_pio(drive, 1);
} }
return drive->channel->dmaproc(dma_func, drive); return drive->channel->udma(dma_func, drive, NULL);
} }
static int cmd680_dmaproc (ide_dma_action_t func, ide_drive_t *drive) static int cmd680_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
switch (func) { switch (func) {
case ide_dma_check: case ide_dma_check:
...@@ -834,10 +834,10 @@ static int cmd680_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -834,10 +834,10 @@ static int cmd680_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
break; break;
} }
/* Other cases are done by generic IDE-DMA code. */ /* Other cases are done by generic IDE-DMA code. */
return ide_dmaproc(func, drive); return ide_dmaproc(func, drive, rq);
} }
static int cmd64x_dmaproc (ide_dma_action_t func, ide_drive_t *drive) static int cmd64x_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
byte dma_stat = 0; byte dma_stat = 0;
byte dma_alt_stat = 0; byte dma_alt_stat = 0;
...@@ -882,14 +882,14 @@ static int cmd64x_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -882,14 +882,14 @@ static int cmd64x_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
break; break;
} }
/* Other cases are done by generic IDE-DMA code. */ /* Other cases are done by generic IDE-DMA code. */
return ide_dmaproc(func, drive); return ide_dmaproc(func, drive, rq);
} }
/* /*
* ASUS P55T2P4D with CMD646 chipset revision 0x01 requires the old * ASUS P55T2P4D with CMD646 chipset revision 0x01 requires the old
* event order for DMA transfers. * event order for DMA transfers.
*/ */
static int cmd646_1_dmaproc (ide_dma_action_t func, ide_drive_t *drive) static int cmd646_1_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
unsigned long dma_base = hwif->dma_base; unsigned long dma_base = hwif->dma_base;
...@@ -910,7 +910,7 @@ static int cmd646_1_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -910,7 +910,7 @@ static int cmd646_1_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
} }
/* Other cases are done by generic IDE-DMA code. */ /* Other cases are done by generic IDE-DMA code. */
return ide_dmaproc(func, drive); return ide_dmaproc(func, drive, rq);
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -1125,7 +1125,7 @@ void __init ide_init_cmd64x(struct ata_channel *hwif) ...@@ -1125,7 +1125,7 @@ void __init ide_init_cmd64x(struct ata_channel *hwif)
switch(dev->device) { switch(dev->device) {
case PCI_DEVICE_ID_CMD_680: case PCI_DEVICE_ID_CMD_680:
hwif->busproc = &cmd680_busproc; hwif->busproc = &cmd680_busproc;
hwif->dmaproc = &cmd680_dmaproc; hwif->udma = &cmd680_dmaproc;
hwif->resetproc = &cmd680_reset; hwif->resetproc = &cmd680_reset;
hwif->speedproc = &cmd680_tune_chipset; hwif->speedproc = &cmd680_tune_chipset;
hwif->tuneproc = &cmd680_tuneproc; hwif->tuneproc = &cmd680_tuneproc;
...@@ -1133,16 +1133,16 @@ void __init ide_init_cmd64x(struct ata_channel *hwif) ...@@ -1133,16 +1133,16 @@ void __init ide_init_cmd64x(struct ata_channel *hwif)
case PCI_DEVICE_ID_CMD_649: case PCI_DEVICE_ID_CMD_649:
case PCI_DEVICE_ID_CMD_648: case PCI_DEVICE_ID_CMD_648:
case PCI_DEVICE_ID_CMD_643: case PCI_DEVICE_ID_CMD_643:
hwif->dmaproc = &cmd64x_dmaproc; hwif->udma = &cmd64x_dmaproc;
hwif->tuneproc = &cmd64x_tuneproc; hwif->tuneproc = &cmd64x_tuneproc;
hwif->speedproc = &cmd64x_tune_chipset; hwif->speedproc = &cmd64x_tune_chipset;
break; break;
case PCI_DEVICE_ID_CMD_646: case PCI_DEVICE_ID_CMD_646:
hwif->chipset = ide_cmd646; hwif->chipset = ide_cmd646;
if (class_rev == 0x01) { if (class_rev == 0x01) {
hwif->dmaproc = &cmd646_1_dmaproc; hwif->udma = &cmd646_1_dmaproc;
} else { } else {
hwif->dmaproc = &cmd64x_dmaproc; hwif->udma = &cmd64x_dmaproc;
} }
hwif->tuneproc = &cmd64x_tuneproc; hwif->tuneproc = &cmd64x_tuneproc;
hwif->speedproc = &cmd64x_tune_chipset; hwif->speedproc = &cmd64x_tune_chipset;
......
...@@ -144,7 +144,7 @@ static int cs5530_config_dma (ide_drive_t *drive) ...@@ -144,7 +144,7 @@ static int cs5530_config_dma (ide_drive_t *drive)
/* /*
* Default to DMA-off in case we run into trouble here. * Default to DMA-off in case we run into trouble here.
*/ */
(void)hwif->dmaproc(ide_dma_off_quietly, drive); /* turn off DMA while we fiddle */ hwif->udma(ide_dma_off_quietly, drive, NULL);
outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* clear DMA_capable bit */ outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* clear DMA_capable bit */
/* /*
...@@ -158,7 +158,7 @@ static int cs5530_config_dma (ide_drive_t *drive) ...@@ -158,7 +158,7 @@ static int cs5530_config_dma (ide_drive_t *drive)
*/ */
if (mate->present) { if (mate->present) {
struct hd_driveid *mateid = mate->id; struct hd_driveid *mateid = mate->id;
if (mateid && (mateid->capability & 1) && !hwif->dmaproc(ide_dma_bad_drive, mate)) { if (mateid && (mateid->capability & 1) && !hwif->udma(ide_dma_bad_drive, mate, NULL)) {
if ((mateid->field_valid & 4) && (mateid->dma_ultra & 7)) if ((mateid->field_valid & 4) && (mateid->dma_ultra & 7))
udma_ok = 1; udma_ok = 1;
else if ((mateid->field_valid & 2) && (mateid->dma_mword & 7)) else if ((mateid->field_valid & 2) && (mateid->dma_mword & 7))
...@@ -172,7 +172,7 @@ static int cs5530_config_dma (ide_drive_t *drive) ...@@ -172,7 +172,7 @@ static int cs5530_config_dma (ide_drive_t *drive)
* Now see what the current drive is capable of, * Now see what the current drive is capable of,
* selecting UDMA only if the mate said it was ok. * selecting UDMA only if the mate said it was ok.
*/ */
if (id && (id->capability & 1) && hwif->autodma && !hwif->dmaproc(ide_dma_bad_drive, drive)) { if (id && (id->capability & 1) && hwif->autodma && !hwif->udma(ide_dma_bad_drive, drive, NULL)) {
if (udma_ok && (id->field_valid & 4) && (id->dma_ultra & 7)) { if (udma_ok && (id->field_valid & 4) && (id->dma_ultra & 7)) {
if (id->dma_ultra & 4) if (id->dma_ultra & 4)
mode = XFER_UDMA_2; mode = XFER_UDMA_2;
...@@ -229,7 +229,7 @@ static int cs5530_config_dma (ide_drive_t *drive) ...@@ -229,7 +229,7 @@ static int cs5530_config_dma (ide_drive_t *drive)
/* /*
* Finally, turn DMA on in software, and exit. * Finally, turn DMA on in software, and exit.
*/ */
return hwif->dmaproc(ide_dma_on, drive); /* success */ return hwif->udma(ide_dma_on, drive, NULL); /* success */
} }
/* /*
...@@ -237,7 +237,7 @@ static int cs5530_config_dma (ide_drive_t *drive) ...@@ -237,7 +237,7 @@ static int cs5530_config_dma (ide_drive_t *drive)
* We need it for our custom "ide_dma_check" function. * We need it for our custom "ide_dma_check" function.
* All other requests are forwarded to the standard ide_dmaproc(). * All other requests are forwarded to the standard ide_dmaproc().
*/ */
int cs5530_dmaproc (ide_dma_action_t func, ide_drive_t *drive) int cs5530_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
switch (func) { switch (func) {
case ide_dma_check: case ide_dma_check:
...@@ -246,7 +246,7 @@ int cs5530_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -246,7 +246,7 @@ int cs5530_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
break; break;
} }
/* Other cases are done by generic IDE-DMA code. */ /* Other cases are done by generic IDE-DMA code. */
return ide_dmaproc(func, drive); return ide_dmaproc(func, drive, rq);
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -353,7 +353,7 @@ void __init ide_init_cs5530(struct ata_channel *hwif) ...@@ -353,7 +353,7 @@ void __init ide_init_cs5530(struct ata_channel *hwif)
unsigned int basereg, d0_timings; unsigned int basereg, d0_timings;
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
hwif->dmaproc = &cs5530_dmaproc; hwif->udma = cs5530_dmaproc;
hwif->highmem = 1; hwif->highmem = 1;
#else #else
hwif->autodma = 0; hwif->autodma = 0;
......
...@@ -234,7 +234,7 @@ static void cy82c693_dma_enable (ide_drive_t *drive, int mode, int single) ...@@ -234,7 +234,7 @@ static void cy82c693_dma_enable (ide_drive_t *drive, int mode, int single)
/* /*
* used to set DMA mode for CY82C693 (single and multi modes) * used to set DMA mode for CY82C693 (single and multi modes)
*/ */
static int cy82c693_dmaproc(ide_dma_action_t func, ide_drive_t *drive) static int cy82c693_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
/* /*
* if the function is dma on, set dma mode for drive everything * if the function is dma on, set dma mode for drive everything
...@@ -262,7 +262,7 @@ static int cy82c693_dmaproc(ide_dma_action_t func, ide_drive_t *drive) ...@@ -262,7 +262,7 @@ static int cy82c693_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
} }
} }
} }
return ide_dmaproc(func, drive); return ide_dmaproc(func, drive, rq);
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -442,7 +442,7 @@ void __init ide_init_cy82c693(struct ata_channel *hwif) ...@@ -442,7 +442,7 @@ void __init ide_init_cy82c693(struct ata_channel *hwif)
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
if (hwif->dma_base) { if (hwif->dma_base) {
hwif->highmem = 1; hwif->highmem = 1;
hwif->dmaproc = cy82c693_dmaproc; hwif->udma = cy82c693_dmaproc;
if (!noautodma) if (!noautodma)
hwif->autodma = 1; hwif->autodma = 1;
} }
......
...@@ -334,7 +334,6 @@ int hpt34x_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -334,7 +334,6 @@ int hpt34x_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
drive->waiting_for_dma = 1; drive->waiting_for_dma = 1;
if (drive->type != ATA_DISK) if (drive->type != ATA_DISK)
return 0; return 0;
BUG_ON(HWGROUP(drive)->handler);
ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); /* issue cmd to drive */ ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); /* issue cmd to drive */
OUT_BYTE((reading == 9) ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); OUT_BYTE((reading == 9) ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG);
return 0; return 0;
......
...@@ -750,7 +750,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -750,7 +750,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->channel->autodma) { if (id && (id->capability & 1) && drive->channel->autodma) {
/* Consult the list of known "bad" drives */ /* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive)) { if (ide_dmaproc(ide_dma_bad_drive, drive, NULL)) {
dma_func = ide_dma_off; dma_func = ide_dma_off;
goto fast_ata_pio; goto fast_ata_pio;
} }
...@@ -771,7 +771,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -771,7 +771,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (dma_func != ide_dma_on) if (dma_func != ide_dma_on)
goto no_dma_set; goto no_dma_set;
} }
} else if (ide_dmaproc(ide_dma_good_drive, drive)) { } else if (ide_dmaproc(ide_dma_good_drive, drive, NULL)) {
if (id->eide_dma_time > 150) { if (id->eide_dma_time > 150) {
goto no_dma_set; goto no_dma_set;
} }
...@@ -789,7 +789,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -789,7 +789,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
config_chipset_for_pio(drive); config_chipset_for_pio(drive);
} }
return drive->channel->dmaproc(dma_func, drive); return drive->channel->udma(dma_func, drive, NULL);
} }
/* /*
...@@ -798,7 +798,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -798,7 +798,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
* This is specific to the HPT366 UDMA bios chipset * This is specific to the HPT366 UDMA bios chipset
* by HighPoint|Triones Technologies, Inc. * by HighPoint|Triones Technologies, Inc.
*/ */
int hpt366_dmaproc (ide_dma_action_t func, ide_drive_t *drive) int hpt366_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
byte reg50h = 0, reg52h = 0, reg5ah = 0, dma_stat = 0; byte reg50h = 0, reg52h = 0, reg5ah = 0, dma_stat = 0;
unsigned long dma_base = drive->channel->dma_base; unsigned long dma_base = drive->channel->dma_base;
...@@ -829,10 +829,10 @@ int hpt366_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -829,10 +829,10 @@ int hpt366_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
default: default:
break; break;
} }
return ide_dmaproc(func, drive); /* use standard DMA stuff */ return ide_dmaproc(func, drive, rq); /* use standard DMA stuff */
} }
int hpt370_dmaproc (ide_dma_action_t func, ide_drive_t *drive) int hpt370_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
unsigned long dma_base = hwif->dma_base; unsigned long dma_base = hwif->dma_base;
...@@ -883,7 +883,7 @@ int hpt370_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -883,7 +883,7 @@ int hpt370_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
default: default:
break; break;
} }
return ide_dmaproc(func, drive); /* use standard DMA stuff */ return ide_dmaproc(func, drive, rq); /* use standard DMA stuff */
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -1185,9 +1185,9 @@ void __init ide_init_hpt366(struct ata_channel *hwif) ...@@ -1185,9 +1185,9 @@ void __init ide_init_hpt366(struct ata_channel *hwif)
pci_read_config_byte(hwif->pci_dev, 0x5a, &reg5ah); pci_read_config_byte(hwif->pci_dev, 0x5a, &reg5ah);
if (reg5ah & 0x10) /* interrupt force enable */ if (reg5ah & 0x10) /* interrupt force enable */
pci_write_config_byte(hwif->pci_dev, 0x5a, reg5ah & ~0x10); pci_write_config_byte(hwif->pci_dev, 0x5a, reg5ah & ~0x10);
hwif->dmaproc = &hpt370_dmaproc; hwif->udma = hpt370_dmaproc;
} else { } else {
hwif->dmaproc = &hpt366_dmaproc; hwif->udma = hpt366_dmaproc;
} }
if (!noautodma) if (!noautodma)
hwif->autodma = 1; hwif->autodma = 1;
......
...@@ -327,7 +327,7 @@ icside_set_speed(ide_drive_t *drive, byte speed) ...@@ -327,7 +327,7 @@ icside_set_speed(ide_drive_t *drive, byte speed)
/* /*
* dma_intr() is the handler for disk read/write DMA interrupts * dma_intr() is the handler for disk read/write DMA interrupts
*/ */
static ide_startstop_t icside_dmaintr(ide_drive_t *drive) static ide_startstop_t icside_dmaintr(struct ata_device *drive, struct request *rq)
{ {
int i; int i;
byte stat, dma_stat; byte stat, dma_stat;
...@@ -336,8 +336,6 @@ static ide_startstop_t icside_dmaintr(ide_drive_t *drive) ...@@ -336,8 +336,6 @@ static ide_startstop_t icside_dmaintr(ide_drive_t *drive)
stat = GET_STAT(); /* get drive status */ stat = GET_STAT(); /* get drive status */
if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) {
if (!dma_stat) { if (!dma_stat) {
struct request *rq = HWGROUP(drive)->rq;
rq = HWGROUP(drive)->rq;
for (i = rq->nr_sectors; i > 0;) { for (i = rq->nr_sectors; i > 0;) {
i -= rq->current_nr_sectors; i -= rq->current_nr_sectors;
ide_end_request(drive, 1); ide_end_request(drive, 1);
...@@ -443,8 +441,7 @@ icside_dmaproc(ide_dma_action_t func, ide_drive_t *drive) ...@@ -443,8 +441,7 @@ icside_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
if (drive->type != ATA_DISK) if (drive->type != ATA_DISK)
return 0; return 0;
BUG_ON(HWGROUP(drive)->handler); ide_set_handler(drive, icside_dmaintr, WAIT_CMD, NULL);
ide_set_handler(drive, &icside_dmaintr, WAIT_CMD, NULL);
OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA,
IDE_COMMAND_REG); IDE_COMMAND_REG);
......
This diff is collapsed.
...@@ -275,7 +275,7 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque ...@@ -275,7 +275,7 @@ static ide_startstop_t idedisk_do_request(struct ata_device *drive, struct reque
if (!(rq->flags & REQ_CMD)) { if (!(rq->flags & REQ_CMD)) {
blk_dump_rq_flags(rq, "idedisk_do_request - bad command"); blk_dump_rq_flags(rq, "idedisk_do_request - bad command");
ide_end_request(drive, 0); ide_end_request(drive, rq, 0);
return ide_stopped; return ide_stopped;
} }
...@@ -1050,7 +1050,7 @@ static void idedisk_setup(struct ata_device *drive) ...@@ -1050,7 +1050,7 @@ static void idedisk_setup(struct ata_device *drive)
drive->bios_cyl, drive->bios_head, drive->bios_sect); drive->bios_cyl, drive->bios_head, drive->bios_sect);
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
if (drive->using_dma) if (drive->using_dma)
(void) drive->channel->dmaproc(ide_dma_verbose, drive); (void) drive->channel->udma(ide_dma_verbose, drive, NULL);
#endif #endif
printk("\n"); printk("\n");
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* May be copied or modified under the terms of the GNU General Public License * May be copied or modified under the terms of the GNU General Public License
* *
* Special Thanks to Mark for his Six years of work. * Special Thanks to Mark for his Six years of work.
* *
* This module provides support for the bus-master IDE DMA functions * This module provides support for the bus-master IDE DMA functions
* of various PCI chipsets, including the Intel PIIX (i82371FB for * of various PCI chipsets, including the Intel PIIX (i82371FB for
* the 430 FX chipset), the PIIX3 (i82371SB for the 430 HX/VX and * the 430 FX chipset), the PIIX3 (i82371SB for the 430 HX/VX and
...@@ -194,17 +194,14 @@ const char *bad_dma_drives[] = {"WDC AC11000H", ...@@ -194,17 +194,14 @@ const char *bad_dma_drives[] = {"WDC AC11000H",
/* /*
* dma_intr() is the handler for disk read/write DMA interrupts * dma_intr() is the handler for disk read/write DMA interrupts
*/ */
ide_startstop_t ide_dma_intr (ide_drive_t *drive) ide_startstop_t ide_dma_intr(struct ata_device *drive, struct request *rq)
{ {
byte stat, dma_stat; byte stat, dma_stat;
dma_stat = drive->channel->dmaproc(ide_dma_end, drive); dma_stat = drive->channel->udma(ide_dma_end, drive, rq);
stat = GET_STAT(); /* get drive status */ if (OK_STAT(stat = GET_STAT(),DRIVE_READY,drive->bad_wstat|DRQ_STAT)) {
if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) {
if (!dma_stat) { if (!dma_stat) {
struct request *rq = HWGROUP(drive)->rq; __ide_end_request(drive, rq, 1, rq->nr_sectors);
__ide_end_request(drive, 1, rq->nr_sectors);
return ide_stopped; return ide_stopped;
} }
printk("%s: dma_intr: bad DMA status (dma_stat=%x)\n", printk("%s: dma_intr: bad DMA status (dma_stat=%x)\n",
...@@ -461,38 +458,39 @@ static int config_drive_for_dma (ide_drive_t *drive) ...@@ -461,38 +458,39 @@ static int config_drive_for_dma (ide_drive_t *drive)
if (id && (id->capability & 1) && hwif->autodma && config_allows_dma) { if (id && (id->capability & 1) && hwif->autodma && config_allows_dma) {
/* Consult the list of known "bad" drives */ /* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive)) if (ide_dmaproc(ide_dma_bad_drive, drive, NULL))
return hwif->dmaproc(ide_dma_off, drive); return hwif->udma(ide_dma_off, drive, NULL);
/* Enable DMA on any drive that has UltraDMA (mode 6/7/?) enabled */ /* Enable DMA on any drive that has UltraDMA (mode 6/7/?) enabled */
if ((id->field_valid & 4) && (eighty_ninty_three(drive))) if ((id->field_valid & 4) && (eighty_ninty_three(drive)))
if ((id->dma_ultra & (id->dma_ultra >> 14) & 2)) if ((id->dma_ultra & (id->dma_ultra >> 14) & 2))
return hwif->dmaproc(ide_dma_on, drive); return hwif->udma(ide_dma_on, drive, NULL);
/* Enable DMA on any drive that has UltraDMA (mode 3/4/5) enabled */ /* Enable DMA on any drive that has UltraDMA (mode 3/4/5) enabled */
if ((id->field_valid & 4) && (eighty_ninty_three(drive))) if ((id->field_valid & 4) && (eighty_ninty_three(drive)))
if ((id->dma_ultra & (id->dma_ultra >> 11) & 7)) if ((id->dma_ultra & (id->dma_ultra >> 11) & 7))
return hwif->dmaproc(ide_dma_on, drive); return hwif->udma(ide_dma_on, drive, NULL);
/* Enable DMA on any drive that has UltraDMA (mode 0/1/2) enabled */ /* Enable DMA on any drive that has UltraDMA (mode 0/1/2) enabled */
if (id->field_valid & 4) /* UltraDMA */ if (id->field_valid & 4) /* UltraDMA */
if ((id->dma_ultra & (id->dma_ultra >> 8) & 7)) if ((id->dma_ultra & (id->dma_ultra >> 8) & 7))
return hwif->dmaproc(ide_dma_on, drive); return hwif->udma(ide_dma_on, drive, NULL);
/* Enable DMA on any drive that has mode2 DMA (multi or single) enabled */ /* Enable DMA on any drive that has mode2 DMA (multi or single) enabled */
if (id->field_valid & 2) /* regular DMA */ if (id->field_valid & 2) /* regular DMA */
if ((id->dma_mword & 0x404) == 0x404 || (id->dma_1word & 0x404) == 0x404) if ((id->dma_mword & 0x404) == 0x404 || (id->dma_1word & 0x404) == 0x404)
return hwif->dmaproc(ide_dma_on, drive); return hwif->udma(ide_dma_on, drive, NULL);
/* Consult the list of known "good" drives */ /* Consult the list of known "good" drives */
if (ide_dmaproc(ide_dma_good_drive, drive)) if (ide_dmaproc(ide_dma_good_drive, drive, NULL))
return hwif->dmaproc(ide_dma_on, drive); return hwif->udma(ide_dma_on, drive, NULL);
} }
return hwif->dmaproc(ide_dma_off_quietly, drive); return hwif->udma(ide_dma_off_quietly, drive, NULL);
} }
/* /*
* 1 dma-ing, 2 error, 4 intr * 1 dma-ing, 2 error, 4 intr
*/ */
static int dma_timer_expiry(ide_drive_t *drive) static int dma_timer_expiry(struct ata_device *drive, struct request *__rq)
{ {
byte dma_stat = inb(drive->channel->dma_base+2); /* FIXME: What's that? */
u8 dma_stat = inb(drive->channel->dma_base+2);
#ifdef DEBUG #ifdef DEBUG
printk("%s: dma_timer_expiry: dma status == 0x%02x\n", drive->name, dma_stat); printk("%s: dma_timer_expiry: dma status == 0x%02x\n", drive->name, dma_stat);
...@@ -503,7 +501,7 @@ static int dma_timer_expiry(ide_drive_t *drive) ...@@ -503,7 +501,7 @@ static int dma_timer_expiry(ide_drive_t *drive)
#endif #endif
if (dma_stat & 2) { /* ERROR */ if (dma_stat & 2) { /* ERROR */
byte stat = GET_STAT(); u8 stat = GET_STAT();
return ide_error(drive, "dma_timer_expiry", stat); return ide_error(drive, "dma_timer_expiry", stat);
} }
if (dma_stat & 1) /* DMAing */ if (dma_stat & 1) /* DMAing */
...@@ -526,7 +524,7 @@ static void ide_toggle_bounce(ide_drive_t *drive, int on) ...@@ -526,7 +524,7 @@ static void ide_toggle_bounce(ide_drive_t *drive, int on)
} }
/* /*
* ide_dmaproc() initiates/aborts DMA read/write operations on a drive. * This initiates/aborts DMA read/write operations on a drive.
* *
* The caller is assumed to have selected the drive and programmed the drive's * The caller is assumed to have selected the drive and programmed the drive's
* sector address using CHS or LBA. All that remains is to prepare for DMA * sector address using CHS or LBA. All that remains is to prepare for DMA
...@@ -541,7 +539,7 @@ static void ide_toggle_bounce(ide_drive_t *drive, int on) ...@@ -541,7 +539,7 @@ static void ide_toggle_bounce(ide_drive_t *drive, int on)
* the caller should revert to PIO for the current request. * the caller should revert to PIO for the current request.
* May also be invoked from trm290.c * May also be invoked from trm290.c
*/ */
int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive) int ide_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
unsigned long dma_base = hwif->dma_base; unsigned long dma_base = hwif->dma_base;
...@@ -579,11 +577,9 @@ int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -579,11 +577,9 @@ int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
if (drive->type != ATA_DISK) if (drive->type != ATA_DISK)
return 0; return 0;
BUG_ON(HWGROUP(drive)->handler); ide_set_handler(drive, ide_dma_intr, WAIT_CMD, dma_timer_expiry); /* issue cmd to drive */
ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, dma_timer_expiry); /* issue cmd to drive */ if ((rq->flags & REQ_DRIVE_ACB) && (drive->addressing == 1)) {
if ((HWGROUP(drive)->rq->flags & REQ_DRIVE_ACB) && struct ata_taskfile *args = rq->special;
(drive->addressing == 1)) {
struct ata_taskfile *args = HWGROUP(drive)->rq->special;
OUT_BYTE(args->taskfile.command, IDE_COMMAND_REG); OUT_BYTE(args->taskfile.command, IDE_COMMAND_REG);
} else if (drive->addressing) { } else if (drive->addressing) {
...@@ -591,7 +587,7 @@ int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -591,7 +587,7 @@ int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
} else { } else {
OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG);
} }
return drive->channel->dmaproc(ide_dma_begin, drive); return drive->channel->udma(ide_dma_begin, drive, NULL);
case ide_dma_begin: case ide_dma_begin:
/* Note that this is done *after* the cmd has /* Note that this is done *after* the cmd has
* been issued to the drive, as per the BM-IDE spec. * been issued to the drive, as per the BM-IDE spec.
...@@ -685,7 +681,7 @@ void ide_setup_dma(struct ata_channel *hwif, unsigned long dma_base, unsigned in ...@@ -685,7 +681,7 @@ void ide_setup_dma(struct ata_channel *hwif, unsigned long dma_base, unsigned in
goto dma_alloc_failure; goto dma_alloc_failure;
} }
hwif->dmaproc = &ide_dmaproc; hwif->udma = ide_dmaproc;
if (hwif->chipset != ide_trm290) { if (hwif->chipset != ide_trm290) {
byte dma_stat = inb(dma_base+2); byte dma_stat = inb(dma_base+2);
......
This diff is collapsed.
...@@ -1384,8 +1384,7 @@ int pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive) ...@@ -1384,8 +1384,7 @@ int pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
drive->waiting_for_dma = 1; drive->waiting_for_dma = 1;
if (drive->type != ATA_DISK) if (drive->type != ATA_DISK)
return 0; return 0;
BUG_ON(HWGROUP(drive)->handler); ide_set_handler(drive, ide_dma_intr, WAIT_CMD, NULL);
ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL);
if ((HWGROUP(drive)->rq->flags & REQ_DRIVE_ACB) && if ((HWGROUP(drive)->rq->flags & REQ_DRIVE_ACB) &&
(drive->addressing == 1)) { (drive->addressing == 1)) {
struct ata_taskfile *args = HWGROUP(drive)->rq->special; struct ata_taskfile *args = HWGROUP(drive)->rq->special;
......
This diff is collapsed.
...@@ -260,7 +260,7 @@ int drive_is_ready(ide_drive_t *drive) ...@@ -260,7 +260,7 @@ int drive_is_ready(ide_drive_t *drive)
{ {
byte stat = 0; byte stat = 0;
if (drive->waiting_for_dma) if (drive->waiting_for_dma)
return drive->channel->dmaproc(ide_dma_test_irq, drive); return drive->channel->udma(ide_dma_test_irq, drive, NULL);
#if 0 #if 0
/* need to guarantee 400ns since last command was issued */ /* need to guarantee 400ns since last command was issued */
udelay(1); udelay(1);
...@@ -294,7 +294,6 @@ void ata_poll_drive_ready(ide_drive_t *drive) ...@@ -294,7 +294,6 @@ void ata_poll_drive_ready(ide_drive_t *drive)
{ {
int i; int i;
if (drive_is_ready(drive)) if (drive_is_ready(drive))
return; return;
...@@ -306,28 +305,22 @@ void ata_poll_drive_ready(ide_drive_t *drive) ...@@ -306,28 +305,22 @@ void ata_poll_drive_ready(ide_drive_t *drive)
} }
} }
static ide_startstop_t pre_task_mulout_intr(ide_drive_t *drive, struct request *rq) static ide_startstop_t pre_task_mulout_intr(struct ata_device *drive, struct request *rq)
{ {
struct ata_taskfile *args = rq->special; struct ata_taskfile *args = rq->special;
ide_startstop_t startstop; ide_startstop_t startstop;
/*
* assign private copy for multi-write
*/
memcpy(&HWGROUP(drive)->wrq, rq, sizeof(struct request));
if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ))
return startstop; return startstop;
ata_poll_drive_ready(drive); ata_poll_drive_ready(drive);
return args->handler(drive); return args->handler(drive, rq);
} }
static ide_startstop_t task_mulout_intr (ide_drive_t *drive) static ide_startstop_t task_mulout_intr(struct ata_device *drive, struct request *rq)
{ {
byte stat = GET_STAT(); u8 stat = GET_STAT();
struct request *rq = &HWGROUP(drive)->wrq;
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
int mcount = drive->mult_count; int mcount = drive->mult_count;
ide_startstop_t startstop; ide_startstop_t startstop;
...@@ -339,11 +332,11 @@ static ide_startstop_t task_mulout_intr (ide_drive_t *drive) ...@@ -339,11 +332,11 @@ static ide_startstop_t task_mulout_intr (ide_drive_t *drive)
if (!rq->nr_sectors) { if (!rq->nr_sectors) {
if (stat & (ERR_STAT|DRQ_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) {
startstop = ide_error(drive, "task_mulout_intr", stat); startstop = ide_error(drive, "task_mulout_intr", stat);
memcpy(rq, HWGROUP(drive)->rq, sizeof(struct request));
return startstop; return startstop;
} }
__ide_end_request(drive, 1, rq->hard_nr_sectors); __ide_end_request(drive, rq, 1, rq->hard_nr_sectors);
rq->bio = NULL; rq->bio = NULL;
return ide_stopped; return ide_stopped;
...@@ -352,7 +345,7 @@ static ide_startstop_t task_mulout_intr (ide_drive_t *drive) ...@@ -352,7 +345,7 @@ static ide_startstop_t task_mulout_intr (ide_drive_t *drive)
if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) { if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) {
if (stat & (ERR_STAT | DRQ_STAT)) { if (stat & (ERR_STAT | DRQ_STAT)) {
startstop = ide_error(drive, "task_mulout_intr", stat); startstop = ide_error(drive, "task_mulout_intr", stat);
memcpy(rq, HWGROUP(drive)->rq, sizeof(struct request));
return startstop; return startstop;
} }
...@@ -465,9 +458,9 @@ ide_startstop_t ata_taskfile(ide_drive_t *drive, ...@@ -465,9 +458,9 @@ ide_startstop_t ata_taskfile(ide_drive_t *drive,
} else { } else {
/* for dma commands we down set the handler */ /* for dma commands we down set the handler */
if (drive->using_dma && if (drive->using_dma &&
!(drive->channel->dmaproc(((args->taskfile.command == WIN_WRITEDMA) !(drive->channel->udma(((args->taskfile.command == WIN_WRITEDMA)
|| (args->taskfile.command == WIN_WRITEDMA_EXT)) || (args->taskfile.command == WIN_WRITEDMA_EXT))
? ide_dma_write : ide_dma_read, drive))); ? ide_dma_write : ide_dma_read, drive, rq)));
} }
return ide_started; return ide_started;
...@@ -476,11 +469,11 @@ ide_startstop_t ata_taskfile(ide_drive_t *drive, ...@@ -476,11 +469,11 @@ ide_startstop_t ata_taskfile(ide_drive_t *drive,
/* /*
* This is invoked on completion of a WIN_SETMULT cmd. * This is invoked on completion of a WIN_SETMULT cmd.
*/ */
ide_startstop_t set_multmode_intr(struct ata_device *drive) ide_startstop_t set_multmode_intr(struct ata_device *drive, struct request *__rq)
{ {
u8 stat; u8 stat;
if (OK_STAT(stat=GET_STAT(),READY_STAT,BAD_STAT)) { if (OK_STAT(stat = GET_STAT(),READY_STAT,BAD_STAT)) {
drive->mult_count = drive->mult_req; drive->mult_count = drive->mult_req;
} else { } else {
drive->mult_req = drive->mult_count = 0; drive->mult_req = drive->mult_count = 0;
...@@ -493,9 +486,9 @@ ide_startstop_t set_multmode_intr(struct ata_device *drive) ...@@ -493,9 +486,9 @@ ide_startstop_t set_multmode_intr(struct ata_device *drive)
/* /*
* This is invoked on completion of a WIN_SPECIFY cmd. * This is invoked on completion of a WIN_SPECIFY cmd.
*/ */
ide_startstop_t set_geometry_intr (ide_drive_t *drive) ide_startstop_t set_geometry_intr(struct ata_device *drive, struct request *__rq)
{ {
byte stat; u8 stat;
if (OK_STAT(stat=GET_STAT(),READY_STAT,BAD_STAT)) if (OK_STAT(stat=GET_STAT(),READY_STAT,BAD_STAT))
return ide_stopped; return ide_stopped;
...@@ -503,18 +496,18 @@ ide_startstop_t set_geometry_intr (ide_drive_t *drive) ...@@ -503,18 +496,18 @@ ide_startstop_t set_geometry_intr (ide_drive_t *drive)
if (stat & (ERR_STAT|DRQ_STAT)) if (stat & (ERR_STAT|DRQ_STAT))
return ide_error(drive, "set_geometry_intr", stat); return ide_error(drive, "set_geometry_intr", stat);
ide_set_handler(drive, &set_geometry_intr, WAIT_CMD, NULL); ide_set_handler(drive, set_geometry_intr, WAIT_CMD, NULL);
return ide_started; return ide_started;
} }
/* /*
* This is invoked on completion of a WIN_RESTORE (recalibrate) cmd. * This is invoked on completion of a WIN_RESTORE (recalibrate) cmd.
*/ */
ide_startstop_t recal_intr(ide_drive_t *drive) ide_startstop_t recal_intr(struct ata_device *drive, struct request *__rq)
{ {
byte stat = GET_STAT(); u8 stat;
if (!OK_STAT(stat,READY_STAT,BAD_STAT)) if (!OK_STAT(stat = GET_STAT(),READY_STAT,BAD_STAT))
return ide_error(drive, "recal_intr", stat); return ide_error(drive, "recal_intr", stat);
return ide_stopped; return ide_stopped;
} }
...@@ -522,14 +515,14 @@ ide_startstop_t recal_intr(ide_drive_t *drive) ...@@ -522,14 +515,14 @@ ide_startstop_t recal_intr(ide_drive_t *drive)
/* /*
* Handler for commands without a data phase * Handler for commands without a data phase
*/ */
ide_startstop_t task_no_data_intr (ide_drive_t *drive) ide_startstop_t task_no_data_intr(struct ata_device *drive, struct request *rq)
{ {
struct ata_taskfile *args = HWGROUP(drive)->rq->special; u8 stat;
byte stat = GET_STAT(); struct ata_taskfile *args = rq->special;
ide__sti(); /* local CPU only */ ide__sti(); /* local CPU only */
if (!OK_STAT(stat, READY_STAT, BAD_STAT)) if (!OK_STAT(stat = GET_STAT(), READY_STAT, BAD_STAT))
return ide_error(drive, "task_no_data_intr", stat); return ide_error(drive, "task_no_data_intr", stat);
/* calls ide_end_drive_cmd */ /* calls ide_end_drive_cmd */
if (args) if (args)
...@@ -541,10 +534,9 @@ ide_startstop_t task_no_data_intr (ide_drive_t *drive) ...@@ -541,10 +534,9 @@ ide_startstop_t task_no_data_intr (ide_drive_t *drive)
/* /*
* Handler for command with PIO data-in phase * Handler for command with PIO data-in phase
*/ */
static ide_startstop_t task_in_intr (ide_drive_t *drive) static ide_startstop_t task_in_intr (struct ata_device *drive, struct request *rq)
{ {
byte stat = GET_STAT(); u8 stat = GET_STAT();
struct request *rq = HWGROUP(drive)->rq;
char *pBuf = NULL; char *pBuf = NULL;
unsigned long flags; unsigned long flags;
...@@ -554,7 +546,7 @@ static ide_startstop_t task_in_intr (ide_drive_t *drive) ...@@ -554,7 +546,7 @@ static ide_startstop_t task_in_intr (ide_drive_t *drive)
} }
if (!(stat & BUSY_STAT)) { if (!(stat & BUSY_STAT)) {
DTF("task_in_intr to Soon wait for next interrupt\n"); DTF("task_in_intr to Soon wait for next interrupt\n");
ide_set_handler(drive, &task_in_intr, WAIT_CMD, NULL); ide_set_handler(drive, task_in_intr, WAIT_CMD, NULL);
return ide_started; return ide_started;
} }
} }
...@@ -572,18 +564,18 @@ static ide_startstop_t task_in_intr (ide_drive_t *drive) ...@@ -572,18 +564,18 @@ static ide_startstop_t task_in_intr (ide_drive_t *drive)
*/ */
if (--rq->current_nr_sectors <= 0) { if (--rq->current_nr_sectors <= 0) {
DTF("Request Ended stat: %02x\n", GET_STAT()); DTF("Request Ended stat: %02x\n", GET_STAT());
if (!ide_end_request(drive, 1)) if (!ide_end_request(drive, rq, 1))
return ide_stopped; return ide_stopped;
} }
/* /*
* still data left to transfer * still data left to transfer
*/ */
ide_set_handler(drive, &task_in_intr, WAIT_CMD, NULL); ide_set_handler(drive, task_in_intr, WAIT_CMD, NULL);
return ide_started; return ide_started;
} }
static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq) static ide_startstop_t pre_task_out_intr(struct ata_device *drive, struct request *rq)
{ {
struct ata_taskfile *args = rq->special; struct ata_taskfile *args = rq->special;
ide_startstop_t startstop; ide_startstop_t startstop;
...@@ -604,7 +596,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq) ...@@ -604,7 +596,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq)
ide_unmap_rq(rq, buf, &flags); ide_unmap_rq(rq, buf, &flags);
} else { } else {
ata_poll_drive_ready(drive); ata_poll_drive_ready(drive);
return args->handler(drive); return args->handler(drive, rq);
} }
return ide_started; return ide_started;
} }
...@@ -612,10 +604,9 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq) ...@@ -612,10 +604,9 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq)
/* /*
* Handler for command with PIO data-out phase * Handler for command with PIO data-out phase
*/ */
static ide_startstop_t task_out_intr(ide_drive_t *drive) static ide_startstop_t task_out_intr(struct ata_device *drive, struct request *rq)
{ {
byte stat = GET_STAT(); u8 stat = GET_STAT();
struct request *rq = HWGROUP(drive)->rq;
char *pBuf = NULL; char *pBuf = NULL;
unsigned long flags; unsigned long flags;
...@@ -623,11 +614,10 @@ static ide_startstop_t task_out_intr(ide_drive_t *drive) ...@@ -623,11 +614,10 @@ static ide_startstop_t task_out_intr(ide_drive_t *drive)
return ide_error(drive, "task_out_intr", stat); return ide_error(drive, "task_out_intr", stat);
if (!rq->current_nr_sectors) if (!rq->current_nr_sectors)
if (!ide_end_request(drive, 1)) if (!ide_end_request(drive, rq, 1))
return ide_stopped; return ide_stopped;
if ((rq->current_nr_sectors==1) ^ (stat & DRQ_STAT)) { if ((rq->current_nr_sectors==1) ^ (stat & DRQ_STAT)) {
rq = HWGROUP(drive)->rq;
pBuf = ide_map_rq(rq, &flags); pBuf = ide_map_rq(rq, &flags);
DTF("write: %p, rq->current_nr_sectors: %d\n", pBuf, (int) rq->current_nr_sectors); DTF("write: %p, rq->current_nr_sectors: %d\n", pBuf, (int) rq->current_nr_sectors);
...@@ -644,15 +634,14 @@ static ide_startstop_t task_out_intr(ide_drive_t *drive) ...@@ -644,15 +634,14 @@ static ide_startstop_t task_out_intr(ide_drive_t *drive)
/* /*
* Handler for command with Read Multiple * Handler for command with Read Multiple
*/ */
static ide_startstop_t task_mulin_intr(ide_drive_t *drive) static ide_startstop_t task_mulin_intr(struct ata_device *drive, struct request *rq)
{ {
unsigned int msect, nsect; u8 stat;
byte stat = GET_STAT();
struct request *rq = HWGROUP(drive)->rq;
char *pBuf = NULL; char *pBuf = NULL;
unsigned int msect, nsect;
unsigned long flags; unsigned long flags;
if (!OK_STAT(stat,DATA_READY,BAD_R_STAT)) { if (!OK_STAT(stat = GET_STAT(),DATA_READY,BAD_R_STAT)) {
if (stat & (ERR_STAT|DRQ_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) {
return ide_error(drive, "task_mulin_intr", stat); return ide_error(drive, "task_mulin_intr", stat);
} }
...@@ -679,7 +668,7 @@ static ide_startstop_t task_mulin_intr(ide_drive_t *drive) ...@@ -679,7 +668,7 @@ static ide_startstop_t task_mulin_intr(ide_drive_t *drive)
rq->current_nr_sectors -= nsect; rq->current_nr_sectors -= nsect;
msect -= nsect; msect -= nsect;
if (!rq->current_nr_sectors) { if (!rq->current_nr_sectors) {
if (!ide_end_request(drive, 1)) if (!ide_end_request(drive, rq, 1))
return ide_stopped; return ide_stopped;
} }
} while (msect); } while (msect);
......
This diff is collapsed.
...@@ -82,7 +82,7 @@ static void ns87415_selectproc (ide_drive_t *drive) ...@@ -82,7 +82,7 @@ static void ns87415_selectproc (ide_drive_t *drive)
} }
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
static int ns87415_dmaproc(ide_dma_action_t func, ide_drive_t *drive) static int ns87415_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
byte dma_stat; byte dma_stat;
...@@ -98,16 +98,16 @@ static int ns87415_dmaproc(ide_dma_action_t func, ide_drive_t *drive) ...@@ -98,16 +98,16 @@ static int ns87415_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
case ide_dma_write: case ide_dma_write:
case ide_dma_read: case ide_dma_read:
ns87415_prepare_drive(drive, 1); /* select DMA xfer */ ns87415_prepare_drive(drive, 1); /* select DMA xfer */
if (!ide_dmaproc(func, drive)) /* use standard DMA stuff */ if (!ide_dmaproc(func, drive, rq)) /* use standard DMA stuff */
return 0; return 0;
ns87415_prepare_drive(drive, 0); /* DMA failed: select PIO xfer */ ns87415_prepare_drive(drive, 0); /* DMA failed: select PIO xfer */
return 1; return 1;
case ide_dma_check: case ide_dma_check:
if (drive->type != ATA_DISK) if (drive->type != ATA_DISK)
return ide_dmaproc(ide_dma_off_quietly, drive); return ide_dmaproc(ide_dma_off_quietly, drive, rq);
/* Fallthrough... */ /* Fallthrough... */
default: default:
return ide_dmaproc(func, drive); /* use standard DMA stuff */ return ide_dmaproc(func, drive, rq); /* use standard DMA stuff */
} }
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -206,7 +206,7 @@ void __init ide_init_ns87415(struct ata_channel *hwif) ...@@ -206,7 +206,7 @@ void __init ide_init_ns87415(struct ata_channel *hwif)
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
if (hwif->dma_base) if (hwif->dma_base)
hwif->dmaproc = &ns87415_dmaproc; hwif->udma = ns87415_dmaproc;
#endif #endif
hwif->selectproc = &ns87415_selectproc; hwif->selectproc = &ns87415_selectproc;
......
...@@ -929,7 +929,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -929,7 +929,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && hwif->autodma) { if (id && (id->capability & 1) && hwif->autodma) {
/* Consult the list of known "bad" drives */ /* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive)) { if (ide_dmaproc(ide_dma_bad_drive, drive, NULL)) {
dma_func = ide_dma_off; dma_func = ide_dma_off;
goto fast_ata_pio; goto fast_ata_pio;
} }
...@@ -951,7 +951,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -951,7 +951,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (dma_func != ide_dma_on) if (dma_func != ide_dma_on)
goto no_dma_set; goto no_dma_set;
} }
} else if (ide_dmaproc(ide_dma_good_drive, drive)) { } else if (ide_dmaproc(ide_dma_good_drive, drive, NULL)) {
if (id->eide_dma_time > 150) { if (id->eide_dma_time > 150) {
goto no_dma_set; goto no_dma_set;
} }
...@@ -969,7 +969,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -969,7 +969,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
(void) config_chipset_for_pio(drive, 5); (void) config_chipset_for_pio(drive, 5);
} }
return drive->channel->dmaproc(dma_func, drive); return drive->channel->udma(dma_func, drive, NULL);
} }
int pdc202xx_quirkproc (ide_drive_t *drive) int pdc202xx_quirkproc (ide_drive_t *drive)
...@@ -980,7 +980,7 @@ int pdc202xx_quirkproc (ide_drive_t *drive) ...@@ -980,7 +980,7 @@ int pdc202xx_quirkproc (ide_drive_t *drive)
/* /*
* pdc202xx_dmaproc() initiates/aborts (U)DMA read/write operations on a drive. * pdc202xx_dmaproc() initiates/aborts (U)DMA read/write operations on a drive.
*/ */
int pdc202xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive) int pdc202xx_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
byte dma_stat = 0; byte dma_stat = 0;
byte sc1d = 0; byte sc1d = 0;
...@@ -1060,7 +1060,7 @@ int pdc202xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -1060,7 +1060,7 @@ int pdc202xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
default: default:
break; break;
} }
return ide_dmaproc(func, drive); /* use standard DMA stuff */ return ide_dmaproc(func, drive, rq); /* use standard DMA stuff */
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -1268,7 +1268,7 @@ void __init ide_init_pdc202xx(struct ata_channel *hwif) ...@@ -1268,7 +1268,7 @@ void __init ide_init_pdc202xx(struct ata_channel *hwif)
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
if (hwif->dma_base) { if (hwif->dma_base) {
hwif->dmaproc = &pdc202xx_dmaproc; hwif->udma = pdc202xx_dmaproc;
hwif->highmem = 1; hwif->highmem = 1;
if (!noautodma) if (!noautodma)
hwif->autodma = 1; hwif->autodma = 1;
......
...@@ -306,13 +306,12 @@ void __init ide_probe_for_pdc4030(void) ...@@ -306,13 +306,12 @@ void __init ide_probe_for_pdc4030(void)
/* /*
* promise_read_intr() is the handler for disk read/multread interrupts * promise_read_intr() is the handler for disk read/multread interrupts
*/ */
static ide_startstop_t promise_read_intr (ide_drive_t *drive) static ide_startstop_t promise_read_intr(struct ata_device *drive, struct request *rq)
{ {
byte stat; byte stat;
int total_remaining; int total_remaining;
unsigned int sectors_left, sectors_avail, nsect; unsigned int sectors_left, sectors_avail, nsect;
unsigned long flags; unsigned long flags;
struct request *rq;
char *to; char *to;
if (!OK_STAT(stat=GET_STAT(),DATA_READY,BAD_R_STAT)) { if (!OK_STAT(stat=GET_STAT(),DATA_READY,BAD_R_STAT)) {
...@@ -324,13 +323,11 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive) ...@@ -324,13 +323,11 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive)
sectors_left = IN_BYTE(IDE_NSECTOR_REG); sectors_left = IN_BYTE(IDE_NSECTOR_REG);
IN_BYTE(IDE_SECTOR_REG); IN_BYTE(IDE_SECTOR_REG);
} while (IN_BYTE(IDE_NSECTOR_REG) != sectors_left); } while (IN_BYTE(IDE_NSECTOR_REG) != sectors_left);
rq = HWGROUP(drive)->rq;
sectors_avail = rq->nr_sectors - sectors_left; sectors_avail = rq->nr_sectors - sectors_left;
if (!sectors_avail) if (!sectors_avail)
goto read_again; goto read_again;
read_next: read_next:
rq = HWGROUP(drive)->rq;
nsect = rq->current_nr_sectors; nsect = rq->current_nr_sectors;
if (nsect > sectors_avail) if (nsect > sectors_avail)
nsect = sectors_avail; nsect = sectors_avail;
...@@ -348,7 +345,7 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive) ...@@ -348,7 +345,7 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive)
rq->nr_sectors -= nsect; rq->nr_sectors -= nsect;
total_remaining = rq->nr_sectors; total_remaining = rq->nr_sectors;
if ((rq->current_nr_sectors -= nsect) <= 0) { if ((rq->current_nr_sectors -= nsect) <= 0) {
ide_end_request(drive, 1); ide_end_request(drive, rq, 1);
} }
/* /*
* Now the data has been read in, do the following: * Now the data has been read in, do the following:
...@@ -368,7 +365,7 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive) ...@@ -368,7 +365,7 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive)
if (stat & DRQ_STAT) if (stat & DRQ_STAT)
goto read_again; goto read_again;
if (stat & BUSY_STAT) { if (stat & BUSY_STAT) {
ide_set_handler (drive, &promise_read_intr, WAIT_CMD, NULL); ide_set_handler(drive, promise_read_intr, WAIT_CMD, NULL);
#ifdef DEBUG_READ #ifdef DEBUG_READ
printk(KERN_DEBUG "%s: promise_read: waiting for" printk(KERN_DEBUG "%s: promise_read: waiting for"
"interrupt\n", drive->name); "interrupt\n", drive->name);
...@@ -383,22 +380,19 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive) ...@@ -383,22 +380,19 @@ static ide_startstop_t promise_read_intr (ide_drive_t *drive)
} }
/* /*
* promise_complete_pollfunc()
* This is the polling function for waiting (nicely!) until drive stops * This is the polling function for waiting (nicely!) until drive stops
* being busy. It is invoked at the end of a write, after the previous poll * being busy. It is invoked at the end of a write, after the previous poll
* has finished. * has finished.
* *
* Once not busy, the end request is called. * Once not busy, the end request is called.
*/ */
static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive) static ide_startstop_t promise_complete_pollfunc(struct ata_device *drive, struct request *rq)
{ {
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
struct request *rq = hwgroup->rq;
if (GET_STAT() & BUSY_STAT) { if (GET_STAT() & BUSY_STAT) {
if (time_before(jiffies, hwgroup->poll_timeout)) { if (time_before(jiffies, hwgroup->poll_timeout)) {
BUG_ON(HWGROUP(drive)->handler); ide_set_handler(drive, promise_complete_pollfunc, HZ/100, NULL);
ide_set_handler(drive, &promise_complete_pollfunc, HZ/100, NULL);
return ide_started; /* continue polling... */ return ide_started; /* continue polling... */
} }
hwgroup->poll_timeout = 0; hwgroup->poll_timeout = 0;
...@@ -411,7 +405,7 @@ static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive) ...@@ -411,7 +405,7 @@ static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive)
#ifdef DEBUG_WRITE #ifdef DEBUG_WRITE
printk(KERN_DEBUG "%s: Write complete - end_request\n", drive->name); printk(KERN_DEBUG "%s: Write complete - end_request\n", drive->name);
#endif #endif
__ide_end_request(drive, 1, rq->nr_sectors); __ide_end_request(drive, rq, 1, rq->nr_sectors);
return ide_stopped; return ide_stopped;
} }
...@@ -427,11 +421,8 @@ static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive) ...@@ -427,11 +421,8 @@ static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive)
* full "mcount" number of sectors, so we must make sure we update the * full "mcount" number of sectors, so we must make sure we update the
* state _before_ we output the final part of the data! * state _before_ we output the final part of the data!
*/ */
int promise_multwrite (ide_drive_t *drive, unsigned int mcount) int promise_multwrite(struct ata_device *drive, struct request *rq, unsigned int mcount)
{ {
ide_hwgroup_t *hwgroup= HWGROUP(drive);
struct request *rq = &hwgroup->wrq;
do { do {
char *buffer; char *buffer;
int nsect = rq->current_nr_sectors; int nsect = rq->current_nr_sectors;
...@@ -474,14 +465,13 @@ int promise_multwrite (ide_drive_t *drive, unsigned int mcount) ...@@ -474,14 +465,13 @@ int promise_multwrite (ide_drive_t *drive, unsigned int mcount)
/* /*
* promise_write_pollfunc() is the handler for disk write completion polling. * promise_write_pollfunc() is the handler for disk write completion polling.
*/ */
static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive) static ide_startstop_t promise_write_pollfunc(struct ata_device *drive, struct request *rq)
{ {
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
if (IN_BYTE(IDE_NSECTOR_REG) != 0) { if (IN_BYTE(IDE_NSECTOR_REG) != 0) {
if (time_before(jiffies, hwgroup->poll_timeout)) { if (time_before(jiffies, hwgroup->poll_timeout)) {
BUG_ON(HWGROUP(drive)->handler); ide_set_handler(drive, promise_write_pollfunc, HZ/100, NULL);
ide_set_handler (drive, &promise_write_pollfunc, HZ/100, NULL);
return ide_started; /* continue polling... */ return ide_started; /* continue polling... */
} }
hwgroup->poll_timeout = 0; hwgroup->poll_timeout = 0;
...@@ -492,10 +482,9 @@ static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive) ...@@ -492,10 +482,9 @@ static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive)
/* /*
* Now write out last 4 sectors and poll for not BUSY * Now write out last 4 sectors and poll for not BUSY
*/ */
promise_multwrite(drive, 4); promise_multwrite(drive, rq, 4);
hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
BUG_ON(HWGROUP(drive)->handler); ide_set_handler(drive, promise_complete_pollfunc, HZ/100, NULL);
ide_set_handler(drive, &promise_complete_pollfunc, HZ/100, NULL);
#ifdef DEBUG_WRITE #ifdef DEBUG_WRITE
printk(KERN_DEBUG "%s: Done last 4 sectors - status = %02x\n", printk(KERN_DEBUG "%s: Done last 4 sectors - status = %02x\n",
drive->name, GET_STAT()); drive->name, GET_STAT());
...@@ -510,10 +499,9 @@ static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive) ...@@ -510,10 +499,9 @@ static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive)
* before the final 4 sectors are transferred. There is no interrupt generated * before the final 4 sectors are transferred. There is no interrupt generated
* on writes (at least on the DC4030VL-2), we just have to poll for NOT BUSY. * on writes (at least on the DC4030VL-2), we just have to poll for NOT BUSY.
*/ */
static ide_startstop_t promise_write (ide_drive_t *drive) static ide_startstop_t promise_write(struct ata_device *drive, struct request *rq)
{ {
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
struct request *rq = &hwgroup->wrq;
#ifdef DEBUG_WRITE #ifdef DEBUG_WRITE
printk(KERN_DEBUG "%s: promise_write: sectors(%ld-%ld), " printk(KERN_DEBUG "%s: promise_write: sectors(%ld-%ld), "
...@@ -526,22 +514,20 @@ static ide_startstop_t promise_write (ide_drive_t *drive) ...@@ -526,22 +514,20 @@ static ide_startstop_t promise_write (ide_drive_t *drive)
* the polling strategy as defined above. * the polling strategy as defined above.
*/ */
if (rq->nr_sectors > 4) { if (rq->nr_sectors > 4) {
if (promise_multwrite(drive, rq->nr_sectors - 4)) if (promise_multwrite(drive, rq, rq->nr_sectors - 4))
return ide_stopped; return ide_stopped;
hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
BUG_ON(HWGROUP(drive)->handler); ide_set_handler(drive, promise_write_pollfunc, HZ/100, NULL);
ide_set_handler (drive, &promise_write_pollfunc, HZ/100, NULL);
return ide_started; return ide_started;
} else { } else {
/* /*
* There are 4 or fewer sectors to transfer, do them all in one go * There are 4 or fewer sectors to transfer, do them all in one go
* and wait for NOT BUSY. * and wait for NOT BUSY.
*/ */
if (promise_multwrite(drive, rq->nr_sectors)) if (promise_multwrite(drive, rq, rq->nr_sectors))
return ide_stopped; return ide_stopped;
hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
BUG_ON(HWGROUP(drive)->handler); ide_set_handler(drive, promise_complete_pollfunc, HZ/100, NULL);
ide_set_handler(drive, &promise_complete_pollfunc, HZ/100, NULL);
#ifdef DEBUG_WRITE #ifdef DEBUG_WRITE
printk(KERN_DEBUG "%s: promise_write: <= 4 sectors, " printk(KERN_DEBUG "%s: promise_write: <= 4 sectors, "
"status = %02x\n", drive->name, GET_STAT()); "status = %02x\n", drive->name, GET_STAT());
...@@ -555,9 +541,8 @@ static ide_startstop_t promise_write (ide_drive_t *drive) ...@@ -555,9 +541,8 @@ static ide_startstop_t promise_write (ide_drive_t *drive)
* already set up. It issues a READ or WRITE command to the Promise * already set up. It issues a READ or WRITE command to the Promise
* controller, assuming LBA has been used to set up the block number. * controller, assuming LBA has been used to set up the block number.
*/ */
ide_startstop_t do_pdc4030_io(ide_drive_t *drive, struct ata_taskfile *task) ide_startstop_t do_pdc4030_io(struct ata_device *drive, struct ata_taskfile *task, struct request *rq)
{ {
struct request *rq = HWGROUP(drive)->rq;
struct hd_drive_task_hdr *taskfile = &task->taskfile; struct hd_drive_task_hdr *taskfile = &task->taskfile;
unsigned long timeout; unsigned long timeout;
byte stat; byte stat;
...@@ -565,7 +550,7 @@ ide_startstop_t do_pdc4030_io(ide_drive_t *drive, struct ata_taskfile *task) ...@@ -565,7 +550,7 @@ ide_startstop_t do_pdc4030_io(ide_drive_t *drive, struct ata_taskfile *task)
/* Check that it's a regular command. If not, bomb out early. */ /* Check that it's a regular command. If not, bomb out early. */
if (!(rq->flags & REQ_CMD)) { if (!(rq->flags & REQ_CMD)) {
blk_dump_rq_flags(rq, "pdc4030 bad flags"); blk_dump_rq_flags(rq, "pdc4030 bad flags");
ide_end_request(drive, 0); ide_end_request(drive, rq, 0);
return ide_stopped; return ide_stopped;
} }
...@@ -600,15 +585,14 @@ ide_startstop_t do_pdc4030_io(ide_drive_t *drive, struct ata_taskfile *task) ...@@ -600,15 +585,14 @@ ide_startstop_t do_pdc4030_io(ide_drive_t *drive, struct ata_taskfile *task)
stat=GET_STAT(); stat=GET_STAT();
if (stat & DRQ_STAT) { if (stat & DRQ_STAT) {
udelay(1); udelay(1);
return promise_read_intr(drive); return promise_read_intr(drive, rq);
} }
if (IN_BYTE(IDE_SELECT_REG) & 0x01) { if (IN_BYTE(IDE_SELECT_REG) & 0x01) {
#ifdef DEBUG_READ #ifdef DEBUG_READ
printk(KERN_DEBUG "%s: read: waiting for " printk(KERN_DEBUG "%s: read: waiting for "
"interrupt\n", drive->name); "interrupt\n", drive->name);
#endif #endif
BUG_ON(HWGROUP(drive)->handler); ide_set_handler(drive, promise_read_intr, WAIT_CMD, NULL);
ide_set_handler(drive, &promise_read_intr, WAIT_CMD, NULL);
return ide_started; return ide_started;
} }
udelay(1); udelay(1);
...@@ -634,39 +618,34 @@ ide_startstop_t do_pdc4030_io(ide_drive_t *drive, struct ata_taskfile *task) ...@@ -634,39 +618,34 @@ ide_startstop_t do_pdc4030_io(ide_drive_t *drive, struct ata_taskfile *task)
} }
if (!drive->channel->unmask) if (!drive->channel->unmask)
__cli(); /* local CPU only */ __cli(); /* local CPU only */
HWGROUP(drive)->wrq = *rq; /* scratchpad */ return promise_write(drive, rq);
return promise_write(drive);
} }
default: default:
printk(KERN_ERR "pdc4030: command not READ or WRITE! Huh?\n"); printk(KERN_ERR "pdc4030: command not READ or WRITE! Huh?\n");
ide_end_request(drive, 0); ide_end_request(drive, rq, 0);
return ide_stopped; return ide_stopped;
} }
} }
ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) ide_startstop_t promise_rw_disk(struct ata_device *drive, struct request *rq, sector_t block)
{ {
struct hd_drive_task_hdr taskfile;
struct ata_taskfile args; struct ata_taskfile args;
memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); memset(&args, 0, sizeof(args));
/* The four drives on the two logical (one physical) interfaces /* The four drives on the two logical (one physical) interfaces
are distinguished by writing the drive number (0-3) to the are distinguished by writing the drive number (0-3) to the
Feature register. Feature register.
FIXME: Is promise_selectproc now redundant?? FIXME: Is promise_selectproc now redundant??
*/ */
taskfile.feature = (drive->channel->unit << 1) + drive->select.b.unit; args.taskfile.feature = (drive->channel->unit << 1) + drive->select.b.unit;
taskfile.sector_count = rq->nr_sectors; args.taskfile.sector_count = rq->nr_sectors;
taskfile.sector_number = block; args.taskfile.sector_number = block;
taskfile.low_cylinder = (block>>=8); args.taskfile.low_cylinder = (block>>=8);
taskfile.high_cylinder = (block>>=8); args.taskfile.high_cylinder = (block>>=8);
taskfile.device_head = ((block>>8)&0x0f)|drive->select.all; args.taskfile.device_head = ((block>>8)&0x0f)|drive->select.all;
taskfile.command = (rq_data_dir(rq)==READ)?PROMISE_READ:PROMISE_WRITE; args.taskfile.command = (rq_data_dir(rq)==READ)?PROMISE_READ:PROMISE_WRITE;
args.taskfile = taskfile;
memset(&args.hobfile, 0, sizeof(struct hd_drive_hob_hdr));
ide_cmd_type_parser(&args); ide_cmd_type_parser(&args);
/* We don't use the generic inerrupt handlers here? */ /* We don't use the generic inerrupt handlers here? */
...@@ -674,6 +653,6 @@ ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigne ...@@ -674,6 +653,6 @@ ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigne
args.handler = NULL; args.handler = NULL;
rq->special = &args; rq->special = &args;
return do_pdc4030_io(drive, &args); return do_pdc4030_io(drive, &args, rq);
} }
...@@ -376,7 +376,7 @@ static void piix_tune_drive(ide_drive_t *drive, unsigned char pio) ...@@ -376,7 +376,7 @@ static void piix_tune_drive(ide_drive_t *drive, unsigned char pio)
* else to the default ide_dmaproc(). * else to the default ide_dmaproc().
*/ */
int piix_dmaproc(ide_dma_action_t func, ide_drive_t *drive) int piix_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
if (func == ide_dma_check) { if (func == ide_dma_check) {
...@@ -397,7 +397,7 @@ int piix_dmaproc(ide_dma_action_t func, ide_drive_t *drive) ...@@ -397,7 +397,7 @@ int piix_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
} }
return ide_dmaproc(func, drive); return ide_dmaproc(func, drive, rq);
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -555,7 +555,7 @@ void __init ide_init_piix(struct ata_channel *hwif) ...@@ -555,7 +555,7 @@ void __init ide_init_piix(struct ata_channel *hwif)
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
if (hwif->dma_base) { if (hwif->dma_base) {
hwif->highmem = 1; hwif->highmem = 1;
hwif->dmaproc = &piix_dmaproc; hwif->udma = piix_dmaproc;
#ifdef CONFIG_IDEDMA_AUTO #ifdef CONFIG_IDEDMA_AUTO
if (!noautodma) if (!noautodma)
hwif->autodma = 1; hwif->autodma = 1;
......
...@@ -438,7 +438,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -438,7 +438,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->channel->autodma) { if (id && (id->capability & 1) && drive->channel->autodma) {
/* Consult the list of known "bad" drives */ /* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive)) { if (ide_dmaproc(ide_dma_bad_drive, drive, NULL)) {
dma_func = ide_dma_off; dma_func = ide_dma_off;
goto fast_ata_pio; goto fast_ata_pio;
} }
...@@ -460,7 +460,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -460,7 +460,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (dma_func != ide_dma_on) if (dma_func != ide_dma_on)
goto no_dma_set; goto no_dma_set;
} }
} else if (ide_dmaproc(ide_dma_good_drive, drive)) { } else if (ide_dmaproc(ide_dma_good_drive, drive, NULL)) {
if (id->eide_dma_time > 150) { if (id->eide_dma_time > 150) {
goto no_dma_set; goto no_dma_set;
} }
...@@ -477,10 +477,10 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -477,10 +477,10 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
no_dma_set: no_dma_set:
config_chipset_for_pio(drive); config_chipset_for_pio(drive);
} }
return drive->channel->dmaproc(dma_func, drive); return drive->channel->udma(dma_func, drive, NULL);
} }
static int svwks_dmaproc(ide_dma_action_t func, ide_drive_t *drive) static int svwks_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
switch (func) { switch (func) {
case ide_dma_check: case ide_dma_check:
...@@ -523,7 +523,7 @@ static int svwks_dmaproc(ide_dma_action_t func, ide_drive_t *drive) ...@@ -523,7 +523,7 @@ static int svwks_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
break; break;
} }
/* Other cases are done by generic IDE-DMA code. */ /* Other cases are done by generic IDE-DMA code. */
return ide_dmaproc(func, drive); return ide_dmaproc(func, drive, rq);
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -645,7 +645,7 @@ void __init ide_init_svwks(struct ata_channel *hwif) ...@@ -645,7 +645,7 @@ void __init ide_init_svwks(struct ata_channel *hwif)
if (!noautodma) if (!noautodma)
hwif->autodma = 1; hwif->autodma = 1;
#endif #endif
hwif->dmaproc = &svwks_dmaproc; hwif->udma = svwks_dmaproc;
hwif->highmem = 1; hwif->highmem = 1;
} else { } else {
hwif->autodma = 0; hwif->autodma = 0;
......
...@@ -685,7 +685,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -685,7 +685,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->channel->autodma) { if (id && (id->capability & 1) && drive->channel->autodma) {
/* Consult the list of known "bad" drives */ /* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive)) { if (ide_dmaproc(ide_dma_bad_drive, drive, NULL)) {
dma_func = ide_dma_off; dma_func = ide_dma_off;
goto fast_ata_pio; goto fast_ata_pio;
} }
...@@ -707,7 +707,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -707,7 +707,7 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
if (dma_func != ide_dma_on) if (dma_func != ide_dma_on)
goto no_dma_set; goto no_dma_set;
} }
} else if ((ide_dmaproc(ide_dma_good_drive, drive)) && } else if ((ide_dmaproc(ide_dma_good_drive, drive, NULL)) &&
(id->eide_dma_time > 150)) { (id->eide_dma_time > 150)) {
/* Consult the list of known "good" drives */ /* Consult the list of known "good" drives */
dma_func = config_chipset_for_dma(drive, 0); dma_func = config_chipset_for_dma(drive, 0);
...@@ -723,11 +723,11 @@ static int config_drive_xfer_rate (ide_drive_t *drive) ...@@ -723,11 +723,11 @@ static int config_drive_xfer_rate (ide_drive_t *drive)
(void) config_chipset_for_pio(drive, 5); (void) config_chipset_for_pio(drive, 5);
} }
return drive->channel->dmaproc(dma_func, drive); return drive->channel->udma(dma_func, drive, NULL);
} }
/* initiates/aborts (U)DMA read/write operations on a drive. */ /* initiates/aborts (U)DMA read/write operations on a drive. */
int sis5513_dmaproc (ide_dma_action_t func, ide_drive_t *drive) int sis5513_dmaproc (ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
switch (func) { switch (func) {
case ide_dma_check: case ide_dma_check:
...@@ -737,7 +737,7 @@ int sis5513_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -737,7 +737,7 @@ int sis5513_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
default: default:
break; break;
} }
return ide_dmaproc(func, drive); /* use standard DMA stuff */ return ide_dmaproc(func, drive, rq); /* use standard DMA stuff */
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -852,7 +852,7 @@ void __init ide_init_sis5513(struct ata_channel *hwif) ...@@ -852,7 +852,7 @@ void __init ide_init_sis5513(struct ata_channel *hwif)
if (chipset_family > ATA_16) { if (chipset_family > ATA_16) {
hwif->autodma = noautodma ? 0 : 1; hwif->autodma = noautodma ? 0 : 1;
hwif->highmem = 1; hwif->highmem = 1;
hwif->dmaproc = &sis5513_dmaproc; hwif->udma = sis5513_dmaproc;
} else { } else {
#endif #endif
hwif->autodma = 0; hwif->autodma = 0;
......
...@@ -194,7 +194,6 @@ static int trm290_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -194,7 +194,6 @@ static int trm290_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
outw((count * 2) - 1, hwif->dma_base+2); /* start DMA */ outw((count * 2) - 1, hwif->dma_base+2); /* start DMA */
if (drive->type != ATA_DISK) if (drive->type != ATA_DISK)
return 0; return 0;
BUG_ON(HWGROUP(drive)->handler);
ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL);
OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG);
return 0; return 0;
......
...@@ -363,7 +363,7 @@ static void via82cxxx_tune_drive(ide_drive_t *drive, unsigned char pio) ...@@ -363,7 +363,7 @@ static void via82cxxx_tune_drive(ide_drive_t *drive, unsigned char pio)
* else to the default ide_dmaproc(). * else to the default ide_dmaproc().
*/ */
int via82cxxx_dmaproc(ide_dma_action_t func, ide_drive_t *drive) int via82cxxx_dmaproc(ide_dma_action_t func, struct ata_device *drive, struct request *rq)
{ {
if (func == ide_dma_check) { if (func == ide_dma_check) {
...@@ -383,7 +383,7 @@ int via82cxxx_dmaproc(ide_dma_action_t func, ide_drive_t *drive) ...@@ -383,7 +383,7 @@ int via82cxxx_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
? ide_dma_on : ide_dma_off_quietly; ? ide_dma_on : ide_dma_off_quietly;
} }
return ide_dmaproc(func, drive); return ide_dmaproc(func, drive, rq);
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif /* CONFIG_BLK_DEV_IDEDMA */
...@@ -546,7 +546,7 @@ void __init ide_init_via82cxxx(struct ata_channel *hwif) ...@@ -546,7 +546,7 @@ void __init ide_init_via82cxxx(struct ata_channel *hwif)
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
if (hwif->dma_base) { if (hwif->dma_base) {
hwif->highmem = 1; hwif->highmem = 1;
hwif->dmaproc = &via82cxxx_dmaproc; hwif->udma = &via82cxxx_dmaproc;
#ifdef CONFIG_IDEDMA_AUTO #ifdef CONFIG_IDEDMA_AUTO
if (!noautodma) if (!noautodma)
hwif->autodma = 1; hwif->autodma = 1;
......
...@@ -59,7 +59,6 @@ typedef struct idescsi_pc_s { ...@@ -59,7 +59,6 @@ typedef struct idescsi_pc_s {
int request_transfer; /* Bytes to transfer */ int request_transfer; /* Bytes to transfer */
int actually_transferred; /* Bytes actually transferred */ int actually_transferred; /* Bytes actually transferred */
int buffer_size; /* Size of our data buffer */ int buffer_size; /* Size of our data buffer */
struct request *rq; /* The corresponding request */
byte *buffer; /* Data buffer */ byte *buffer; /* Data buffer */
byte *current_position; /* Pointer into the above buffer */ byte *current_position; /* Pointer into the above buffer */
struct scatterlist *sg; /* Scatter gather table */ struct scatterlist *sg; /* Scatter gather table */
...@@ -259,10 +258,9 @@ static void hexdump(u8 *x, int len) ...@@ -259,10 +258,9 @@ static void hexdump(u8 *x, int len)
printk("]\n"); printk("]\n");
} }
static int idescsi_end_request(ide_drive_t *drive, int uptodate) static int idescsi_end_request(struct ata_device *drive, struct request *rq, int uptodate)
{ {
idescsi_scsi_t *scsi = drive->driver_data; idescsi_scsi_t *scsi = drive->driver_data;
struct request *rq = HWGROUP(drive)->rq;
idescsi_pc_t *pc = (idescsi_pc_t *) rq->special; idescsi_pc_t *pc = (idescsi_pc_t *) rq->special;
int log = test_bit(IDESCSI_LOG_CMD, &scsi->log); int log = test_bit(IDESCSI_LOG_CMD, &scsi->log);
struct Scsi_Host *host; struct Scsi_Host *host;
...@@ -270,7 +268,7 @@ static int idescsi_end_request(ide_drive_t *drive, int uptodate) ...@@ -270,7 +268,7 @@ static int idescsi_end_request(ide_drive_t *drive, int uptodate)
unsigned long flags; unsigned long flags;
if (!(rq->flags & REQ_SPECIAL)) { if (!(rq->flags & REQ_SPECIAL)) {
ide_end_request(drive, uptodate); ide_end_request(drive, rq, uptodate);
return 0; return 0;
} }
ide_end_drive_cmd (drive, 0, 0); ide_end_drive_cmd (drive, 0, 0);
...@@ -313,13 +311,12 @@ static inline unsigned long get_timeout(idescsi_pc_t *pc) ...@@ -313,13 +311,12 @@ static inline unsigned long get_timeout(idescsi_pc_t *pc)
/* /*
* Our interrupt handler. * Our interrupt handler.
*/ */
static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) static ide_startstop_t idescsi_pc_intr(struct ata_device *drive, struct request *rq)
{ {
idescsi_scsi_t *scsi = drive->driver_data; idescsi_scsi_t *scsi = drive->driver_data;
byte status, ireason; byte status, ireason;
int bcount; int bcount;
idescsi_pc_t *pc=scsi->pc; idescsi_pc_t *pc=scsi->pc;
struct request *rq = pc->rq;
unsigned int temp; unsigned int temp;
#if IDESCSI_DEBUG_LOG #if IDESCSI_DEBUG_LOG
...@@ -331,7 +328,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -331,7 +328,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
printk ("ide-scsi: %s: DMA complete\n", drive->name); printk ("ide-scsi: %s: DMA complete\n", drive->name);
#endif /* IDESCSI_DEBUG_LOG */ #endif /* IDESCSI_DEBUG_LOG */
pc->actually_transferred=pc->request_transfer; pc->actually_transferred=pc->request_transfer;
(void) drive->channel->dmaproc(ide_dma_end, drive); (void) drive->channel->udma(ide_dma_end, drive, NULL);
} }
status = GET_STAT(); /* Clear the interrupt */ status = GET_STAT(); /* Clear the interrupt */
...@@ -342,7 +339,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -342,7 +339,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
ide__sti(); ide__sti();
if (status & ERR_STAT) if (status & ERR_STAT)
rq->errors++; rq->errors++;
idescsi_end_request(drive, 1); idescsi_end_request(drive, rq, 1);
return ide_stopped; return ide_stopped;
} }
bcount = IN_BYTE (IDE_BCOUNTH_REG) << 8 | IN_BYTE (IDE_BCOUNTL_REG); bcount = IN_BYTE (IDE_BCOUNTH_REG) << 8 | IN_BYTE (IDE_BCOUNTL_REG);
...@@ -369,7 +366,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -369,7 +366,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
pc->actually_transferred += temp; pc->actually_transferred += temp;
pc->current_position += temp; pc->current_position += temp;
idescsi_discard_data (drive,bcount - temp); idescsi_discard_data (drive,bcount - temp);
ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), NULL); ide_set_handler(drive, idescsi_pc_intr, get_timeout(pc), NULL);
return ide_started; return ide_started;
} }
#if IDESCSI_DEBUG_LOG #if IDESCSI_DEBUG_LOG
...@@ -393,11 +390,11 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -393,11 +390,11 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
pc->actually_transferred+=bcount; /* Update the current position */ pc->actually_transferred+=bcount; /* Update the current position */
pc->current_position+=bcount; pc->current_position+=bcount;
ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), NULL); /* And set the interrupt handler again */ ide_set_handler(drive, idescsi_pc_intr, get_timeout(pc), NULL); /* And set the interrupt handler again */
return ide_started; return ide_started;
} }
static ide_startstop_t idescsi_transfer_pc (ide_drive_t *drive) static ide_startstop_t idescsi_transfer_pc(struct ata_device *drive, struct request *rq)
{ {
idescsi_scsi_t *scsi = drive->driver_data; idescsi_scsi_t *scsi = drive->driver_data;
idescsi_pc_t *pc = scsi->pc; idescsi_pc_t *pc = scsi->pc;
...@@ -413,7 +410,7 @@ static ide_startstop_t idescsi_transfer_pc (ide_drive_t *drive) ...@@ -413,7 +410,7 @@ static ide_startstop_t idescsi_transfer_pc (ide_drive_t *drive)
printk (KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while issuing a packet command\n"); printk (KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while issuing a packet command\n");
return ide_stopped; return ide_stopped;
} }
ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), NULL); /* Set the interrupt routine */ ide_set_handler(drive, idescsi_pc_intr, get_timeout(pc), NULL); /* Set the interrupt routine */
atapi_write(drive, scsi->pc->c, 12); /* Send the actual packet */ atapi_write(drive, scsi->pc->c, 12); /* Send the actual packet */
return ide_started; return ide_started;
} }
...@@ -421,11 +418,10 @@ static ide_startstop_t idescsi_transfer_pc (ide_drive_t *drive) ...@@ -421,11 +418,10 @@ static ide_startstop_t idescsi_transfer_pc (ide_drive_t *drive)
/* /*
* Issue a packet command * Issue a packet command
*/ */
static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc) static ide_startstop_t idescsi_issue_pc(struct ata_device *drive, struct request *rq, idescsi_pc_t *pc)
{ {
idescsi_scsi_t *scsi = drive->driver_data; idescsi_scsi_t *scsi = drive->driver_data;
int bcount; int bcount;
struct request *rq = pc->rq;
int dma_ok = 0; int dma_ok = 0;
scsi->pc=pc; /* Set the current packet command */ scsi->pc=pc; /* Set the current packet command */
...@@ -434,7 +430,7 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc) ...@@ -434,7 +430,7 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc)
bcount = min(pc->request_transfer, 63 * 1024); /* Request to transfer the entire buffer at once */ bcount = min(pc->request_transfer, 63 * 1024); /* Request to transfer the entire buffer at once */
if (drive->using_dma && rq->bio) if (drive->using_dma && rq->bio)
dma_ok = !drive->channel->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive); dma_ok = !drive->channel->udma(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive, rq);
SELECT_DRIVE(drive->channel, drive); SELECT_DRIVE(drive->channel, drive);
if (IDE_CONTROL_REG) if (IDE_CONTROL_REG)
...@@ -445,15 +441,15 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc) ...@@ -445,15 +441,15 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc)
if (dma_ok) { if (dma_ok) {
set_bit(PC_DMA_IN_PROGRESS, &pc->flags); set_bit(PC_DMA_IN_PROGRESS, &pc->flags);
(void) drive->channel->dmaproc(ide_dma_begin, drive); (void) drive->channel->udma(ide_dma_begin, drive, NULL);
} }
if (test_bit (IDESCSI_DRQ_INTERRUPT, &scsi->flags)) { if (test_bit (IDESCSI_DRQ_INTERRUPT, &scsi->flags)) {
ide_set_handler (drive, &idescsi_transfer_pc, get_timeout(pc), NULL); ide_set_handler(drive, idescsi_transfer_pc, get_timeout(pc), NULL);
OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* Issue the packet command */ OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* Issue the packet command */
return ide_started; return ide_started;
} else { } else {
OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG);
return idescsi_transfer_pc (drive); return idescsi_transfer_pc(drive, rq);
} }
} }
...@@ -468,10 +464,10 @@ static ide_startstop_t idescsi_do_request(struct ata_device *drive, struct reque ...@@ -468,10 +464,10 @@ static ide_startstop_t idescsi_do_request(struct ata_device *drive, struct reque
#endif /* IDESCSI_DEBUG_LOG */ #endif /* IDESCSI_DEBUG_LOG */
if (rq->flags & REQ_SPECIAL) { if (rq->flags & REQ_SPECIAL) {
return idescsi_issue_pc(drive, (idescsi_pc_t *) rq->special); return idescsi_issue_pc(drive, rq, (idescsi_pc_t *) rq->special);
} }
blk_dump_rq_flags(rq, "ide-scsi: unsup command"); blk_dump_rq_flags(rq, "ide-scsi: unsup command");
idescsi_end_request(drive, 0); idescsi_end_request(drive, rq, 0);
return ide_stopped; return ide_stopped;
} }
...@@ -760,7 +756,6 @@ int idescsi_queue (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) ...@@ -760,7 +756,6 @@ int idescsi_queue (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
memset (pc->c, 0, 12); memset (pc->c, 0, 12);
pc->flags = 0; pc->flags = 0;
pc->rq = rq;
memcpy (pc->c, cmd->cmnd, cmd->cmd_len); memcpy (pc->c, cmd->cmnd, cmd->cmd_len);
if (cmd->use_sg) { if (cmd->use_sg) {
pc->buffer = NULL; pc->buffer = NULL;
......
...@@ -374,7 +374,7 @@ struct ata_device { ...@@ -374,7 +374,7 @@ struct ata_device {
} ide_drive_t; } ide_drive_t;
/* /*
* An ide_dmaproc_t() initiates/aborts DMA read/write operations on a drive. * This initiates/aborts DMA read/write operations on a drive.
* *
* The caller is assumed to have selected the drive and programmed the drive's * The caller is assumed to have selected the drive and programmed the drive's
* sector address using CHS or LBA. All that remains is to prepare for DMA * sector address using CHS or LBA. All that remains is to prepare for DMA
...@@ -392,8 +392,6 @@ typedef enum { ide_dma_read, ide_dma_write, ide_dma_begin, ...@@ -392,8 +392,6 @@ typedef enum { ide_dma_read, ide_dma_write, ide_dma_begin,
ide_dma_lostirq, ide_dma_timeout ide_dma_lostirq, ide_dma_timeout
} ide_dma_action_t; } ide_dma_action_t;
typedef int (ide_dmaproc_t)(ide_dma_action_t, ide_drive_t *);
enum { enum {
ATA_PRIMARY = 0, ATA_PRIMARY = 0,
ATA_SECONDARY = 1 ATA_SECONDARY = 1
...@@ -446,7 +444,7 @@ struct ata_channel { ...@@ -446,7 +444,7 @@ struct ata_channel {
void (*atapi_read)(ide_drive_t *, void *, unsigned int); void (*atapi_read)(ide_drive_t *, void *, unsigned int);
void (*atapi_write)(ide_drive_t *, void *, unsigned int); void (*atapi_write)(ide_drive_t *, void *, unsigned int);
ide_dmaproc_t *dmaproc; /* dma read/write/abort routine */ int (*udma)(ide_dma_action_t, struct ata_device *, struct request *); /* dma read/write/abort routine */
unsigned int *dmatable_cpu; /* dma physical region descriptor table (cpu view) */ unsigned int *dmatable_cpu; /* dma physical region descriptor table (cpu view) */
dma_addr_t dmatable_dma; /* dma physical region descriptor table (dma view) */ dma_addr_t dmatable_dma; /* dma physical region descriptor table (dma view) */
struct scatterlist *sg_table; /* Scatter-gather list used to build the above */ struct scatterlist *sg_table; /* Scatter-gather list used to build the above */
...@@ -500,31 +498,25 @@ typedef enum { ...@@ -500,31 +498,25 @@ typedef enum {
} ide_startstop_t; } ide_startstop_t;
/* /*
* Interrupt handler types. * Interrupt and timeout handler type.
*/ */
struct ata_taskfile; typedef ide_startstop_t (ata_handler_t)(struct ata_device *, struct request *);
typedef ide_startstop_t (ide_pre_handler_t)(ide_drive_t *, struct request *); typedef int (ata_expiry_t)(struct ata_device *, struct request *);
typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
/* struct ata_taskfile;
* when ide_timer_expiry fires, invoke a handler of this type
* to decide what to do.
*/
typedef int (ide_expiry_t)(ide_drive_t *);
#define IDE_BUSY 0 /* awaiting an interrupt */ #define IDE_BUSY 0 /* awaiting an interrupt */
#define IDE_SLEEP 1 #define IDE_SLEEP 1
#define IDE_DMA 2 /* DMA in progress */ #define IDE_DMA 2 /* DMA in progress */
typedef struct hwgroup_s { typedef struct hwgroup_s {
ide_handler_t *handler; /* irq handler, if active */ ide_startstop_t (*handler)(struct ata_device *, struct request *); /* irq handler, if active */
unsigned long flags; /* BUSY, SLEEPING */ unsigned long flags; /* BUSY, SLEEPING */
struct ata_device *drive; /* current drive */ struct ata_device *drive; /* current drive */
struct request *rq; /* current request */ struct request *rq; /* current request */
struct timer_list timer; /* failsafe timer */ struct timer_list timer; /* failsafe timer */
struct request wrq; /* local copy of current write rq */
unsigned long poll_timeout; /* timeout value during long polls */ unsigned long poll_timeout; /* timeout value during long polls */
ide_expiry_t *expiry; /* queried upon timeouts */ int (*expiry)(struct ata_device *, struct request *); /* irq handler, if active */
} ide_hwgroup_t; } ide_hwgroup_t;
/* structure attached to the request for IDE_TASK_CMDS */ /* structure attached to the request for IDE_TASK_CMDS */
...@@ -616,7 +608,7 @@ struct ata_operations { ...@@ -616,7 +608,7 @@ struct ata_operations {
int (*cleanup)(struct ata_device *); int (*cleanup)(struct ata_device *);
int (*standby)(struct ata_device *); int (*standby)(struct ata_device *);
ide_startstop_t (*do_request)(struct ata_device *, struct request *, sector_t); ide_startstop_t (*do_request)(struct ata_device *, struct request *, sector_t);
int (*end_request)(struct ata_device *, int); int (*end_request)(struct ata_device *, struct request *, int);
int (*ioctl)(struct ata_device *, struct inode *, struct file *, unsigned int, unsigned long); int (*ioctl)(struct ata_device *, struct inode *, struct file *, unsigned int, unsigned long);
int (*open)(struct inode *, struct file *, struct ata_device *); int (*open)(struct inode *, struct file *, struct ata_device *);
...@@ -663,14 +655,15 @@ extern int noautodma; ...@@ -663,14 +655,15 @@ extern int noautodma;
#define LOCAL_END_REQUEST /* Don't generate end_request in blk.h */ #define LOCAL_END_REQUEST /* Don't generate end_request in blk.h */
#include <linux/blk.h> #include <linux/blk.h>
extern int __ide_end_request(ide_drive_t *drive, int uptodate, int nr_secs); extern int __ide_end_request(struct ata_device *, struct request *, int, int);
extern int ide_end_request(ide_drive_t *drive, int uptodate); extern int ide_end_request(struct ata_device *drive, struct request *, int);
/* /*
* This is used on exit from the driver, to designate the next irq handler * This is used on exit from the driver, to designate the next irq handler
* and also to start the safety timer. * and also to start the safety timer.
*/ */
void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry); extern void ide_set_handler(struct ata_device *drive, ata_handler_t handler,
unsigned long timeout, ata_expiry_t expiry);
/* /*
* Error reporting, in human readable form (luxurious, but a memory hog). * Error reporting, in human readable form (luxurious, but a memory hog).
...@@ -687,7 +680,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); ...@@ -687,7 +680,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
* Issue a simple drive command * Issue a simple drive command
* The drive must be selected beforehand. * The drive must be selected beforehand.
*/ */
void ide_cmd(ide_drive_t *drive, byte cmd, byte nsect, ide_handler_t *handler); void ide_cmd(ide_drive_t *drive, byte cmd, byte nsect, ata_handler_t handler);
/* /*
* ide_fixstring() cleans up and (optionally) byte-swaps a text string, * ide_fixstring() cleans up and (optionally) byte-swaps a text string,
...@@ -757,8 +750,8 @@ struct ata_taskfile { ...@@ -757,8 +750,8 @@ struct ata_taskfile {
struct hd_drive_task_hdr taskfile; struct hd_drive_task_hdr taskfile;
struct hd_drive_hob_hdr hobfile; struct hd_drive_hob_hdr hobfile;
int command_type; int command_type;
ide_pre_handler_t *prehandler; ide_startstop_t (*prehandler)(struct ata_device *, struct request *);
ide_handler_t *handler; ide_startstop_t (*handler)(struct ata_device *, struct request *);
}; };
extern void ata_read(ide_drive_t *drive, void *buffer, unsigned int wcount); extern void ata_read(ide_drive_t *drive, void *buffer, unsigned int wcount);
...@@ -774,10 +767,10 @@ extern ide_startstop_t ata_taskfile(ide_drive_t *drive, ...@@ -774,10 +767,10 @@ extern ide_startstop_t ata_taskfile(ide_drive_t *drive,
* Special Flagged Register Validation Caller * Special Flagged Register Validation Caller
*/ */
extern ide_startstop_t recal_intr(ide_drive_t *drive); extern ide_startstop_t recal_intr(struct ata_device *, struct request *);
extern ide_startstop_t set_geometry_intr(ide_drive_t *drive); extern ide_startstop_t set_geometry_intr(struct ata_device *, struct request *);
extern ide_startstop_t set_multmode_intr(ide_drive_t *drive); extern ide_startstop_t set_multmode_intr(struct ata_device *, struct request *);
extern ide_startstop_t task_no_data_intr(ide_drive_t *drive); extern ide_startstop_t task_no_data_intr(struct ata_device *, struct request *);
/* This is setting up all fields in args, which depend upon the command type. /* This is setting up all fields in args, which depend upon the command type.
...@@ -871,9 +864,9 @@ void __init ide_scan_pcibus(int scan_direction); ...@@ -871,9 +864,9 @@ void __init ide_scan_pcibus(int scan_direction);
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
int ide_build_dmatable (ide_drive_t *drive, ide_dma_action_t func); int ide_build_dmatable (ide_drive_t *drive, ide_dma_action_t func);
void ide_destroy_dmatable (ide_drive_t *drive); void ide_destroy_dmatable (ide_drive_t *drive);
ide_startstop_t ide_dma_intr (ide_drive_t *drive); extern ide_startstop_t ide_dma_intr(struct ata_device *, struct request *);
int check_drive_lists (ide_drive_t *drive, int good_bad); int check_drive_lists (ide_drive_t *drive, int good_bad);
int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive); int ide_dmaproc (ide_dma_action_t func, struct ata_device *drive, struct request *);
extern void ide_release_dma(struct ata_channel *hwif); extern void ide_release_dma(struct ata_channel *hwif);
extern void ide_setup_dma(struct ata_channel *hwif, extern void ide_setup_dma(struct ata_channel *hwif,
unsigned long dmabase, unsigned int num_ports) __init; unsigned long dmabase, unsigned int num_ports) __init;
......
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