aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/ulp/iser/iser_initiator.c2
-rw-r--r--drivers/scsi/be2iscsi/be_main.h4
-rw-r--r--drivers/scsi/bnx2i/bnx2i_hwi.c8
-rw-r--r--drivers/scsi/bnx2i/bnx2i_iscsi.c2
-rw-r--r--drivers/scsi/libiscsi.c6
-rw-r--r--include/scsi/iscsi_proto.h30
6 files changed, 33 insertions, 19 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index 95a08a8ca8aa..5745b7fe158c 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -271,7 +271,7 @@ int iser_send_command(struct iscsi_conn *conn,
271 unsigned long edtl; 271 unsigned long edtl;
272 int err; 272 int err;
273 struct iser_data_buf *data_buf; 273 struct iser_data_buf *data_buf;
274 struct iscsi_cmd *hdr = (struct iscsi_cmd *)task->hdr; 274 struct iscsi_scsi_req *hdr = (struct iscsi_scsi_req *)task->hdr;
275 struct scsi_cmnd *sc = task->sc; 275 struct scsi_cmnd *sc = task->sc;
276 struct iser_tx_desc *tx_desc = &iser_task->desc; 276 struct iser_tx_desc *tx_desc = &iser_task->desc;
277 277
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 081c171a1ed6..5ce5170254ca 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -397,7 +397,7 @@ struct amap_pdu_data_out {
397}; 397};
398 398
399struct be_cmd_bhs { 399struct be_cmd_bhs {
400 struct iscsi_cmd iscsi_hdr; 400 struct iscsi_scsi_req iscsi_hdr;
401 unsigned char pad1[16]; 401 unsigned char pad1[16];
402 struct pdu_data_out iscsi_data_pdu; 402 struct pdu_data_out iscsi_data_pdu;
403 unsigned char pad2[BE_SENSE_INFO_SIZE - 403 unsigned char pad2[BE_SENSE_INFO_SIZE -
@@ -428,7 +428,7 @@ struct be_nonio_bhs {
428}; 428};
429 429
430struct be_status_bhs { 430struct be_status_bhs {
431 struct iscsi_cmd iscsi_hdr; 431 struct iscsi_scsi_req iscsi_hdr;
432 unsigned char pad1[16]; 432 unsigned char pad1[16];
433 /** 433 /**
434 * The plus 2 below is to hold the sense info length that gets 434 * The plus 2 below is to hold the sense info length that gets
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index 372d30c099cc..1b160e12afa3 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,
328{ 328{
329 struct bnx2i_cmd *bnx2i_cmd; 329 struct bnx2i_cmd *bnx2i_cmd;
330 struct bnx2i_login_request *login_wqe; 330 struct bnx2i_login_request *login_wqe;
331 struct iscsi_login *login_hdr; 331 struct iscsi_login_req *login_hdr;
332 u32 dword; 332 u32 dword;
333 333
334 bnx2i_cmd = (struct bnx2i_cmd *)task->dd_data; 334 bnx2i_cmd = (struct bnx2i_cmd *)task->dd_data;
335 login_hdr = (struct iscsi_login *)task->hdr; 335 login_hdr = (struct iscsi_login_req *)task->hdr;
336 login_wqe = (struct bnx2i_login_request *) 336 login_wqe = (struct bnx2i_login_request *)
337 bnx2i_conn->ep->qp.sq_prod_qe; 337 bnx2i_conn->ep->qp.sq_prod_qe;
338 338
@@ -1344,7 +1344,7 @@ static int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session,
1344 struct bnx2i_cmd_response *resp_cqe; 1344 struct bnx2i_cmd_response *resp_cqe;
1345 struct bnx2i_cmd *bnx2i_cmd; 1345 struct bnx2i_cmd *bnx2i_cmd;
1346 struct iscsi_task *task; 1346 struct iscsi_task *task;
1347 struct iscsi_cmd_rsp *hdr; 1347 struct iscsi_scsi_rsp *hdr;
1348 u32 datalen = 0; 1348 u32 datalen = 0;
1349 1349
1350 resp_cqe = (struct bnx2i_cmd_response *)cqe; 1350 resp_cqe = (struct bnx2i_cmd_response *)cqe;
@@ -1371,7 +1371,7 @@ static int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session,
1371 } 1371 }
1372 bnx2i_iscsi_unmap_sg_list(bnx2i_cmd); 1372 bnx2i_iscsi_unmap_sg_list(bnx2i_cmd);
1373 1373
1374 hdr = (struct iscsi_cmd_rsp *)task->hdr; 1374 hdr = (struct iscsi_scsi_rsp *)task->hdr;
1375 resp_cqe = (struct bnx2i_cmd_response *)cqe; 1375 resp_cqe = (struct bnx2i_cmd_response *)cqe;
1376 hdr->opcode = resp_cqe->op_code; 1376 hdr->opcode = resp_cqe->op_code;
1377 hdr->max_cmdsn = cpu_to_be32(resp_cqe->max_cmd_sn); 1377 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 041928b23cb0..97ff47ce1840 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)
1212 struct bnx2i_conn *bnx2i_conn = conn->dd_data; 1212 struct bnx2i_conn *bnx2i_conn = conn->dd_data;
1213 struct scsi_cmnd *sc = task->sc; 1213 struct scsi_cmnd *sc = task->sc;
1214 struct bnx2i_cmd *cmd = task->dd_data; 1214 struct bnx2i_cmd *cmd = task->dd_data;
1215 struct iscsi_cmd *hdr = (struct iscsi_cmd *) task->hdr; 1215 struct iscsi_scsi_req *hdr = (struct iscsi_scsi_req *)task->hdr;
1216 1216
1217 if (bnx2i_conn->ep->num_active_cmds + 1 > hba->max_sqes) 1217 if (bnx2i_conn->ep->num_active_cmds + 1 > hba->max_sqes)
1218 return -ENOMEM; 1218 return -ENOMEM;
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 0c550d5b9133..c552cd7850ac 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -360,7 +360,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
360 struct iscsi_conn *conn = task->conn; 360 struct iscsi_conn *conn = task->conn;
361 struct iscsi_session *session = conn->session; 361 struct iscsi_session *session = conn->session;
362 struct scsi_cmnd *sc = task->sc; 362 struct scsi_cmnd *sc = task->sc;
363 struct iscsi_cmd *hdr; 363 struct iscsi_scsi_req *hdr;
364 unsigned hdrlength, cmd_len; 364 unsigned hdrlength, cmd_len;
365 itt_t itt; 365 itt_t itt;
366 int rc; 366 int rc;
@@ -374,7 +374,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
374 if (rc) 374 if (rc)
375 return rc; 375 return rc;
376 } 376 }
377 hdr = (struct iscsi_cmd *) task->hdr; 377 hdr = (struct iscsi_scsi_req *)task->hdr;
378 itt = hdr->itt; 378 itt = hdr->itt;
379 memset(hdr, 0, sizeof(*hdr)); 379 memset(hdr, 0, sizeof(*hdr));
380 380
@@ -830,7 +830,7 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
830 struct iscsi_task *task, char *data, 830 struct iscsi_task *task, char *data,
831 int datalen) 831 int datalen)
832{ 832{
833 struct iscsi_cmd_rsp *rhdr = (struct iscsi_cmd_rsp *)hdr; 833 struct iscsi_scsi_rsp *rhdr = (struct iscsi_scsi_rsp *)hdr;
834 struct iscsi_session *session = conn->session; 834 struct iscsi_session *session = conn->session;
835 struct scsi_cmnd *sc = task->sc; 835 struct scsi_cmnd *sc = task->sc;
836 836
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index dd0a52cea95a..a9c9058ffc60 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -116,7 +116,7 @@ struct iscsi_ahs_hdr {
116#define ISCSI_CDB_SIZE 16 116#define ISCSI_CDB_SIZE 16
117 117
118/* iSCSI PDU Header */ 118/* iSCSI PDU Header */
119struct iscsi_cmd { 119struct iscsi_scsi_req {
120 uint8_t opcode; 120 uint8_t opcode;
121 uint8_t flags; 121 uint8_t flags;
122 __be16 rsvd2; 122 __be16 rsvd2;
@@ -161,7 +161,7 @@ struct iscsi_ecdb_ahdr {
161}; 161};
162 162
163/* SCSI Response Header */ 163/* SCSI Response Header */
164struct iscsi_cmd_rsp { 164struct iscsi_scsi_rsp {
165 uint8_t opcode; 165 uint8_t opcode;
166 uint8_t flags; 166 uint8_t flags;
167 uint8_t response; 167 uint8_t response;
@@ -406,7 +406,7 @@ struct iscsi_text_rsp {
406}; 406};
407 407
408/* Login Header */ 408/* Login Header */
409struct iscsi_login { 409struct iscsi_login_req {
410 uint8_t opcode; 410 uint8_t opcode;
411 uint8_t flags; 411 uint8_t flags;
412 uint8_t max_version; /* Max. version supported */ 412 uint8_t max_version; /* Max. version supported */
@@ -427,7 +427,13 @@ struct iscsi_login {
427#define ISCSI_FLAG_LOGIN_TRANSIT 0x80 427#define ISCSI_FLAG_LOGIN_TRANSIT 0x80
428#define ISCSI_FLAG_LOGIN_CONTINUE 0x40 428#define ISCSI_FLAG_LOGIN_CONTINUE 0x40
429#define ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK 0x0C /* 2 bits */ 429#define ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK 0x0C /* 2 bits */
430#define ISCSI_FLAG_LOGIN_CURRENT_STAGE1 0x04
431#define ISCSI_FLAG_LOGIN_CURRENT_STAGE2 0x08
432#define ISCSI_FLAG_LOGIN_CURRENT_STAGE3 0x0C
430#define ISCSI_FLAG_LOGIN_NEXT_STAGE_MASK 0x03 /* 2 bits */ 433#define ISCSI_FLAG_LOGIN_NEXT_STAGE_MASK 0x03 /* 2 bits */
434#define ISCSI_FLAG_LOGIN_NEXT_STAGE1 0x01
435#define ISCSI_FLAG_LOGIN_NEXT_STAGE2 0x02
436#define ISCSI_FLAG_LOGIN_NEXT_STAGE3 0x03
431 437
432#define ISCSI_LOGIN_CURRENT_STAGE(flags) \ 438#define ISCSI_LOGIN_CURRENT_STAGE(flags) \
433 ((flags & ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK) >> 2) 439 ((flags & ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK) >> 2)
@@ -550,17 +556,25 @@ struct iscsi_logout_rsp {
550struct iscsi_snack { 556struct iscsi_snack {
551 uint8_t opcode; 557 uint8_t opcode;
552 uint8_t flags; 558 uint8_t flags;
553 uint8_t rsvd2[14]; 559 uint8_t rsvd2[2];
560 uint8_t hlength;
561 uint8_t dlength[3];
562 uint8_t lun[8];
554 itt_t itt; 563 itt_t itt;
564 __be32 ttt;
565 uint8_t rsvd3[4];
566 __be32 exp_statsn;
567 uint8_t rsvd4[8];
555 __be32 begrun; 568 __be32 begrun;
556 __be32 runlength; 569 __be32 runlength;
557 __be32 exp_statsn;
558 __be32 rsvd3;
559 __be32 exp_datasn;
560 uint8_t rsvd6[8];
561}; 570};
562 571
563/* SNACK PDU flags */ 572/* SNACK PDU flags */
573#define ISCSI_FLAG_SNACK_TYPE_DATA 0
574#define ISCSI_FLAG_SNACK_TYPE_R2T 0
575#define ISCSI_FLAG_SNACK_TYPE_STATUS 1
576#define ISCSI_FLAG_SNACK_TYPE_DATA_ACK 2
577#define ISCSI_FLAG_SNACK_TYPE_RDATA 3
564#define ISCSI_FLAG_SNACK_TYPE_MASK 0x0F /* 4 bits */ 578#define ISCSI_FLAG_SNACK_TYPE_MASK 0x0F /* 4 bits */
565 579
566/* Reject Message Header */ 580/* Reject Message Header */