提交 bc06cffd 编写于 作者: L Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (166 commits)
  [SCSI] ibmvscsi: convert to use the data buffer accessors
  [SCSI] dc395x: convert to use the data buffer accessors
  [SCSI] ncr53c8xx: convert to use the data buffer accessors
  [SCSI] sym53c8xx: convert to use the data buffer accessors
  [SCSI] ppa: coding police and printk levels
  [SCSI] aic7xxx_old: remove redundant GFP_ATOMIC from kmalloc
  [SCSI] i2o: remove redundant GFP_ATOMIC from kmalloc from device.c
  [SCSI] remove the dead CYBERSTORMIII_SCSI option
  [SCSI] don't build scsi_dma_{map,unmap} for !HAS_DMA
  [SCSI] Clean up scsi_add_lun a bit
  [SCSI] 53c700: Remove printk, which triggers because of low scsi clock on SNI RMs
  [SCSI] sni_53c710: Cleanup
  [SCSI] qla4xxx: Fix underrun/overrun conditions
  [SCSI] megaraid_mbox: use mutex instead of semaphore
  [SCSI] aacraid: add 51245, 51645 and 52245 adapters to documentation.
  [SCSI] qla2xxx: update version to 8.02.00-k1.
  [SCSI] qla2xxx: add support for NPIV
  [SCSI] stex: use resid for xfer len information
  [SCSI] Add Brownie 1200U3P to blacklist
  [SCSI] scsi.c: convert to use the data buffer accessors
  ...
