falconide/q40ide: add ->atapi_*put_bytes and ->ata_*put_data methods (take 2)

* Add ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods to
  falconide and q40ide host drivers (->ata_* methods are implemented on
  top of ->atapi_* methods so they also do byte-swapping now).

* Cleanup atapi_{in,out}put_bytes().

v2:
* Add 'struct request *rq' argument to ->ata_{in,out}put_data methods
  and don't byte-swap disk fs requests (we shouldn't un-swap fs requests
  because fs itself is stored byte-swapped on the disk) - this is how
  things were done before the patch (ideally device mapper should be
  used instead but it would break existing setups and would have some
  performance impact).

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitz@debian.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Richard Zidlicky <rz@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
Bartlomiej Zolnierkiewicz
2008-04-28 23:44:36 +02:00
والد 284aa76b53
کامیت 92d3ab27e8
8فایلهای تغییر یافته به همراه98 افزوده شده و 36 حذف شده

مشاهده پرونده

@@ -283,7 +283,8 @@ static u8 wait_drive_not_busy(ide_drive_t *drive)
return stat;
}
static void ide_pio_sector(ide_drive_t *drive, unsigned int write)
static void ide_pio_sector(ide_drive_t *drive, struct request *rq,
unsigned int write)
{
ide_hwif_t *hwif = drive->hwif;
struct scatterlist *sg = hwif->sg_table;
@@ -323,9 +324,9 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned int write)
/* do the actual data transfer */
if (write)
hwif->ata_output_data(drive, buf, SECTOR_WORDS);
hwif->ata_output_data(drive, rq, buf, SECTOR_WORDS);
else
hwif->ata_input_data(drive, buf, SECTOR_WORDS);
hwif->ata_input_data(drive, rq, buf, SECTOR_WORDS);
kunmap_atomic(buf, KM_BIO_SRC_IRQ);
#ifdef CONFIG_HIGHMEM
@@ -333,13 +334,14 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned int write)
#endif
}
static void ide_pio_multi(ide_drive_t *drive, unsigned int write)
static void ide_pio_multi(ide_drive_t *drive, struct request *rq,
unsigned int write)
{
unsigned int nsect;
nsect = min_t(unsigned int, drive->hwif->nleft, drive->mult_count);
while (nsect--)
ide_pio_sector(drive, write);
ide_pio_sector(drive, rq, write);
}
static void ide_pio_datablock(ide_drive_t *drive, struct request *rq,
@@ -362,10 +364,10 @@ static void ide_pio_datablock(ide_drive_t *drive, struct request *rq,
switch (drive->hwif->data_phase) {
case TASKFILE_MULTI_IN:
case TASKFILE_MULTI_OUT:
ide_pio_multi(drive, write);
ide_pio_multi(drive, rq, write);
break;
default:
ide_pio_sector(drive, write);
ide_pio_sector(drive, rq, write);
break;
}