Skip to content

Commit

Permalink
scsi: nsp_cs: Drop internal SCSI message definition
Browse files Browse the repository at this point in the history
Use the standard SCSI message definitions instead of the driver-internal
ones.

Link: https://lore.kernel.org/r/20210113090500.129644-19-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>
  • Loading branch information
Hannes Reinecke authored and Martin K. Petersen committed Jan 23, 2021
1 parent 8959e81 commit 1c9eb79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
12 changes: 6 additions & 6 deletions drivers/scsi/pcmcia/nsp_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ static irqreturn_t nspintr(int irq, void *dev_id)
//*sync_neg = SYNC_NOT_YET;

/* all command complete and return status */
if (tmpSC->SCp.Message == MSG_COMMAND_COMPLETE) {
if (tmpSC->SCp.Message == COMMAND_COMPLETE) {
tmpSC->result = (DID_OK << 16) |
((tmpSC->SCp.Message & 0xff) << 8) |
((tmpSC->SCp.Status & 0xff) << 0);
Expand Down Expand Up @@ -1226,9 +1226,9 @@ static irqreturn_t nspintr(int irq, void *dev_id)
data->Sync[target].SyncOffset = 0;

/**/
data->MsgBuffer[i] = MSG_EXTENDED; i++;
data->MsgBuffer[i] = EXTENDED_MESSAGE; i++;
data->MsgBuffer[i] = 3; i++;
data->MsgBuffer[i] = MSG_EXT_SDTR; i++;
data->MsgBuffer[i] = EXTENDED_SDTR; i++;
data->MsgBuffer[i] = 0x0c; i++;
data->MsgBuffer[i] = 15; i++;
/**/
Expand All @@ -1255,9 +1255,9 @@ static irqreturn_t nspintr(int irq, void *dev_id)
//nsp_dbg(NSP_DEBUG_INTR, "sync target=%d,lun=%d",target,lun);

if (data->MsgLen >= 5 &&
data->MsgBuffer[0] == MSG_EXTENDED &&
data->MsgBuffer[0] == EXTENDED_MESSAGE &&
data->MsgBuffer[1] == 3 &&
data->MsgBuffer[2] == MSG_EXT_SDTR ) {
data->MsgBuffer[2] == EXTENDED_SDTR ) {
data->Sync[target].SyncPeriod = data->MsgBuffer[3];
data->Sync[target].SyncOffset = data->MsgBuffer[4];
//nsp_dbg(NSP_DEBUG_INTR, "sync ok, %d %d", data->MsgBuffer[3], data->MsgBuffer[4]);
Expand All @@ -1275,7 +1275,7 @@ static irqreturn_t nspintr(int irq, void *dev_id)
tmp = -1;
for (i = 0; i < data->MsgLen; i++) {
tmp = data->MsgBuffer[i];
if (data->MsgBuffer[i] == MSG_EXTENDED) {
if (data->MsgBuffer[i] == EXTENDED_MESSAGE) {
i += (1 + data->MsgBuffer[i+1]);
}
}
Expand Down
11 changes: 0 additions & 11 deletions drivers/scsi/pcmcia/nsp_cs.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,17 +370,6 @@ enum _burst_mode {
BURST_MEM32 = 2,
};

/**************************************************************************
* SCSI messaage
*/
#define MSG_COMMAND_COMPLETE 0x00
#define MSG_EXTENDED 0x01
#define MSG_ABORT 0x06
#define MSG_NO_OPERATION 0x08
#define MSG_BUS_DEVICE_RESET 0x0c

#define MSG_EXT_SDTR 0x01

/* scatter-gather table */
# define BUFFER_ADDR ((char *)((sg_virt(SCpnt->SCp.buffer))))

Expand Down

0 comments on commit 1c9eb79

Please sign in to comment.