diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:37 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:37 -0400 |
commit | 7645c1514c7d34ebdf3ea0e8ee3a935c08abceb2 (patch) | |
tree | 98e51341f3f1a259ca89baf7d2e83b7357dc8a22 /drivers/ide/ide-atapi.c | |
parent | 7bf7420a318978cd6042e5a5da34b7cfa18ae559 (diff) |
ide: add ide_queue_pc_head() helper
* Move REQ_IDETAPE_* enums to <linux/ide.h>.
* Add ide_queue_pc_head() and convert ide-{floppy,tape}.c to use it
instead of ide*_queue_pc_head().
* Remove no longer used ide*_queue_pc_head().
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.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 8f0842ce77f5..da71bfce92e8 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -119,6 +119,26 @@ void ide_init_pc(struct ide_atapi_pc *pc) | |||
119 | } | 119 | } |
120 | EXPORT_SYMBOL_GPL(ide_init_pc); | 120 | EXPORT_SYMBOL_GPL(ide_init_pc); |
121 | 121 | ||
122 | /* | ||
123 | * Generate a new packet command request in front of the request queue, before | ||
124 | * the current request, so that it will be processed immediately, on the next | ||
125 | * pass through the driver. | ||
126 | */ | ||
127 | void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk, | ||
128 | struct ide_atapi_pc *pc, struct request *rq) | ||
129 | { | ||
130 | blk_rq_init(NULL, rq); | ||
131 | rq->cmd_type = REQ_TYPE_SPECIAL; | ||
132 | rq->cmd_flags |= REQ_PREEMPT; | ||
133 | rq->buffer = (char *)pc; | ||
134 | rq->rq_disk = disk; | ||
135 | memcpy(rq->cmd, pc->c, 12); | ||
136 | if (drive->media == ide_tape) | ||
137 | rq->cmd[13] = REQ_IDETAPE_PC1; | ||
138 | ide_do_drive_cmd(drive, rq); | ||
139 | } | ||
140 | EXPORT_SYMBOL_GPL(ide_queue_pc_head); | ||
141 | |||
122 | /* TODO: unify the code thus making some arguments go away */ | 142 | /* TODO: unify the code thus making some arguments go away */ |
123 | ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, | 143 | ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, |
124 | ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry, | 144 | ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry, |