diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-28 17:44:36 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-28 17:44:36 -0400 |
commit | 92d3ab27e8fd23d1a9dc3b69d17b2afb83e5c6f5 (patch) | |
tree | e58076cb0102443dfe76401931a41931f97053cf /drivers/ide/ide-taskfile.c | |
parent | 284aa76b5339ce79d5ad2ac1c7cbf717082816a7 (diff) |
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>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r-- | drivers/ide/ide-taskfile.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 9f9ad9fb6b89..7f6bfd314411 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -283,7 +283,8 @@ static u8 wait_drive_not_busy(ide_drive_t *drive) | |||
283 | return stat; | 283 | return stat; |
284 | } | 284 | } |
285 | 285 | ||
286 | static void ide_pio_sector(ide_drive_t *drive, unsigned int write) | 286 | static void ide_pio_sector(ide_drive_t *drive, struct request *rq, |
287 | unsigned int write) | ||
287 | { | 288 | { |
288 | ide_hwif_t *hwif = drive->hwif; | 289 | ide_hwif_t *hwif = drive->hwif; |
289 | struct scatterlist *sg = hwif->sg_table; | 290 | struct scatterlist *sg = hwif->sg_table; |
@@ -323,9 +324,9 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned int write) | |||
323 | 324 | ||
324 | /* do the actual data transfer */ | 325 | /* do the actual data transfer */ |
325 | if (write) | 326 | if (write) |
326 | hwif->ata_output_data(drive, buf, SECTOR_WORDS); | 327 | hwif->ata_output_data(drive, rq, buf, SECTOR_WORDS); |
327 | else | 328 | else |
328 | hwif->ata_input_data(drive, buf, SECTOR_WORDS); | 329 | hwif->ata_input_data(drive, rq, buf, SECTOR_WORDS); |
329 | 330 | ||
330 | kunmap_atomic(buf, KM_BIO_SRC_IRQ); | 331 | kunmap_atomic(buf, KM_BIO_SRC_IRQ); |
331 | #ifdef CONFIG_HIGHMEM | 332 | #ifdef CONFIG_HIGHMEM |
@@ -333,13 +334,14 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned int write) | |||
333 | #endif | 334 | #endif |
334 | } | 335 | } |
335 | 336 | ||
336 | static void ide_pio_multi(ide_drive_t *drive, unsigned int write) | 337 | static void ide_pio_multi(ide_drive_t *drive, struct request *rq, |
338 | unsigned int write) | ||
337 | { | 339 | { |
338 | unsigned int nsect; | 340 | unsigned int nsect; |
339 | 341 | ||
340 | nsect = min_t(unsigned int, drive->hwif->nleft, drive->mult_count); | 342 | nsect = min_t(unsigned int, drive->hwif->nleft, drive->mult_count); |
341 | while (nsect--) | 343 | while (nsect--) |
342 | ide_pio_sector(drive, write); | 344 | ide_pio_sector(drive, rq, write); |
343 | } | 345 | } |
344 | 346 | ||
345 | static void ide_pio_datablock(ide_drive_t *drive, struct request *rq, | 347 | 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, | |||
362 | switch (drive->hwif->data_phase) { | 364 | switch (drive->hwif->data_phase) { |
363 | case TASKFILE_MULTI_IN: | 365 | case TASKFILE_MULTI_IN: |
364 | case TASKFILE_MULTI_OUT: | 366 | case TASKFILE_MULTI_OUT: |
365 | ide_pio_multi(drive, write); | 367 | ide_pio_multi(drive, rq, write); |
366 | break; | 368 | break; |
367 | default: | 369 | default: |
368 | ide_pio_sector(drive, write); | 370 | ide_pio_sector(drive, rq, write); |
369 | break; | 371 | break; |
370 | } | 372 | } |
371 | 373 | ||