Loading drivers/ide/ide-atapi.c +12 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,12 @@ static void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk, rq->cmd_flags |= REQ_PREEMPT; rq->buffer = (char *)pc; rq->rq_disk = disk; if (pc->req_xfer) { rq->data = pc->buf; rq->data_len = pc->req_xfer; } memcpy(rq->cmd, pc->c, 12); if (drive->media == ide_tape) rq->cmd[13] = REQ_IDETAPE_PC1; Loading @@ -159,6 +165,12 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, rq = blk_get_request(drive->queue, READ, __GFP_WAIT); rq->cmd_type = REQ_TYPE_SPECIAL; rq->buffer = (char *)pc; if (pc->req_xfer) { rq->data = pc->buf; rq->data_len = pc->req_xfer; } memcpy(rq->cmd, pc->c, 12); if (drive->media == ide_tape) rq->cmd[13] = REQ_IDETAPE_PC1; Loading drivers/ide/ide-dma.c +9 −3 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq) { ide_hwif_t *hwif = drive->hwif; struct scatterlist *sg = hwif->sg_table; int i; ide_map_sg(drive, rq); Loading @@ -136,8 +137,13 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq) else hwif->sg_dma_direction = DMA_TO_DEVICE; return dma_map_sg(hwif->dev, sg, hwif->sg_nents, hwif->sg_dma_direction); i = dma_map_sg(hwif->dev, sg, hwif->sg_nents, hwif->sg_dma_direction); if (i) { hwif->orig_sg_nents = hwif->sg_nents; hwif->sg_nents = i; } return i; } EXPORT_SYMBOL_GPL(ide_build_sglist); Loading @@ -156,7 +162,7 @@ void ide_destroy_dmatable(ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents, dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->orig_sg_nents, hwif->sg_dma_direction); } EXPORT_SYMBOL_GPL(ide_destroy_dmatable); Loading drivers/ide/ide-floppy.c +4 −2 Original line number Diff line number Diff line Loading @@ -327,8 +327,10 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, return ide_stopped; } if (blk_fs_request(rq) || pc->req_xfer) { ide_init_sg_cmd(drive, rq); ide_map_sg(drive, rq); } pc->sg = hwif->sg_table; pc->sg_cnt = hwif->sg_nents; Loading include/linux/ide.h +1 −0 Original line number Diff line number Diff line Loading @@ -797,6 +797,7 @@ typedef struct hwif_s { struct scatterlist *sg_table; int sg_max_nents; /* Maximum number of entries in it */ int sg_nents; /* Current number of entries in it */ int orig_sg_nents; int sg_dma_direction; /* dma transfer direction */ /* data phase of the active command (currently only valid for PIO/DMA) */ Loading Loading
drivers/ide/ide-atapi.c +12 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,12 @@ static void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk, rq->cmd_flags |= REQ_PREEMPT; rq->buffer = (char *)pc; rq->rq_disk = disk; if (pc->req_xfer) { rq->data = pc->buf; rq->data_len = pc->req_xfer; } memcpy(rq->cmd, pc->c, 12); if (drive->media == ide_tape) rq->cmd[13] = REQ_IDETAPE_PC1; Loading @@ -159,6 +165,12 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, rq = blk_get_request(drive->queue, READ, __GFP_WAIT); rq->cmd_type = REQ_TYPE_SPECIAL; rq->buffer = (char *)pc; if (pc->req_xfer) { rq->data = pc->buf; rq->data_len = pc->req_xfer; } memcpy(rq->cmd, pc->c, 12); if (drive->media == ide_tape) rq->cmd[13] = REQ_IDETAPE_PC1; Loading
drivers/ide/ide-dma.c +9 −3 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq) { ide_hwif_t *hwif = drive->hwif; struct scatterlist *sg = hwif->sg_table; int i; ide_map_sg(drive, rq); Loading @@ -136,8 +137,13 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq) else hwif->sg_dma_direction = DMA_TO_DEVICE; return dma_map_sg(hwif->dev, sg, hwif->sg_nents, hwif->sg_dma_direction); i = dma_map_sg(hwif->dev, sg, hwif->sg_nents, hwif->sg_dma_direction); if (i) { hwif->orig_sg_nents = hwif->sg_nents; hwif->sg_nents = i; } return i; } EXPORT_SYMBOL_GPL(ide_build_sglist); Loading @@ -156,7 +162,7 @@ void ide_destroy_dmatable(ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents, dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->orig_sg_nents, hwif->sg_dma_direction); } EXPORT_SYMBOL_GPL(ide_destroy_dmatable); Loading
drivers/ide/ide-floppy.c +4 −2 Original line number Diff line number Diff line Loading @@ -327,8 +327,10 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, return ide_stopped; } if (blk_fs_request(rq) || pc->req_xfer) { ide_init_sg_cmd(drive, rq); ide_map_sg(drive, rq); } pc->sg = hwif->sg_table; pc->sg_cnt = hwif->sg_nents; Loading
include/linux/ide.h +1 −0 Original line number Diff line number Diff line Loading @@ -797,6 +797,7 @@ typedef struct hwif_s { struct scatterlist *sg_table; int sg_max_nents; /* Maximum number of entries in it */ int sg_nents; /* Current number of entries in it */ int orig_sg_nents; int sg_dma_direction; /* dma transfer direction */ /* data phase of the active command (currently only valid for PIO/DMA) */ Loading