...@@ -50,6 +50,9 @@ Supported Cards/Chipsets ...@@ -50,6 +50,9 @@ Supported Cards/Chipsets
9005:0285:9005:02be Adaptec 31605 (Marauder160) 9005:0285:9005:02be Adaptec 31605 (Marauder160)
9005:0285:9005:02c3 Adaptec 51205 (Voodoo120) 9005:0285:9005:02c3 Adaptec 51205 (Voodoo120)
9005:0285:9005:02c4 Adaptec 51605 (Voodoo160) 9005:0285:9005:02c4 Adaptec 51605 (Voodoo160)
9005:0285:9005:02ce Adaptec 51245 (Voodoo124)
9005:0285:9005:02cf Adaptec 51645 (Voodoo164)
9005:0285:9005:02d0 Adaptec 52445 (Voodoo244)
1011:0046:9005:0364 Adaptec 5400S (Mustang) 1011:0046:9005:0364 Adaptec 5400S (Mustang)
9005:0287:9005:0800 Adaptec Themisto (Jupiter) 9005:0287:9005:0800 Adaptec Themisto (Jupiter)
9005:0200:9005:0200 Adaptec Themisto (Jupiter) 9005:0200:9005:0200 Adaptec Themisto (Jupiter)
......
此差异已折叠。
...@@ -555,7 +555,6 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag) ...@@ -555,7 +555,6 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag)
{ {
struct scsi_cmnd *cmd; struct scsi_cmnd *cmd;
ctlr_info_t *ctlr; ctlr_info_t *ctlr;
u64bit addr64;
ErrorInfo_struct *ei; ErrorInfo_struct *ei;
ei = cp->err_info; ei = cp->err_info;
...@@ -569,20 +568,7 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag) ...@@ -569,20 +568,7 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag)
cmd = (struct scsi_cmnd *) cp->scsi_cmd; cmd = (struct scsi_cmnd *) cp->scsi_cmd;
ctlr = hba[cp->ctlr]; ctlr = hba[cp->ctlr];
/* undo the DMA mappings */ scsi_dma_unmap(cmd);
if (cmd->use_sg) {
pci_unmap_sg(ctlr->pdev,
cmd->request_buffer, cmd->use_sg,
cmd->sc_data_direction);
}
else if (cmd->request_bufflen) {
addr64.val32.lower = cp->SG[0].Addr.lower;
addr64.val32.upper = cp->SG[0].Addr.upper;
pci_unmap_single(ctlr->pdev, (dma_addr_t) addr64.val,
cmd->request_bufflen,
cmd->sc_data_direction);
}
cmd->result = (DID_OK << 16); /* host byte */ cmd->result = (DID_OK << 16); /* host byte */
cmd->result |= (COMMAND_COMPLETE << 8); /* msg byte */ cmd->result |= (COMMAND_COMPLETE << 8); /* msg byte */
...@@ -597,7 +583,7 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag) ...@@ -597,7 +583,7 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag)
ei->SenseLen > SCSI_SENSE_BUFFERSIZE ? ei->SenseLen > SCSI_SENSE_BUFFERSIZE ?
SCSI_SENSE_BUFFERSIZE : SCSI_SENSE_BUFFERSIZE :
ei->SenseLen); ei->SenseLen);
cmd->resid = ei->ResidualCnt; scsi_set_resid(cmd, ei->ResidualCnt);
if(ei->CommandStatus != 0) if(ei->CommandStatus != 0)
{ /* an error has occurred */ { /* an error has occurred */
...@@ -1204,46 +1190,29 @@ cciss_scatter_gather(struct pci_dev *pdev, ...@@ -1204,46 +1190,29 @@ cciss_scatter_gather(struct pci_dev *pdev,
CommandList_struct *cp, CommandList_struct *cp,
struct scsi_cmnd *cmd) struct scsi_cmnd *cmd)
{ {
unsigned int use_sg, nsegs=0, len; unsigned int len;
struct scatterlist *scatter = (struct scatterlist *) cmd->request_buffer; struct scatterlist *sg;
__u64 addr64; __u64 addr64;
int use_sg, i;
/* is it just one virtual address? */
if (!cmd->use_sg) { BUG_ON(scsi_sg_count(cmd) > MAXSGENTRIES);
if (cmd->request_bufflen) { /* anything to xfer? */
use_sg = scsi_dma_map(cmd);
addr64 = (__u64) pci_map_single(pdev, if (use_sg) { /* not too many addrs? */
cmd->request_buffer, scsi_for_each_sg(cmd, sg, use_sg, i) {
cmd->request_bufflen, addr64 = (__u64) sg_dma_address(sg);
cmd->sc_data_direction); len = sg_dma_len(sg);
cp->SG[i].Addr.lower =
cp->SG[0].Addr.lower = (__u32) (addr64 & (__u64) 0x00000000FFFFFFFF);
(__u32) (addr64 & (__u64) 0x00000000FFFFFFFF); cp->SG[i].Addr.upper =
cp->SG[0].Addr.upper = (__u32) ((addr64 >> 32) & (__u64) 0x00000000FFFFFFFF);
(__u32) ((addr64 >> 32) & (__u64) 0x00000000FFFFFFFF); cp->SG[i].Len = len;
cp->SG[0].Len = cmd->request_bufflen; cp->SG[i].Ext = 0; // we are not chaining
nsegs=1;
}
} /* else, must be a list of virtual addresses.... */
else if (cmd->use_sg <= MAXSGENTRIES) { /* not too many addrs? */
use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg,
cmd->sc_data_direction);
for (nsegs=0; nsegs < use_sg; nsegs++) {
addr64 = (__u64) sg_dma_address(&scatter[nsegs]);
len = sg_dma_len(&scatter[nsegs]);
cp->SG[nsegs].Addr.lower =
(__u32) (addr64 & (__u64) 0x00000000FFFFFFFF);
cp->SG[nsegs].Addr.upper =
(__u32) ((addr64 >> 32) & (__u64) 0x00000000FFFFFFFF);
cp->SG[nsegs].Len = len;
cp->SG[nsegs].Ext = 0; // we are not chaining
} }
} else BUG(); }
cp->Header.SGList = (__u8) nsegs; /* no. SGs contig in this cmd */ cp->Header.SGList = (__u8) use_sg; /* no. SGs contig in this cmd */
cp->Header.SGTotal = (__u16) nsegs; /* total sgs in this cmd list */ cp->Header.SGTotal = (__u16) use_sg; /* total sgs in this cmd list */
return; return;
} }
......
...@@ -1509,69 +1509,6 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb, ...@@ -1509,69 +1509,6 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
} }
} }
static void sbp2_prep_command_orb_no_sg(struct sbp2_command_orb *orb,
struct sbp2_fwhost_info *hi,
struct sbp2_command_info *cmd,
struct scatterlist *sgpnt,
u32 orb_direction,
unsigned int scsi_request_bufflen,
void *scsi_request_buffer,
enum dma_data_direction dma_dir)
{
cmd->dma_dir = dma_dir;
cmd->dma_size = scsi_request_bufflen;
cmd->dma_type = CMD_DMA_SINGLE;
cmd->cmd_dma = dma_map_single(hi->host->device.parent,
scsi_request_buffer,
cmd->dma_size, cmd->dma_dir);
orb->data_descriptor_hi = ORB_SET_NODE_ID(hi->host->node_id);
orb->misc |= ORB_SET_DIRECTION(orb_direction);
/* handle case where we get a command w/o s/g enabled
* (but check for transfers larger than 64K) */
if (scsi_request_bufflen <= SBP2_MAX_SG_ELEMENT_LENGTH) {
orb->data_descriptor_lo = cmd->cmd_dma;
orb->misc |= ORB_SET_DATA_SIZE(scsi_request_bufflen);
} else {
/* The buffer is too large. Turn this into page tables. */
struct sbp2_unrestricted_page_table *sg_element =
&cmd->scatter_gather_element[0];
u32 sg_count, sg_len;
dma_addr_t sg_addr;
orb->data_descriptor_lo = cmd->sge_dma;
orb->misc |= ORB_SET_PAGE_TABLE_PRESENT(0x1);
/* fill out our SBP-2 page tables; split up the large buffer */
sg_count = 0;
sg_len = scsi_request_bufflen;
sg_addr = cmd->cmd_dma;
while (sg_len) {
sg_element[sg_count].segment_base_lo = sg_addr;
if (sg_len > SBP2_MAX_SG_ELEMENT_LENGTH) {
sg_element[sg_count].length_segment_base_hi =
PAGE_TABLE_SET_SEGMENT_LENGTH(SBP2_MAX_SG_ELEMENT_LENGTH);
sg_addr += SBP2_MAX_SG_ELEMENT_LENGTH;
sg_len -= SBP2_MAX_SG_ELEMENT_LENGTH;
} else {
sg_element[sg_count].length_segment_base_hi =
PAGE_TABLE_SET_SEGMENT_LENGTH(sg_len);
sg_len = 0;
}
sg_count++;
}
orb->misc |= ORB_SET_DATA_SIZE(sg_count);
sbp2util_cpu_to_be32_buffer(sg_element,
(sizeof(struct sbp2_unrestricted_page_table)) *
sg_count);
}
}
static void sbp2_create_command_orb(struct sbp2_lu *lu, static void sbp2_create_command_orb(struct sbp2_lu *lu,
struct sbp2_command_info *cmd, struct sbp2_command_info *cmd,
unchar *scsi_cmd, unchar *scsi_cmd,
...@@ -1615,13 +1552,9 @@ static void sbp2_create_command_orb(struct sbp2_lu *lu, ...@@ -1615,13 +1552,9 @@ static void sbp2_create_command_orb(struct sbp2_lu *lu,
orb->data_descriptor_hi = 0x0; orb->data_descriptor_hi = 0x0;
orb->data_descriptor_lo = 0x0; orb->data_descriptor_lo = 0x0;
orb->misc |= ORB_SET_DIRECTION(1); orb->misc |= ORB_SET_DIRECTION(1);
} else if (scsi_use_sg) } else
sbp2_prep_command_orb_sg(orb, hi, cmd, scsi_use_sg, sgpnt, sbp2_prep_command_orb_sg(orb, hi, cmd, scsi_use_sg, sgpnt,
orb_direction, dma_dir); orb_direction, dma_dir);
else
sbp2_prep_command_orb_no_sg(orb, hi, cmd, sgpnt, orb_direction,
scsi_request_bufflen,
scsi_request_buffer, dma_dir);
sbp2util_cpu_to_be32_buffer(orb, sizeof(*orb)); sbp2util_cpu_to_be32_buffer(orb, sizeof(*orb));
...@@ -1710,15 +1643,15 @@ static int sbp2_send_command(struct sbp2_lu *lu, struct scsi_cmnd *SCpnt, ...@@ -1710,15 +1643,15 @@ static int sbp2_send_command(struct sbp2_lu *lu, struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *)) void (*done)(struct scsi_cmnd *))
{ {
unchar *scsi_cmd = (unchar *)SCpnt->cmnd; unchar *scsi_cmd = (unchar *)SCpnt->cmnd;
unsigned int request_bufflen = SCpnt->request_bufflen; unsigned int request_bufflen = scsi_bufflen(SCpnt);
struct sbp2_command_info *cmd; struct sbp2_command_info *cmd;
cmd = sbp2util_allocate_command_orb(lu, SCpnt, done); cmd = sbp2util_allocate_command_orb(lu, SCpnt, done);
if (!cmd) if (!cmd)
return -EIO; return -EIO;
sbp2_create_command_orb(lu, cmd, scsi_cmd, SCpnt->use_sg, sbp2_create_command_orb(lu, cmd, scsi_cmd, scsi_sg_count(SCpnt),
request_bufflen, SCpnt->request_buffer, request_bufflen, scsi_sglist(SCpnt),
SCpnt->sc_data_direction); SCpnt->sc_data_direction);
sbp2_link_orb_command(lu, cmd); sbp2_link_orb_command(lu, cmd);
......
...@@ -134,19 +134,9 @@ iscsi_iser_cmd_init(struct iscsi_cmd_task *ctask) ...@@ -134,19 +134,9 @@ iscsi_iser_cmd_init(struct iscsi_cmd_task *ctask)
{ {
struct iscsi_iser_conn *iser_conn = ctask->conn->dd_data; struct iscsi_iser_conn *iser_conn = ctask->conn->dd_data;
struct iscsi_iser_cmd_task *iser_ctask = ctask->dd_data; struct iscsi_iser_cmd_task *iser_ctask = ctask->dd_data;
struct scsi_cmnd *sc = ctask->sc;
iser_ctask->command_sent = 0; iser_ctask->command_sent = 0;
iser_ctask->iser_conn = iser_conn; iser_ctask->iser_conn = iser_conn;
if (sc->sc_data_direction == DMA_TO_DEVICE) {
BUG_ON(ctask->total_length == 0);
debug_scsi("cmd [itt %x total %d imm %d unsol_data %d\n",
ctask->itt, ctask->total_length, ctask->imm_count,
ctask->unsol_count);
}
iser_ctask_rdma_init(iser_ctask); iser_ctask_rdma_init(iser_ctask);
} }
...@@ -219,6 +209,14 @@ iscsi_iser_ctask_xmit(struct iscsi_conn *conn, ...@@ -219,6 +209,14 @@ iscsi_iser_ctask_xmit(struct iscsi_conn *conn,
struct iscsi_iser_cmd_task *iser_ctask = ctask->dd_data; struct iscsi_iser_cmd_task *iser_ctask = ctask->dd_data;
int error = 0; int error = 0;
if (ctask->sc->sc_data_direction == DMA_TO_DEVICE) {
BUG_ON(scsi_bufflen(ctask->sc) == 0);
debug_scsi("cmd [itt %x total %d imm %d unsol_data %d\n",
ctask->itt, scsi_bufflen(ctask->sc),
ctask->imm_count, ctask->unsol_count);
}
debug_scsi("ctask deq [cid %d itt 0x%x]\n", debug_scsi("ctask deq [cid %d itt 0x%x]\n",
conn->id, ctask->itt); conn->id, ctask->itt);
...@@ -375,7 +373,8 @@ static struct iscsi_transport iscsi_iser_transport; ...@@ -375,7 +373,8 @@ static struct iscsi_transport iscsi_iser_transport;
static struct iscsi_cls_session * static struct iscsi_cls_session *
iscsi_iser_session_create(struct iscsi_transport *iscsit, iscsi_iser_session_create(struct iscsi_transport *iscsit,
struct scsi_transport_template *scsit, struct scsi_transport_template *scsit,
uint32_t initial_cmdsn, uint32_t *hostno) uint16_t cmds_max, uint16_t qdepth,
uint32_t initial_cmdsn, uint32_t *hostno)
{ {
struct iscsi_cls_session *cls_session; struct iscsi_cls_session *cls_session;
struct iscsi_session *session; struct iscsi_session *session;
...@@ -386,7 +385,13 @@ iscsi_iser_session_create(struct iscsi_transport *iscsit, ...@@ -386,7 +385,13 @@ iscsi_iser_session_create(struct iscsi_transport *iscsit,
struct iscsi_iser_cmd_task *iser_ctask; struct iscsi_iser_cmd_task *iser_ctask;
struct iser_desc *desc; struct iser_desc *desc;
/*
* we do not support setting can_queue cmd_per_lun from userspace yet
* because we preallocate so many resources
*/
cls_session = iscsi_session_setup(iscsit, scsit, cls_session = iscsi_session_setup(iscsit, scsit,
ISCSI_DEF_XMIT_CMDS_MAX,
ISCSI_MAX_CMD_PER_LUN,
sizeof(struct iscsi_iser_cmd_task), sizeof(struct iscsi_iser_cmd_task),
sizeof(struct iser_desc), sizeof(struct iser_desc),
initial_cmdsn, &hn); initial_cmdsn, &hn);
...@@ -545,7 +550,7 @@ iscsi_iser_ep_disconnect(__u64 ep_handle) ...@@ -545,7 +550,7 @@ iscsi_iser_ep_disconnect(__u64 ep_handle)
static struct scsi_host_template iscsi_iser_sht = { static struct scsi_host_template iscsi_iser_sht = {
.name = "iSCSI Initiator over iSER, v." DRV_VER, .name = "iSCSI Initiator over iSER, v." DRV_VER,
.queuecommand = iscsi_queuecommand, .queuecommand = iscsi_queuecommand,
.can_queue = ISCSI_XMIT_CMDS_MAX - 1, .can_queue = ISCSI_DEF_XMIT_CMDS_MAX - 1,
.sg_tablesize = ISCSI_ISER_SG_TABLESIZE, .sg_tablesize = ISCSI_ISER_SG_TABLESIZE,
.max_sectors = 1024, .max_sectors = 1024,
.cmd_per_lun = ISCSI_MAX_CMD_PER_LUN, .cmd_per_lun = ISCSI_MAX_CMD_PER_LUN,
...@@ -574,8 +579,12 @@ static struct iscsi_transport iscsi_iser_transport = { ...@@ -574,8 +579,12 @@ static struct iscsi_transport iscsi_iser_transport = {
ISCSI_EXP_STATSN | ISCSI_EXP_STATSN |
ISCSI_PERSISTENT_PORT | ISCSI_PERSISTENT_PORT |
ISCSI_PERSISTENT_ADDRESS | ISCSI_PERSISTENT_ADDRESS |
ISCSI_TARGET_NAME | ISCSI_TARGET_NAME | ISCSI_TPGT |
ISCSI_TPGT, ISCSI_USERNAME | ISCSI_PASSWORD |
ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN,
.host_param_mask = ISCSI_HOST_HWADDRESS |
ISCSI_HOST_NETDEV_NAME |
ISCSI_HOST_INITIATOR_NAME,
.host_template = &iscsi_iser_sht, .host_template = &iscsi_iser_sht,
.conndata_size = sizeof(struct iscsi_conn), .conndata_size = sizeof(struct iscsi_conn),
.max_lun = ISCSI_ISER_MAX_LUN, .max_lun = ISCSI_ISER_MAX_LUN,
...@@ -592,6 +601,9 @@ static struct iscsi_transport iscsi_iser_transport = { ...@@ -592,6 +601,9 @@ static struct iscsi_transport iscsi_iser_transport = {
.get_session_param = iscsi_session_get_param, .get_session_param = iscsi_session_get_param,
.start_conn = iscsi_iser_conn_start, .start_conn = iscsi_iser_conn_start,
.stop_conn = iscsi_conn_stop, .stop_conn = iscsi_conn_stop,
/* iscsi host params */
.get_host_param = iscsi_host_get_param,
.set_host_param = iscsi_host_set_param,
/* IO */ /* IO */
.send_pdu = iscsi_conn_send_pdu, .send_pdu = iscsi_conn_send_pdu,
.get_stats = iscsi_iser_conn_get_stats, .get_stats = iscsi_iser_conn_get_stats,
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
#define ISER_MAX_TX_MISC_PDUS 6 /* NOOP_OUT(2), TEXT(1), * #define ISER_MAX_TX_MISC_PDUS 6 /* NOOP_OUT(2), TEXT(1), *
* SCSI_TMFUNC(2), LOGOUT(1) */ * SCSI_TMFUNC(2), LOGOUT(1) */
#define ISER_QP_MAX_RECV_DTOS (ISCSI_XMIT_CMDS_MAX + \ #define ISER_QP_MAX_RECV_DTOS (ISCSI_DEF_XMIT_CMDS_MAX + \
ISER_MAX_RX_MISC_PDUS + \ ISER_MAX_RX_MISC_PDUS + \
ISER_MAX_TX_MISC_PDUS) ISER_MAX_TX_MISC_PDUS)
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
#define ISER_INFLIGHT_DATAOUTS 8 #define ISER_INFLIGHT_DATAOUTS 8
#define ISER_QP_MAX_REQ_DTOS (ISCSI_XMIT_CMDS_MAX * \ #define ISER_QP_MAX_REQ_DTOS (ISCSI_DEF_XMIT_CMDS_MAX * \
(1 + ISER_INFLIGHT_DATAOUTS) + \ (1 + ISER_INFLIGHT_DATAOUTS) + \
ISER_MAX_TX_MISC_PDUS + \ ISER_MAX_TX_MISC_PDUS + \
ISER_MAX_RX_MISC_PDUS) ISER_MAX_RX_MISC_PDUS)
......
...@@ -351,18 +351,12 @@ int iser_send_command(struct iscsi_conn *conn, ...@@ -351,18 +351,12 @@ int iser_send_command(struct iscsi_conn *conn,
else else
data_buf = &iser_ctask->data[ISER_DIR_OUT]; data_buf = &iser_ctask->data[ISER_DIR_OUT];
if (sc->use_sg) { /* using a scatter list */ if (scsi_sg_count(sc)) { /* using a scatter list */
data_buf->buf = sc->request_buffer; data_buf->buf = scsi_sglist(sc);
data_buf->size = sc->use_sg; data_buf->size = scsi_sg_count(sc);
} else if (sc->request_bufflen) {
/* using a single buffer - convert it into one entry SG */
sg_init_one(&data_buf->sg_single,
sc->request_buffer, sc->request_bufflen);
data_buf->buf = &data_buf->sg_single;
data_buf->size = 1;
} }
data_buf->data_len = sc->request_bufflen; data_buf->data_len = scsi_bufflen(sc);
if (hdr->flags & ISCSI_FLAG_CMD_READ) { if (hdr->flags & ISCSI_FLAG_CMD_READ) {
err = iser_prepare_read_cmd(ctask, edtl); err = iser_prepare_read_cmd(ctask, edtl);
......
...@@ -155,8 +155,8 @@ static int iser_create_ib_conn_res(struct iser_conn *ib_conn) ...@@ -155,8 +155,8 @@ static int iser_create_ib_conn_res(struct iser_conn *ib_conn)
params.max_pages_per_fmr = ISCSI_ISER_SG_TABLESIZE + 1; params.max_pages_per_fmr = ISCSI_ISER_SG_TABLESIZE + 1;
/* make the pool size twice the max number of SCSI commands * /* make the pool size twice the max number of SCSI commands *
* the ML is expected to queue, watermark for unmap at 50% */ * the ML is expected to queue, watermark for unmap at 50% */
params.pool_size = ISCSI_XMIT_CMDS_MAX * 2; params.pool_size = ISCSI_DEF_XMIT_CMDS_MAX * 2;
params.dirty_watermark = ISCSI_XMIT_CMDS_MAX; params.dirty_watermark = ISCSI_DEF_XMIT_CMDS_MAX;
params.cache = 0; params.cache = 0;
params.flush_function = NULL; params.flush_function = NULL;
params.access = (IB_ACCESS_LOCAL_WRITE | params.access = (IB_ACCESS_LOCAL_WRITE |
......
...@@ -455,10 +455,7 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd, ...@@ -455,10 +455,7 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd,
struct srp_target_port *target, struct srp_target_port *target,
struct srp_request *req) struct srp_request *req)
{ {
struct scatterlist *scat; if (!scsi_sglist(scmnd) ||
int nents;
if (!scmnd->request_buffer ||
(scmnd->sc_data_direction != DMA_TO_DEVICE && (scmnd->sc_data_direction != DMA_TO_DEVICE &&
scmnd->sc_data_direction != DMA_FROM_DEVICE)) scmnd->sc_data_direction != DMA_FROM_DEVICE))
return; return;
...@@ -468,20 +465,8 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd, ...@@ -468,20 +465,8 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd,
req->fmr = NULL; req->fmr = NULL;
} }
/* ib_dma_unmap_sg(target->srp_host->dev->dev, scsi_sglist(scmnd),
* This handling of non-SG commands can be killed when the scsi_sg_count(scmnd), scmnd->sc_data_direction);
* SCSI midlayer no longer generates non-SG commands.
*/
if (likely(scmnd->use_sg)) {
nents = scmnd->use_sg;
scat = scmnd->request_buffer;
} else {
nents = 1;
scat = &req->fake_sg;
}
ib_dma_unmap_sg(target->srp_host->dev->dev, scat, nents,
scmnd->sc_data_direction);
} }
static void srp_remove_req(struct srp_target_port *target, struct srp_request *req) static void srp_remove_req(struct srp_target_port *target, struct srp_request *req)
...@@ -595,6 +580,7 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat, ...@@ -595,6 +580,7 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
int ret; int ret;
struct srp_device *dev = target->srp_host->dev; struct srp_device *dev = target->srp_host->dev;
struct ib_device *ibdev = dev->dev; struct ib_device *ibdev = dev->dev;
struct scatterlist *sg;
if (!dev->fmr_pool) if (!dev->fmr_pool)
return -ENODEV; return -ENODEV;
...@@ -604,16 +590,16 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat, ...@@ -604,16 +590,16 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
return -EINVAL; return -EINVAL;
len = page_cnt = 0; len = page_cnt = 0;
for (i = 0; i < sg_cnt; ++i) { scsi_for_each_sg(req->scmnd, sg, sg_cnt, i) {
unsigned int dma_len = ib_sg_dma_len(ibdev, &scat[i]); unsigned int dma_len = ib_sg_dma_len(ibdev, sg);
if (ib_sg_dma_address(ibdev, &scat[i]) & ~dev->fmr_page_mask) { if (ib_sg_dma_address(ibdev, sg) & ~dev->fmr_page_mask) {
if (i > 0) if (i > 0)
return -EINVAL; return -EINVAL;
else else
++page_cnt; ++page_cnt;
} }
if ((ib_sg_dma_address(ibdev, &scat[i]) + dma_len) & if ((ib_sg_dma_address(ibdev, sg) + dma_len) &
~dev->fmr_page_mask) { ~dev->fmr_page_mask) {
if (i < sg_cnt - 1) if (i < sg_cnt - 1)
return -EINVAL; return -EINVAL;
...@@ -633,12 +619,12 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat, ...@@ -633,12 +619,12 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
return -ENOMEM; return -ENOMEM;
page_cnt = 0; page_cnt = 0;
for (i = 0; i < sg_cnt; ++i) { scsi_for_each_sg(req->scmnd, sg, sg_cnt, i) {
unsigned int dma_len = ib_sg_dma_len(ibdev, &scat[i]); unsigned int dma_len = ib_sg_dma_len(ibdev, sg);
for (j = 0; j < dma_len; j += dev->fmr_page_size) for (j = 0; j < dma_len; j += dev->fmr_page_size)
dma_pages[page_cnt++] = dma_pages[page_cnt++] =
(ib_sg_dma_address(ibdev, &scat[i]) & (ib_sg_dma_address(ibdev, sg) &
dev->fmr_page_mask) + j; dev->fmr_page_mask) + j;
} }
...@@ -673,7 +659,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target, ...@@ -673,7 +659,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
struct srp_device *dev; struct srp_device *dev;
struct ib_device *ibdev; struct ib_device *ibdev;
if (!scmnd->request_buffer || scmnd->sc_data_direction == DMA_NONE) if (!scsi_sglist(scmnd) || scmnd->sc_data_direction == DMA_NONE)
return sizeof (struct srp_cmd); return sizeof (struct srp_cmd);
if (scmnd->sc_data_direction != DMA_FROM_DEVICE && if (scmnd->sc_data_direction != DMA_FROM_DEVICE &&
...@@ -683,18 +669,8 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target, ...@@ -683,18 +669,8 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
return -EINVAL; return -EINVAL;
} }
/* nents = scsi_sg_count(scmnd);
* This handling of non-SG commands can be killed when the scat = scsi_sglist(scmnd);
* SCSI midlayer no longer generates non-SG commands.
*/
if (likely(scmnd->use_sg)) {
nents = scmnd->use_sg;
scat = scmnd->request_buffer;
} else {
nents = 1;
scat = &req->fake_sg;
sg_init_one(scat, scmnd->request_buffer, scmnd->request_bufflen);
}
dev = target->srp_host->dev; dev = target->srp_host->dev;
ibdev = dev->dev; ibdev = dev->dev;
...@@ -724,6 +700,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target, ...@@ -724,6 +700,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
* descriptor. * descriptor.
*/ */
struct srp_indirect_buf *buf = (void *) cmd->add_data; struct srp_indirect_buf *buf = (void *) cmd->add_data;
struct scatterlist *sg;
u32 datalen = 0; u32 datalen = 0;
int i; int i;
...@@ -732,11 +709,11 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target, ...@@ -732,11 +709,11 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
sizeof (struct srp_indirect_buf) + sizeof (struct srp_indirect_buf) +
count * sizeof (struct srp_direct_buf); count * sizeof (struct srp_direct_buf);
for (i = 0; i < count; ++i) { scsi_for_each_sg(scmnd, sg, count, i) {
unsigned int dma_len = ib_sg_dma_len(ibdev, &scat[i]); unsigned int dma_len = ib_sg_dma_len(ibdev, sg);
buf->desc_list[i].va = buf->desc_list[i].va =
cpu_to_be64(ib_sg_dma_address(ibdev, &scat[i])); cpu_to_be64(ib_sg_dma_address(ibdev, sg));
buf->desc_list[i].key = buf->desc_list[i].key =
cpu_to_be32(dev->mr->rkey); cpu_to_be32(dev->mr->rkey);
buf->desc_list[i].len = cpu_to_be32(dma_len); buf->desc_list[i].len = cpu_to_be32(dma_len);
...@@ -802,9 +779,9 @@ static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp) ...@@ -802,9 +779,9 @@ static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp)
} }
if (rsp->flags & (SRP_RSP_FLAG_DOOVER | SRP_RSP_FLAG_DOUNDER)) if (rsp->flags & (SRP_RSP_FLAG_DOOVER | SRP_RSP_FLAG_DOUNDER))
scmnd->resid = be32_to_cpu(rsp->data_out_res_cnt); scsi_set_resid(scmnd, be32_to_cpu(rsp->data_out_res_cnt));
else if (rsp->flags & (SRP_RSP_FLAG_DIOVER | SRP_RSP_FLAG_DIUNDER)) else if (rsp->flags & (SRP_RSP_FLAG_DIOVER | SRP_RSP_FLAG_DIUNDER))
scmnd->resid = be32_to_cpu(rsp->data_in_res_cnt); scsi_set_resid(scmnd, be32_to_cpu(rsp->data_in_res_cnt));
if (!req->tsk_mgmt) { if (!req->tsk_mgmt) {
scmnd->host_scribble = (void *) -1L; scmnd->host_scribble = (void *) -1L;
......
...@@ -106,11 +106,6 @@ struct srp_request { ...@@ -106,11 +106,6 @@ struct srp_request {
struct srp_iu *cmd; struct srp_iu *cmd;
struct srp_iu *tsk_mgmt; struct srp_iu *tsk_mgmt;
struct ib_pool_fmr *fmr; struct ib_pool_fmr *fmr;
/*
* Fake scatterlist used when scmnd->use_sg==0. Can be killed
* when the SCSI midlayer no longer generates non-SG commands.
*/
struct scatterlist fake_sg;
struct completion done; struct completion done;
short index; short index;
u8 cmd_done; u8 cmd_done;
......
/* drivers/message/fusion/linux_compat.h */
#ifndef FUSION_LINUX_COMPAT_H
#define FUSION_LINUX_COMPAT_H
#include <linux/version.h>
#include <scsi/scsi_device.h>
#endif /* _LINUX_COMPAT_H */
/* /*
* Copyright (c) 2000-2006 LSI Logic Corporation. * Copyright (c) 2000-2007 LSI Logic Corporation.
* *
* *
* Name: mpi.h * Name: mpi.h
* Title: MPI Message independent structures and definitions * Title: MPI Message independent structures and definitions
* Creation Date: July 27, 2000 * Creation Date: July 27, 2000
* *
* mpi.h Version: 01.05.12 * mpi.h Version: 01.05.13
* *
* Version History * Version History
* --------------- * ---------------
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
* 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target. * 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target.
* 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT. * 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT.
* 10-11-06 01.05.12 Bumped MPI_HEADER_VERSION_UNIT. * 10-11-06 01.05.12 Bumped MPI_HEADER_VERSION_UNIT.
* 05-24-07 01.05.13 Bumped MPI_HEADER_VERSION_UNIT.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -108,7 +109,7 @@ ...@@ -108,7 +109,7 @@
/* Note: The major versions of 0xe0 through 0xff are reserved */ /* Note: The major versions of 0xe0 through 0xff are reserved */
/* versioning for this MPI header set */ /* versioning for this MPI header set */
#define MPI_HEADER_VERSION_UNIT (0x0E) #define MPI_HEADER_VERSION_UNIT (0x10)
#define MPI_HEADER_VERSION_DEV (0x00) #define MPI_HEADER_VERSION_DEV (0x00)
#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI_HEADER_VERSION_UNIT_MASK (0xFF00)
#define MPI_HEADER_VERSION_UNIT_SHIFT (8) #define MPI_HEADER_VERSION_UNIT_SHIFT (8)
......
/* /*
* Copyright (c) 2000-2006 LSI Logic Corporation. * Copyright (c) 2000-2007 LSI Logic Corporation.
* *
* *
* Name: mpi_cnfg.h * Name: mpi_cnfg.h
* Title: MPI Config message, structures, and Pages * Title: MPI Config message, structures, and Pages
* Creation Date: July 27, 2000 * Creation Date: July 27, 2000
* *
* mpi_cnfg.h Version: 01.05.13 * mpi_cnfg.h Version: 01.05.15
* *
* Version History * Version History
* --------------- * ---------------
...@@ -293,6 +293,21 @@ ...@@ -293,6 +293,21 @@
* Added more AccessStatus values for SAS Device Page 0. * Added more AccessStatus values for SAS Device Page 0.
* Added bit for SATA Asynchronous Notification Support in * Added bit for SATA Asynchronous Notification Support in
* Flags field of SAS Device Page 0. * Flags field of SAS Device Page 0.
* 02-28-07 01.05.14 Added ExtFlags field to Manufacturing Page 4.
* Added Disable SMART Polling for CapabilitiesFlags of
* IOC Page 6.
* Added Disable SMART Polling to DeviceSettings of BIOS
* Page 1.
* Added Multi-Port Domain bit for DiscoveryStatus field
* of SAS IO Unit Page.
* Added Multi-Port Domain Illegal flag for SAS IO Unit
* Page 1 AdditionalControlFlags field.
* 05-24-07 01.05.15 Added Hide Physical Disks with Non-Integrated RAID
* Metadata bit to Manufacturing Page 4 ExtFlags field.
* Added Internal Connector to End Device Present bit to
* Expander Page 0 Flags field.
* Fixed define for
* MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -639,7 +654,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4 ...@@ -639,7 +654,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
U8 InfoSize1; /* 0Bh */ U8 InfoSize1; /* 0Bh */
U8 InquirySize; /* 0Ch */ U8 InquirySize; /* 0Ch */
U8 Flags; /* 0Dh */ U8 Flags; /* 0Dh */
U16 Reserved2; /* 0Eh */ U16 ExtFlags; /* 0Eh */
U8 InquiryData[56]; /* 10h */ U8 InquiryData[56]; /* 10h */
U32 ISVolumeSettings; /* 48h */ U32 ISVolumeSettings; /* 48h */
U32 IMEVolumeSettings; /* 4Ch */ U32 IMEVolumeSettings; /* 4Ch */
...@@ -658,7 +673,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4 ...@@ -658,7 +673,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
} CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, } CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4,
ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t;
#define MPI_MANUFACTURING4_PAGEVERSION (0x04) #define MPI_MANUFACTURING4_PAGEVERSION (0x05)
/* defines for the Flags field */ /* defines for the Flags field */
#define MPI_MANPAGE4_FORCE_BAD_BLOCK_TABLE (0x80) #define MPI_MANPAGE4_FORCE_BAD_BLOCK_TABLE (0x80)
...@@ -670,6 +685,12 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4 ...@@ -670,6 +685,12 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
#define MPI_MANPAGE4_IM_RESYNC_CACHE_ENABLE (0x02) #define MPI_MANPAGE4_IM_RESYNC_CACHE_ENABLE (0x02)
#define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01) #define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01)
/* defines for the ExtFlags field */
#define MPI_MANPAGE4_EXTFLAGS_HIDE_NON_IR_METADATA (0x0008)
#define MPI_MANPAGE4_EXTFLAGS_SAS_CACHE_DISABLE (0x0004)
#define MPI_MANPAGE4_EXTFLAGS_SATA_CACHE_DISABLE (0x0002)
#define MPI_MANPAGE4_EXTFLAGS_LEGACY_MODE (0x0001)
#ifndef MPI_MANPAGE5_NUM_FORCEWWID #ifndef MPI_MANPAGE5_NUM_FORCEWWID
#define MPI_MANPAGE5_NUM_FORCEWWID (1) #define MPI_MANPAGE5_NUM_FORCEWWID (1)
...@@ -781,7 +802,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_9 ...@@ -781,7 +802,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_9
} CONFIG_PAGE_MANUFACTURING_9, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_9, } CONFIG_PAGE_MANUFACTURING_9, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_9,
ManufacturingPage9_t, MPI_POINTER pManufacturingPage9_t; ManufacturingPage9_t, MPI_POINTER pManufacturingPage9_t;
#define MPI_MANUFACTURING6_PAGEVERSION (0x00) #define MPI_MANUFACTURING9_PAGEVERSION (0x00)
typedef struct _CONFIG_PAGE_MANUFACTURING_10 typedef struct _CONFIG_PAGE_MANUFACTURING_10
...@@ -1138,6 +1159,8 @@ typedef struct _CONFIG_PAGE_IOC_6 ...@@ -1138,6 +1159,8 @@ typedef struct _CONFIG_PAGE_IOC_6
/* IOC Page 6 Capabilities Flags */ /* IOC Page 6 Capabilities Flags */
#define MPI_IOCPAGE6_CAP_FLAGS_DISABLE_SMART_POLLING (0x00000008)
#define MPI_IOCPAGE6_CAP_FLAGS_MASK_METADATA_SIZE (0x00000006) #define MPI_IOCPAGE6_CAP_FLAGS_MASK_METADATA_SIZE (0x00000006)
#define MPI_IOCPAGE6_CAP_FLAGS_64MB_METADATA_SIZE (0x00000000) #define MPI_IOCPAGE6_CAP_FLAGS_64MB_METADATA_SIZE (0x00000000)
#define MPI_IOCPAGE6_CAP_FLAGS_512MB_METADATA_SIZE (0x00000002) #define MPI_IOCPAGE6_CAP_FLAGS_512MB_METADATA_SIZE (0x00000002)
...@@ -1208,6 +1231,7 @@ typedef struct _CONFIG_PAGE_BIOS_1 ...@@ -1208,6 +1231,7 @@ typedef struct _CONFIG_PAGE_BIOS_1
#define MPI_BIOSPAGE1_IOCSET_ALTERNATE_CHS (0x00000008) #define MPI_BIOSPAGE1_IOCSET_ALTERNATE_CHS (0x00000008)
/* values for the DeviceSettings field */ /* values for the DeviceSettings field */
#define MPI_BIOSPAGE1_DEVSET_DISABLE_SMART_POLLING (0x00000010)
#define MPI_BIOSPAGE1_DEVSET_DISABLE_SEQ_LUN (0x00000008) #define MPI_BIOSPAGE1_DEVSET_DISABLE_SEQ_LUN (0x00000008)
#define MPI_BIOSPAGE1_DEVSET_DISABLE_RM_LUN (0x00000004) #define MPI_BIOSPAGE1_DEVSET_DISABLE_RM_LUN (0x00000004)
#define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002) #define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002)
...@@ -2281,11 +2305,11 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0 ...@@ -2281,11 +2305,11 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0
typedef struct _CONFIG_PAGE_RAID_VOL_1 typedef struct _CONFIG_PAGE_RAID_VOL_1
{ {
CONFIG_PAGE_HEADER Header; /* 00h */ CONFIG_PAGE_HEADER Header; /* 00h */
U8 VolumeID; /* 01h */ U8 VolumeID; /* 04h */
U8 VolumeBus; /* 02h */ U8 VolumeBus; /* 05h */
U8 VolumeIOC; /* 03h */ U8 VolumeIOC; /* 06h */
U8 Reserved0; /* 04h */ U8 Reserved0; /* 07h */
U8 GUID[24]; /* 05h */ U8 GUID[24]; /* 08h */
U8 Name[32]; /* 20h */ U8 Name[32]; /* 20h */
U64 WWID; /* 40h */ U64 WWID; /* 40h */
U32 Reserved1; /* 48h */ U32 Reserved1; /* 48h */
...@@ -2340,7 +2364,7 @@ typedef struct _RAID_PHYS_DISK0_STATUS ...@@ -2340,7 +2364,7 @@ typedef struct _RAID_PHYS_DISK0_STATUS
} RAID_PHYS_DISK0_STATUS, MPI_POINTER PTR_RAID_PHYS_DISK0_STATUS, } RAID_PHYS_DISK0_STATUS, MPI_POINTER PTR_RAID_PHYS_DISK0_STATUS,
RaidPhysDiskStatus_t, MPI_POINTER pRaidPhysDiskStatus_t; RaidPhysDiskStatus_t, MPI_POINTER pRaidPhysDiskStatus_t;
/* RAID Volume 2 IM Physical Disk DiskStatus flags */ /* RAID Physical Disk PhysDiskStatus flags */
#define MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC (0x01) #define MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC (0x01)
#define MPI_PHYSDISK0_STATUS_FLAG_QUIESCED (0x02) #define MPI_PHYSDISK0_STATUS_FLAG_QUIESCED (0x02)
...@@ -2544,6 +2568,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 ...@@ -2544,6 +2568,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
#define MPI_SAS_IOUNIT0_DS_TABLE_LINK (0x00000400) #define MPI_SAS_IOUNIT0_DS_TABLE_LINK (0x00000400)
#define MPI_SAS_IOUNIT0_DS_UNSUPPORTED_DEVICE (0x00000800) #define MPI_SAS_IOUNIT0_DS_UNSUPPORTED_DEVICE (0x00000800)
#define MPI_SAS_IOUNIT0_DS_MAX_SATA_TARGETS (0x00001000) #define MPI_SAS_IOUNIT0_DS_MAX_SATA_TARGETS (0x00001000)
#define MPI_SAS_IOUNIT0_DS_MULTI_PORT_DOMAIN (0x00002000)
typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA
...@@ -2607,6 +2632,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1 ...@@ -2607,6 +2632,7 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1
#define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001) #define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001)
/* values for SAS IO Unit Page 1 AdditionalControlFlags */ /* values for SAS IO Unit Page 1 AdditionalControlFlags */
#define MPI_SAS_IOUNIT1_ACONTROL_MULTI_PORT_DOMAIN_ILLEGAL (0x0080)
#define MPI_SAS_IOUNIT1_ACONTROL_SATA_ASYNCHROUNOUS_NOTIFICATION (0x0040) #define MPI_SAS_IOUNIT1_ACONTROL_SATA_ASYNCHROUNOUS_NOTIFICATION (0x0040)
#define MPI_SAS_IOUNIT1_ACONTROL_HIDE_NONZERO_ATTACHED_PHY_IDENT (0x0020) #define MPI_SAS_IOUNIT1_ACONTROL_HIDE_NONZERO_ATTACHED_PHY_IDENT (0x0020)
#define MPI_SAS_IOUNIT1_ACONTROL_PORT_ENABLE_ONLY_SATA_LINK_RESET (0x0010) #define MPI_SAS_IOUNIT1_ACONTROL_PORT_ENABLE_ONLY_SATA_LINK_RESET (0x0010)
...@@ -2734,6 +2760,7 @@ typedef struct _CONFIG_PAGE_SAS_EXPANDER_0 ...@@ -2734,6 +2760,7 @@ typedef struct _CONFIG_PAGE_SAS_EXPANDER_0
#define MPI_SAS_EXPANDER0_DS_UNSUPPORTED_DEVICE (0x00000800) #define MPI_SAS_EXPANDER0_DS_UNSUPPORTED_DEVICE (0x00000800)
/* values for SAS Expander Page 0 Flags field */ /* values for SAS Expander Page 0 Flags field */
#define MPI_SAS_EXPANDER0_FLAGS_CONNECTOR_END_DEVICE (0x04)
#define MPI_SAS_EXPANDER0_FLAGS_ROUTE_TABLE_CONFIG (0x02) #define MPI_SAS_EXPANDER0_FLAGS_ROUTE_TABLE_CONFIG (0x02)
#define MPI_SAS_EXPANDER0_FLAGS_CONFIG_IN_PROGRESS (0x01) #define MPI_SAS_EXPANDER0_FLAGS_CONFIG_IN_PROGRESS (0x01)
...@@ -2774,7 +2801,7 @@ typedef struct _CONFIG_PAGE_SAS_EXPANDER_1 ...@@ -2774,7 +2801,7 @@ typedef struct _CONFIG_PAGE_SAS_EXPANDER_1
/* see mpi_sas.h for values for SAS Expander Page 1 AttachedDeviceInfo values */ /* see mpi_sas.h for values for SAS Expander Page 1 AttachedDeviceInfo values */
/* values for SAS Expander Page 1 DiscoveryInfo field */ /* values for SAS Expander Page 1 DiscoveryInfo field */
#define MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY DISABLED (0x04) #define MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED (0x04)
#define MPI_SAS_EXPANDER1_DISCINFO_LINK_STATUS_CHANGE (0x02) #define MPI_SAS_EXPANDER1_DISCINFO_LINK_STATUS_CHANGE (0x02)
#define MPI_SAS_EXPANDER1_DISCINFO_NO_ROUTING_ENTRIES (0x01) #define MPI_SAS_EXPANDER1_DISCINFO_NO_ROUTING_ENTRIES (0x01)
...@@ -2895,11 +2922,11 @@ typedef struct _CONFIG_PAGE_SAS_PHY_0 ...@@ -2895,11 +2922,11 @@ typedef struct _CONFIG_PAGE_SAS_PHY_0
U8 AttachedPhyIdentifier; /* 16h */ U8 AttachedPhyIdentifier; /* 16h */
U8 Reserved2; /* 17h */ U8 Reserved2; /* 17h */
U32 AttachedDeviceInfo; /* 18h */ U32 AttachedDeviceInfo; /* 18h */
U8 ProgrammedLinkRate; /* 20h */ U8 ProgrammedLinkRate; /* 1Ch */
U8 HwLinkRate; /* 21h */ U8 HwLinkRate; /* 1Dh */
U8 ChangeCount; /* 22h */ U8 ChangeCount; /* 1Eh */
U8 Flags; /* 23h */ U8 Flags; /* 1Fh */
U32 PhyInfo; /* 24h */ U32 PhyInfo; /* 20h */
} CONFIG_PAGE_SAS_PHY_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_0, } CONFIG_PAGE_SAS_PHY_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_0,
SasPhyPage0_t, MPI_POINTER pSasPhyPage0_t; SasPhyPage0_t, MPI_POINTER pSasPhyPage0_t;
......
...@@ -3,28 +3,28 @@ ...@@ -3,28 +3,28 @@
MPI Header File Change History MPI Header File Change History
============================== ==============================
Copyright (c) 2000-2006 LSI Logic Corporation. Copyright (c) 2000-2007 LSI Logic Corporation.
--------------------------------------- ---------------------------------------
Header Set Release Version: 01.05.14 Header Set Release Version: 01.05.16
Header Set Release Date: 10-11-06 Header Set Release Date: 05-24-07
--------------------------------------- ---------------------------------------
Filename Current version Prior version Filename Current version Prior version
---------- --------------- ------------- ---------- --------------- -------------
mpi.h 01.05.12 01.05.11 mpi.h 01.05.13 01.05.12
mpi_ioc.h 01.05.12 01.05.11 mpi_ioc.h 01.05.14 01.05.13
mpi_cnfg.h 01.05.13 01.05.12 mpi_cnfg.h 01.05.15 01.05.14
mpi_init.h 01.05.08 01.05.07 mpi_init.h 01.05.09 01.05.09
mpi_targ.h 01.05.06 01.05.06 mpi_targ.h 01.05.06 01.05.06
mpi_fc.h 01.05.01 01.05.01 mpi_fc.h 01.05.01 01.05.01
mpi_lan.h 01.05.01 01.05.01 mpi_lan.h 01.05.01 01.05.01
mpi_raid.h 01.05.02 01.05.02 mpi_raid.h 01.05.03 01.05.03
mpi_tool.h 01.05.03 01.05.03 mpi_tool.h 01.05.03 01.05.03
mpi_inb.h 01.05.01 01.05.01 mpi_inb.h 01.05.01 01.05.01
mpi_sas.h 01.05.04 01.05.03 mpi_sas.h 01.05.04 01.05.04
mpi_type.h 01.05.02 01.05.02 mpi_type.h 01.05.02 01.05.02
mpi_history.txt 01.05.14 01.05.13 mpi_history.txt 01.05.14 01.05.14
* Date Version Description * Date Version Description
...@@ -95,6 +95,7 @@ mpi.h ...@@ -95,6 +95,7 @@ mpi.h
* 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target. * 08-30-05 01.05.10 Added 2 new IOCStatus codes for Target.
* 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT. * 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT.
* 10-11-06 01.05.12 Bumped MPI_HEADER_VERSION_UNIT. * 10-11-06 01.05.12 Bumped MPI_HEADER_VERSION_UNIT.
* 05-24-07 01.05.13 Bumped MPI_HEADER_VERSION_UNIT.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_ioc.h mpi_ioc.h
...@@ -191,6 +192,13 @@ mpi_ioc.h ...@@ -191,6 +192,13 @@ mpi_ioc.h
* data structure. * data structure.
* Added new ImageType values for FWDownload and FWUpload * Added new ImageType values for FWDownload and FWUpload
* requests. * requests.
* 02-28-07 01.05.13 Added MPI_EVENT_PRIMITIVE_ASYNCHRONOUS_EVENT for SAS
* Broadcast Event Data (replacing _RESERVED2).
* For Discovery Error Event Data DiscoveryStatus field,
* replaced _MULTPL_PATHS with _UNSUPPORTED_DEVICE and
* added _MULTI_PORT_DOMAIN.
* 05-24-07 01.05.14 Added Common Boot Block type to FWDownload Request.
* Added Common Boot Block type to FWUpload Request.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_cnfg.h mpi_cnfg.h
...@@ -473,6 +481,21 @@ mpi_cnfg.h ...@@ -473,6 +481,21 @@ mpi_cnfg.h
* Added more AccessStatus values for SAS Device Page 0. * Added more AccessStatus values for SAS Device Page 0.
* Added bit for SATA Asynchronous Notification Support in * Added bit for SATA Asynchronous Notification Support in
* Flags field of SAS Device Page 0. * Flags field of SAS Device Page 0.
* 02-28-07 01.05.14 Added ExtFlags field to Manufacturing Page 4.
* Added Disable SMART Polling for CapabilitiesFlags of
* IOC Page 6.
* Added Disable SMART Polling to DeviceSettings of BIOS
* Page 1.
* Added Multi-Port Domain bit for DiscoveryStatus field
* of SAS IO Unit Page.
* Added Multi-Port Domain Illegal flag for SAS IO Unit
* Page 1 AdditionalControlFlags field.
* 05-24-07 01.05.15 Added Hide Physical Disks with Non-Integrated RAID
* Metadata bit to Manufacturing Page 4 ExtFlags field.
* Added Internal Connector to End Device Present bit to
* Expander Page 0 Flags field.
* Fixed define for
* MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_init.h mpi_init.h
...@@ -517,6 +540,8 @@ mpi_init.h ...@@ -517,6 +540,8 @@ mpi_init.h
* unique in the first 32 characters. * unique in the first 32 characters.
* 03-27-06 01.05.07 Added Task Management type of Clear ACA. * 03-27-06 01.05.07 Added Task Management type of Clear ACA.
* 10-11-06 01.05.08 Shortened define for Task Management type of Clear ACA. * 10-11-06 01.05.08 Shortened define for Task Management type of Clear ACA.
* 02-28-07 01.05.09 Defined two new MsgFlags bits for SCSI Task Management
* Request: Do Not Send Task IU and Soft Reset Option.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_targ.h mpi_targ.h
...@@ -571,7 +596,7 @@ mpi_fc.h ...@@ -571,7 +596,7 @@ mpi_fc.h
* 11-02-00 01.01.01 Original release for post 1.0 work * 11-02-00 01.01.01 Original release for post 1.0 work
* 12-04-00 01.01.02 Added messages for Common Transport Send and * 12-04-00 01.01.02 Added messages for Common Transport Send and
* Primitive Send. * Primitive Send.
* 01-09-01 01.01.03 Modified some of the new flags to have an MPI prefix * 01-09-01 01.01.03 Modifed some of the new flags to have an MPI prefix
* and modified the FcPrimitiveSend flags. * and modified the FcPrimitiveSend flags.
* 01-25-01 01.01.04 Move InitiatorIndex in LinkServiceRsp reply to a larger * 01-25-01 01.01.04 Move InitiatorIndex in LinkServiceRsp reply to a larger
* field. * field.
...@@ -634,6 +659,8 @@ mpi_raid.h ...@@ -634,6 +659,8 @@ mpi_raid.h
* 08-19-04 01.05.01 Original release for MPI v1.5. * 08-19-04 01.05.01 Original release for MPI v1.5.
* 01-15-05 01.05.02 Added defines for the two new RAID Actions for * 01-15-05 01.05.02 Added defines for the two new RAID Actions for
* _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE. * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
* 02-28-07 01.05.03 Added new RAID Action, Device FW Update Mode, and
* associated defines.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
mpi_tool.h mpi_tool.h
...@@ -682,7 +709,22 @@ mpi_type.h ...@@ -682,7 +709,22 @@ mpi_type.h
mpi_history.txt Parts list history mpi_history.txt Parts list history
Filename 01.05.13 01.05.13 01.05.12 01.05.11 01.05.10 01.05.09 Filename 01.05.15 01.05.15
---------- -------- --------
mpi.h 01.05.12 01.05.13
mpi_ioc.h 01.05.13 01.05.14
mpi_cnfg.h 01.05.14 01.05.15
mpi_init.h 01.05.09 01.05.09
mpi_targ.h 01.05.06 01.05.06
mpi_fc.h 01.05.01 01.05.01
mpi_lan.h 01.05.01 01.05.01
mpi_raid.h 01.05.03 01.05.03
mpi_tool.h 01.05.03 01.05.03
mpi_inb.h 01.05.01 01.05.01
mpi_sas.h 01.05.04 01.05.04
mpi_type.h 01.05.02 01.05.02
Filename 01.05.14 01.05.13 01.05.12 01.05.11 01.05.10 01.05.09
---------- -------- -------- -------- -------- -------- -------- ---------- -------- -------- -------- -------- -------- --------
mpi.h 01.05.12 01.05.11 01.05.10 01.05.09 01.05.08 01.05.07 mpi.h 01.05.12 01.05.11 01.05.10 01.05.09 01.05.08 01.05.07
mpi_ioc.h 01.05.12 01.05.11 01.05.10 01.05.09 01.05.09 01.05.08 mpi_ioc.h 01.05.12 01.05.11 01.05.10 01.05.09 01.05.09 01.05.08
......
/*
* Copyright (c) 2003-2004 LSI Logic Corporation.
*
*
* Name: mpi_inb.h
* Title: MPI Inband structures and definitions
* Creation Date: September 30, 2003
*
* mpi_inb.h Version: 01.05.01
*
* Version History
* ---------------
*
* Date Version Description
* -------- -------- ------------------------------------------------------
* 05-11-04 01.03.01 Original release.
* 08-19-04 01.05.01 Original release for MPI v1.5.
* --------------------------------------------------------------------------
*/
#ifndef MPI_INB_H
#define MPI_INB_H
/******************************************************************************
*
* I n b a n d M e s s a g e s
*
*******************************************************************************/
/****************************************************************************/
/* Inband Buffer Post Request */
/****************************************************************************/
typedef struct _MSG_INBAND_BUFFER_POST_REQUEST
{
U8 Reserved1; /* 00h */
U8 BufferCount; /* 01h */
U8 ChainOffset; /* 02h */
U8 Function; /* 03h */
U16 Reserved2; /* 04h */
U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */
U32 Reserved4; /* 0Ch */
SGE_TRANS_SIMPLE_UNION SGL; /* 10h */
} MSG_INBAND_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_INBAND_BUFFER_POST_REQUEST,
MpiInbandBufferPostRequest_t , MPI_POINTER pMpiInbandBufferPostRequest_t;
typedef struct _WWN_FC_FORMAT
{
U64 NodeName; /* 00h */
U64 PortName; /* 08h */
} WWN_FC_FORMAT, MPI_POINTER PTR_WWN_FC_FORMAT,
WwnFcFormat_t, MPI_POINTER pWwnFcFormat_t;
typedef struct _WWN_SAS_FORMAT
{
U64 WorldWideID; /* 00h */
U32 Reserved1; /* 08h */
U32 Reserved2; /* 0Ch */
} WWN_SAS_FORMAT, MPI_POINTER PTR_WWN_SAS_FORMAT,
WwnSasFormat_t, MPI_POINTER pWwnSasFormat_t;
typedef union _WWN_INBAND_FORMAT
{
WWN_FC_FORMAT Fc;
WWN_SAS_FORMAT Sas;
} WWN_INBAND_FORMAT, MPI_POINTER PTR_WWN_INBAND_FORMAT,
WwnInbandFormat, MPI_POINTER pWwnInbandFormat;
/* Inband Buffer Post reply message */
typedef struct _MSG_INBAND_BUFFER_POST_REPLY
{
U16 Reserved1; /* 00h */
U8 MsgLength; /* 02h */
U8 Function; /* 03h */
U16 Reserved2; /* 04h */
U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */
U16 Reserved4; /* 0Ch */
U16 IOCStatus; /* 0Eh */
U32 IOCLogInfo; /* 10h */
U32 TransferLength; /* 14h */
U32 TransactionContext; /* 18h */
WWN_INBAND_FORMAT Wwn; /* 1Ch */
U32 IOCIdentifier[4]; /* 2Ch */
} MSG_INBAND_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_INBAND_BUFFER_POST_REPLY,
MpiInbandBufferPostReply_t, MPI_POINTER pMpiInbandBufferPostReply_t;
/****************************************************************************/
/* Inband Send Request */
/****************************************************************************/
typedef struct _MSG_INBAND_SEND_REQUEST
{
U16 Reserved1; /* 00h */
U8 ChainOffset; /* 02h */
U8 Function; /* 03h */
U16 Reserved2; /* 04h */
U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */
U32 Reserved4; /* 0Ch */
WWN_INBAND_FORMAT Wwn; /* 10h */
U32 Reserved5; /* 20h */
SGE_IO_UNION SGL; /* 24h */
} MSG_INBAND_SEND_REQUEST, MPI_POINTER PTR_MSG_INBAND_SEND_REQUEST,
MpiInbandSendRequest_t , MPI_POINTER pMpiInbandSendRequest_t;
/* Inband Send reply message */
typedef struct _MSG_INBAND_SEND_REPLY
{
U16 Reserved1; /* 00h */
U8 MsgLength; /* 02h */
U8 Function; /* 03h */
U16 Reserved2; /* 04h */
U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */
U16 Reserved4; /* 0Ch */
U16 IOCStatus; /* 0Eh */
U32 IOCLogInfo; /* 10h */
U32 ResponseLength; /* 14h */
} MSG_INBAND_SEND_REPLY, MPI_POINTER PTR_MSG_INBAND_SEND_REPLY,
MpiInbandSendReply_t, MPI_POINTER pMpiInbandSendReply_t;
/****************************************************************************/
/* Inband Response Request */
/****************************************************************************/
typedef struct _MSG_INBAND_RSP_REQUEST
{
U16 Reserved1; /* 00h */
U8 ChainOffset; /* 02h */
U8 Function; /* 03h */
U16 Reserved2; /* 04h */
U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */
U32 Reserved4; /* 0Ch */
WWN_INBAND_FORMAT Wwn; /* 10h */
U32 IOCIdentifier[4]; /* 20h */
U32 ResponseLength; /* 30h */
SGE_IO_UNION SGL; /* 34h */
} MSG_INBAND_RSP_REQUEST, MPI_POINTER PTR_MSG_INBAND_RSP_REQUEST,
MpiInbandRspRequest_t , MPI_POINTER pMpiInbandRspRequest_t;
/* Inband Response reply message */
typedef struct _MSG_INBAND_RSP_REPLY
{
U16 Reserved1; /* 00h */
U8 MsgLength; /* 02h */
U8 Function; /* 03h */
U16 Reserved2; /* 04h */
U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */
U16 Reserved4; /* 0Ch */
U16 IOCStatus; /* 0Eh */
U32 IOCLogInfo; /* 10h */
} MSG_INBAND_RSP_REPLY, MPI_POINTER PTR_MSG_INBAND_RSP_REPLY,
MpiInbandRspReply_t, MPI_POINTER pMpiInbandRspReply_t;
/****************************************************************************/
/* Inband Abort Request */
/****************************************************************************/
typedef struct _MSG_INBAND_ABORT_REQUEST
{
U8 Reserved1; /* 00h */
U8 AbortType; /* 01h */
U8 ChainOffset; /* 02h */
U8 Function; /* 03h */
U16 Reserved2; /* 04h */
U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */
U32 Reserved4; /* 0Ch */
U32 ContextToAbort; /* 10h */
} MSG_INBAND_ABORT_REQUEST, MPI_POINTER PTR_MSG_INBAND_ABORT_REQUEST,
MpiInbandAbortRequest_t , MPI_POINTER pMpiInbandAbortRequest_t;
#define MPI_INBAND_ABORT_TYPE_ALL_BUFFERS (0x00)
#define MPI_INBAND_ABORT_TYPE_EXACT_BUFFER (0x01)
#define MPI_INBAND_ABORT_TYPE_SEND_REQUEST (0x02)
#define MPI_INBAND_ABORT_TYPE_RESPONSE_REQUEST (0x03)
/* Inband Abort reply message */
typedef struct _MSG_INBAND_ABORT_REPLY
{
U8 Reserved1; /* 00h */
U8 AbortType; /* 01h */
U8 MsgLength; /* 02h */
U8 Function; /* 03h */
U16 Reserved2; /* 04h */
U8 Reserved3; /* 06h */
U8 MsgFlags; /* 07h */
U32 MsgContext; /* 08h */
U16 Reserved4; /* 0Ch */
U16 IOCStatus; /* 0Eh */
U32 IOCLogInfo; /* 10h */
} MSG_INBAND_ABORT_REPLY, MPI_POINTER PTR_MSG_INBAND_ABORT_REPLY,
MpiInbandAbortReply_t, MPI_POINTER pMpiInbandAbortReply_t;
#endif
/* /*
* Copyright (c) 2000-2006 LSI Logic Corporation. * Copyright (c) 2000-2007 LSI Logic Corporation.
* *
* *
* Name: mpi_init.h * Name: mpi_init.h
* Title: MPI initiator mode messages and structures * Title: MPI initiator mode messages and structures
* Creation Date: June 8, 2000 * Creation Date: June 8, 2000
* *
* mpi_init.h Version: 01.05.08 * mpi_init.h Version: 01.05.09
* *
* Version History * Version History
* --------------- * ---------------
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
* unique in the first 32 characters. * unique in the first 32 characters.
* 03-27-06 01.05.07 Added Task Management type of Clear ACA. * 03-27-06 01.05.07 Added Task Management type of Clear ACA.
* 10-11-06 01.05.08 Shortened define for Task Management type of Clear ACA. * 10-11-06 01.05.08 Shortened define for Task Management type of Clear ACA.
* 02-28-07 01.05.09 Defined two new MsgFlags bits for SCSI Task Management
* Request: Do Not Send Task IU and Soft Reset Option.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -432,10 +434,14 @@ typedef struct _MSG_SCSI_TASK_MGMT ...@@ -432,10 +434,14 @@ typedef struct _MSG_SCSI_TASK_MGMT
#define MPI_SCSITASKMGMT_TASKTYPE_CLR_ACA (0x08) #define MPI_SCSITASKMGMT_TASKTYPE_CLR_ACA (0x08)
/* MsgFlags bits */ /* MsgFlags bits */
#define MPI_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x01)
#define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00) #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00)
#define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION (0x02) #define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION (0x02)
#define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04) #define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04)
#define MPI_SCSITASKMGMT_MSGFLAGS_SOFT_RESET_OPTION (0x08)
/* SCSI Task Management Reply */ /* SCSI Task Management Reply */
typedef struct _MSG_SCSI_TASK_MGMT_REPLY typedef struct _MSG_SCSI_TASK_MGMT_REPLY
{ {
......
/* /*
* Copyright (c) 2000-2006 LSI Logic Corporation. * Copyright (c) 2000-2007 LSI Logic Corporation.
* *
* *
* Name: mpi_ioc.h * Name: mpi_ioc.h
* Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages
* Creation Date: August 11, 2000 * Creation Date: August 11, 2000
* *
* mpi_ioc.h Version: 01.05.12 * mpi_ioc.h Version: 01.05.14
* *
* Version History * Version History
* --------------- * ---------------
...@@ -106,6 +106,13 @@ ...@@ -106,6 +106,13 @@
* data structure. * data structure.
* Added new ImageType values for FWDownload and FWUpload * Added new ImageType values for FWDownload and FWUpload
* requests. * requests.
* 02-28-07 01.05.13 Added MPI_EVENT_PRIMITIVE_ASYNCHRONOUS_EVENT for SAS
* Broadcast Event Data (replacing _RESERVED2).
* For Discovery Error Event Data DiscoveryStatus field,
* replaced _MULTPL_PATHS with _UNSUPPORTED_DEVICE and
* added _MULTI_PORT_DOMAIN.
* 05-24-07 01.05.14 Added Common Boot Block type to FWDownload Request.
* Added Common Boot Block type to FWUpload Request.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -792,7 +799,7 @@ typedef struct _EVENT_DATA_SAS_BROADCAST_PRIMITIVE ...@@ -792,7 +799,7 @@ typedef struct _EVENT_DATA_SAS_BROADCAST_PRIMITIVE
#define MPI_EVENT_PRIMITIVE_CHANGE (0x01) #define MPI_EVENT_PRIMITIVE_CHANGE (0x01)
#define MPI_EVENT_PRIMITIVE_EXPANDER (0x03) #define MPI_EVENT_PRIMITIVE_EXPANDER (0x03)
#define MPI_EVENT_PRIMITIVE_RESERVED2 (0x04) #define MPI_EVENT_PRIMITIVE_ASYNCHRONOUS_EVENT (0x04)
#define MPI_EVENT_PRIMITIVE_RESERVED3 (0x05) #define MPI_EVENT_PRIMITIVE_RESERVED3 (0x05)
#define MPI_EVENT_PRIMITIVE_RESERVED4 (0x06) #define MPI_EVENT_PRIMITIVE_RESERVED4 (0x06)
#define MPI_EVENT_PRIMITIVE_CHANGE0_RESERVED (0x07) #define MPI_EVENT_PRIMITIVE_CHANGE0_RESERVED (0x07)
...@@ -857,8 +864,9 @@ typedef struct _EVENT_DATA_DISCOVERY_ERROR ...@@ -857,8 +864,9 @@ typedef struct _EVENT_DATA_DISCOVERY_ERROR
#define MPI_EVENT_DSCVRY_ERR_DS_SMP_CRC_ERROR (0x00000100) #define MPI_EVENT_DSCVRY_ERR_DS_SMP_CRC_ERROR (0x00000100)
#define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_SUBTRACTIVE (0x00000200) #define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_SUBTRACTIVE (0x00000200)
#define MPI_EVENT_DSCVRY_ERR_DS_TABLE_TO_TABLE (0x00000400) #define MPI_EVENT_DSCVRY_ERR_DS_TABLE_TO_TABLE (0x00000400)
#define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_PATHS (0x00000800) #define MPI_EVENT_DSCVRY_ERR_DS_UNSUPPORTED_DEVICE (0x00000800)
#define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS (0x00001000) #define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS (0x00001000)
#define MPI_EVENT_DSCVRY_ERR_DS_MULTI_PORT_DOMAIN (0x00002000)
/* SAS SMP Error Event data */ /* SAS SMP Error Event data */
...@@ -990,6 +998,7 @@ typedef struct _MSG_FW_DOWNLOAD ...@@ -990,6 +998,7 @@ typedef struct _MSG_FW_DOWNLOAD
#define MPI_FW_DOWNLOAD_ITYPE_CONFIG_1 (0x07) #define MPI_FW_DOWNLOAD_ITYPE_CONFIG_1 (0x07)
#define MPI_FW_DOWNLOAD_ITYPE_CONFIG_2 (0x08) #define MPI_FW_DOWNLOAD_ITYPE_CONFIG_2 (0x08)
#define MPI_FW_DOWNLOAD_ITYPE_MEGARAID (0x09) #define MPI_FW_DOWNLOAD_ITYPE_MEGARAID (0x09)
#define MPI_FW_DOWNLOAD_ITYPE_COMMON_BOOT_BLOCK (0x0B)
typedef struct _FWDownloadTCSGE typedef struct _FWDownloadTCSGE
...@@ -1038,17 +1047,18 @@ typedef struct _MSG_FW_UPLOAD ...@@ -1038,17 +1047,18 @@ typedef struct _MSG_FW_UPLOAD
} MSG_FW_UPLOAD, MPI_POINTER PTR_MSG_FW_UPLOAD, } MSG_FW_UPLOAD, MPI_POINTER PTR_MSG_FW_UPLOAD,
FWUpload_t, MPI_POINTER pFWUpload_t; FWUpload_t, MPI_POINTER pFWUpload_t;
#define MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM (0x00) #define MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM (0x00)
#define MPI_FW_UPLOAD_ITYPE_FW_FLASH (0x01) #define MPI_FW_UPLOAD_ITYPE_FW_FLASH (0x01)
#define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH (0x02) #define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH (0x02)
#define MPI_FW_UPLOAD_ITYPE_NVDATA (0x03) #define MPI_FW_UPLOAD_ITYPE_NVDATA (0x03)
#define MPI_FW_UPLOAD_ITYPE_BOOTLOADER (0x04) #define MPI_FW_UPLOAD_ITYPE_BOOTLOADER (0x04)
#define MPI_FW_UPLOAD_ITYPE_FW_BACKUP (0x05) #define MPI_FW_UPLOAD_ITYPE_FW_BACKUP (0x05)
#define MPI_FW_UPLOAD_ITYPE_MANUFACTURING (0x06) #define MPI_FW_UPLOAD_ITYPE_MANUFACTURING (0x06)
#define MPI_FW_UPLOAD_ITYPE_CONFIG_1 (0x07) #define MPI_FW_UPLOAD_ITYPE_CONFIG_1 (0x07)
#define MPI_FW_UPLOAD_ITYPE_CONFIG_2 (0x08) #define MPI_FW_UPLOAD_ITYPE_CONFIG_2 (0x08)
#define MPI_FW_UPLOAD_ITYPE_MEGARAID (0x09) #define MPI_FW_UPLOAD_ITYPE_MEGARAID (0x09)
#define MPI_FW_UPLOAD_ITYPE_COMPLETE (0x0A) #define MPI_FW_UPLOAD_ITYPE_COMPLETE (0x0A)
#define MPI_FW_UPLOAD_ITYPE_COMMON_BOOT_BLOCK (0x0B)
typedef struct _FWUploadTCSGE typedef struct _FWUploadTCSGE
{ {
......
/* /*
* Copyright (c) 2001-2005 LSI Logic Corporation. * Copyright (c) 2001-2007 LSI Logic Corporation.
* *
* *
* Name: mpi_raid.h * Name: mpi_raid.h
* Title: MPI RAID message and structures * Title: MPI RAID message and structures
* Creation Date: February 27, 2001 * Creation Date: February 27, 2001
* *
* mpi_raid.h Version: 01.05.02 * mpi_raid.h Version: 01.05.03
* *
* Version History * Version History
* --------------- * ---------------
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
* 08-19-04 01.05.01 Original release for MPI v1.5. * 08-19-04 01.05.01 Original release for MPI v1.5.
* 01-15-05 01.05.02 Added defines for the two new RAID Actions for * 01-15-05 01.05.02 Added defines for the two new RAID Actions for
* _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE. * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
* 02-28-07 01.05.03 Added new RAID Action, Device FW Update Mode, and
* associated defines.
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
...@@ -90,6 +92,7 @@ typedef struct _MSG_RAID_ACTION ...@@ -90,6 +92,7 @@ typedef struct _MSG_RAID_ACTION
#define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12) #define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12)
#define MPI_RAID_ACTION_SET_RESYNC_RATE (0x13) #define MPI_RAID_ACTION_SET_RESYNC_RATE (0x13)
#define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE (0x14) #define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE (0x14)
#define MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE (0x15)
/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */ /* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001) #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001)
...@@ -111,6 +114,10 @@ typedef struct _MSG_RAID_ACTION ...@@ -111,6 +114,10 @@ typedef struct _MSG_RAID_ACTION
/* ActionDataWord defines for use with MPI_RAID_ACTION_SET_DATA_SCRUB_RATE action */ /* ActionDataWord defines for use with MPI_RAID_ACTION_SET_DATA_SCRUB_RATE action */
#define MPI_RAID_ACTION_ADATA_DATA_SCRUB_RATE_MASK (0x000000FF) #define MPI_RAID_ACTION_ADATA_DATA_SCRUB_RATE_MASK (0x000000FF)
/* ActionDataWord defines for use with MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE action */
#define MPI_RAID_ACTION_ADATA_ENABLE_FW_UPDATE (0x00000001)
#define MPI_RAID_ACTION_ADATA_MASK_FW_UPDATE_TIMEOUT (0x0000FF00)
#define MPI_RAID_ACTION_ADATA_SHIFT_FW_UPDATE_TIMEOUT (8)
/* RAID Action reply message */ /* RAID Action reply message */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#endif #endif
#include "mptbase.h" #include "mptbase.h"
#include "lsi/mpi_log_fc.h"
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#define my_NAME "Fusion MPT base driver" #define my_NAME "Fusion MPT base driver"
...@@ -6349,14 +6350,37 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply ...@@ -6349,14 +6350,37 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
static void static void
mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info) mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info)
{ {
static char *subcl_str[8] = { char *desc = "unknown";
"FCP Initiator", "FCP Target", "LAN", "MPI Message Layer",
"FC Link", "Context Manager", "Invalid Field Offset", "State Change Info" switch (log_info & 0xFF000000) {
}; case MPI_IOCLOGINFO_FC_INIT_BASE:
u8 subcl = (log_info >> 24) & 0x7; desc = "FCP Initiator";
break;
case MPI_IOCLOGINFO_FC_TARGET_BASE:
desc = "FCP Target";
break;
case MPI_IOCLOGINFO_FC_LAN_BASE:
desc = "LAN";
break;
case MPI_IOCLOGINFO_FC_MSG_BASE:
desc = "MPI Message Layer";
break;
case MPI_IOCLOGINFO_FC_LINK_BASE:
desc = "FC Link";
break;
case MPI_IOCLOGINFO_FC_CTX_BASE:
desc = "Context Manager";
break;
case MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET:
desc = "Invalid Field Offset";
break;
case MPI_IOCLOGINFO_FC_STATE_CHANGE:
desc = "State Change Info";
break;
}
printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): SubCl={%s}\n", printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): SubClass={%s}, Value=(0x%06x)\n",
ioc->name, log_info, subcl_str[subcl]); ioc->name, log_info, desc, (log_info & 0xFFFFFF));
} }
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
...@@ -75,8 +75,8 @@ ...@@ -75,8 +75,8 @@
#define COPYRIGHT "Copyright (c) 1999-2007 " MODULEAUTHOR #define COPYRIGHT "Copyright (c) 1999-2007 " MODULEAUTHOR
#endif #endif
#define MPT_LINUX_VERSION_COMMON "3.04.04" #define MPT_LINUX_VERSION_COMMON "3.04.05"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.04" #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.05"
#define WHAT_MAGIC_STRING "@" "(" "#" ")" #define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \ #define show_mptmod_ver(s,ver) \
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#include "linux_compat.h" /* linux-2.6 tweaks */
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 2000-2007 LSI Logic Corporation * Copyright (c) 2000-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 2000-2007 LSI Logic Corporation * Copyright (c) 2000-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* Copyright (c) 2005-2007 Dell * Copyright (c) 2005-2007 Dell
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#include "linux_compat.h" /* linux-2.6 tweaks */
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -260,30 +259,13 @@ mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt, ...@@ -260,30 +259,13 @@ mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt,
/* Map the data portion, if any. /* Map the data portion, if any.
* sges_left = 0 if no data transfer. * sges_left = 0 if no data transfer.
*/ */
if ( (sges_left = SCpnt->use_sg) ) { sges_left = scsi_dma_map(SCpnt);
sges_left = pci_map_sg(ioc->pcidev, if (sges_left < 0)
(struct scatterlist *) SCpnt->request_buffer, return FAILED;
SCpnt->use_sg,
SCpnt->sc_data_direction);
if (sges_left == 0)
return FAILED;
} else if (SCpnt->request_bufflen) {
SCpnt->SCp.dma_handle = pci_map_single(ioc->pcidev,
SCpnt->request_buffer,
SCpnt->request_bufflen,
SCpnt->sc_data_direction);
dsgprintk((MYIOC_s_INFO_FMT "SG: non-SG for %p, len=%d\n",
ioc->name, SCpnt, SCpnt->request_bufflen));
mptscsih_add_sge((char *) &pReq->SGL,
0xD1000000|MPT_SGE_FLAGS_ADDRESSING|sgdir|SCpnt->request_bufflen,
SCpnt->SCp.dma_handle);
return SUCCESS;
}
/* Handle the SG case. /* Handle the SG case.
*/ */
sg = (struct scatterlist *) SCpnt->request_buffer; sg = scsi_sglist(SCpnt);
sg_done = 0; sg_done = 0;
sgeOffset = sizeof(SCSIIORequest_t) - sizeof(SGE_IO_UNION); sgeOffset = sizeof(SCSIIORequest_t) - sizeof(SGE_IO_UNION);
chainSge = NULL; chainSge = NULL;
...@@ -465,7 +447,12 @@ mptscsih_issue_sep_command(MPT_ADAPTER *ioc, VirtTarget *vtarget, ...@@ -465,7 +447,12 @@ mptscsih_issue_sep_command(MPT_ADAPTER *ioc, VirtTarget *vtarget,
MPT_FRAME_HDR *mf; MPT_FRAME_HDR *mf;
SEPRequest_t *SEPMsg; SEPRequest_t *SEPMsg;
if (ioc->bus_type == FC) if (ioc->bus_type != SAS)
return;
/* Not supported for hidden raid components
*/
if (vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT)
return; return;
if ((mf = mpt_get_msg_frame(ioc->InternalCtx, ioc)) == NULL) { if ((mf = mpt_get_msg_frame(ioc->InternalCtx, ioc)) == NULL) {
...@@ -662,7 +649,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -662,7 +649,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
scsi_state = pScsiReply->SCSIState; scsi_state = pScsiReply->SCSIState;
scsi_status = pScsiReply->SCSIStatus; scsi_status = pScsiReply->SCSIStatus;
xfer_cnt = le32_to_cpu(pScsiReply->TransferCount); xfer_cnt = le32_to_cpu(pScsiReply->TransferCount);
sc->resid = sc->request_bufflen - xfer_cnt; scsi_set_resid(sc, scsi_bufflen(sc) - xfer_cnt);
log_info = le32_to_cpu(pScsiReply->IOCLogInfo); log_info = le32_to_cpu(pScsiReply->IOCLogInfo);
/* /*
...@@ -767,7 +754,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -767,7 +754,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
break; break;
case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */ case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */
sc->resid = sc->request_bufflen - xfer_cnt; scsi_set_resid(sc, scsi_bufflen(sc) - xfer_cnt);
if((xfer_cnt==0)||(sc->underflow > xfer_cnt)) if((xfer_cnt==0)||(sc->underflow > xfer_cnt))
sc->result=DID_SOFT_ERROR << 16; sc->result=DID_SOFT_ERROR << 16;
else /* Sufficient data transfer occurred */ else /* Sufficient data transfer occurred */
...@@ -816,7 +803,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -816,7 +803,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
break; break;
case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */ case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */
sc->resid=0; scsi_set_resid(sc, 0);
case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */
case MPI_IOCSTATUS_SUCCESS: /* 0x0000 */ case MPI_IOCSTATUS_SUCCESS: /* 0x0000 */
sc->result = (DID_OK << 16) | scsi_status; sc->result = (DID_OK << 16) | scsi_status;
...@@ -899,23 +886,18 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -899,23 +886,18 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
scsi_state, scsi_status, log_info)); scsi_state, scsi_status, log_info));
dreplyprintk(("%s: [%d:%d:%d:%d] resid=%d " dreplyprintk(("%s: [%d:%d:%d:%d] resid=%d "
"bufflen=%d xfer_cnt=%d\n", __FUNCTION__, "bufflen=%d xfer_cnt=%d\n", __FUNCTION__,
sc->device->host->host_no, sc->device->channel, sc->device->id, sc->device->host->host_no,
sc->device->lun, sc->resid, sc->request_bufflen, sc->device->channel, sc->device->id,
xfer_cnt)); sc->device->lun, scsi_get_resid(sc),
scsi_bufflen(sc), xfer_cnt));
} }
#endif #endif
} /* end of address reply case */ } /* end of address reply case */
/* Unmap the DMA buffers, if any. */ /* Unmap the DMA buffers, if any. */
if (sc->use_sg) { scsi_dma_unmap(sc);
pci_unmap_sg(ioc->pcidev, (struct scatterlist *) sc->request_buffer,
sc->use_sg, sc->sc_data_direction);
} else if (sc->request_bufflen) {
pci_unmap_single(ioc->pcidev, sc->SCp.dma_handle,
sc->request_bufflen, sc->sc_data_direction);
}
sc->scsi_done(sc); /* Issue the command callback */ sc->scsi_done(sc); /* Issue the command callback */
...@@ -970,17 +952,8 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd) ...@@ -970,17 +952,8 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
/* Set status, free OS resources (SG DMA buffers) /* Set status, free OS resources (SG DMA buffers)
* Do OS callback * Do OS callback
*/ */
if (SCpnt->use_sg) { scsi_dma_unmap(SCpnt);
pci_unmap_sg(ioc->pcidev,
(struct scatterlist *) SCpnt->request_buffer,
SCpnt->use_sg,
SCpnt->sc_data_direction);
} else if (SCpnt->request_bufflen) {
pci_unmap_single(ioc->pcidev,
SCpnt->SCp.dma_handle,
SCpnt->request_bufflen,
SCpnt->sc_data_direction);
}
SCpnt->result = DID_RESET << 16; SCpnt->result = DID_RESET << 16;
SCpnt->host_scribble = NULL; SCpnt->host_scribble = NULL;
...@@ -1023,14 +996,19 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) ...@@ -1023,14 +996,19 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
mf = (SCSIIORequest_t *)MPT_INDEX_2_MFPTR(hd->ioc, ii); mf = (SCSIIORequest_t *)MPT_INDEX_2_MFPTR(hd->ioc, ii);
if (mf == NULL) if (mf == NULL)
continue; continue;
/* If the device is a hidden raid component, then its
* expected that the mf->function will be RAID_SCSI_IO
*/
if (vdevice->vtarget->tflags &
MPT_TARGET_FLAGS_RAID_COMPONENT && mf->Function !=
MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH)
continue;
int_to_scsilun(vdevice->lun, &lun); int_to_scsilun(vdevice->lun, &lun);
if ((mf->Bus != vdevice->vtarget->channel) || if ((mf->Bus != vdevice->vtarget->channel) ||
(mf->TargetID != vdevice->vtarget->id) || (mf->TargetID != vdevice->vtarget->id) ||
memcmp(lun.scsi_lun, mf->LUN, 8)) memcmp(lun.scsi_lun, mf->LUN, 8))
continue; continue;
dsprintk(( "search_running: found (sc=%p, mf = %p) "
"channel %d id %d, lun %d \n", hd->ScsiLookup[ii],
mf, mf->Bus, mf->TargetID, vdevice->lun));
/* Cleanup /* Cleanup
*/ */
...@@ -1039,19 +1017,12 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) ...@@ -1039,19 +1017,12 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
mpt_free_msg_frame(hd->ioc, (MPT_FRAME_HDR *)mf); mpt_free_msg_frame(hd->ioc, (MPT_FRAME_HDR *)mf);
if ((unsigned char *)mf != sc->host_scribble) if ((unsigned char *)mf != sc->host_scribble)
continue; continue;
if (sc->use_sg) { scsi_dma_unmap(sc);
pci_unmap_sg(hd->ioc->pcidev,
(struct scatterlist *) sc->request_buffer,
sc->use_sg,
sc->sc_data_direction);
} else if (sc->request_bufflen) {
pci_unmap_single(hd->ioc->pcidev,
sc->SCp.dma_handle,
sc->request_bufflen,
sc->sc_data_direction);
}
sc->host_scribble = NULL; sc->host_scribble = NULL;
sc->result = DID_NO_CONNECT << 16; sc->result = DID_NO_CONNECT << 16;
dsprintk(( "search_running: found (sc=%p, mf = %p) "
"channel %d id %d, lun %d \n", sc, mf,
vdevice->vtarget->channel, vdevice->vtarget->id, vdevice->lun));
sc->scsi_done(sc); sc->scsi_done(sc);
} }
} }
...@@ -1380,10 +1351,10 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) ...@@ -1380,10 +1351,10 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
* will be no data transfer! GRRRRR... * will be no data transfer! GRRRRR...
*/ */
if (SCpnt->sc_data_direction == DMA_FROM_DEVICE) { if (SCpnt->sc_data_direction == DMA_FROM_DEVICE) {
datalen = SCpnt->request_bufflen; datalen = scsi_bufflen(SCpnt);
scsidir = MPI_SCSIIO_CONTROL_READ; /* DATA IN (host<--ioc<--dev) */ scsidir = MPI_SCSIIO_CONTROL_READ; /* DATA IN (host<--ioc<--dev) */
} else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) { } else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) {
datalen = SCpnt->request_bufflen; datalen = scsi_bufflen(SCpnt);
scsidir = MPI_SCSIIO_CONTROL_WRITE; /* DATA OUT (host-->ioc-->dev) */ scsidir = MPI_SCSIIO_CONTROL_WRITE; /* DATA OUT (host-->ioc-->dev) */
} else { } else {
datalen = 0; datalen = 0;
...@@ -1768,20 +1739,45 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) ...@@ -1768,20 +1739,45 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
u32 ctx2abort; u32 ctx2abort;
int scpnt_idx; int scpnt_idx;
int retval; int retval;
VirtDevice *vdev; VirtDevice *vdevice;
ulong sn = SCpnt->serial_number; ulong sn = SCpnt->serial_number;
MPT_ADAPTER *ioc;
/* If we can't locate our host adapter structure, return FAILED status. /* If we can't locate our host adapter structure, return FAILED status.
*/ */
if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL) { if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL) {
SCpnt->result = DID_RESET << 16; SCpnt->result = DID_RESET << 16;
SCpnt->scsi_done(SCpnt); SCpnt->scsi_done(SCpnt);
dfailprintk((KERN_INFO MYNAM ": mptscsih_abort: " dfailprintk((KERN_INFO MYNAM ": mptscsih_abort: Can't locate "
"Can't locate host! (sc=%p)\n", "host! (sc=%p)\n", SCpnt));
SCpnt));
return FAILED; return FAILED;
} }
ioc = hd->ioc;
printk(MYIOC_s_INFO_FMT "attempting task abort! (sc=%p)\n",
ioc->name, SCpnt);
scsi_print_command(SCpnt);
vdevice = SCpnt->device->hostdata;
if (!vdevice || !vdevice->vtarget) {
dtmprintk((MYIOC_s_DEBUG_FMT "task abort: device has been "
"deleted (sc=%p)\n", ioc->name, SCpnt));
SCpnt->result = DID_NO_CONNECT << 16;
SCpnt->scsi_done(SCpnt);
retval = 0;
goto out;
}
/* Task aborts are not supported for hidden raid components.
*/
if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) {
dtmprintk((MYIOC_s_DEBUG_FMT "task abort: hidden raid "
"component (sc=%p)\n", ioc->name, SCpnt));
SCpnt->result = DID_RESET << 16;
retval = FAILED;
goto out;
}
/* Find this command /* Find this command
*/ */
if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) {
...@@ -1790,21 +1786,20 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) ...@@ -1790,21 +1786,20 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
*/ */
SCpnt->result = DID_RESET << 16; SCpnt->result = DID_RESET << 16;
dtmprintk((KERN_INFO MYNAM ": %s: mptscsih_abort: " dtmprintk((KERN_INFO MYNAM ": %s: mptscsih_abort: "
"Command not in the active list! (sc=%p)\n", "Command not in the active list! (sc=%p)\n", ioc->name,
hd->ioc->name, SCpnt)); SCpnt));
return SUCCESS; retval = 0;
goto out;
} }
if (hd->resetPending) if (hd->resetPending) {
return FAILED; retval = FAILED;
goto out;
}
if (hd->timeouts < -1) if (hd->timeouts < -1)
hd->timeouts++; hd->timeouts++;
printk(KERN_WARNING MYNAM ": %s: attempting task abort! (sc=%p)\n",
hd->ioc->name, SCpnt);
scsi_print_command(SCpnt);
/* Most important! Set TaskMsgContext to SCpnt's MsgContext! /* Most important! Set TaskMsgContext to SCpnt's MsgContext!
* (the IO to be ABORT'd) * (the IO to be ABORT'd)
* *
...@@ -1817,18 +1812,17 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) ...@@ -1817,18 +1812,17 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
hd->abortSCpnt = SCpnt; hd->abortSCpnt = SCpnt;
vdev = SCpnt->device->hostdata;
retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
vdev->vtarget->channel, vdev->vtarget->id, vdev->lun, vdevice->vtarget->channel, vdevice->vtarget->id, vdevice->lun,
ctx2abort, mptscsih_get_tm_timeout(hd->ioc)); ctx2abort, mptscsih_get_tm_timeout(ioc));
if (SCPNT_TO_LOOKUP_IDX(SCpnt) == scpnt_idx && if (SCPNT_TO_LOOKUP_IDX(SCpnt) == scpnt_idx &&
SCpnt->serial_number == sn) SCpnt->serial_number == sn)
retval = FAILED; retval = FAILED;
printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n", out:
hd->ioc->name, printk(MYIOC_s_INFO_FMT "task abort: %s (sc=%p)\n",
((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt); ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt);
if (retval == 0) if (retval == 0)
return SUCCESS; return SUCCESS;
...@@ -1850,32 +1844,47 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt) ...@@ -1850,32 +1844,47 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
{ {
MPT_SCSI_HOST *hd; MPT_SCSI_HOST *hd;
int retval; int retval;
VirtDevice *vdev; VirtDevice *vdevice;
MPT_ADAPTER *ioc;
/* If we can't locate our host adapter structure, return FAILED status. /* If we can't locate our host adapter structure, return FAILED status.
*/ */
if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){ if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){
dtmprintk((KERN_INFO MYNAM ": mptscsih_dev_reset: " dtmprintk((KERN_INFO MYNAM ": mptscsih_dev_reset: Can't "
"Can't locate host! (sc=%p)\n", "locate host! (sc=%p)\n", SCpnt));
SCpnt));
return FAILED; return FAILED;
} }
if (hd->resetPending) ioc = hd->ioc;
return FAILED; printk(MYIOC_s_INFO_FMT "attempting target reset! (sc=%p)\n",
ioc->name, SCpnt);
printk(KERN_WARNING MYNAM ": %s: attempting target reset! (sc=%p)\n",
hd->ioc->name, SCpnt);
scsi_print_command(SCpnt); scsi_print_command(SCpnt);
vdev = SCpnt->device->hostdata; if (hd->resetPending) {
retval = FAILED;
goto out;
}
vdevice = SCpnt->device->hostdata;
if (!vdevice || !vdevice->vtarget) {
retval = 0;
goto out;
}
/* Target reset to hidden raid component is not supported
*/
if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) {
retval = FAILED;
goto out;
}
retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET,
vdev->vtarget->channel, vdev->vtarget->id, vdevice->vtarget->channel, vdevice->vtarget->id, 0, 0,
0, 0, mptscsih_get_tm_timeout(hd->ioc)); mptscsih_get_tm_timeout(ioc));
printk (KERN_WARNING MYNAM ": %s: target reset: %s (sc=%p)\n", out:
hd->ioc->name, printk (MYIOC_s_INFO_FMT "target reset: %s (sc=%p)\n",
((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt); ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt);
if (retval == 0) if (retval == 0)
return SUCCESS; return SUCCESS;
...@@ -1899,18 +1908,19 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt) ...@@ -1899,18 +1908,19 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
MPT_SCSI_HOST *hd; MPT_SCSI_HOST *hd;
int retval; int retval;
VirtDevice *vdev; VirtDevice *vdev;
MPT_ADAPTER *ioc;
/* If we can't locate our host adapter structure, return FAILED status. /* If we can't locate our host adapter structure, return FAILED status.
*/ */
if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){ if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){
dtmprintk((KERN_INFO MYNAM ": mptscsih_bus_reset: " dtmprintk((KERN_INFO MYNAM ": mptscsih_bus_reset: Can't "
"Can't locate host! (sc=%p)\n", "locate host! (sc=%p)\n", SCpnt ));
SCpnt ) );
return FAILED; return FAILED;
} }
printk(KERN_WARNING MYNAM ": %s: attempting bus reset! (sc=%p)\n", ioc = hd->ioc;
hd->ioc->name, SCpnt); printk(MYIOC_s_INFO_FMT "attempting bus reset! (sc=%p)\n",
ioc->name, SCpnt);
scsi_print_command(SCpnt); scsi_print_command(SCpnt);
if (hd->timeouts < -1) if (hd->timeouts < -1)
...@@ -1918,11 +1928,10 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt) ...@@ -1918,11 +1928,10 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
vdev = SCpnt->device->hostdata; vdev = SCpnt->device->hostdata;
retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS,
vdev->vtarget->channel, 0, 0, 0, mptscsih_get_tm_timeout(hd->ioc)); vdev->vtarget->channel, 0, 0, 0, mptscsih_get_tm_timeout(ioc));
printk (KERN_WARNING MYNAM ": %s: bus reset: %s (sc=%p)\n", printk(MYIOC_s_INFO_FMT "bus reset: %s (sc=%p)\n",
hd->ioc->name, ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt);
((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt);
if (retval == 0) if (retval == 0)
return SUCCESS; return SUCCESS;
...@@ -1943,37 +1952,38 @@ int ...@@ -1943,37 +1952,38 @@ int
mptscsih_host_reset(struct scsi_cmnd *SCpnt) mptscsih_host_reset(struct scsi_cmnd *SCpnt)
{ {
MPT_SCSI_HOST * hd; MPT_SCSI_HOST * hd;
int status = SUCCESS; int retval;
MPT_ADAPTER *ioc;
/* If we can't locate the host to reset, then we failed. */ /* If we can't locate the host to reset, then we failed. */
if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){ if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){
dtmprintk( ( KERN_INFO MYNAM ": mptscsih_host_reset: " dtmprintk( ( KERN_INFO MYNAM ": mptscsih_host_reset: Can't "
"Can't locate host! (sc=%p)\n", "locate host! (sc=%p)\n", SCpnt));
SCpnt ) );
return FAILED; return FAILED;
} }
printk(KERN_WARNING MYNAM ": %s: Attempting host reset! (sc=%p)\n", ioc = hd->ioc;
hd->ioc->name, SCpnt); printk(MYIOC_s_INFO_FMT "attempting host reset! (sc=%p)\n",
ioc->name, SCpnt);
/* If our attempts to reset the host failed, then return a failed /* If our attempts to reset the host failed, then return a failed
* status. The host will be taken off line by the SCSI mid-layer. * status. The host will be taken off line by the SCSI mid-layer.
*/ */
if (mpt_HardResetHandler(hd->ioc, CAN_SLEEP) < 0){ if (mpt_HardResetHandler(hd->ioc, CAN_SLEEP) < 0) {
status = FAILED; retval = FAILED;
} else { } else {
/* Make sure TM pending is cleared and TM state is set to /* Make sure TM pending is cleared and TM state is set to
* NONE. * NONE.
*/ */
retval = 0;
hd->tmPending = 0; hd->tmPending = 0;
hd->tmState = TM_STATE_NONE; hd->tmState = TM_STATE_NONE;
} }
dtmprintk( ( KERN_INFO MYNAM ": mptscsih_host_reset: " printk(MYIOC_s_INFO_FMT "host reset: %s (sc=%p)\n",
"Status = %s\n", ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt);
(status == SUCCESS) ? "SUCCESS" : "FAILED" ) );
return status; return retval;
} }
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
...@@ -3150,6 +3160,16 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice) ...@@ -3150,6 +3160,16 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
{ {
INTERNAL_CMD iocmd; INTERNAL_CMD iocmd;
/* Ignore hidden raid components, this is handled when the command
* is sent to the volume
*/
if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT)
return;
if (vdevice->vtarget->type != TYPE_DISK || vdevice->vtarget->deleted ||
!vdevice->configured_lun)
return;
/* Following parameters will not change /* Following parameters will not change
* in this routine. * in this routine.
*/ */
...@@ -3164,9 +3184,7 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice) ...@@ -3164,9 +3184,7 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
iocmd.id = vdevice->vtarget->id; iocmd.id = vdevice->vtarget->id;
iocmd.lun = vdevice->lun; iocmd.lun = vdevice->lun;
if ((vdevice->vtarget->type == TYPE_DISK) && mptscsih_do_cmd(hd, &iocmd);
(vdevice->configured_lun))
mptscsih_do_cmd(hd, &iocmd);
} }
EXPORT_SYMBOL(mptscsih_remove); EXPORT_SYMBOL(mptscsih_remove);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Logic Corporation
* (mailto:mpt_linux_developer@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
*/ */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#include "linux_compat.h" /* linux-2.6 tweaks */
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -485,7 +485,7 @@ int i2o_parm_field_get(struct i2o_device *i2o_dev, int group, int field, ...@@ -485,7 +485,7 @@ int i2o_parm_field_get(struct i2o_device *i2o_dev, int group, int field,
u8 *resblk; /* 8 bytes for header */ u8 *resblk; /* 8 bytes for header */
int rc; int rc;
resblk = kmalloc(buflen + 8, GFP_KERNEL | GFP_ATOMIC); resblk = kmalloc(buflen + 8, GFP_KERNEL);
if (!resblk) if (!resblk)
return -ENOMEM; return -ENOMEM;
......
...@@ -377,12 +377,8 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m, ...@@ -377,12 +377,8 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m,
osm_err("SCSI error %08x\n", error); osm_err("SCSI error %08x\n", error);
dev = &c->pdev->dev; dev = &c->pdev->dev;
if (cmd->use_sg)
dma_unmap_sg(dev, cmd->request_buffer, cmd->use_sg, scsi_dma_unmap(cmd);
cmd->sc_data_direction);
else if (cmd->SCp.dma_handle)
dma_unmap_single(dev, cmd->SCp.dma_handle, cmd->request_bufflen,
cmd->sc_data_direction);
cmd->scsi_done(cmd); cmd->scsi_done(cmd);
...@@ -664,21 +660,15 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, ...@@ -664,21 +660,15 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt,
if (sgl_offset != SGL_OFFSET_0) { if (sgl_offset != SGL_OFFSET_0) {
/* write size of data addressed by SGL */ /* write size of data addressed by SGL */
*mptr++ = cpu_to_le32(SCpnt->request_bufflen); *mptr++ = cpu_to_le32(scsi_bufflen(SCpnt));
/* Now fill in the SGList and command */ /* Now fill in the SGList and command */
if (SCpnt->use_sg) {
if (!i2o_dma_map_sg(c, SCpnt->request_buffer, if (scsi_sg_count(SCpnt)) {
SCpnt->use_sg, if (!i2o_dma_map_sg(c, scsi_sglist(SCpnt),
scsi_sg_count(SCpnt),
SCpnt->sc_data_direction, &mptr)) SCpnt->sc_data_direction, &mptr))
goto nomem; goto nomem;
} else {
SCpnt->SCp.dma_handle =
i2o_dma_map_single(c, SCpnt->request_buffer,
SCpnt->request_bufflen,
SCpnt->sc_data_direction, &mptr);
if (dma_mapping_error(SCpnt->SCp.dma_handle))
goto nomem;
} }
} }
......
...@@ -815,9 +815,7 @@ zfcp_get_adapter_by_busid(char *bus_id) ...@@ -815,9 +815,7 @@ zfcp_get_adapter_by_busid(char *bus_id)
struct zfcp_unit * struct zfcp_unit *
zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun) zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun)
{ {
struct zfcp_unit *unit, *tmp_unit; struct zfcp_unit *unit;
unsigned int scsi_lun;
int found;
/* /*
* check that there is no unit with this FCP_LUN already in list * check that there is no unit with this FCP_LUN already in list
...@@ -863,22 +861,10 @@ zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun) ...@@ -863,22 +861,10 @@ zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun)
} }
zfcp_unit_get(unit); zfcp_unit_get(unit);
unit->scsi_lun = scsilun_to_int((struct scsi_lun *)&unit->fcp_lun);
scsi_lun = 0;
found = 0;
write_lock_irq(&zfcp_data.config_lock); write_lock_irq(&zfcp_data.config_lock);
list_for_each_entry(tmp_unit, &port->unit_list_head, list) { list_add_tail(&unit->list, &port->unit_list_head);
if (tmp_unit->scsi_lun != scsi_lun) {
found = 1;
break;
}
scsi_lun++;
}
unit->scsi_lun = scsi_lun;
if (found)
list_add_tail(&unit->list, &tmp_unit->list);
else
list_add_tail(&unit->list, &port->unit_list_head);
atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &unit->status); atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &unit->status);
atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status); atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status);
write_unlock_irq(&zfcp_data.config_lock); write_unlock_irq(&zfcp_data.config_lock);
......
...@@ -1986,6 +1986,10 @@ zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *erp_action, int close) ...@@ -1986,6 +1986,10 @@ zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *erp_action, int close)
failed_openfcp: failed_openfcp:
zfcp_close_fsf(erp_action->adapter); zfcp_close_fsf(erp_action->adapter);
failed_qdio: failed_qdio:
atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK |
ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED |
ZFCP_STATUS_ADAPTER_XPORT_OK,
&erp_action->adapter->status);
out: out:
return retval; return retval;
} }
...@@ -2167,6 +2171,9 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -2167,6 +2171,9 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
sleep *= 2; sleep *= 2;
} }
atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
&adapter->status);
if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK,
&adapter->status)) { &adapter->status)) {
ZFCP_LOG_INFO("error: exchange of configuration data for " ZFCP_LOG_INFO("error: exchange of configuration data for "
......
...@@ -1306,22 +1306,26 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance) ...@@ -1306,22 +1306,26 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
wake_up(&tw_dev->ioctl_wqueue); wake_up(&tw_dev->ioctl_wqueue);
} }
} else { } else {
struct scsi_cmnd *cmd;
cmd = tw_dev->srb[request_id];
twa_scsiop_execute_scsi_complete(tw_dev, request_id); twa_scsiop_execute_scsi_complete(tw_dev, request_id);
/* If no error command was a success */ /* If no error command was a success */
if (error == 0) { if (error == 0) {
tw_dev->srb[request_id]->result = (DID_OK << 16); cmd->result = (DID_OK << 16);
} }
/* If error, command failed */ /* If error, command failed */
if (error == 1) { if (error == 1) {
/* Ask for a host reset */ /* Ask for a host reset */
tw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1); cmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
} }
/* Report residual bytes for single sgl */ /* Report residual bytes for single sgl */
if ((tw_dev->srb[request_id]->use_sg <= 1) && (full_command_packet->command.newcommand.status == 0)) { if ((scsi_sg_count(cmd) <= 1) && (full_command_packet->command.newcommand.status == 0)) {
if (full_command_packet->command.newcommand.sg_list[0].length < tw_dev->srb[request_id]->request_bufflen) if (full_command_packet->command.newcommand.sg_list[0].length < scsi_bufflen(tw_dev->srb[request_id]))
tw_dev->srb[request_id]->resid = tw_dev->srb[request_id]->request_bufflen - full_command_packet->command.newcommand.sg_list[0].length; scsi_set_resid(cmd, scsi_bufflen(cmd) - full_command_packet->command.newcommand.sg_list[0].length);
} }
/* Now complete the io */ /* Now complete the io */
...@@ -1384,52 +1388,20 @@ static int twa_map_scsi_sg_data(TW_Device_Extension *tw_dev, int request_id) ...@@ -1384,52 +1388,20 @@ static int twa_map_scsi_sg_data(TW_Device_Extension *tw_dev, int request_id)
{ {
int use_sg; int use_sg;
struct scsi_cmnd *cmd = tw_dev->srb[request_id]; struct scsi_cmnd *cmd = tw_dev->srb[request_id];
struct pci_dev *pdev = tw_dev->tw_pci_dev;
int retval = 0;
if (cmd->use_sg == 0)
goto out;
use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg, DMA_BIDIRECTIONAL);
if (use_sg == 0) { use_sg = scsi_dma_map(cmd);
if (!use_sg)
return 0;
else if (use_sg < 0) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1c, "Failed to map scatter gather list"); TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1c, "Failed to map scatter gather list");
goto out; return 0;
} }
cmd->SCp.phase = TW_PHASE_SGLIST; cmd->SCp.phase = TW_PHASE_SGLIST;
cmd->SCp.have_data_in = use_sg; cmd->SCp.have_data_in = use_sg;
retval = use_sg;
out:
return retval;
} /* End twa_map_scsi_sg_data() */
/* This function will perform a pci-dma map for a single buffer */
static dma_addr_t twa_map_scsi_single_data(TW_Device_Extension *tw_dev, int request_id)
{
dma_addr_t mapping;
struct scsi_cmnd *cmd = tw_dev->srb[request_id];
struct pci_dev *pdev = tw_dev->tw_pci_dev;
dma_addr_t retval = 0;
if (cmd->request_bufflen == 0) {
retval = 0;
goto out;
}
mapping = pci_map_single(pdev, cmd->request_buffer, cmd->request_bufflen, DMA_BIDIRECTIONAL);
if (mapping == 0) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1d, "Failed to map page");
goto out;
}
cmd->SCp.phase = TW_PHASE_SINGLE; return use_sg;
cmd->SCp.have_data_in = mapping; } /* End twa_map_scsi_sg_data() */
retval = mapping;
out:
return retval;
} /* End twa_map_scsi_single_data() */
/* This function will poll for a response interrupt of a request */ /* This function will poll for a response interrupt of a request */
static int twa_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds) static int twa_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds)
...@@ -1815,15 +1787,13 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, ...@@ -1815,15 +1787,13 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
u32 num_sectors = 0x0; u32 num_sectors = 0x0;
int i, sg_count; int i, sg_count;
struct scsi_cmnd *srb = NULL; struct scsi_cmnd *srb = NULL;
struct scatterlist *sglist = NULL; struct scatterlist *sglist = NULL, *sg;
dma_addr_t buffaddr = 0x0;
int retval = 1; int retval = 1;
if (tw_dev->srb[request_id]) { if (tw_dev->srb[request_id]) {
if (tw_dev->srb[request_id]->request_buffer) {
sglist = (struct scatterlist *)tw_dev->srb[request_id]->request_buffer;
}
srb = tw_dev->srb[request_id]; srb = tw_dev->srb[request_id];
if (scsi_sglist(srb))
sglist = scsi_sglist(srb);
} }
/* Initialize command packet */ /* Initialize command packet */
...@@ -1856,32 +1826,12 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, ...@@ -1856,32 +1826,12 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
if (!sglistarg) { if (!sglistarg) {
/* Map sglist from scsi layer to cmd packet */ /* Map sglist from scsi layer to cmd packet */
if (tw_dev->srb[request_id]->use_sg == 0) {
if (tw_dev->srb[request_id]->request_bufflen < TW_MIN_SGL_LENGTH) {
command_packet->sg_list[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]);
command_packet->sg_list[0].length = cpu_to_le32(TW_MIN_SGL_LENGTH);
if (tw_dev->srb[request_id]->sc_data_direction == DMA_TO_DEVICE || tw_dev->srb[request_id]->sc_data_direction == DMA_BIDIRECTIONAL)
memcpy(tw_dev->generic_buffer_virt[request_id], tw_dev->srb[request_id]->request_buffer, tw_dev->srb[request_id]->request_bufflen);
} else {
buffaddr = twa_map_scsi_single_data(tw_dev, request_id);
if (buffaddr == 0)
goto out;
command_packet->sg_list[0].address = TW_CPU_TO_SGL(buffaddr);
command_packet->sg_list[0].length = cpu_to_le32(tw_dev->srb[request_id]->request_bufflen);
}
command_packet->sgl_entries__lunh = cpu_to_le16(TW_REQ_LUN_IN((srb->device->lun >> 4), 1));
if (command_packet->sg_list[0].address & TW_CPU_TO_SGL(TW_ALIGNMENT_9000_SGL)) { if (scsi_sg_count(srb)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x2d, "Found unaligned address during execute scsi"); if ((scsi_sg_count(srb) == 1) &&
goto out; (scsi_bufflen(srb) < TW_MIN_SGL_LENGTH)) {
} if (srb->sc_data_direction == DMA_TO_DEVICE || srb->sc_data_direction == DMA_BIDIRECTIONAL) {
} struct scatterlist *sg = scsi_sglist(srb);
if (tw_dev->srb[request_id]->use_sg > 0) {
if ((tw_dev->srb[request_id]->use_sg == 1) && (tw_dev->srb[request_id]->request_bufflen < TW_MIN_SGL_LENGTH)) {
if (tw_dev->srb[request_id]->sc_data_direction == DMA_TO_DEVICE || tw_dev->srb[request_id]->sc_data_direction == DMA_BIDIRECTIONAL) {
struct scatterlist *sg = (struct scatterlist *)tw_dev->srb[request_id]->request_buffer;
char *buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset; char *buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
memcpy(tw_dev->generic_buffer_virt[request_id], buf, sg->length); memcpy(tw_dev->generic_buffer_virt[request_id], buf, sg->length);
kunmap_atomic(buf - sg->offset, KM_IRQ0); kunmap_atomic(buf - sg->offset, KM_IRQ0);
...@@ -1893,16 +1843,16 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, ...@@ -1893,16 +1843,16 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
if (sg_count == 0) if (sg_count == 0)
goto out; goto out;
for (i = 0; i < sg_count; i++) { scsi_for_each_sg(srb, sg, sg_count, i) {
command_packet->sg_list[i].address = TW_CPU_TO_SGL(sg_dma_address(&sglist[i])); command_packet->sg_list[i].address = TW_CPU_TO_SGL(sg_dma_address(sg));
command_packet->sg_list[i].length = cpu_to_le32(sg_dma_len(&sglist[i])); command_packet->sg_list[i].length = cpu_to_le32(sg_dma_len(sg));
if (command_packet->sg_list[i].address & TW_CPU_TO_SGL(TW_ALIGNMENT_9000_SGL)) { if (command_packet->sg_list[i].address & TW_CPU_TO_SGL(TW_ALIGNMENT_9000_SGL)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x2e, "Found unaligned sgl address during execute scsi"); TW_PRINTK(tw_dev->host, TW_DRIVER, 0x2e, "Found unaligned sgl address during execute scsi");
goto out; goto out;
} }
} }
} }
command_packet->sgl_entries__lunh = cpu_to_le16(TW_REQ_LUN_IN((srb->device->lun >> 4), tw_dev->srb[request_id]->use_sg)); command_packet->sgl_entries__lunh = cpu_to_le16(TW_REQ_LUN_IN((srb->device->lun >> 4), scsi_sg_count(tw_dev->srb[request_id])));
} }
} else { } else {
/* Internal cdb post */ /* Internal cdb post */
...@@ -1932,7 +1882,7 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, ...@@ -1932,7 +1882,7 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
/* Update SG statistics */ /* Update SG statistics */
if (srb) { if (srb) {
tw_dev->sgl_entries = tw_dev->srb[request_id]->use_sg; tw_dev->sgl_entries = scsi_sg_count(tw_dev->srb[request_id]);
if (tw_dev->sgl_entries > tw_dev->max_sgl_entries) if (tw_dev->sgl_entries > tw_dev->max_sgl_entries)
tw_dev->max_sgl_entries = tw_dev->sgl_entries; tw_dev->max_sgl_entries = tw_dev->sgl_entries;
} }
...@@ -1951,16 +1901,13 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, ...@@ -1951,16 +1901,13 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
/* This function completes an execute scsi operation */ /* This function completes an execute scsi operation */
static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int request_id) static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int request_id)
{ {
if (tw_dev->srb[request_id]->request_bufflen < TW_MIN_SGL_LENGTH && struct scsi_cmnd *cmd = tw_dev->srb[request_id];
(tw_dev->srb[request_id]->sc_data_direction == DMA_FROM_DEVICE ||
tw_dev->srb[request_id]->sc_data_direction == DMA_BIDIRECTIONAL)) { if (scsi_bufflen(cmd) < TW_MIN_SGL_LENGTH &&
if (tw_dev->srb[request_id]->use_sg == 0) { (cmd->sc_data_direction == DMA_FROM_DEVICE ||
memcpy(tw_dev->srb[request_id]->request_buffer, cmd->sc_data_direction == DMA_BIDIRECTIONAL)) {
tw_dev->generic_buffer_virt[request_id], if (scsi_sg_count(cmd) == 1) {
tw_dev->srb[request_id]->request_bufflen); struct scatterlist *sg = scsi_sglist(tw_dev->srb[request_id]);
}
if (tw_dev->srb[request_id]->use_sg == 1) {
struct scatterlist *sg = (struct scatterlist *)tw_dev->srb[request_id]->request_buffer;
char *buf; char *buf;
unsigned long flags = 0; unsigned long flags = 0;
local_irq_save(flags); local_irq_save(flags);
...@@ -2017,16 +1964,8 @@ static char *twa_string_lookup(twa_message_type *table, unsigned int code) ...@@ -2017,16 +1964,8 @@ static char *twa_string_lookup(twa_message_type *table, unsigned int code)
static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id) static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id)
{ {
struct scsi_cmnd *cmd = tw_dev->srb[request_id]; struct scsi_cmnd *cmd = tw_dev->srb[request_id];
struct pci_dev *pdev = tw_dev->tw_pci_dev;
switch(cmd->SCp.phase) { scsi_dma_unmap(cmd);
case TW_PHASE_SINGLE:
pci_unmap_single(pdev, cmd->SCp.have_data_in, cmd->request_bufflen, DMA_BIDIRECTIONAL);
break;
case TW_PHASE_SGLIST:
pci_unmap_sg(pdev, cmd->request_buffer, cmd->use_sg, DMA_BIDIRECTIONAL);
break;
}
} /* End twa_unmap_scsi_data() */ } /* End twa_unmap_scsi_data() */
/* scsi_host_template initializer */ /* scsi_host_template initializer */
......
...@@ -1273,57 +1273,24 @@ static int tw_map_scsi_sg_data(struct pci_dev *pdev, struct scsi_cmnd *cmd) ...@@ -1273,57 +1273,24 @@ static int tw_map_scsi_sg_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
int use_sg; int use_sg;
dprintk(KERN_WARNING "3w-xxxx: tw_map_scsi_sg_data()\n"); dprintk(KERN_WARNING "3w-xxxx: tw_map_scsi_sg_data()\n");
if (cmd->use_sg == 0)
return 0;
use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg, DMA_BIDIRECTIONAL); use_sg = scsi_dma_map(cmd);
if (use_sg < 0) {
if (use_sg == 0) {
printk(KERN_WARNING "3w-xxxx: tw_map_scsi_sg_data(): pci_map_sg() failed.\n"); printk(KERN_WARNING "3w-xxxx: tw_map_scsi_sg_data(): pci_map_sg() failed.\n");
return 0; return 0;
} }
cmd->SCp.phase = TW_PHASE_SGLIST; cmd->SCp.phase = TW_PHASE_SGLIST;
cmd->SCp.have_data_in = use_sg; cmd->SCp.have_data_in = use_sg;
return use_sg; return use_sg;
} /* End tw_map_scsi_sg_data() */ } /* End tw_map_scsi_sg_data() */
static u32 tw_map_scsi_single_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
{
dma_addr_t mapping;
dprintk(KERN_WARNING "3w-xxxx: tw_map_scsi_single_data()\n");
if (cmd->request_bufflen == 0)
return 0;
mapping = pci_map_page(pdev, virt_to_page(cmd->request_buffer), offset_in_page(cmd->request_buffer), cmd->request_bufflen, DMA_BIDIRECTIONAL);
if (mapping == 0) {
printk(KERN_WARNING "3w-xxxx: tw_map_scsi_single_data(): pci_map_page() failed.\n");
return 0;
}
cmd->SCp.phase = TW_PHASE_SINGLE;
cmd->SCp.have_data_in = mapping;
return mapping;
} /* End tw_map_scsi_single_data() */
static void tw_unmap_scsi_data(struct pci_dev *pdev, struct scsi_cmnd *cmd) static void tw_unmap_scsi_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
{ {
dprintk(KERN_WARNING "3w-xxxx: tw_unmap_scsi_data()\n"); dprintk(KERN_WARNING "3w-xxxx: tw_unmap_scsi_data()\n");
switch(cmd->SCp.phase) { scsi_dma_unmap(cmd);
case TW_PHASE_SINGLE:
pci_unmap_page(pdev, cmd->SCp.have_data_in, cmd->request_bufflen, DMA_BIDIRECTIONAL);
break;
case TW_PHASE_SGLIST:
pci_unmap_sg(pdev, cmd->request_buffer, cmd->use_sg, DMA_BIDIRECTIONAL);
break;
}
} /* End tw_unmap_scsi_data() */ } /* End tw_unmap_scsi_data() */
/* This function will reset a device extension */ /* This function will reset a device extension */
...@@ -1499,27 +1466,16 @@ static void tw_transfer_internal(TW_Device_Extension *tw_dev, int request_id, ...@@ -1499,27 +1466,16 @@ static void tw_transfer_internal(TW_Device_Extension *tw_dev, int request_id,
void *buf; void *buf;
unsigned int transfer_len; unsigned int transfer_len;
unsigned long flags = 0; unsigned long flags = 0;
struct scatterlist *sg = scsi_sglist(cmd);
if (cmd->use_sg) { local_irq_save(flags);
struct scatterlist *sg = buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
(struct scatterlist *)cmd->request_buffer; transfer_len = min(sg->length, len);
local_irq_save(flags);
buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
transfer_len = min(sg->length, len);
} else {
buf = cmd->request_buffer;
transfer_len = min(cmd->request_bufflen, len);
}
memcpy(buf, data, transfer_len); memcpy(buf, data, transfer_len);
if (cmd->use_sg) {
struct scatterlist *sg;
sg = (struct scatterlist *)cmd->request_buffer; kunmap_atomic(buf - sg->offset, KM_IRQ0);
kunmap_atomic(buf - sg->offset, KM_IRQ0); local_irq_restore(flags);
local_irq_restore(flags);
}
} }
/* This function is called by the isr to complete an inquiry command */ /* This function is called by the isr to complete an inquiry command */
...@@ -1764,19 +1720,20 @@ static int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id) ...@@ -1764,19 +1720,20 @@ static int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id)
{ {
TW_Command *command_packet; TW_Command *command_packet;
unsigned long command_que_value; unsigned long command_que_value;
u32 lba = 0x0, num_sectors = 0x0, buffaddr = 0x0; u32 lba = 0x0, num_sectors = 0x0;
int i, use_sg; int i, use_sg;
struct scsi_cmnd *srb; struct scsi_cmnd *srb;
struct scatterlist *sglist; struct scatterlist *sglist, *sg;
dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_read_write()\n"); dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_read_write()\n");
if (tw_dev->srb[request_id]->request_buffer == NULL) { srb = tw_dev->srb[request_id];
sglist = scsi_sglist(srb);
if (!sglist) {
printk(KERN_WARNING "3w-xxxx: tw_scsiop_read_write(): Request buffer NULL.\n"); printk(KERN_WARNING "3w-xxxx: tw_scsiop_read_write(): Request buffer NULL.\n");
return 1; return 1;
} }
sglist = (struct scatterlist *)tw_dev->srb[request_id]->request_buffer;
srb = tw_dev->srb[request_id];
/* Initialize command packet */ /* Initialize command packet */
command_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id]; command_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];
...@@ -1819,33 +1776,18 @@ static int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id) ...@@ -1819,33 +1776,18 @@ static int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id)
command_packet->byte8.io.lba = lba; command_packet->byte8.io.lba = lba;
command_packet->byte6.block_count = num_sectors; command_packet->byte6.block_count = num_sectors;
/* Do this if there are no sg list entries */ use_sg = tw_map_scsi_sg_data(tw_dev->tw_pci_dev, tw_dev->srb[request_id]);
if (tw_dev->srb[request_id]->use_sg == 0) { if (!use_sg)
dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_read_write(): SG = 0\n"); return 1;
buffaddr = tw_map_scsi_single_data(tw_dev->tw_pci_dev, tw_dev->srb[request_id]);
if (buffaddr == 0)
return 1;
command_packet->byte8.io.sgl[0].address = buffaddr; scsi_for_each_sg(tw_dev->srb[request_id], sg, use_sg, i) {
command_packet->byte8.io.sgl[0].length = tw_dev->srb[request_id]->request_bufflen; command_packet->byte8.io.sgl[i].address = sg_dma_address(sg);
command_packet->byte8.io.sgl[i].length = sg_dma_len(sg);
command_packet->size+=2; command_packet->size+=2;
} }
/* Do this if we have multiple sg list entries */
if (tw_dev->srb[request_id]->use_sg > 0) {
use_sg = tw_map_scsi_sg_data(tw_dev->tw_pci_dev, tw_dev->srb[request_id]);
if (use_sg == 0)
return 1;
for (i=0;i<use_sg; i++) {
command_packet->byte8.io.sgl[i].address = sg_dma_address(&sglist[i]);
command_packet->byte8.io.sgl[i].length = sg_dma_len(&sglist[i]);
command_packet->size+=2;
}
}
/* Update SG statistics */ /* Update SG statistics */
tw_dev->sgl_entries = tw_dev->srb[request_id]->use_sg; tw_dev->sgl_entries = scsi_sg_count(tw_dev->srb[request_id]);
if (tw_dev->sgl_entries > tw_dev->max_sgl_entries) if (tw_dev->sgl_entries > tw_dev->max_sgl_entries)
tw_dev->max_sgl_entries = tw_dev->sgl_entries; tw_dev->max_sgl_entries = tw_dev->sgl_entries;
......
...@@ -267,8 +267,6 @@ NCR_700_offset_period_to_sxfer(struct NCR_700_Host_Parameters *hostdata, ...@@ -267,8 +267,6 @@ NCR_700_offset_period_to_sxfer(struct NCR_700_Host_Parameters *hostdata,
offset = max_offset; offset = max_offset;
} }
if(XFERP < min_xferp) { if(XFERP < min_xferp) {
printk(KERN_WARNING "53c700: XFERP %d is less than minium, setting to %d\n",
XFERP, min_xferp);
XFERP = min_xferp; XFERP = min_xferp;
} }
return (offset & 0x0f) | (XFERP & 0x07)<<4; return (offset & 0x0f) | (XFERP & 0x07)<<4;
...@@ -585,16 +583,8 @@ NCR_700_unmap(struct NCR_700_Host_Parameters *hostdata, struct scsi_cmnd *SCp, ...@@ -585,16 +583,8 @@ NCR_700_unmap(struct NCR_700_Host_Parameters *hostdata, struct scsi_cmnd *SCp,
struct NCR_700_command_slot *slot) struct NCR_700_command_slot *slot)
{ {
if(SCp->sc_data_direction != DMA_NONE && if(SCp->sc_data_direction != DMA_NONE &&
SCp->sc_data_direction != DMA_BIDIRECTIONAL) { SCp->sc_data_direction != DMA_BIDIRECTIONAL)
if(SCp->use_sg) { scsi_dma_unmap(SCp);
dma_unmap_sg(hostdata->dev, SCp->request_buffer,
SCp->use_sg, SCp->sc_data_direction);
} else {
dma_unmap_single(hostdata->dev, slot->dma_handle,
SCp->request_bufflen,
SCp->sc_data_direction);
}
}
} }
STATIC inline void STATIC inline void
...@@ -661,7 +651,6 @@ NCR_700_chip_setup(struct Scsi_Host *host) ...@@ -661,7 +651,6 @@ NCR_700_chip_setup(struct Scsi_Host *host)
{ {
struct NCR_700_Host_Parameters *hostdata = struct NCR_700_Host_Parameters *hostdata =
(struct NCR_700_Host_Parameters *)host->hostdata[0]; (struct NCR_700_Host_Parameters *)host->hostdata[0];
__u32 dcntl_extra = 0;
__u8 min_period; __u8 min_period;
__u8 min_xferp = (hostdata->chip710 ? NCR_710_MIN_XFERP : NCR_700_MIN_XFERP); __u8 min_xferp = (hostdata->chip710 ? NCR_710_MIN_XFERP : NCR_700_MIN_XFERP);
...@@ -686,13 +675,14 @@ NCR_700_chip_setup(struct Scsi_Host *host) ...@@ -686,13 +675,14 @@ NCR_700_chip_setup(struct Scsi_Host *host)
burst_disable = BURST_DISABLE; burst_disable = BURST_DISABLE;
break; break;
} }
dcntl_extra = COMPAT_700_MODE; hostdata->dcntl_extra |= COMPAT_700_MODE;
NCR_700_writeb(dcntl_extra, host, DCNTL_REG); NCR_700_writeb(hostdata->dcntl_extra, host, DCNTL_REG);
NCR_700_writeb(burst_length | hostdata->dmode_extra, NCR_700_writeb(burst_length | hostdata->dmode_extra,
host, DMODE_710_REG); host, DMODE_710_REG);
NCR_700_writeb(burst_disable | (hostdata->differential ? NCR_700_writeb(burst_disable | hostdata->ctest7_extra |
DIFF : 0), host, CTEST7_REG); (hostdata->differential ? DIFF : 0),
host, CTEST7_REG);
NCR_700_writeb(BTB_TIMER_DISABLE, host, CTEST0_REG); NCR_700_writeb(BTB_TIMER_DISABLE, host, CTEST0_REG);
NCR_700_writeb(FULL_ARBITRATION | ENABLE_PARITY | PARITY NCR_700_writeb(FULL_ARBITRATION | ENABLE_PARITY | PARITY
| AUTO_ATN, host, SCNTL0_REG); | AUTO_ATN, host, SCNTL0_REG);
...@@ -727,13 +717,13 @@ NCR_700_chip_setup(struct Scsi_Host *host) ...@@ -727,13 +717,13 @@ NCR_700_chip_setup(struct Scsi_Host *host)
* of spec: sync divider 2, async divider 3 */ * of spec: sync divider 2, async divider 3 */
DEBUG(("53c700: sync 2 async 3\n")); DEBUG(("53c700: sync 2 async 3\n"));
NCR_700_writeb(SYNC_DIV_2_0, host, SBCL_REG); NCR_700_writeb(SYNC_DIV_2_0, host, SBCL_REG);
NCR_700_writeb(ASYNC_DIV_3_0 | dcntl_extra, host, DCNTL_REG); NCR_700_writeb(ASYNC_DIV_3_0 | hostdata->dcntl_extra, host, DCNTL_REG);
hostdata->sync_clock = hostdata->clock/2; hostdata->sync_clock = hostdata->clock/2;
} else if(hostdata->clock > 50 && hostdata->clock <= 75) { } else if(hostdata->clock > 50 && hostdata->clock <= 75) {
/* sync divider 1.5, async divider 3 */ /* sync divider 1.5, async divider 3 */
DEBUG(("53c700: sync 1.5 async 3\n")); DEBUG(("53c700: sync 1.5 async 3\n"));
NCR_700_writeb(SYNC_DIV_1_5, host, SBCL_REG); NCR_700_writeb(SYNC_DIV_1_5, host, SBCL_REG);
NCR_700_writeb(ASYNC_DIV_3_0 | dcntl_extra, host, DCNTL_REG); NCR_700_writeb(ASYNC_DIV_3_0 | hostdata->dcntl_extra, host, DCNTL_REG);
hostdata->sync_clock = hostdata->clock*2; hostdata->sync_clock = hostdata->clock*2;
hostdata->sync_clock /= 3; hostdata->sync_clock /= 3;
...@@ -741,18 +731,18 @@ NCR_700_chip_setup(struct Scsi_Host *host) ...@@ -741,18 +731,18 @@ NCR_700_chip_setup(struct Scsi_Host *host)
/* sync divider 1, async divider 2 */ /* sync divider 1, async divider 2 */
DEBUG(("53c700: sync 1 async 2\n")); DEBUG(("53c700: sync 1 async 2\n"));
NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG); NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
NCR_700_writeb(ASYNC_DIV_2_0 | dcntl_extra, host, DCNTL_REG); NCR_700_writeb(ASYNC_DIV_2_0 | hostdata->dcntl_extra, host, DCNTL_REG);
hostdata->sync_clock = hostdata->clock; hostdata->sync_clock = hostdata->clock;
} else if(hostdata->clock > 25 && hostdata->clock <=37) { } else if(hostdata->clock > 25 && hostdata->clock <=37) {
/* sync divider 1, async divider 1.5 */ /* sync divider 1, async divider 1.5 */
DEBUG(("53c700: sync 1 async 1.5\n")); DEBUG(("53c700: sync 1 async 1.5\n"));
NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG); NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
NCR_700_writeb(ASYNC_DIV_1_5 | dcntl_extra, host, DCNTL_REG); NCR_700_writeb(ASYNC_DIV_1_5 | hostdata->dcntl_extra, host, DCNTL_REG);
hostdata->sync_clock = hostdata->clock; hostdata->sync_clock = hostdata->clock;
} else { } else {
DEBUG(("53c700: sync 1 async 1\n")); DEBUG(("53c700: sync 1 async 1\n"));
NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG); NCR_700_writeb(SYNC_DIV_1_0, host, SBCL_REG);
NCR_700_writeb(ASYNC_DIV_1_0 | dcntl_extra, host, DCNTL_REG); NCR_700_writeb(ASYNC_DIV_1_0 | hostdata->dcntl_extra, host, DCNTL_REG);
/* sync divider 1, async divider 1 */ /* sync divider 1, async divider 1 */
hostdata->sync_clock = hostdata->clock; hostdata->sync_clock = hostdata->clock;
} }
...@@ -1263,14 +1253,13 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, ...@@ -1263,14 +1253,13 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
host->host_no, pun, lun, NCR_700_condition[i], host->host_no, pun, lun, NCR_700_condition[i],
NCR_700_phase[j], dsp - hostdata->pScript); NCR_700_phase[j], dsp - hostdata->pScript);
if(SCp != NULL) { if(SCp != NULL) {
scsi_print_command(SCp); struct scatterlist *sg;
if(SCp->use_sg) { scsi_print_command(SCp);
for(i = 0; i < SCp->use_sg + 1; i++) { scsi_for_each_sg(SCp, sg, scsi_sg_count(SCp) + 1, i) {
printk(KERN_INFO " SG[%d].length = %d, move_insn=%08x, addr %08x\n", i, ((struct scatterlist *)SCp->request_buffer)[i].length, ((struct NCR_700_command_slot *)SCp->host_scribble)->SG[i].ins, ((struct NCR_700_command_slot *)SCp->host_scribble)->SG[i].pAddr); printk(KERN_INFO " SG[%d].length = %d, move_insn=%08x, addr %08x\n", i, sg->length, ((struct NCR_700_command_slot *)SCp->host_scribble)->SG[i].ins, ((struct NCR_700_command_slot *)SCp->host_scribble)->SG[i].pAddr);
}
} }
} }
NCR_700_internal_bus_reset(host); NCR_700_internal_bus_reset(host);
} else if((dsps & 0xfffff000) == A_DEBUG_INTERRUPT) { } else if((dsps & 0xfffff000) == A_DEBUG_INTERRUPT) {
printk(KERN_NOTICE "scsi%d (%d:%d) DEBUG INTERRUPT %d AT %08x[%04x], continuing\n", printk(KERN_NOTICE "scsi%d (%d:%d) DEBUG INTERRUPT %d AT %08x[%04x], continuing\n",
...@@ -1844,8 +1833,8 @@ NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) ...@@ -1844,8 +1833,8 @@ NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
} }
/* sanity check: some of the commands generated by the mid-layer /* sanity check: some of the commands generated by the mid-layer
* have an eccentric idea of their sc_data_direction */ * have an eccentric idea of their sc_data_direction */
if(!SCp->use_sg && !SCp->request_bufflen if(!scsi_sg_count(SCp) && !scsi_bufflen(SCp) &&
&& SCp->sc_data_direction != DMA_NONE) { SCp->sc_data_direction != DMA_NONE) {
#ifdef NCR_700_DEBUG #ifdef NCR_700_DEBUG
printk("53c700: Command"); printk("53c700: Command");
scsi_print_command(SCp); scsi_print_command(SCp);
...@@ -1887,31 +1876,15 @@ NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) ...@@ -1887,31 +1876,15 @@ NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
int i; int i;
int sg_count; int sg_count;
dma_addr_t vPtr = 0; dma_addr_t vPtr = 0;
struct scatterlist *sg;
__u32 count = 0; __u32 count = 0;
if(SCp->use_sg) { sg_count = scsi_dma_map(SCp);
sg_count = dma_map_sg(hostdata->dev, BUG_ON(sg_count < 0);
SCp->request_buffer, SCp->use_sg,
direction);
} else {
vPtr = dma_map_single(hostdata->dev,
SCp->request_buffer,
SCp->request_bufflen,
direction);
count = SCp->request_bufflen;
slot->dma_handle = vPtr;
sg_count = 1;
}
for(i = 0; i < sg_count; i++) { scsi_for_each_sg(SCp, sg, sg_count, i) {
vPtr = sg_dma_address(sg);
if(SCp->use_sg) { count = sg_dma_len(sg);
struct scatterlist *sg = SCp->request_buffer;
vPtr = sg_dma_address(&sg[i]);
count = sg_dma_len(&sg[i]);
}
slot->SG[i].ins = bS_to_host(move_ins | count); slot->SG[i].ins = bS_to_host(move_ins | count);
DEBUG((" scatter block %d: move %d[%08x] from 0x%lx\n", DEBUG((" scatter block %d: move %d[%08x] from 0x%lx\n",
......
...@@ -177,6 +177,7 @@ struct NCR_700_command_slot { ...@@ -177,6 +177,7 @@ struct NCR_700_command_slot {
__u8 state; __u8 state;
#define NCR_700_FLAG_AUTOSENSE 0x01 #define NCR_700_FLAG_AUTOSENSE 0x01
__u8 flags; __u8 flags;
__u8 pad1[2]; /* Needed for m68k where min alignment is 2 bytes */
int tag; int tag;
__u32 resume_offset; __u32 resume_offset;
struct scsi_cmnd *cmnd; struct scsi_cmnd *cmnd;
...@@ -196,6 +197,8 @@ struct NCR_700_Host_Parameters { ...@@ -196,6 +197,8 @@ struct NCR_700_Host_Parameters {
void __iomem *base; /* the base for the port (copied to host) */ void __iomem *base; /* the base for the port (copied to host) */
struct device *dev; struct device *dev;
__u32 dmode_extra; /* adjustable bus settings */ __u32 dmode_extra; /* adjustable bus settings */
__u32 dcntl_extra; /* adjustable bus settings */
__u32 ctest7_extra; /* adjustable bus settings */
__u32 differential:1; /* if we are differential */ __u32 differential:1; /* if we are differential */
#ifdef CONFIG_53C700_LE_ON_BE #ifdef CONFIG_53C700_LE_ON_BE
/* This option is for HP only. Set it if your chip is wired for /* This option is for HP only. Set it if your chip is wired for
...@@ -352,6 +355,7 @@ struct NCR_700_Host_Parameters { ...@@ -352,6 +355,7 @@ struct NCR_700_Host_Parameters {
#define SEL_TIMEOUT_DISABLE 0x10 /* 710 only */ #define SEL_TIMEOUT_DISABLE 0x10 /* 710 only */
#define DFP 0x08 #define DFP 0x08
#define EVP 0x04 #define EVP 0x04
#define CTEST7_TT1 0x02
#define DIFF 0x01 #define DIFF 0x01
#define CTEST6_REG 0x1A #define CTEST6_REG 0x1A
#define TEMP_REG 0x1C #define TEMP_REG 0x1C
...@@ -385,6 +389,7 @@ struct NCR_700_Host_Parameters { ...@@ -385,6 +389,7 @@ struct NCR_700_Host_Parameters {
#define SOFTWARE_RESET 0x01 #define SOFTWARE_RESET 0x01
#define COMPAT_700_MODE 0x01 #define COMPAT_700_MODE 0x01
#define SCRPTS_16BITS 0x20 #define SCRPTS_16BITS 0x20
#define EA_710 0x20
#define ASYNC_DIV_2_0 0x00 #define ASYNC_DIV_2_0 0x00
#define ASYNC_DIV_1_5 0x40 #define ASYNC_DIV_1_5 0x40
#define ASYNC_DIV_1_0 0x80 #define ASYNC_DIV_1_0 0x80
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
#undef A_NCR53c7xx_msg_abort
#undef A_NCR53c7xx_msg_reject
#undef A_NCR53c7xx_sink
#undef A_NCR53c7xx_zero
#undef A_NOP_insn
#undef A_addr_dsa
#undef A_addr_reconnect_dsa_head
#undef A_addr_scratch
#undef A_addr_temp
#undef A_dmode_memory_to_memory
#undef A_dmode_memory_to_ncr
#undef A_dmode_ncr_to_memory
#undef A_dsa_check_reselect
#undef A_dsa_cmdout
#undef A_dsa_cmnd
#undef A_dsa_datain
#undef A_dsa_dataout
#undef A_dsa_end
#undef A_dsa_fields_start
#undef A_dsa_msgin
#undef A_dsa_msgout
#undef A_dsa_msgout_other
#undef A_dsa_next
#undef A_dsa_restore_pointers
#undef A_dsa_save_data_pointer
#undef A_dsa_select
#undef A_dsa_sscf_710
#undef A_dsa_status
#undef A_dsa_temp_addr_array_value
#undef A_dsa_temp_addr_dsa_value
#undef A_dsa_temp_addr_new_value
#undef A_dsa_temp_addr_next
#undef A_dsa_temp_addr_residual
#undef A_dsa_temp_addr_saved_pointer
#undef A_dsa_temp_addr_saved_residual
#undef A_dsa_temp_lun
#undef A_dsa_temp_next
#undef A_dsa_temp_sync
#undef A_dsa_temp_target
#undef A_emulfly
#undef A_int_debug_break
#undef A_int_debug_panic
#undef A_int_err_check_condition
#undef A_int_err_no_phase
#undef A_int_err_selected
#undef A_int_err_unexpected_phase
#undef A_int_err_unexpected_reselect
#undef A_int_msg_1
#undef A_int_msg_sdtr
#undef A_int_msg_wdtr
#undef A_int_norm_aborted
#undef A_int_norm_command_complete
#undef A_int_norm_disconnected
#undef A_int_norm_emulateintfly
#undef A_int_norm_reselect_complete
#undef A_int_norm_reset
#undef A_int_norm_select_complete
#undef A_int_test_1
#undef A_int_test_2
#undef A_int_test_3
#undef A_msg_buf
#undef A_reconnect_dsa_head
#undef A_reselected_identify
#undef A_reselected_tag
#undef A_saved_dsa
#undef A_schedule
#undef A_test_dest
#undef A_test_src
#undef Ent_accept_message
#undef Ent_cmdout_cmdout
#undef Ent_command_complete
#undef Ent_command_complete_msgin
#undef Ent_data_transfer
#undef Ent_datain_to_jump
#undef Ent_debug_break
#undef Ent_dsa_code_begin
#undef Ent_dsa_code_check_reselect
#undef Ent_dsa_code_fix_jump
#undef Ent_dsa_code_restore_pointers
#undef Ent_dsa_code_save_data_pointer
#undef Ent_dsa_code_template
#undef Ent_dsa_code_template_end
#undef Ent_dsa_schedule
#undef Ent_dsa_zero
#undef Ent_end_data_transfer
#undef Ent_initiator_abort
#undef Ent_msg_in
#undef Ent_msg_in_restart
#undef Ent_other_in
#undef Ent_other_out
#undef Ent_other_transfer
#undef Ent_reject_message
#undef Ent_reselected_check_next
#undef Ent_reselected_ok
#undef Ent_respond_message
#undef Ent_select
#undef Ent_select_msgout
#undef Ent_target_abort
#undef Ent_test_1
#undef Ent_test_2
#undef Ent_test_2_msgout
#undef Ent_wait_reselect
...@@ -304,18 +304,10 @@ static struct BusLogic_CCB *BusLogic_AllocateCCB(struct BusLogic_HostAdapter ...@@ -304,18 +304,10 @@ static struct BusLogic_CCB *BusLogic_AllocateCCB(struct BusLogic_HostAdapter
static void BusLogic_DeallocateCCB(struct BusLogic_CCB *CCB) static void BusLogic_DeallocateCCB(struct BusLogic_CCB *CCB)
{ {
struct BusLogic_HostAdapter *HostAdapter = CCB->HostAdapter; struct BusLogic_HostAdapter *HostAdapter = CCB->HostAdapter;
struct scsi_cmnd *cmd = CCB->Command;
if (cmd->use_sg != 0) { scsi_dma_unmap(CCB->Command);
pci_unmap_sg(HostAdapter->PCI_Device,
(struct scatterlist *)cmd->request_buffer,
cmd->use_sg, cmd->sc_data_direction);
} else if (cmd->request_bufflen != 0) {
pci_unmap_single(HostAdapter->PCI_Device, CCB->DataPointer,
CCB->DataLength, cmd->sc_data_direction);
}
pci_unmap_single(HostAdapter->PCI_Device, CCB->SenseDataPointer, pci_unmap_single(HostAdapter->PCI_Device, CCB->SenseDataPointer,
CCB->SenseDataLength, PCI_DMA_FROMDEVICE); CCB->SenseDataLength, PCI_DMA_FROMDEVICE);
CCB->Command = NULL; CCB->Command = NULL;
CCB->Status = BusLogic_CCB_Free; CCB->Status = BusLogic_CCB_Free;
...@@ -2648,7 +2640,8 @@ static void BusLogic_ProcessCompletedCCBs(struct BusLogic_HostAdapter *HostAdapt ...@@ -2648,7 +2640,8 @@ static void BusLogic_ProcessCompletedCCBs(struct BusLogic_HostAdapter *HostAdapt
*/ */
if (CCB->CDB[0] == INQUIRY && CCB->CDB[1] == 0 && CCB->HostAdapterStatus == BusLogic_CommandCompletedNormally) { if (CCB->CDB[0] == INQUIRY && CCB->CDB[1] == 0 && CCB->HostAdapterStatus == BusLogic_CommandCompletedNormally) {
struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[CCB->TargetID]; struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[CCB->TargetID];
struct SCSI_Inquiry *InquiryResult = (struct SCSI_Inquiry *) Command->request_buffer; struct SCSI_Inquiry *InquiryResult =
(struct SCSI_Inquiry *) scsi_sglist(Command);
TargetFlags->TargetExists = true; TargetFlags->TargetExists = true;
TargetFlags->TaggedQueuingSupported = InquiryResult->CmdQue; TargetFlags->TaggedQueuingSupported = InquiryResult->CmdQue;
TargetFlags->WideTransfersSupported = InquiryResult->WBus16; TargetFlags->WideTransfersSupported = InquiryResult->WBus16;
...@@ -2819,9 +2812,8 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou ...@@ -2819,9 +2812,8 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou
int CDB_Length = Command->cmd_len; int CDB_Length = Command->cmd_len;
int TargetID = Command->device->id; int TargetID = Command->device->id;
int LogicalUnit = Command->device->lun; int LogicalUnit = Command->device->lun;
void *BufferPointer = Command->request_buffer; int BufferLength = scsi_bufflen(Command);
int BufferLength = Command->request_bufflen; int Count;
int SegmentCount = Command->use_sg;
struct BusLogic_CCB *CCB; struct BusLogic_CCB *CCB;
/* /*
SCSI REQUEST_SENSE commands will be executed automatically by the Host SCSI REQUEST_SENSE commands will be executed automatically by the Host
...@@ -2851,36 +2843,35 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou ...@@ -2851,36 +2843,35 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou
return 0; return 0;
} }
} }
/* /*
Initialize the fields in the BusLogic Command Control Block (CCB). Initialize the fields in the BusLogic Command Control Block (CCB).
*/ */
if (SegmentCount == 0 && BufferLength != 0) { Count = scsi_dma_map(Command);
CCB->Opcode = BusLogic_InitiatorCCB; BUG_ON(Count < 0);
CCB->DataLength = BufferLength; if (Count) {
CCB->DataPointer = pci_map_single(HostAdapter->PCI_Device, struct scatterlist *sg;
BufferPointer, BufferLength, int i;
Command->sc_data_direction);
} else if (SegmentCount != 0) {
struct scatterlist *ScatterList = (struct scatterlist *) BufferPointer;
int Segment, Count;
Count = pci_map_sg(HostAdapter->PCI_Device, ScatterList, SegmentCount,
Command->sc_data_direction);
CCB->Opcode = BusLogic_InitiatorCCB_ScatterGather; CCB->Opcode = BusLogic_InitiatorCCB_ScatterGather;
CCB->DataLength = Count * sizeof(struct BusLogic_ScatterGatherSegment); CCB->DataLength = Count * sizeof(struct BusLogic_ScatterGatherSegment);
if (BusLogic_MultiMasterHostAdapterP(HostAdapter)) if (BusLogic_MultiMasterHostAdapterP(HostAdapter))
CCB->DataPointer = (unsigned int) CCB->DMA_Handle + ((unsigned long) &CCB->ScatterGatherList - (unsigned long) CCB); CCB->DataPointer = (unsigned int) CCB->DMA_Handle + ((unsigned long) &CCB->ScatterGatherList - (unsigned long) CCB);
else else
CCB->DataPointer = Virtual_to_32Bit_Virtual(CCB->ScatterGatherList); CCB->DataPointer = Virtual_to_32Bit_Virtual(CCB->ScatterGatherList);
for (Segment = 0; Segment < Count; Segment++) {
CCB->ScatterGatherList[Segment].SegmentByteCount = sg_dma_len(ScatterList + Segment); scsi_for_each_sg(Command, sg, Count, i) {
CCB->ScatterGatherList[Segment].SegmentDataPointer = sg_dma_address(ScatterList + Segment); CCB->ScatterGatherList[i].SegmentByteCount =
sg_dma_len(sg);
CCB->ScatterGatherList[i].SegmentDataPointer =
sg_dma_address(sg);
} }
} else { } else if (!Count) {
CCB->Opcode = BusLogic_InitiatorCCB; CCB->Opcode = BusLogic_InitiatorCCB;
CCB->DataLength = BufferLength; CCB->DataLength = BufferLength;
CCB->DataPointer = 0; CCB->DataPointer = 0;
} }
switch (CDB[0]) { switch (CDB[0]) {
case READ_6: case READ_6:
case READ_10: case READ_10:
......
...@@ -10,6 +10,7 @@ config RAID_ATTRS ...@@ -10,6 +10,7 @@ config RAID_ATTRS
config SCSI config SCSI
tristate "SCSI device support" tristate "SCSI device support"
depends on BLOCK depends on BLOCK
select SCSI_DMA if HAS_DMA
---help--- ---help---
If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
any other SCSI device under Linux, say Y and make sure that you know any other SCSI device under Linux, say Y and make sure that you know
...@@ -29,6 +30,10 @@ config SCSI ...@@ -29,6 +30,10 @@ config SCSI
However, do not compile this as a module if your root file system However, do not compile this as a module if your root file system
(the one containing the directory /) is located on a SCSI device. (the one containing the directory /) is located on a SCSI device.
config SCSI_DMA
bool
default n
config SCSI_TGT config SCSI_TGT
tristate "SCSI target support" tristate "SCSI target support"
depends on SCSI && EXPERIMENTAL depends on SCSI && EXPERIMENTAL
...@@ -739,7 +744,7 @@ config SCSI_GENERIC_NCR53C400 ...@@ -739,7 +744,7 @@ config SCSI_GENERIC_NCR53C400
config SCSI_IBMMCA config SCSI_IBMMCA
tristate "IBMMCA SCSI support" tristate "IBMMCA SCSI support"
depends on MCA_LEGACY && SCSI depends on MCA && SCSI
---help--- ---help---
This is support for the IBM SCSI adapter found in many of the PS/2 This is support for the IBM SCSI adapter found in many of the PS/2
series computers. These machines have an MCA bus, so you need to series computers. These machines have an MCA bus, so you need to
...@@ -1007,6 +1012,11 @@ config SCSI_STEX ...@@ -1007,6 +1012,11 @@ config SCSI_STEX
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called stex. module will be called stex.
config 53C700_BE_BUS
bool
depends on SCSI_A4000T || SCSI_ZORRO7XX || MVME16x_SCSI || BVME6000_SCSI
default y
config SCSI_SYM53C8XX_2 config SCSI_SYM53C8XX_2
tristate "SYM53C8XX Version 2 SCSI support" tristate "SYM53C8XX Version 2 SCSI support"
depends on PCI && SCSI depends on PCI && SCSI
...@@ -1611,13 +1621,25 @@ config FASTLANE_SCSI ...@@ -1611,13 +1621,25 @@ config FASTLANE_SCSI
If you have the Phase5 Fastlane Z3 SCSI controller, or plan to use If you have the Phase5 Fastlane Z3 SCSI controller, or plan to use
one in the near future, say Y to this question. Otherwise, say N. one in the near future, say Y to this question. Otherwise, say N.
config SCSI_AMIGA7XX config SCSI_A4000T
bool "Amiga NCR53c710 SCSI support (EXPERIMENTAL)" tristate "A4000T NCR53c710 SCSI support (EXPERIMENTAL)"
depends on AMIGA && SCSI && EXPERIMENTAL && BROKEN depends on AMIGA && SCSI && EXPERIMENTAL
select SCSI_SPI_ATTRS
help help
Support for various NCR53c710-based SCSI controllers on the Amiga. If you have an Amiga 4000T and have SCSI devices connected to the
built-in SCSI controller, say Y. Otherwise, say N.
To compile this driver as a module, choose M here: the
module will be called a4000t.
config SCSI_ZORRO7XX
tristate "Zorro NCR53c710 SCSI support (EXPERIMENTAL)"
depends on ZORRO && SCSI && EXPERIMENTAL
select SCSI_SPI_ATTRS
help
Support for various NCR53c710-based SCSI controllers on Zorro
expansion boards for the Amiga.
This includes: This includes:
- the builtin SCSI controller on the Amiga 4000T,
- the Amiga 4091 Zorro III SCSI-2 controller, - the Amiga 4091 Zorro III SCSI-2 controller,
- the MacroSystem Development's WarpEngine Amiga SCSI-2 controller - the MacroSystem Development's WarpEngine Amiga SCSI-2 controller
(info at (info at
...@@ -1625,10 +1647,6 @@ config SCSI_AMIGA7XX ...@@ -1625,10 +1647,6 @@ config SCSI_AMIGA7XX
- the SCSI controller on the Phase5 Blizzard PowerUP 603e+ - the SCSI controller on the Phase5 Blizzard PowerUP 603e+
accelerator card for the Amiga 1200, accelerator card for the Amiga 1200,
- the SCSI controller on the GVP Turbo 040/060 accelerator. - the SCSI controller on the GVP Turbo 040/060 accelerator.
Note that all of the above SCSI controllers, except for the builtin
SCSI controller on the Amiga 4000T, reside on the Zorro expansion
bus, so you also have to enable Zorro bus support if you want to use
them.
config OKTAGON_SCSI config OKTAGON_SCSI
tristate "BSC Oktagon SCSI support (EXPERIMENTAL)" tristate "BSC Oktagon SCSI support (EXPERIMENTAL)"
...@@ -1712,8 +1730,8 @@ config MVME147_SCSI ...@@ -1712,8 +1730,8 @@ config MVME147_SCSI
single-board computer. single-board computer.
config MVME16x_SCSI config MVME16x_SCSI
bool "NCR53C710 SCSI driver for MVME16x" tristate "NCR53C710 SCSI driver for MVME16x"
depends on MVME16x && SCSI && BROKEN depends on MVME16x && SCSI
select SCSI_SPI_ATTRS select SCSI_SPI_ATTRS
help help
The Motorola MVME162, 166, 167, 172 and 177 boards use the NCR53C710 The Motorola MVME162, 166, 167, 172 and 177 boards use the NCR53C710
...@@ -1721,22 +1739,14 @@ config MVME16x_SCSI ...@@ -1721,22 +1739,14 @@ config MVME16x_SCSI
will want to say Y to this question. will want to say Y to this question.
config BVME6000_SCSI config BVME6000_SCSI
bool "NCR53C710 SCSI driver for BVME6000" tristate "NCR53C710 SCSI driver for BVME6000"
depends on BVME6000 && SCSI && BROKEN depends on BVME6000 && SCSI
select SCSI_SPI_ATTRS select SCSI_SPI_ATTRS
help help
The BVME4000 and BVME6000 boards from BVM Ltd use the NCR53C710 The BVME4000 and BVME6000 boards from BVM Ltd use the NCR53C710
SCSI controller chip. Almost everyone using one of these boards SCSI controller chip. Almost everyone using one of these boards
will want to say Y to this question. will want to say Y to this question.
config SCSI_NCR53C7xx_FAST
bool "allow FAST-SCSI [10MHz]"
depends on SCSI_AMIGA7XX || MVME16x_SCSI || BVME6000_SCSI
help
This will enable 10MHz FAST-SCSI transfers with your host
adapter. Some systems have problems with that speed, so it's safest
to say N here.
config SUN3_SCSI config SUN3_SCSI
tristate "Sun3 NCR5380 SCSI" tristate "Sun3 NCR5380 SCSI"
depends on SUN3 && SCSI depends on SUN3 && SCSI
...@@ -1766,8 +1776,6 @@ config SCSI_SUNESP ...@@ -1766,8 +1776,6 @@ config SCSI_SUNESP
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called esp. module will be called esp.
# bool 'Cyberstorm Mk III SCSI support (EXPERIMENTAL)' CONFIG_CYBERSTORMIII_SCSI
config ZFCP config ZFCP
tristate "FCP host bus adapter driver for IBM eServer zSeries" tristate "FCP host bus adapter driver for IBM eServer zSeries"
depends on S390 && QDIO && SCSI depends on S390 && QDIO && SCSI
......
...@@ -37,7 +37,8 @@ obj-$(CONFIG_SCSI_SAS_LIBSAS) += libsas/ ...@@ -37,7 +37,8 @@ obj-$(CONFIG_SCSI_SAS_LIBSAS) += libsas/
obj-$(CONFIG_ISCSI_TCP) += libiscsi.o iscsi_tcp.o obj-$(CONFIG_ISCSI_TCP) += libiscsi.o iscsi_tcp.o
obj-$(CONFIG_INFINIBAND_ISER) += libiscsi.o obj-$(CONFIG_INFINIBAND_ISER) += libiscsi.o
obj-$(CONFIG_SCSI_AMIGA7XX) += amiga7xx.o 53c7xx.o obj-$(CONFIG_SCSI_A4000T) += 53c700.o a4000t.o
obj-$(CONFIG_SCSI_ZORRO7XX) += 53c700.o zorro7xx.o
obj-$(CONFIG_A3000_SCSI) += a3000.o wd33c93.o obj-$(CONFIG_A3000_SCSI) += a3000.o wd33c93.o
obj-$(CONFIG_A2091_SCSI) += a2091.o wd33c93.o obj-$(CONFIG_A2091_SCSI) += a2091.o wd33c93.o
obj-$(CONFIG_GVP11_SCSI) += gvp11.o wd33c93.o obj-$(CONFIG_GVP11_SCSI) += gvp11.o wd33c93.o
...@@ -53,8 +54,8 @@ obj-$(CONFIG_ATARI_SCSI) += atari_scsi.o ...@@ -53,8 +54,8 @@ obj-$(CONFIG_ATARI_SCSI) += atari_scsi.o
obj-$(CONFIG_MAC_SCSI) += mac_scsi.o obj-$(CONFIG_MAC_SCSI) += mac_scsi.o
obj-$(CONFIG_SCSI_MAC_ESP) += mac_esp.o NCR53C9x.o obj-$(CONFIG_SCSI_MAC_ESP) += mac_esp.o NCR53C9x.o
obj-$(CONFIG_SUN3_SCSI) += sun3_scsi.o sun3_scsi_vme.o obj-$(CONFIG_SUN3_SCSI) += sun3_scsi.o sun3_scsi_vme.o
obj-$(CONFIG_MVME16x_SCSI) += mvme16x.o 53c7xx.o obj-$(CONFIG_MVME16x_SCSI) += 53c700.o mvme16x_scsi.o
obj-$(CONFIG_BVME6000_SCSI) += bvme6000.o 53c7xx.o obj-$(CONFIG_BVME6000_SCSI) += 53c700.o bvme6000_scsi.o
obj-$(CONFIG_SCSI_SIM710) += 53c700.o sim710.o obj-$(CONFIG_SCSI_SIM710) += 53c700.o sim710.o
obj-$(CONFIG_SCSI_ADVANSYS) += advansys.o obj-$(CONFIG_SCSI_ADVANSYS) += advansys.o
obj-$(CONFIG_SCSI_PSI240I) += psi240i.o obj-$(CONFIG_SCSI_PSI240I) += psi240i.o
...@@ -89,7 +90,6 @@ obj-$(CONFIG_SCSI_QLA_ISCSI) += qla4xxx/ ...@@ -89,7 +90,6 @@ obj-$(CONFIG_SCSI_QLA_ISCSI) += qla4xxx/
obj-$(CONFIG_SCSI_LPFC) += lpfc/ obj-$(CONFIG_SCSI_LPFC) += lpfc/
obj-$(CONFIG_SCSI_PAS16) += pas16.o obj-$(CONFIG_SCSI_PAS16) += pas16.o
obj-$(CONFIG_SCSI_SEAGATE) += seagate.o obj-$(CONFIG_SCSI_SEAGATE) += seagate.o
obj-$(CONFIG_SCSI_FD_8xx) += seagate.o
obj-$(CONFIG_SCSI_T128) += t128.o obj-$(CONFIG_SCSI_T128) += t128.o
obj-$(CONFIG_SCSI_DMX3191D) += dmx3191d.o obj-$(CONFIG_SCSI_DMX3191D) += dmx3191d.o
obj-$(CONFIG_SCSI_DTC3280) += dtc.o obj-$(CONFIG_SCSI_DTC3280) += dtc.o
...@@ -148,9 +148,9 @@ obj-$(CONFIG_SCSI_DEBUG) += scsi_debug.o ...@@ -148,9 +148,9 @@ obj-$(CONFIG_SCSI_DEBUG) += scsi_debug.o
obj-$(CONFIG_SCSI_WAIT_SCAN) += scsi_wait_scan.o obj-$(CONFIG_SCSI_WAIT_SCAN) += scsi_wait_scan.o
scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \ scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \
scsicam.o scsi_error.o scsi_lib.o \ scsicam.o scsi_error.o scsi_lib.o
scsi_scan.o scsi_sysfs.o \ scsi_mod-$(CONFIG_SCSI_DMA) += scsi_lib_dma.o
scsi_devinfo.o scsi_mod-y += scsi_scan.o scsi_sysfs.o scsi_devinfo.o
scsi_mod-$(CONFIG_SCSI_NETLINK) += scsi_netlink.o scsi_mod-$(CONFIG_SCSI_NETLINK) += scsi_netlink.o
scsi_mod-$(CONFIG_SYSCTL) += scsi_sysctl.o scsi_mod-$(CONFIG_SYSCTL) += scsi_sysctl.o
scsi_mod-$(CONFIG_SCSI_PROC_FS) += scsi_proc.o scsi_mod-$(CONFIG_SCSI_PROC_FS) += scsi_proc.o
...@@ -168,10 +168,8 @@ NCR_Q720_mod-objs := NCR_Q720.o ncr53c8xx.o ...@@ -168,10 +168,8 @@ NCR_Q720_mod-objs := NCR_Q720.o ncr53c8xx.o
oktagon_esp_mod-objs := oktagon_esp.o oktagon_io.o oktagon_esp_mod-objs := oktagon_esp.o oktagon_io.o
# Files generated that shall be removed upon make clean # Files generated that shall be removed upon make clean
clean-files := 53c7xx_d.h 53c700_d.h \ clean-files := 53c700_d.h 53c700_u.h
53c7xx_u.h 53c700_u.h
$(obj)/53c7xx.o: $(obj)/53c7xx_d.h $(obj)/53c7xx_u.h
$(obj)/53c700.o $(MODVERDIR)/$(obj)/53c700.ver: $(obj)/53c700_d.h $(obj)/53c700.o $(MODVERDIR)/$(obj)/53c700.ver: $(obj)/53c700_d.h
# If you want to play with the firmware, uncomment # If you want to play with the firmware, uncomment
...@@ -179,11 +177,6 @@ $(obj)/53c700.o $(MODVERDIR)/$(obj)/53c700.ver: $(obj)/53c700_d.h ...@@ -179,11 +177,6 @@ $(obj)/53c700.o $(MODVERDIR)/$(obj)/53c700.ver: $(obj)/53c700_d.h
ifdef GENERATE_FIRMWARE ifdef GENERATE_FIRMWARE
$(obj)/53c7xx_d.h: $(src)/53c7xx.scr $(src)/script_asm.pl
$(CPP) -traditional -DCHIP=710 - < $< | grep -v '^#' | $(PERL) -s $(src)/script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h)
$(obj)/53c7xx_u.h: $(obj)/53c7xx_d.h
$(obj)/53c700_d.h: $(src)/53c700.scr $(src)/script_asm.pl $(obj)/53c700_d.h: $(src)/53c700.scr $(src)/script_asm.pl
$(PERL) -s $(src)/script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h) < $< $(PERL) -s $(src)/script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h) < $<
......
...@@ -347,7 +347,7 @@ static int NCR5380_poll_politely(struct Scsi_Host *instance, int reg, int bit, i ...@@ -347,7 +347,7 @@ static int NCR5380_poll_politely(struct Scsi_Host *instance, int reg, int bit, i
if((r & bit) == val) if((r & bit) == val)
return 0; return 0;
if(!in_interrupt()) if(!in_interrupt())
yield(); cond_resched();
else else
cpu_relax(); cpu_relax();
} }
...@@ -357,7 +357,7 @@ static int NCR5380_poll_politely(struct Scsi_Host *instance, int reg, int bit, i ...@@ -357,7 +357,7 @@ static int NCR5380_poll_politely(struct Scsi_Host *instance, int reg, int bit, i
static struct { static struct {
unsigned char value; unsigned char value;
const char *name; const char *name;
} phases[] = { } phases[] __maybe_unused = {
{PHASE_DATAOUT, "DATAOUT"}, {PHASE_DATAOUT, "DATAOUT"},
{PHASE_DATAIN, "DATAIN"}, {PHASE_DATAIN, "DATAIN"},
{PHASE_CMDOUT, "CMDOUT"}, {PHASE_CMDOUT, "CMDOUT"},
...@@ -575,7 +575,8 @@ static irqreturn_t __init probe_intr(int irq, void *dev_id) ...@@ -575,7 +575,8 @@ static irqreturn_t __init probe_intr(int irq, void *dev_id)
* Locks: none, irqs must be enabled on entry * Locks: none, irqs must be enabled on entry
*/ */
static int __init NCR5380_probe_irq(struct Scsi_Host *instance, int possible) static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance,
int possible)
{ {
NCR5380_local_declare(); NCR5380_local_declare();
struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
...@@ -629,7 +630,8 @@ static int __init NCR5380_probe_irq(struct Scsi_Host *instance, int possible) ...@@ -629,7 +630,8 @@ static int __init NCR5380_probe_irq(struct Scsi_Host *instance, int possible)
* Locks: none * Locks: none
*/ */
static void __init NCR5380_print_options(struct Scsi_Host *instance) static void __init __maybe_unused
NCR5380_print_options(struct Scsi_Host *instance)
{ {
printk(" generic options" printk(" generic options"
#ifdef AUTOPROBE_IRQ #ifdef AUTOPROBE_IRQ
...@@ -703,8 +705,8 @@ char *lprint_command(unsigned char *cmd, char *pos, char *buffer, int len); ...@@ -703,8 +705,8 @@ char *lprint_command(unsigned char *cmd, char *pos, char *buffer, int len);
static static
char *lprint_opcode(int opcode, char *pos, char *buffer, int length); char *lprint_opcode(int opcode, char *pos, char *buffer, int length);
static static int __maybe_unused NCR5380_proc_info(struct Scsi_Host *instance,
int NCR5380_proc_info(struct Scsi_Host *instance, char *buffer, char **start, off_t offset, int length, int inout) char *buffer, char **start, off_t offset, int length, int inout)
{ {
char *pos = buffer; char *pos = buffer;
struct NCR5380_hostdata *hostdata; struct NCR5380_hostdata *hostdata;
......
...@@ -299,7 +299,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance); ...@@ -299,7 +299,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance);
static irqreturn_t NCR5380_intr(int irq, void *dev_id); static irqreturn_t NCR5380_intr(int irq, void *dev_id);
#endif #endif
static void NCR5380_main(struct work_struct *work); static void NCR5380_main(struct work_struct *work);
static void NCR5380_print_options(struct Scsi_Host *instance); static void __maybe_unused NCR5380_print_options(struct Scsi_Host *instance);
#ifdef NDEBUG #ifdef NDEBUG
static void NCR5380_print_phase(struct Scsi_Host *instance); static void NCR5380_print_phase(struct Scsi_Host *instance);
static void NCR5380_print(struct Scsi_Host *instance); static void NCR5380_print(struct Scsi_Host *instance);
...@@ -307,8 +307,8 @@ static void NCR5380_print(struct Scsi_Host *instance); ...@@ -307,8 +307,8 @@ static void NCR5380_print(struct Scsi_Host *instance);
static int NCR5380_abort(Scsi_Cmnd * cmd); static int NCR5380_abort(Scsi_Cmnd * cmd);
static int NCR5380_bus_reset(Scsi_Cmnd * cmd); static int NCR5380_bus_reset(Scsi_Cmnd * cmd);
static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)); static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
static int NCR5380_proc_info(struct Scsi_Host *instance, char *buffer, char **start, static int __maybe_unused NCR5380_proc_info(struct Scsi_Host *instance,
off_t offset, int length, int inout); char *buffer, char **start, off_t offset, int length, int inout);
static void NCR5380_reselect(struct Scsi_Host *instance); static void NCR5380_reselect(struct Scsi_Host *instance);
static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag); static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*
* advansys.h - Linux Host Driver for AdvanSys SCSI Adapters
*
* Copyright (c) 1995-2000 Advanced System Products, Inc.
* Copyright (c) 2000-2001 ConnectCom Solutions, Inc.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that redistributions of source
* code retain the above copyright notice and this comment without
* modification.
*
* As of March 8, 2000 Advanced System Products, Inc. (AdvanSys)
* changed its name to ConnectCom Solutions, Inc.
*
*/
#ifndef _ADVANSYS_H
#define _ADVANSYS_H
/*
* struct scsi_host_template function prototypes.
*/
int advansys_detect(struct scsi_host_template *);
int advansys_release(struct Scsi_Host *);
const char *advansys_info(struct Scsi_Host *);
int advansys_queuecommand(struct scsi_cmnd *, void (* done)(struct scsi_cmnd *));
int advansys_reset(struct scsi_cmnd *);
int advansys_biosparam(struct scsi_device *, struct block_device *,
sector_t, int[]);
static int advansys_slave_configure(struct scsi_device *);
/* init/main.c setup function */
void advansys_setup(char *, int *);
#endif /* _ADVANSYS_H */
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册