diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:46 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:46 -0400 |
commit | 2298169418f43ba5e0919762a4bab95a1227872a (patch) | |
tree | 67cf3133c7bae747ad957c68a650534105a7d8e7 /drivers/ide/alim15x3.c | |
parent | 130e886708d6e11f3d54e5d27c266578de56f343 (diff) |
ide: pass command to ide_map_sg()
* Set IDE_TFLAG_WRITE flag and ->rq also for ATA_CMD_PACKET
commands.
* Pass command to ->dma_setup method and update all its
implementations accordingly.
* Pass command instead of request to ide_build_sglist(),
*_build_dmatable() and ide_map_sg().
While at it:
* Fix scc_dma_setup() documentation + use ATA_DMA_WR define.
* Rename sgiioc4_build_dma_table() to sgiioc4_build_dmatable(),
change return value type to 'int' and drop unused 'ddir'
argument.
* Do some minor cleanups in [tx4939]ide_dma_setup().
There should be no functional changes caused by this patch.
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/alim15x3.c')
-rw-r--r-- | drivers/ide/alim15x3.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c index d3513b6b8530..e837fd9f196f 100644 --- a/drivers/ide/alim15x3.c +++ b/drivers/ide/alim15x3.c | |||
@@ -191,17 +191,18 @@ static void ali_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
191 | /** | 191 | /** |
192 | * ali15x3_dma_setup - begin a DMA phase | 192 | * ali15x3_dma_setup - begin a DMA phase |
193 | * @drive: target device | 193 | * @drive: target device |
194 | * @cmd: command | ||
194 | * | 195 | * |
195 | * Returns 1 if the DMA cannot be performed, zero on success. | 196 | * Returns 1 if the DMA cannot be performed, zero on success. |
196 | */ | 197 | */ |
197 | 198 | ||
198 | static int ali15x3_dma_setup(ide_drive_t *drive) | 199 | static int ali15x3_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) |
199 | { | 200 | { |
200 | if (m5229_revision < 0xC2 && drive->media != ide_disk) { | 201 | if (m5229_revision < 0xC2 && drive->media != ide_disk) { |
201 | if (rq_data_dir(drive->hwif->rq)) | 202 | if (cmd->tf_flags & IDE_TFLAG_WRITE) |
202 | return 1; /* try PIO instead of DMA */ | 203 | return 1; /* try PIO instead of DMA */ |
203 | } | 204 | } |
204 | return ide_dma_setup(drive); | 205 | return ide_dma_setup(drive, cmd); |
205 | } | 206 | } |
206 | 207 | ||
207 | /** | 208 | /** |