ide: remove REQ_TYPE_ATA_CMD

Based on the earlier work by Tejun Heo.

All users are gone so we can finally remove it.

Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 5a9e77af
...@@ -354,7 +354,6 @@ void ide_tf_read(ide_drive_t *drive, ide_task_t *task) ...@@ -354,7 +354,6 @@ void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
{ {
ide_hwif_t *hwif = HWIF(drive);
unsigned long flags; unsigned long flags;
struct request *rq; struct request *rq;
...@@ -362,19 +361,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) ...@@ -362,19 +361,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
rq = HWGROUP(drive)->rq; rq = HWGROUP(drive)->rq;
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
if (rq->cmd_type == REQ_TYPE_ATA_CMD) { if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
u8 *args = (u8 *) rq->buffer;
if (rq->errors == 0)
rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
if (args) {
args[0] = stat;
args[1] = err;
/* be sure we're looking at the low order bits */
hwif->OUTB(drive->ctl & ~0x80, IDE_CONTROL_REG);
args[2] = hwif->INB(IDE_NSECTOR_REG);
}
} else if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
ide_task_t *args = (ide_task_t *) rq->special; ide_task_t *args = (ide_task_t *) rq->special;
if (rq->errors == 0) if (rq->errors == 0)
rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
...@@ -624,48 +611,6 @@ ide_startstop_t ide_abort(ide_drive_t *drive, const char *msg) ...@@ -624,48 +611,6 @@ ide_startstop_t ide_abort(ide_drive_t *drive, const char *msg)
return __ide_abort(drive, rq); return __ide_abort(drive, rq);
} }
/**
* drive_cmd_intr - drive command completion interrupt
* @drive: drive the completion interrupt occurred on
*
* drive_cmd_intr() is invoked on completion of a special DRIVE_CMD.
* We do any necessary data reading and then wait for the drive to
* go non busy. At that point we may read the error data and complete
* the request
*/
static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
{
struct request *rq = HWGROUP(drive)->rq;
ide_hwif_t *hwif = HWIF(drive);
u8 *args = (u8 *)rq->buffer, pio_in = (args && args[3]) ? 1 : 0, stat;
if (pio_in) {
u8 io_32bit = drive->io_32bit;
stat = hwif->INB(IDE_STATUS_REG);
if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) {
if (stat & (ERR_STAT | DRQ_STAT))
return ide_error(drive, __FUNCTION__, stat);
ide_set_handler(drive, &drive_cmd_intr, WAIT_WORSTCASE,
NULL);
return ide_started;
}
drive->io_32bit = 0;
hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
drive->io_32bit = io_32bit;
stat = wait_drive_not_busy(drive);
} else {
local_irq_enable_in_hardirq();
stat = hwif->INB(IDE_STATUS_REG);
}
if (!OK_STAT(stat, (pio_in ? 0 : READY_STAT), BAD_STAT))
return ide_error(drive, __FUNCTION__, stat);
/* calls ide_end_drive_cmd */
ide_end_drive_cmd(drive, stat, hwif->INB(IDE_ERROR_REG));
return ide_stopped;
}
static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf) static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
{ {
tf->nsect = drive->sect; tf->nsect = drive->sect;
...@@ -851,16 +796,9 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, ...@@ -851,16 +796,9 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
struct request *rq) struct request *rq)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
u8 *args = rq->buffer;
ide_task_t ltask;
struct ide_taskfile *tf = &ltask.tf;
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
ide_task_t *task = rq->special; ide_task_t *task = rq->special;
if (task == NULL) if (task) {
goto done;
hwif->data_phase = task->data_phase; hwif->data_phase = task->data_phase;
switch (hwif->data_phase) { switch (hwif->data_phase) {
...@@ -877,33 +815,6 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, ...@@ -877,33 +815,6 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
return do_rw_taskfile(drive, task); return do_rw_taskfile(drive, task);
} }
if (args == NULL)
goto done;
memset(&ltask, 0, sizeof(ltask));
if (rq->cmd_type == REQ_TYPE_ATA_CMD) {
#ifdef DEBUG
printk("%s: DRIVE_CMD\n", drive->name);
#endif
tf->feature = args[2];
if (args[0] == WIN_SMART) {
tf->nsect = args[3];
tf->lbal = args[1];
tf->lbam = 0x4f;
tf->lbah = 0xc2;
ltask.tf_flags = IDE_TFLAG_OUT_TF;
} else {
tf->nsect = args[1];
ltask.tf_flags = IDE_TFLAG_OUT_FEATURE |
IDE_TFLAG_OUT_NSECT;
}
}
tf->command = args[0];
ide_tf_load(drive, &ltask);
ide_execute_command(drive, args[0], &drive_cmd_intr, WAIT_WORSTCASE, NULL);
return ide_started;
done:
/* /*
* NULL is actually a valid way of waiting for * NULL is actually a valid way of waiting for
* all current requests to be flushed from the queue. * all current requests to be flushed from the queue.
...@@ -1007,8 +918,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) ...@@ -1007,8 +918,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
if (drive->current_speed == 0xff) if (drive->current_speed == 0xff)
ide_config_drive_speed(drive, drive->desired_speed); ide_config_drive_speed(drive, drive->desired_speed);
if (rq->cmd_type == REQ_TYPE_ATA_CMD || if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
return execute_drive_cmd(drive, rq); return execute_drive_cmd(drive, rq);
else if (blk_pm_request(rq)) { else if (blk_pm_request(rq)) {
struct request_pm_state *pm = rq->data; struct request_pm_state *pm = rq->data;
......
...@@ -454,8 +454,7 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) ...@@ -454,8 +454,7 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
static void ide_dump_opcode(ide_drive_t *drive) static void ide_dump_opcode(ide_drive_t *drive)
{ {
struct request *rq; struct request *rq;
u8 opcode = 0; ide_task_t *task = NULL;
int found = 0;
spin_lock(&ide_lock); spin_lock(&ide_lock);
rq = NULL; rq = NULL;
...@@ -464,25 +463,15 @@ static void ide_dump_opcode(ide_drive_t *drive) ...@@ -464,25 +463,15 @@ static void ide_dump_opcode(ide_drive_t *drive)
spin_unlock(&ide_lock); spin_unlock(&ide_lock);
if (!rq) if (!rq)
return; return;
if (rq->cmd_type == REQ_TYPE_ATA_CMD) {
char *args = rq->buffer; if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
if (args) { task = rq->special;
opcode = args[0];
found = 1;
}
} else if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
ide_task_t *args = rq->special;
if (args) {
opcode = args->tf.command;
found = 1;
}
}
printk("ide: failed opcode was: "); printk("ide: failed opcode was: ");
if (!found) if (task == NULL)
printk("unknown\n"); printk(KERN_CONT "unknown\n");
else else
printk("0x%02x\n", opcode); printk(KERN_CONT "0x%02x\n", task->tf.command);
} }
u64 ide_get_lba_addr(struct ide_taskfile *tf, int lba48) u64 ide_get_lba_addr(struct ide_taskfile *tf, int lba48)
......
...@@ -143,7 +143,6 @@ enum rq_cmd_type_bits { ...@@ -143,7 +143,6 @@ enum rq_cmd_type_bits {
* use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver
* private REQ_LB opcodes to differentiate what type of request this is * private REQ_LB opcodes to differentiate what type of request this is
*/ */
REQ_TYPE_ATA_CMD,
REQ_TYPE_ATA_TASKFILE, REQ_TYPE_ATA_TASKFILE,
REQ_TYPE_ATA_PC, REQ_TYPE_ATA_PC,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册