Commit 9c2d2670 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: dc395x: Drop internal SCSI message definitions

Drop the internal SCSI message definitions and use the functions provided
by the SPI transport class.

Link: https://lore.kernel.org/r/20210113090500.129644-21-hare@suse.deReported-by: default avatarkernel test robot <lkp@intel.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d8cd784f
...@@ -1168,6 +1168,7 @@ config SCSI_SIM710 ...@@ -1168,6 +1168,7 @@ config SCSI_SIM710
config SCSI_DC395x config SCSI_DC395x
tristate "Tekram DC395(U/UW/F) and DC315(U) SCSI support" tristate "Tekram DC395(U/UW/F) and DC315(U) SCSI support"
depends on PCI && SCSI depends on PCI && SCSI
select SCSI_SPI_ATTRS
help help
This driver supports PCI SCSI host adapters based on the ASIC This driver supports PCI SCSI host adapters based on the ASIC
TRM-S1040 chip, e.g Tekram DC395(U/UW/F) and DC315(U) variants. TRM-S1040 chip, e.g Tekram DC395(U/UW/F) and DC315(U) variants.
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include <scsi/scsi_cmnd.h> #include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h> #include <scsi/scsi_device.h>
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <scsi/scsi_transport_spi.h>
#include "dc395x.h" #include "dc395x.h"
...@@ -1281,12 +1282,8 @@ static void build_sdtr(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, ...@@ -1281,12 +1282,8 @@ static void build_sdtr(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
} else if (dcb->sync_offset == 0) } else if (dcb->sync_offset == 0)
dcb->sync_offset = SYNC_NEGO_OFFSET; dcb->sync_offset = SYNC_NEGO_OFFSET;
*ptr++ = MSG_EXTENDED; /* (01h) */ srb->msg_count += spi_populate_sync_msg(ptr, dcb->min_nego_period,
*ptr++ = 3; /* length */ dcb->sync_offset);
*ptr++ = EXTENDED_SDTR; /* (01h) */
*ptr++ = dcb->min_nego_period; /* Transfer period (in 4ns) */
*ptr++ = dcb->sync_offset; /* Transfer period (max. REQ/ACK dist) */
srb->msg_count += 5;
srb->state |= SRB_DO_SYNC_NEGO; srb->state |= SRB_DO_SYNC_NEGO;
} }
...@@ -1305,11 +1302,7 @@ static void build_wdtr(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, ...@@ -1305,11 +1302,7 @@ static void build_wdtr(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
srb->msgout_buf[1]); srb->msgout_buf[1]);
return; return;
} }
*ptr++ = MSG_EXTENDED; /* (01h) */ srb->msg_count += spi_populate_width_msg(ptr, wide);
*ptr++ = 2; /* length */
*ptr++ = EXTENDED_WDTR; /* (03h) */
*ptr++ = wide;
srb->msg_count += 4;
srb->state |= SRB_DO_WIDE_NEGO; srb->state |= SRB_DO_WIDE_NEGO;
} }
...@@ -1476,7 +1469,7 @@ static u8 start_scsi(struct AdapterCtlBlk* acb, struct DeviceCtlBlk* dcb, ...@@ -1476,7 +1469,7 @@ static u8 start_scsi(struct AdapterCtlBlk* acb, struct DeviceCtlBlk* dcb,
return 1; return 1;
} }
/* Send Tag id */ /* Send Tag id */
DC395x_write8(acb, TRM_S1040_SCSI_FIFO, MSG_SIMPLE_QTAG); DC395x_write8(acb, TRM_S1040_SCSI_FIFO, SIMPLE_QUEUE_TAG);
DC395x_write8(acb, TRM_S1040_SCSI_FIFO, tag_number); DC395x_write8(acb, TRM_S1040_SCSI_FIFO, tag_number);
dcb->tag_mask |= tag_mask; dcb->tag_mask |= tag_mask;
srb->tag_number = tag_number; srb->tag_number = tag_number;
...@@ -1732,8 +1725,9 @@ static void msgout_phase1(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb, ...@@ -1732,8 +1725,9 @@ static void msgout_phase1(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
if (!srb->msg_count) { if (!srb->msg_count) {
dprintkdbg(DBG_0, "msgout_phase1: (0x%p) NOP msg\n", dprintkdbg(DBG_0, "msgout_phase1: (0x%p) NOP msg\n",
srb->cmd); srb->cmd);
DC395x_write8(acb, TRM_S1040_SCSI_FIFO, MSG_NOP); DC395x_write8(acb, TRM_S1040_SCSI_FIFO, NOP);
DC395x_write16(acb, TRM_S1040_SCSI_CONTROL, DO_DATALATCH); /* it's important for atn stop */ DC395x_write16(acb, TRM_S1040_SCSI_CONTROL, DO_DATALATCH);
/* it's important for atn stop */
DC395x_write8(acb, TRM_S1040_SCSI_COMMAND, SCMD_FIFO_OUT); DC395x_write8(acb, TRM_S1040_SCSI_COMMAND, SCMD_FIFO_OUT);
return; return;
} }
...@@ -1741,7 +1735,7 @@ static void msgout_phase1(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb, ...@@ -1741,7 +1735,7 @@ static void msgout_phase1(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
for (i = 0; i < srb->msg_count; i++) for (i = 0; i < srb->msg_count; i++)
DC395x_write8(acb, TRM_S1040_SCSI_FIFO, *ptr++); DC395x_write8(acb, TRM_S1040_SCSI_FIFO, *ptr++);
srb->msg_count = 0; srb->msg_count = 0;
if (srb->msgout_buf[0] == MSG_ABORT) if (srb->msgout_buf[0] == ABORT_TASK_SET)
srb->state = SRB_ABORT_SENT; srb->state = SRB_ABORT_SENT;
DC395x_write8(acb, TRM_S1040_SCSI_COMMAND, SCMD_FIFO_OUT); DC395x_write8(acb, TRM_S1040_SCSI_COMMAND, SCMD_FIFO_OUT);
...@@ -2538,7 +2532,7 @@ static struct ScsiReqBlk *msgin_qtag(struct AdapterCtlBlk *acb, ...@@ -2538,7 +2532,7 @@ static struct ScsiReqBlk *msgin_qtag(struct AdapterCtlBlk *acb,
srb = acb->tmp_srb; srb = acb->tmp_srb;
srb->state = SRB_UNEXPECT_RESEL; srb->state = SRB_UNEXPECT_RESEL;
dcb->active_srb = srb; dcb->active_srb = srb;
srb->msgout_buf[0] = MSG_ABORT_TAG; srb->msgout_buf[0] = ABORT_TASK;
srb->msg_count = 1; srb->msg_count = 1;
DC395x_ENABLE_MSGOUT; DC395x_ENABLE_MSGOUT;
dprintkl(KERN_DEBUG, "msgin_qtag: Unknown tag %i - abort\n", tag); dprintkl(KERN_DEBUG, "msgin_qtag: Unknown tag %i - abort\n", tag);
...@@ -2780,7 +2774,7 @@ static void msgin_phase0(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb, ...@@ -2780,7 +2774,7 @@ static void msgin_phase0(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
msgin_reject(acb, srb); msgin_reject(acb, srb);
break; break;
case MSG_IGNOREWIDE: case IGNORE_WIDE_RESIDUE:
/* Discard wide residual */ /* Discard wide residual */
dprintkdbg(DBG_0, "msgin_phase0: Ignore Wide Residual!\n"); dprintkdbg(DBG_0, "msgin_phase0: Ignore Wide Residual!\n");
break; break;
......
...@@ -172,28 +172,6 @@ ...@@ -172,28 +172,6 @@
#define SYNC_NEGO_OFFSET 15 #define SYNC_NEGO_OFFSET 15
/* SCSI MSG BYTE */
#define MSG_COMPLETE 0x00
#define MSG_EXTENDED 0x01
#define MSG_SAVE_PTR 0x02
#define MSG_RESTORE_PTR 0x03
#define MSG_DISCONNECT 0x04
#define MSG_INITIATOR_ERROR 0x05
#define MSG_ABORT 0x06
#define MSG_REJECT_ 0x07
#define MSG_NOP 0x08
#define MSG_PARITY_ERROR 0x09
#define MSG_LINK_CMD_COMPL 0x0A
#define MSG_LINK_CMD_COMPL_FLG 0x0B
#define MSG_BUS_RESET 0x0C
#define MSG_ABORT_TAG 0x0D
#define MSG_SIMPLE_QTAG 0x20
#define MSG_HEAD_QTAG 0x21
#define MSG_ORDER_QTAG 0x22
#define MSG_IGNOREWIDE 0x23
#define MSG_IDENTIFY 0x80
#define MSG_HOST_ID 0xC0
/* cmd->result */ /* cmd->result */
#define STATUS_MASK_ 0xFF #define STATUS_MASK_ 0xFF
#define MSG_MASK 0xFF00 #define MSG_MASK 0xFF00
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment