From 123521830c0ea35055b900d2ff0b73bb129e08cb Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Fri, 27 May 2011 11:16:33 +0000 Subject: iscsi: Resolve iscsi_proto.h naming conflicts with drivers/target/iscsi This patch renames the following iscsi_proto.h structures to avoid namespace issues with drivers/target/iscsi/iscsi_target_core.h: *) struct iscsi_cmd -> struct iscsi_scsi_req *) struct iscsi_cmd_rsp -> struct iscsi_scsi_rsp *) struct iscsi_login -> struct iscsi_login_req This patch includes useful ISCSI_FLAG_LOGIN_[CURRENT,NEXT]_STAGE*, and ISCSI_FLAG_SNACK_TYPE_* definitions used by iscsi_target_mod, and fixes the incorrect definition of struct iscsi_snack to following RFC-3720 Section 10.16. SNACK Request. Also, this patch updates libiscsi, iSER, be2iscsi, and bn2xi to use the updated structure definitions in a handful of locations. Signed-off-by: Mike Christie Signed-off-by: Nicholas A. Bellinger --- drivers/scsi/bnx2i/bnx2i_hwi.c | 8 ++++---- drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/scsi/bnx2i') diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 372d30c..1b160e1 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c @@ -328,11 +328,11 @@ int bnx2i_send_iscsi_login(struct bnx2i_conn *bnx2i_conn, { struct bnx2i_cmd *bnx2i_cmd; struct bnx2i_login_request *login_wqe; - struct iscsi_login *login_hdr; + struct iscsi_login_req *login_hdr; u32 dword; bnx2i_cmd = (struct bnx2i_cmd *)task->dd_data; - login_hdr = (struct iscsi_login *)task->hdr; + login_hdr = (struct iscsi_login_req *)task->hdr; login_wqe = (struct bnx2i_login_request *) bnx2i_conn->ep->qp.sq_prod_qe; @@ -1344,7 +1344,7 @@ static int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session, struct bnx2i_cmd_response *resp_cqe; struct bnx2i_cmd *bnx2i_cmd; struct iscsi_task *task; - struct iscsi_cmd_rsp *hdr; + struct iscsi_scsi_rsp *hdr; u32 datalen = 0; resp_cqe = (struct bnx2i_cmd_response *)cqe; @@ -1371,7 +1371,7 @@ static int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session, } bnx2i_iscsi_unmap_sg_list(bnx2i_cmd); - hdr = (struct iscsi_cmd_rsp *)task->hdr; + hdr = (struct iscsi_scsi_rsp *)task->hdr; resp_cqe = (struct bnx2i_cmd_response *)cqe; hdr->opcode = resp_cqe->op_code; hdr->max_cmdsn = cpu_to_be32(resp_cqe->max_cmd_sn); diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index 041928b..97ff47c 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c @@ -1212,7 +1212,7 @@ static int bnx2i_task_xmit(struct iscsi_task *task) struct bnx2i_conn *bnx2i_conn = conn->dd_data; struct scsi_cmnd *sc = task->sc; struct bnx2i_cmd *cmd = task->dd_data; - struct iscsi_cmd *hdr = (struct iscsi_cmd *) task->hdr; + struct iscsi_scsi_req *hdr = (struct iscsi_scsi_req *)task->hdr; if (bnx2i_conn->ep->num_active_cmds + 1 > hba->max_sqes) return -ENOMEM; -- cgit v1.1 From 55bdabdf41b6ee99e22e9d78a895b001fb1d852e Mon Sep 17 00:00:00 2001 From: Andy Grover Date: Thu, 16 Jun 2011 15:57:09 -0700 Subject: iscsi: Use struct scsi_lun in iscsi structs instead of u8[8] struct scsi_lun is also just a struct with an array of 8 octets (64 bits) but using it instead in iscsi structs lets us call scsilun_to_int without a cast, and also lets us copy it using assignment, instead of memcpy(). Signed-off-by: Andy Grover Signed-off-by: James Bottomley --- drivers/scsi/bnx2i/bnx2i_hwi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/scsi/bnx2i') diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 1b160e1..2b119cc 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c @@ -430,7 +430,7 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, default: tmfabort_wqe->ref_itt = RESERVED_ITT; } - memcpy(scsi_lun, tmfabort_hdr->lun, sizeof(struct scsi_lun)); + memcpy(scsi_lun, &tmfabort_hdr->lun, sizeof(struct scsi_lun)); tmfabort_wqe->lun[0] = be32_to_cpu(scsi_lun[0]); tmfabort_wqe->lun[1] = be32_to_cpu(scsi_lun[1]); @@ -547,7 +547,7 @@ int bnx2i_send_iscsi_nopout(struct bnx2i_conn *bnx2i_conn, nopout_wqe->op_code = nopout_hdr->opcode; nopout_wqe->op_attr = ISCSI_FLAG_CMD_FINAL; - memcpy(nopout_wqe->lun, nopout_hdr->lun, 8); + memcpy(nopout_wqe->lun, &nopout_hdr->lun, 8); if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { u32 tmp = nopout_wqe->lun[0]; @@ -1711,7 +1711,7 @@ static int bnx2i_process_nopin_mesg(struct iscsi_session *session, hdr->flags = ISCSI_FLAG_CMD_FINAL; hdr->itt = task->hdr->itt; hdr->ttt = cpu_to_be32(nop_in->ttt); - memcpy(hdr->lun, nop_in->lun, 8); + memcpy(&hdr->lun, nop_in->lun, 8); } done: __iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0); @@ -1754,7 +1754,7 @@ static void bnx2i_process_async_mesg(struct iscsi_session *session, resp_hdr->opcode = async_cqe->op_code; resp_hdr->flags = 0x80; - memcpy(resp_hdr->lun, async_cqe->lun, 8); + memcpy(&resp_hdr->lun, async_cqe->lun, 8); resp_hdr->exp_cmdsn = cpu_to_be32(async_cqe->exp_cmd_sn); resp_hdr->max_cmdsn = cpu_to_be32(async_cqe->max_cmd_sn); -- cgit v1.1 From 610602f369b4c810c9df05e431abd38f38cb8e0d Mon Sep 17 00:00:00 2001 From: Eddie Wai Date: Fri, 26 Aug 2011 11:16:47 -0700 Subject: [SCSI] bnx2i: Fixed the endian on TTT for NOP out transmission The iscsi_nopout task's TTT is defined as __be32 while the DMA memory to the chip is CPU specific. This creates a problem for unsolicited NOP-In responses where the TTT is not the RESERVED tag of 0xFFs. This patch adds a call to be32_to_cpu for the TTT specified. Signed-off-by: Eddie Wai Signed-off-by: James Bottomley --- drivers/scsi/bnx2i/bnx2i_hwi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/scsi/bnx2i') diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 9ae80cd..dba72a4 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c @@ -563,7 +563,7 @@ int bnx2i_send_iscsi_nopout(struct bnx2i_conn *bnx2i_conn, nopout_wqe->itt = ((u16)task->itt | (ISCSI_TASK_TYPE_MPATH << ISCSI_TMF_REQUEST_TYPE_SHIFT)); - nopout_wqe->ttt = nopout_hdr->ttt; + nopout_wqe->ttt = be32_to_cpu(nopout_hdr->ttt); nopout_wqe->flags = 0; if (!unsol) nopout_wqe->flags = ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION; -- cgit v1.1