aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2011-05-27 07:16:33 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-07-25 03:18:45 -0400
commit123521830c0ea35055b900d2ff0b73bb129e08cb (patch)
treee0f2a4b46d6b7759a17b91f4953627b51ce20d5a /include/scsi
parentbbd9d6f7fbb0305c9a592bf05a32e87eb364a4ff (diff)
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 <michaelc@cs.wisc.edu> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/iscsi_proto.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index dd0a52cea95..a9c9058ffc6 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 */