summaryrefslogtreecommitdiff
path: root/drivers/scsi/initio.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-01-13 10:04:46 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2021-01-22 21:14:10 -0500
commit9df17f4679b7f908671395f3ab6acb3294b69770 (patch)
treeaf08bf50c9c04757b47f1670b4884b449f816548 /drivers/scsi/initio.c
parent9c2d2670735157ed5bbe0755da0d275a46309868 (diff)
scsi: initio: Drop internal SCSI message definition
Use the standard SCSI message definitions instead of the driver-internal ones. Link: https://lore.kernel.org/r/20210113090500.129644-22-hare@suse.de Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/initio.c')
-rw-r--r--drivers/scsi/initio.c64
1 files changed, 33 insertions, 31 deletions
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index ca16ef45d8dc..814acc57069d 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -1315,15 +1315,15 @@ static int initio_state_1(struct initio_host * host)
}
if ((active_tc->flags & (TCF_WDTR_DONE | TCF_NO_WDTR)) == 0) {
active_tc->flags |= TCF_WDTR_DONE;
- outb(MSG_EXTEND, host->addr + TUL_SFifo);
+ outb(EXTENDED_MESSAGE, host->addr + TUL_SFifo);
outb(2, host->addr + TUL_SFifo); /* Extended msg length */
- outb(3, host->addr + TUL_SFifo); /* Sync request */
+ outb(EXTENDED_SDTR, host->addr + TUL_SFifo); /* Sync request */
outb(1, host->addr + TUL_SFifo); /* Start from 16 bits */
} else if ((active_tc->flags & (TCF_SYNC_DONE | TCF_NO_SYNC_NEGO)) == 0) {
active_tc->flags |= TCF_SYNC_DONE;
- outb(MSG_EXTEND, host->addr + TUL_SFifo);
+ outb(EXTENDED_MESSAGE, host->addr + TUL_SFifo);
outb(3, host->addr + TUL_SFifo); /* extended msg length */
- outb(1, host->addr + TUL_SFifo); /* sync request */
+ outb(EXTENDED_SDTR, host->addr + TUL_SFifo); /* sync request */
outb(initio_rate_tbl[active_tc->flags & TCF_SCSI_RATE], host->addr + TUL_SFifo);
outb(MAX_OFFSET, host->addr + TUL_SFifo); /* REQ/ACK offset */
}
@@ -1409,16 +1409,16 @@ static int initio_state_3(struct initio_host * host)
case MSG_OUT: /* Message out phase */
if (active_tc->flags & (TCF_SYNC_DONE | TCF_NO_SYNC_NEGO)) {
- outb(MSG_NOP, host->addr + TUL_SFifo); /* msg nop */
+ outb(NOP, host->addr + TUL_SFifo); /* msg nop */
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
if (wait_tulip(host) == -1)
return -1;
} else {
active_tc->flags |= TCF_SYNC_DONE;
- outb(MSG_EXTEND, host->addr + TUL_SFifo);
+ outb(EXTENDED_MESSAGE, host->addr + TUL_SFifo);
outb(3, host->addr + TUL_SFifo); /* ext. msg len */
- outb(1, host->addr + TUL_SFifo); /* sync request */
+ outb(EXTENDED_SDTR, host->addr + TUL_SFifo); /* sync request */
outb(initio_rate_tbl[active_tc->flags & TCF_SCSI_RATE], host->addr + TUL_SFifo);
outb(MAX_OFFSET, host->addr + TUL_SFifo); /* REQ/ACK offset */
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
@@ -1479,7 +1479,7 @@ static int initio_state_4(struct initio_host * host)
return -1;
return 6;
} else {
- outb(MSG_NOP, host->addr + TUL_SFifo); /* msg nop */
+ outb(NOP, host->addr + TUL_SFifo); /* msg nop */
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
if (wait_tulip(host) == -1)
return -1;
@@ -1616,7 +1616,7 @@ static int initio_state_6(struct initio_host * host)
break;
case MSG_OUT: /* Message out phase */
- outb(MSG_NOP, host->addr + TUL_SFifo); /* msg nop */
+ outb(NOP, host->addr + TUL_SFifo); /* msg nop */
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
if (wait_tulip(host) == -1)
return -1;
@@ -1789,9 +1789,9 @@ int initio_status_msg(struct initio_host * host)
if (host->phase == MSG_OUT) {
if (host->jsstatus0 & TSS_PAR_ERROR)
- outb(MSG_PARITY, host->addr + TUL_SFifo);
+ outb(MSG_PARITY_ERROR, host->addr + TUL_SFifo);
else
- outb(MSG_NOP, host->addr + TUL_SFifo);
+ outb(NOP, host->addr + TUL_SFifo);
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
return wait_tulip(host);
}
@@ -1802,7 +1802,7 @@ int initio_status_msg(struct initio_host * host)
return -1;
if (host->phase != MSG_OUT)
return initio_bad_seq(host);
- outb(MSG_PARITY, host->addr + TUL_SFifo);
+ outb(MSG_PARITY_ERROR, host->addr + TUL_SFifo);
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
return wait_tulip(host);
}
@@ -1815,7 +1815,8 @@ int initio_status_msg(struct initio_host * host)
return initio_wait_done_disc(host);
}
- if (msg == MSG_LINK_COMP || msg == MSG_LINK_FLAG) {
+ if (msg == LINKED_CMD_COMPLETE ||
+ msg == LINKED_FLG_CMD_COMPLETE) {
if ((scb->tastat & 0x18) == 0x10)
return initio_msgin_accept(host);
}
@@ -1930,7 +1931,8 @@ int int_initio_resel(struct initio_host * host)
return -1;
msg = inb(host->addr + TUL_SFifo); /* Read Tag Message */
- if (msg < MSG_STAG || msg > MSG_OTAG) /* Is simple Tag */
+ if (msg < SIMPLE_QUEUE_TAG || msg > ORDERED_QUEUE_TAG)
+ /* Is simple Tag */
goto no_tag;
if (initio_msgin_accept(host) == -1)
@@ -2010,7 +2012,7 @@ static int initio_msgout_abort_targ(struct initio_host * host)
if (host->phase != MSG_OUT)
return initio_bad_seq(host);
- outb(MSG_ABORT, host->addr + TUL_SFifo);
+ outb(ABORT_TASK_SET, host->addr + TUL_SFifo);
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
return initio_wait_disc(host);
@@ -2033,7 +2035,7 @@ static int initio_msgout_abort_tag(struct initio_host * host)
if (host->phase != MSG_OUT)
return initio_bad_seq(host);
- outb(MSG_ABORT_TAG, host->addr + TUL_SFifo);
+ outb(ABORT_TASK, host->addr + TUL_SFifo);
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
return initio_wait_disc(host);
@@ -2059,15 +2061,15 @@ static int initio_msgin(struct initio_host * host)
return -1;
switch (inb(host->addr + TUL_SFifo)) {
- case MSG_DISC: /* Disconnect msg */
+ case DISCONNECT: /* Disconnect msg */
outb(TSC_MSG_ACCEPT, host->addr + TUL_SCmd);
return initio_wait_disc(host);
- case MSG_SDP:
- case MSG_RESTORE:
- case MSG_NOP:
+ case SAVE_POINTERS:
+ case RESTORE_POINTERS:
+ case NOP:
initio_msgin_accept(host);
break;
- case MSG_REJ: /* Clear ATN first */
+ case MESSAGE_REJECT: /* Clear ATN first */
outb((inb(host->addr + TUL_SSignal) & (TSC_SET_ACK | 7)),
host->addr + TUL_SSignal);
active_tc = host->active_tc;
@@ -2076,13 +2078,13 @@ static int initio_msgin(struct initio_host * host)
host->addr + TUL_SSignal);
initio_msgin_accept(host);
break;
- case MSG_EXTEND: /* extended msg */
+ case EXTENDED_MESSAGE: /* extended msg */
initio_msgin_extend(host);
break;
- case MSG_IGNOREWIDE:
+ case IGNORE_WIDE_RESIDUE:
initio_msgin_accept(host);
break;
- case MSG_COMP:
+ case COMMAND_COMPLETE:
outb(TSC_FLUSH_FIFO, host->addr + TUL_SCtrl0);
outb(TSC_MSG_ACCEPT, host->addr + TUL_SCmd);
return initio_wait_done_disc(host);
@@ -2104,7 +2106,7 @@ static int initio_msgout_reject(struct initio_host * host)
return -1;
if (host->phase == MSG_OUT) {
- outb(MSG_REJ, host->addr + TUL_SFifo); /* Msg reject */
+ outb(MESSAGE_REJECT, host->addr + TUL_SFifo); /* Msg reject */
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
return wait_tulip(host);
}
@@ -2113,7 +2115,7 @@ static int initio_msgout_reject(struct initio_host * host)
static int initio_msgout_ide(struct initio_host * host)
{
- outb(MSG_IDE, host->addr + TUL_SFifo); /* Initiator Detected Error */
+ outb(INITIATOR_ERROR, host->addr + TUL_SFifo); /* Initiator Detected Error */
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
return wait_tulip(host);
}
@@ -2167,9 +2169,9 @@ static int initio_msgin_extend(struct initio_host * host)
initio_sync_done(host);
- outb(MSG_EXTEND, host->addr + TUL_SFifo);
+ outb(EXTENDED_MESSAGE, host->addr + TUL_SFifo);
outb(3, host->addr + TUL_SFifo);
- outb(1, host->addr + TUL_SFifo);
+ outb(EXTENDED_SDTR, host->addr + TUL_SFifo);
outb(host->msg[2], host->addr + TUL_SFifo);
outb(host->msg[3], host->addr + TUL_SFifo);
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
@@ -2199,9 +2201,9 @@ static int initio_msgin_extend(struct initio_host * host)
if (initio_msgin_accept(host) != MSG_OUT)
return host->phase;
/* WDTR msg out */
- outb(MSG_EXTEND, host->addr + TUL_SFifo);
+ outb(EXTENDED_MESSAGE, host->addr + TUL_SFifo);
outb(2, host->addr + TUL_SFifo);
- outb(3, host->addr + TUL_SFifo);
+ outb(EXTENDED_WDTR, host->addr + TUL_SFifo);
outb(host->msg[2], host->addr + TUL_SFifo);
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
return wait_tulip(host);
@@ -2391,7 +2393,7 @@ int initio_bus_device_reset(struct initio_host * host)
}
tmp = tmp->next;
}
- outb(MSG_DEVRST, host->addr + TUL_SFifo);
+ outb(TARGET_RESET, host->addr + TUL_SFifo);
outb(TSC_XF_FIFO_OUT, host->addr + TUL_SCmd);
return initio_wait_disc(host);