aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/icside.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:46 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:46 -0400
commit2298169418f43ba5e0919762a4bab95a1227872a (patch)
tree67cf3133c7bae747ad957c68a650534105a7d8e7 /drivers/ide/icside.c
parent130e886708d6e11f3d54e5d27c266578de56f343 (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/icside.c')
-rw-r--r--drivers/ide/icside.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c
index bdfeb1222d52..3628b2147902 100644
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -307,15 +307,14 @@ static void icside_dma_start(ide_drive_t *drive)
307 enable_dma(ec->dma); 307 enable_dma(ec->dma);
308} 308}
309 309
310static int icside_dma_setup(ide_drive_t *drive) 310static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
311{ 311{
312 ide_hwif_t *hwif = drive->hwif; 312 ide_hwif_t *hwif = drive->hwif;
313 struct expansion_card *ec = ECARD_DEV(hwif->dev); 313 struct expansion_card *ec = ECARD_DEV(hwif->dev);
314 struct icside_state *state = ecard_get_drvdata(ec); 314 struct icside_state *state = ecard_get_drvdata(ec);
315 struct request *rq = hwif->rq;
316 unsigned int dma_mode; 315 unsigned int dma_mode;
317 316
318 if (rq_data_dir(rq)) 317 if (cmd->tf_flags & IDE_TFLAG_WRITE)
319 dma_mode = DMA_MODE_WRITE; 318 dma_mode = DMA_MODE_WRITE;
320 else 319 else
321 dma_mode = DMA_MODE_READ; 320 dma_mode = DMA_MODE_READ;
@@ -344,7 +343,7 @@ static int icside_dma_setup(ide_drive_t *drive)
344 * Tell the DMA engine about the SG table and 343 * Tell the DMA engine about the SG table and
345 * data direction. 344 * data direction.
346 */ 345 */
347 set_dma_sg(ec->dma, hwif->sg_table, hwif->cmd.sg_nents); 346 set_dma_sg(ec->dma, hwif->sg_table, cmd->sg_nents);
348 set_dma_mode(ec->dma, dma_mode); 347 set_dma_mode(ec->dma, dma_mode);
349 348
350 drive->waiting_for_dma = 1; 349 drive->waiting_for_dma = 1;