aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:38 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:38 -0400
commit2ac07d920604eeee8966d52e70161f9b31fe90a3 (patch)
treeea9fc0a9902da190b5fe695018a4c79740e88d18 /drivers/ide/ide-atapi.c
parent7645c1514c7d34ebdf3ea0e8ee3a935c08abceb2 (diff)
ide: add ide_queue_pc_tail() helper
* Add ide_queue_pc_tail() and convert ide-{floppy,tape}.c to use it instead of ide*_queue_pc_tail(). * Remove no longer used ide*_queue_pc_tail(). There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r--drivers/ide/ide-atapi.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index da71bfce92e8..f82ddfb9a44e 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -139,6 +139,29 @@ void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk,
139} 139}
140EXPORT_SYMBOL_GPL(ide_queue_pc_head); 140EXPORT_SYMBOL_GPL(ide_queue_pc_head);
141 141
142/*
143 * Add a special packet command request to the tail of the request queue,
144 * and wait for it to be serviced.
145 */
146int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
147 struct ide_atapi_pc *pc)
148{
149 struct request *rq;
150 int error;
151
152 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
153 rq->cmd_type = REQ_TYPE_SPECIAL;
154 rq->buffer = (char *)pc;
155 memcpy(rq->cmd, pc->c, 12);
156 if (drive->media == ide_tape)
157 rq->cmd[13] = REQ_IDETAPE_PC1;
158 error = blk_execute_rq(drive->queue, disk, rq, 0);
159 blk_put_request(rq);
160
161 return error;
162}
163EXPORT_SYMBOL_GPL(ide_queue_pc_tail);
164
142/* TODO: unify the code thus making some arguments go away */ 165/* TODO: unify the code thus making some arguments go away */
143ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, 166ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
144 ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry, 167 ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry,