aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
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,