summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-08-13 20:28:30 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-08-13 20:28:30 +0000
commitf77e628497527ea3ad8398c64e07fe37e41d92e7 (patch)
treee0359f2f175495297a2089b8a0e969ef74bfdab0
parent72dbcff09fd8a2d7d0b4bd8fbd0ec0ce61fa0f76 (diff)
Add more stuff change some fields to make the handling a bit easier.
OK dlg@
-rw-r--r--sys/scsi/iscsi.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/sys/scsi/iscsi.h b/sys/scsi/iscsi.h
index bcddf00ed86..79e326b0006 100644
--- a/sys/scsi/iscsi.h
+++ b/sys/scsi/iscsi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iscsi.h,v 1.2 2009/03/23 02:19:07 dlg Exp $ */
+/* $OpenBSD: iscsi.h,v 1.3 2009/08/13 20:28:29 claudio Exp $ */
/*
* Copyright (c) 2008 David Gwynne <dlg@openbsd.org>
@@ -19,8 +19,6 @@
#ifndef _SYS_SCSI_ISCSI_H
#define _SYS_SCSI_ISCSI_H
-#define ISCSI_OP_
-
struct iscsi_pdu {
u_int8_t opcode;
u_int8_t flags;
@@ -33,7 +31,11 @@ struct iscsi_pdu {
u_int32_t itt;
- u_int8_t _reserved2[28];
+ u_int8_t _reserved2[4];
+
+ u_int32_t cmdsn;
+
+ u_int8_t _reserved3[20];
} __packed;
/*
@@ -68,6 +70,15 @@ struct iscsi_pdu {
#define ISCSI_PDU_I(_h) ((_h)->opcode & 0x40)
#define ISCSI_PDU_F(_h) ((_h)->flags & 0x80)
+#define ISCSI_OP_F_IMMEDIATE 0x40
+
+/*
+ * various other flags and values
+ */
+#define ISCSI_ISID_OUI 0x00000000
+#define ISCSI_ISID_EN 0x40000000
+#define ISCSI_ISID_RAND 0x80000000
+
struct iscsi_pdu_scsi_request {
u_int8_t opcode;
u_int8_t flags;
@@ -200,17 +211,17 @@ struct iscsi_pdu_data_in {
u_int32_t ttt;
- u_int8_t statsn[4];
+ u_int32_t statsn;
- u_int8_t expcmdsn[4];
+ u_int32_t expcmdsn;
- u_int8_t maxcmdsn[4];
+ u_int32_t maxcmdsn;
- u_int8_t datasn[4];
+ u_int32_t datasn;
- u_int8_t buffer_offs[4];
+ u_int32_t buffer_offs;
- u_int8_t residual[4];
+ u_int32_t residual;
} __packed;
struct iscsi_pdu_rt2 {
@@ -335,6 +346,14 @@ struct iscsi_pdu_login_request {
u_int8_t _reserved2[16];
} __packed;
+#define ISCSI_LOGIN_F_T 0x80
+#define ISCSI_LOGIN_F_C 0x40
+#define ISCSI_LOGIN_F_CSG(x) (((x) & 0x3) << 2)
+#define ISCSI_LOGIN_F_NSG(x) ((x) & 0x3)
+#define ISCSI_LOGIN_STG_SECNEG 0
+#define ISCSI_LOGIN_STG_OPNEG 1
+#define ISCSI_LOGIN_STG_FULL 3
+
struct iscsi_pdu_login_response {
u_int8_t opcode;
u_int8_t flags;