|
|
786c6d |
From 82c853344888c2d541d6445a08ab31cbcf1c140f Mon Sep 17 00:00:00 2001
|
|
|
786c6d |
From: Mike Christie <michaelc@cs.wisc.edu>
|
|
|
786c6d |
Date: Wed, 11 Sep 2013 17:31:39 -0700
|
|
|
786c6d |
Subject: [PATCH] iscsi tools: sync iscsi_if.h with kernel space
|
|
|
786c6d |
|
|
|
786c6d |
This patches syncs iscsi_if.h with upstream commit
|
|
|
786c6d |
|
|
|
786c6d |
commit ae542edb11c79706cd74d7bd54ebd7702965a7f3
|
|
|
786c6d |
Author: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
|
|
786c6d |
Date: Mon Jul 1 05:54:11 2013 -0400
|
|
|
786c6d |
|
|
|
786c6d |
[SCSI] scsi_transport_iscsi: Exporting new attrs for iscsi session
|
|
|
786c6d |
and conne
|
|
|
786c6d |
---
|
|
|
786c6d |
include/iscsi_if.h | 204 ++++++++++++++++++-------------------------------
|
|
|
786c6d |
usr/initiator.c | 12 +--
|
|
|
786c6d |
usr/initiator.h | 1 +
|
|
|
786c6d |
usr/initiator_common.c | 38 +++++----
|
|
|
786c6d |
4 files changed, 99 insertions(+), 156 deletions(-)
|
|
|
786c6d |
|
|
|
786c6d |
diff --git a/include/iscsi_if.h b/include/iscsi_if.h
|
|
|
786c6d |
index 20f2bc2..01d38e7 100644
|
|
|
786c6d |
--- a/include/iscsi_if.h
|
|
|
786c6d |
+++ b/include/iscsi_if.h
|
|
|
786c6d |
@@ -495,47 +495,64 @@ enum iscsi_param {
|
|
|
786c6d |
|
|
|
786c6d |
ISCSI_PARAM_TGT_RESET_TMO,
|
|
|
786c6d |
ISCSI_PARAM_TARGET_ALIAS,
|
|
|
786c6d |
+
|
|
|
786c6d |
+ ISCSI_PARAM_CHAP_IN_IDX,
|
|
|
786c6d |
+ ISCSI_PARAM_CHAP_OUT_IDX,
|
|
|
786c6d |
+
|
|
|
786c6d |
+ ISCSI_PARAM_BOOT_ROOT,
|
|
|
786c6d |
+ ISCSI_PARAM_BOOT_NIC,
|
|
|
786c6d |
+ ISCSI_PARAM_BOOT_TARGET,
|
|
|
786c6d |
+
|
|
|
786c6d |
+ ISCSI_PARAM_AUTO_SND_TGT_DISABLE,
|
|
|
786c6d |
+ ISCSI_PARAM_DISCOVERY_SESS,
|
|
|
786c6d |
+ ISCSI_PARAM_PORTAL_TYPE,
|
|
|
786c6d |
+ ISCSI_PARAM_CHAP_AUTH_EN,
|
|
|
786c6d |
+ ISCSI_PARAM_DISCOVERY_LOGOUT_EN,
|
|
|
786c6d |
+ ISCSI_PARAM_BIDI_CHAP_EN,
|
|
|
786c6d |
+ ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL,
|
|
|
786c6d |
+
|
|
|
786c6d |
+ ISCSI_PARAM_DEF_TIME2WAIT,
|
|
|
786c6d |
+ ISCSI_PARAM_DEF_TIME2RETAIN,
|
|
|
786c6d |
+ ISCSI_PARAM_MAX_SEGMENT_SIZE,
|
|
|
786c6d |
+ ISCSI_PARAM_STATSN,
|
|
|
786c6d |
+ ISCSI_PARAM_KEEPALIVE_TMO,
|
|
|
786c6d |
+ ISCSI_PARAM_LOCAL_PORT,
|
|
|
786c6d |
+ ISCSI_PARAM_TSID,
|
|
|
786c6d |
+ ISCSI_PARAM_DEF_TASKMGMT_TMO,
|
|
|
786c6d |
+
|
|
|
786c6d |
+ ISCSI_PARAM_TCP_TIMESTAMP_STAT,
|
|
|
786c6d |
+ ISCSI_PARAM_TCP_WSF_DISABLE,
|
|
|
786c6d |
+ ISCSI_PARAM_TCP_NAGLE_DISABLE,
|
|
|
786c6d |
+ ISCSI_PARAM_TCP_TIMER_SCALE,
|
|
|
786c6d |
+ ISCSI_PARAM_TCP_TIMESTAMP_EN,
|
|
|
786c6d |
+ ISCSI_PARAM_TCP_XMIT_WSF,
|
|
|
786c6d |
+ ISCSI_PARAM_TCP_RECV_WSF,
|
|
|
786c6d |
+ ISCSI_PARAM_IP_FRAGMENT_DISABLE,
|
|
|
786c6d |
+ ISCSI_PARAM_IPV4_TOS,
|
|
|
786c6d |
+ ISCSI_PARAM_IPV6_TC,
|
|
|
786c6d |
+ ISCSI_PARAM_IPV6_FLOW_LABEL,
|
|
|
786c6d |
+ ISCSI_PARAM_IS_FW_ASSIGNED_IPV6,
|
|
|
786c6d |
+
|
|
|
786c6d |
+ ISCSI_PARAM_DISCOVERY_PARENT_IDX,
|
|
|
786c6d |
+ ISCSI_PARAM_DISCOVERY_PARENT_TYPE,
|
|
|
786c6d |
/* must always be last */
|
|
|
786c6d |
ISCSI_PARAM_MAX,
|
|
|
786c6d |
};
|
|
|
786c6d |
|
|
|
786c6d |
-#define ISCSI_MAX_RECV_DLENGTH (1ULL << ISCSI_PARAM_MAX_RECV_DLENGTH)
|
|
|
786c6d |
-#define ISCSI_MAX_XMIT_DLENGTH (1ULL << ISCSI_PARAM_MAX_XMIT_DLENGTH)
|
|
|
786c6d |
-#define ISCSI_HDRDGST_EN (1ULL << ISCSI_PARAM_HDRDGST_EN)
|
|
|
786c6d |
-#define ISCSI_DATADGST_EN (1ULL << ISCSI_PARAM_DATADGST_EN)
|
|
|
786c6d |
-#define ISCSI_INITIAL_R2T_EN (1ULL << ISCSI_PARAM_INITIAL_R2T_EN)
|
|
|
786c6d |
-#define ISCSI_MAX_R2T (1ULL << ISCSI_PARAM_MAX_R2T)
|
|
|
786c6d |
-#define ISCSI_IMM_DATA_EN (1ULL << ISCSI_PARAM_IMM_DATA_EN)
|
|
|
786c6d |
-#define ISCSI_FIRST_BURST (1ULL << ISCSI_PARAM_FIRST_BURST)
|
|
|
786c6d |
-#define ISCSI_MAX_BURST (1ULL << ISCSI_PARAM_MAX_BURST)
|
|
|
786c6d |
-#define ISCSI_PDU_INORDER_EN (1ULL << ISCSI_PARAM_PDU_INORDER_EN)
|
|
|
786c6d |
-#define ISCSI_DATASEQ_INORDER_EN (1ULL << ISCSI_PARAM_DATASEQ_INORDER_EN)
|
|
|
786c6d |
-#define ISCSI_ERL (1ULL << ISCSI_PARAM_ERL)
|
|
|
786c6d |
-#define ISCSI_IFMARKER_EN (1ULL << ISCSI_PARAM_IFMARKER_EN)
|
|
|
786c6d |
-#define ISCSI_OFMARKER_EN (1ULL << ISCSI_PARAM_OFMARKER_EN)
|
|
|
786c6d |
-#define ISCSI_EXP_STATSN (1ULL << ISCSI_PARAM_EXP_STATSN)
|
|
|
786c6d |
-#define ISCSI_TARGET_NAME (1ULL << ISCSI_PARAM_TARGET_NAME)
|
|
|
786c6d |
-#define ISCSI_TPGT (1ULL << ISCSI_PARAM_TPGT)
|
|
|
786c6d |
-#define ISCSI_PERSISTENT_ADDRESS (1ULL << ISCSI_PARAM_PERSISTENT_ADDRESS)
|
|
|
786c6d |
-#define ISCSI_PERSISTENT_PORT (1ULL << ISCSI_PARAM_PERSISTENT_PORT)
|
|
|
786c6d |
-#define ISCSI_SESS_RECOVERY_TMO (1ULL << ISCSI_PARAM_SESS_RECOVERY_TMO)
|
|
|
786c6d |
-#define ISCSI_CONN_PORT (1ULL << ISCSI_PARAM_CONN_PORT)
|
|
|
786c6d |
-#define ISCSI_CONN_ADDRESS (1ULL << ISCSI_PARAM_CONN_ADDRESS)
|
|
|
786c6d |
-#define ISCSI_USERNAME (1ULL << ISCSI_PARAM_USERNAME)
|
|
|
786c6d |
-#define ISCSI_USERNAME_IN (1ULL << ISCSI_PARAM_USERNAME_IN)
|
|
|
786c6d |
-#define ISCSI_PASSWORD (1ULL << ISCSI_PARAM_PASSWORD)
|
|
|
786c6d |
-#define ISCSI_PASSWORD_IN (1ULL << ISCSI_PARAM_PASSWORD_IN)
|
|
|
786c6d |
-#define ISCSI_FAST_ABORT (1ULL << ISCSI_PARAM_FAST_ABORT)
|
|
|
786c6d |
-#define ISCSI_ABORT_TMO (1ULL << ISCSI_PARAM_ABORT_TMO)
|
|
|
786c6d |
-#define ISCSI_LU_RESET_TMO (1ULL << ISCSI_PARAM_LU_RESET_TMO)
|
|
|
786c6d |
-#define ISCSI_HOST_RESET_TMO (1ULL << ISCSI_PARAM_HOST_RESET_TMO)
|
|
|
786c6d |
-#define ISCSI_PING_TMO (1ULL << ISCSI_PARAM_PING_TMO)
|
|
|
786c6d |
-#define ISCSI_RECV_TMO (1ULL << ISCSI_PARAM_RECV_TMO)
|
|
|
786c6d |
-#define ISCSI_IFACE_NAME (1ULL << ISCSI_PARAM_IFACE_NAME)
|
|
|
786c6d |
-#define ISCSI_ISID (1ULL << ISCSI_PARAM_ISID)
|
|
|
786c6d |
-#define ISCSI_INITIATOR_NAME (1ULL << ISCSI_PARAM_INITIATOR_NAME)
|
|
|
786c6d |
-#define ISCSI_TGT_RESET_TMO (1ULL << ISCSI_PARAM_TGT_RESET_TMO)
|
|
|
786c6d |
-#define ISCSI_TARGET_ALIAS (1ULL << ISCSI_PARAM_TARGET_ALIAS)
|
|
|
786c6d |
+/* iSCSI HBA params */
|
|
|
786c6d |
+enum iscsi_host_param {
|
|
|
786c6d |
+ ISCSI_HOST_PARAM_HWADDRESS,
|
|
|
786c6d |
+ ISCSI_HOST_PARAM_INITIATOR_NAME,
|
|
|
786c6d |
+ ISCSI_HOST_PARAM_NETDEV_NAME,
|
|
|
786c6d |
+ ISCSI_HOST_PARAM_IPADDRESS,
|
|
|
786c6d |
+ ISCSI_HOST_PARAM_PORT_STATE,
|
|
|
786c6d |
+ ISCSI_HOST_PARAM_PORT_SPEED,
|
|
|
786c6d |
+ ISCSI_HOST_PARAM_MAX,
|
|
|
786c6d |
+};
|
|
|
786c6d |
+
|
|
|
786c6d |
+/* portal type */
|
|
|
786c6d |
+#define PORTAL_TYPE_IPV4 "ipv4"
|
|
|
786c6d |
+#define PORTAL_TYPE_IPV6 "ipv6"
|
|
|
786c6d |
|
|
|
786c6d |
/* iSCSI Flash Target params */
|
|
|
786c6d |
enum iscsi_flashnode_param {
|
|
|
786c6d |
@@ -603,106 +620,32 @@ enum iscsi_flashnode_param {
|
|
|
786c6d |
ISCSI_FLASHNODE_MAX,
|
|
|
786c6d |
};
|
|
|
786c6d |
|
|
|
786c6d |
-#define ISCSI_FNODE_IS_FW_ASSIGNED_IPV6 \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_IS_FW_ASSIGNED_IPV6)
|
|
|
786c6d |
-#define ISCSI_FNODE_PORTAL_TYPE (1ULL << ISCSI_FLASHNODE_PORTAL_TYPE)
|
|
|
786c6d |
-#define ISCSI_FNODE_AUTO_SND_TGT_DISABLE \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_OPT_AUTO_SND_TGT_DISABLE)
|
|
|
786c6d |
-#define ISCSI_FNODE_DISCOVERY_SESS \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_OPT_DISCOVERY_SESS)
|
|
|
786c6d |
-#define ISCSI_FNODE_ENTRY_EN (1ULL << ISCSI_FLASHNODE_ENTRY_EN)
|
|
|
786c6d |
-#define ISCSI_FNODE_HDR_DGST_EN (1ULL << ISCSI_FLASHNODE_HDR_DGST_EN)
|
|
|
786c6d |
-#define ISCSI_FNODE_DATA_DGST_EN (1ULL << ISCSI_FLASHNODE_DATA_DGST_EN)
|
|
|
786c6d |
-#define ISCSI_FNODE_IMM_DATA_EN (1ULL << ISCSI_FLASHNODE_IMM_DATA_EN)
|
|
|
786c6d |
-#define ISCSI_FNODE_INITIAL_R2T_EN (1ULL << ISCSI_FLASHNODE_INITIAL_R2T_EN)
|
|
|
786c6d |
-#define ISCSI_FNODE_DATASEQ_INORDER \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_DATASEQ_INORDER)
|
|
|
786c6d |
-#define ISCSI_FNODE_PDU_INORDER (1ULL << ISCSI_FLASHNODE_PDU_INORDER)
|
|
|
786c6d |
-#define ISCSI_FNODE_CHAP_AUTH_EN (1ULL << ISCSI_FLASHNODE_CHAP_AUTH_EN)
|
|
|
786c6d |
-#define ISCSI_FNODE_SNACK_REQ_EN (1ULL << ISCSI_FLASHNODE_SNACK_REQ_EN)
|
|
|
786c6d |
-#define ISCSI_FNODE_DISCOVERY_LOGOUT_EN \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_DISCOVERY_LOGOUT_EN)
|
|
|
786c6d |
-#define ISCSI_FNODE_BIDI_CHAP_EN (1ULL << ISCSI_FLASHNODE_BIDI_CHAP_EN)
|
|
|
786c6d |
-#define ISCSI_FNODE_DISCOVERY_AUTH_OPTIONAL \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_DISCOVERY_AUTH_OPTIONAL)
|
|
|
786c6d |
-#define ISCSI_FNODE_ERL (1ULL << ISCSI_FLASHNODE_ERL)
|
|
|
786c6d |
-#define ISCSI_FNODE_TCP_TIMESTAMP_STAT \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_TCP_TIMESTAMP_STAT)
|
|
|
786c6d |
-#define ISCSI_FNODE_TCP_NAGLE_DISABLE \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_TCP_NAGLE_DISABLE)
|
|
|
786c6d |
-#define ISCSI_FNODE_TCP_WSF_DISABLE \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_TCP_WSF_DISABLE)
|
|
|
786c6d |
-#define ISCSI_FNODE_TCP_TIMER_SCALE \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_TCP_TIMER_SCALE)
|
|
|
786c6d |
-#define ISCSI_FNODE_TCP_TIMESTAMP_ENABLE \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_TCP_TIMESTAMP_ENABLE)
|
|
|
786c6d |
-#define ISCSI_FNODE_IP_FRAG_DISABLE \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_IP_FRAG_DISABLE)
|
|
|
786c6d |
-#define ISCSI_FNODE_MAX_RECV_DLENGTH \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_MAX_RECV_DLENGTH)
|
|
|
786c6d |
-#define ISCSI_FNODE_MAX_XMIT_DLENGTH \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_MAX_XMIT_DLENGTH)
|
|
|
786c6d |
-#define ISCSI_FNODE_FIRST_BURST (1ULL << ISCSI_FLASHNODE_FIRST_BURST)
|
|
|
786c6d |
-#define ISCSI_FNODE_DEF_TIME2WAIT (1ULL << ISCSI_FLASHNODE_DEF_TIME2WAIT)
|
|
|
786c6d |
-#define ISCSI_FNODE_DEF_TIME2RETAIN \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_DEF_TIME2RETAIN)
|
|
|
786c6d |
-#define ISCSI_FNODE_MAX_R2T (1ULL << ISCSI_FLASHNODE_MAX_R2T)
|
|
|
786c6d |
-#define ISCSI_FNODE_KEEPALIVE_TMO (1ULL << ISCSI_FLASHNODE_KEEPALIVE_TMO)
|
|
|
786c6d |
-#define ISCSI_FNODE_ISID (1ULL << ISCSI_FLASHNODE_ISID)
|
|
|
786c6d |
-#define ISCSI_FNODE_TSID (1ULL << ISCSI_FLASHNODE_TSID)
|
|
|
786c6d |
-#define ISCSI_FNODE_PORT (1ULL << ISCSI_FLASHNODE_PORT)
|
|
|
786c6d |
-#define ISCSI_FNODE_MAX_BURST (1ULL << ISCSI_FLASHNODE_MAX_BURST)
|
|
|
786c6d |
-#define ISCSI_FNODE_DEF_TMF_TMO (1ULL << ISCSI_FLASHNODE_DEF_TMF_TMO)
|
|
|
786c6d |
-#define ISCSI_FNODE_IPADDR (1ULL << ISCSI_FLASHNODE_IPADDR)
|
|
|
786c6d |
-#define ISCSI_FNODE_ALIAS (1ULL << ISCSI_FLASHNODE_ALIAS)
|
|
|
786c6d |
-#define ISCSI_FNODE_REDIRECT_IPADDR \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_REDIRECT_IPADDR)
|
|
|
786c6d |
-#define ISCSI_FNODE_MAX_SEGMENT_SIZE \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_MAX_SEGMENT_SIZE)
|
|
|
786c6d |
-#define ISCSI_FNODE_LOCAL_PORT (1ULL << ISCSI_FLASHNODE_LOCAL_PORT)
|
|
|
786c6d |
-#define ISCSI_FNODE_IPV4_TOS (1ULL << ISCSI_FLASHNODE_IPV4_TOS)
|
|
|
786c6d |
-#define ISCSI_FNODE_IPV6_TC (1ULL << ISCSI_FLASHNODE_IPV6_TC)
|
|
|
786c6d |
-#define ISCSI_FNODE_IPV6_FLOW_LABEL \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_IPV6_FLOW_LABEL)
|
|
|
786c6d |
-#define ISCSI_FNODE_NAME (1ULL << ISCSI_FLASHNODE_NAME)
|
|
|
786c6d |
-#define ISCSI_FNODE_TPGT (1ULL << ISCSI_FLASHNODE_TPGT)
|
|
|
786c6d |
-#define ISCSI_FNODE_LINK_LOCAL_IPV6 \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_LINK_LOCAL_IPV6)
|
|
|
786c6d |
-#define ISCSI_FNODE_DISCOVERY_PARENT_IDX \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_DISCOVERY_PARENT_IDX)
|
|
|
786c6d |
-#define ISCSI_FNODE_DISCOVERY_PARENT_TYPE \
|
|
|
786c6d |
- (1ULL << ISCSI_FLASHNODE_DISCOVERY_PARENT_TYPE)
|
|
|
786c6d |
-#define ISCSI_FNODE_TCP_XMIT_WSF (1ULL << ISCSI_FLASHNODE_TCP_XMIT_WSF)
|
|
|
786c6d |
-#define ISCSI_FNODE_TCP_RECV_WSF (1ULL << ISCSI_FLASHNODE_TCP_RECV_WSF)
|
|
|
786c6d |
-#define ISCSI_FNODE_CHAP_IN_IDX (1ULL << ISCSI_FLASHNODE_CHAP_IN_IDX)
|
|
|
786c6d |
-#define ISCSI_FNODE_CHAP_OUT_IDX (1ULL << ISCSI_FLASHNODE_CHAP_OUT_IDX)
|
|
|
786c6d |
-#define ISCSI_FNODE_USERNAME (1ULL << ISCSI_FLASHNODE_USERNAME)
|
|
|
786c6d |
-#define ISCSI_FNODE_USERNAME_IN (1ULL << ISCSI_FLASHNODE_USERNAME_IN)
|
|
|
786c6d |
-#define ISCSI_FNODE_PASSWORD (1ULL << ISCSI_FLASHNODE_PASSWORD)
|
|
|
786c6d |
-#define ISCSI_FNODE_PASSWORD_IN (1ULL << ISCSI_FLASHNODE_PASSWORD_IN)
|
|
|
786c6d |
-#define ISCSI_FNODE_STATSN (1ULL << ISCSI_FLASHNODE_STATSN)
|
|
|
786c6d |
-#define ISCSI_FNODE_EXP_STATSN (1ULL << ISCSI_FLASHNODE_EXP_STATSN)
|
|
|
786c6d |
-#define ISCSI_FNODE_IS_BOOT_TGT (1ULL << ISCSI_FLASHNODE_IS_BOOT_TGT)
|
|
|
786c6d |
-
|
|
|
786c6d |
struct iscsi_flashnode_param_info {
|
|
|
786c6d |
uint32_t len; /* Actual length of the param */
|
|
|
786c6d |
uint16_t param; /* iscsi param value */
|
|
|
786c6d |
uint8_t value[0]; /* length sized value follows */
|
|
|
786c6d |
} __attribute__((__packed__));
|
|
|
786c6d |
|
|
|
786c6d |
-/* iSCSI HBA params */
|
|
|
786c6d |
-enum iscsi_host_param {
|
|
|
786c6d |
- ISCSI_HOST_PARAM_HWADDRESS,
|
|
|
786c6d |
- ISCSI_HOST_PARAM_INITIATOR_NAME,
|
|
|
786c6d |
- ISCSI_HOST_PARAM_NETDEV_NAME,
|
|
|
786c6d |
- ISCSI_HOST_PARAM_IPADDRESS,
|
|
|
786c6d |
- ISCSI_HOST_PARAM_MAX,
|
|
|
786c6d |
+enum iscsi_discovery_parent_type {
|
|
|
786c6d |
+ ISCSI_DISC_PARENT_UNKNOWN = 0x1,
|
|
|
786c6d |
+ ISCSI_DISC_PARENT_SENDTGT = 0x2,
|
|
|
786c6d |
+ ISCSI_DISC_PARENT_ISNS = 0x3,
|
|
|
786c6d |
};
|
|
|
786c6d |
|
|
|
786c6d |
-#define ISCSI_HOST_HWADDRESS (1ULL << ISCSI_HOST_PARAM_HWADDRESS)
|
|
|
786c6d |
-#define ISCSI_HOST_INITIATOR_NAME (1ULL << ISCSI_HOST_PARAM_INITIATOR_NAME)
|
|
|
786c6d |
-#define ISCSI_HOST_NETDEV_NAME (1ULL << ISCSI_HOST_PARAM_NETDEV_NAME)
|
|
|
786c6d |
-#define ISCSI_HOST_IPADDRESS (1ULL << ISCSI_HOST_PARAM_IPADDRESS)
|
|
|
786c6d |
+/* iSCSI port Speed */
|
|
|
786c6d |
+enum iscsi_port_speed {
|
|
|
786c6d |
+ ISCSI_PORT_SPEED_UNKNOWN = 0x1,
|
|
|
786c6d |
+ ISCSI_PORT_SPEED_10MBPS = 0x2,
|
|
|
786c6d |
+ ISCSI_PORT_SPEED_100MBPS = 0x4,
|
|
|
786c6d |
+ ISCSI_PORT_SPEED_1GBPS = 0x8,
|
|
|
786c6d |
+ ISCSI_PORT_SPEED_10GBPS = 0x10,
|
|
|
786c6d |
+};
|
|
|
786c6d |
+
|
|
|
786c6d |
+/* iSCSI port state */
|
|
|
786c6d |
+enum iscsi_port_state {
|
|
|
786c6d |
+ ISCSI_PORT_STATE_DOWN = 0x1,
|
|
|
786c6d |
+ ISCSI_PORT_STATE_UP = 0x2,
|
|
|
786c6d |
+};
|
|
|
786c6d |
|
|
|
786c6d |
/* iSCSI PING status/error code */
|
|
|
786c6d |
enum iscsi_ping_status_code {
|
|
|
786c6d |
@@ -739,7 +682,7 @@ enum iscsi_ping_status_code {
|
|
|
786c6d |
#define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */
|
|
|
786c6d |
#define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal,
|
|
|
786c6d |
and verification */
|
|
|
786c6d |
-#define CAP_LOGIN_OFFLOAD 0x4000 /* offload normal session login */
|
|
|
786c6d |
+#define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */
|
|
|
786c6d |
|
|
|
786c6d |
/*
|
|
|
786c6d |
* These flags describes reason of stop_conn() call
|
|
|
786c6d |
@@ -807,7 +750,6 @@ enum chap_type_e {
|
|
|
786c6d |
|
|
|
786c6d |
#define ISCSI_CHAP_AUTH_NAME_MAX_LEN 256
|
|
|
786c6d |
#define ISCSI_CHAP_AUTH_SECRET_MAX_LEN 256
|
|
|
786c6d |
-
|
|
|
786c6d |
struct iscsi_chap_rec {
|
|
|
786c6d |
uint16_t chap_tbl_idx;
|
|
|
786c6d |
enum chap_type_e chap_type;
|
|
|
786c6d |
diff --git a/usr/initiator.c b/usr/initiator.c
|
|
|
786c6d |
index a3b24b7..79d1779 100644
|
|
|
786c6d |
--- a/usr/initiator.c
|
|
|
786c6d |
+++ b/usr/initiator.c
|
|
|
786c6d |
@@ -384,17 +384,7 @@ __session_create(node_rec_t *rec, struct iscsi_transport *t)
|
|
|
786c6d |
/* setup authentication variables for the session*/
|
|
|
786c6d |
iscsi_setup_authentication(session, &rec->session.auth);
|
|
|
786c6d |
|
|
|
786c6d |
- session->param_mask = ~0ULL;
|
|
|
786c6d |
- if (!(t->caps & CAP_MULTI_R2T))
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_MAX_R2T;
|
|
|
786c6d |
- if (!(t->caps & CAP_HDRDGST))
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_HDRDGST_EN;
|
|
|
786c6d |
- if (!(t->caps & CAP_DATADGST))
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_DATADGST_EN;
|
|
|
786c6d |
- if (!(t->caps & CAP_MARKERS)) {
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_IFMARKER_EN;
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_OFMARKER_EN;
|
|
|
786c6d |
- }
|
|
|
786c6d |
+ iscsi_session_init_params(session);
|
|
|
786c6d |
|
|
|
786c6d |
hostno = iscsi_sysfs_get_host_no_from_hwinfo(&rec->iface, &rc);
|
|
|
786c6d |
if (!rc) {
|
|
|
786c6d |
diff --git a/usr/initiator.h b/usr/initiator.h
|
|
|
786c6d |
index d6dc02e..680640c 100644
|
|
|
786c6d |
--- a/usr/initiator.h
|
|
|
786c6d |
+++ b/usr/initiator.h
|
|
|
786c6d |
@@ -357,5 +357,6 @@ extern int iscsi_setup_portal(struct iscsi_conn *conn, char *address, int port);
|
|
|
786c6d |
extern int iscsi_set_net_config(struct iscsi_transport *t,
|
|
|
786c6d |
iscsi_session_t *session,
|
|
|
786c6d |
struct iface_rec *iface);
|
|
|
786c6d |
+extern void iscsi_session_init_params(struct iscsi_session *session);
|
|
|
786c6d |
|
|
|
786c6d |
#endif /* INITIATOR_H */
|
|
|
786c6d |
diff --git a/usr/initiator_common.c b/usr/initiator_common.c
|
|
|
786c6d |
index eb72795..0fb7edc 100644
|
|
|
786c6d |
--- a/usr/initiator_common.c
|
|
|
786c6d |
+++ b/usr/initiator_common.c
|
|
|
786c6d |
@@ -324,12 +324,32 @@ int iscsi_host_set_params(struct iscsi_session *session)
|
|
|
786c6d |
return 0;
|
|
|
786c6d |
}
|
|
|
786c6d |
|
|
|
786c6d |
+static inline void iscsi_session_clear_param(struct iscsi_session *session,
|
|
|
786c6d |
+ int param)
|
|
|
786c6d |
+{
|
|
|
786c6d |
+ session->param_mask &= ~(1ULL << param);
|
|
|
786c6d |
+}
|
|
|
786c6d |
+
|
|
|
786c6d |
+void iscsi_session_init_params(struct iscsi_session *session)
|
|
|
786c6d |
+{
|
|
|
786c6d |
+ session->param_mask = ~0ULL;
|
|
|
786c6d |
+ if (!(session->t->caps & CAP_MULTI_R2T))
|
|
|
786c6d |
+ iscsi_session_clear_param(session, ISCSI_PARAM_MAX_R2T);
|
|
|
786c6d |
+ if (!(session->t->caps & CAP_HDRDGST))
|
|
|
786c6d |
+ iscsi_session_clear_param(session, ISCSI_PARAM_HDRDGST_EN);
|
|
|
786c6d |
+ if (!(session->t->caps & CAP_DATADGST))
|
|
|
786c6d |
+ iscsi_session_clear_param(session, ISCSI_PARAM_DATADGST_EN);
|
|
|
786c6d |
+ if (!(session->t->caps & CAP_MARKERS)) {
|
|
|
786c6d |
+ iscsi_session_clear_param(session, ISCSI_PARAM_IFMARKER_EN);
|
|
|
786c6d |
+ iscsi_session_clear_param(session, ISCSI_PARAM_OFMARKER_EN);
|
|
|
786c6d |
+ }
|
|
|
786c6d |
+}
|
|
|
786c6d |
+
|
|
|
786c6d |
#define MAX_SESSION_PARAMS 32
|
|
|
786c6d |
|
|
|
786c6d |
int iscsi_session_set_params(struct iscsi_conn *conn)
|
|
|
786c6d |
{
|
|
|
786c6d |
struct iscsi_session *session = conn->session;
|
|
|
786c6d |
- struct iscsi_transport *t = session->t;
|
|
|
786c6d |
int i, rc;
|
|
|
786c6d |
uint32_t one = 1, zero = 0;
|
|
|
786c6d |
struct connparam {
|
|
|
786c6d |
@@ -499,22 +519,12 @@ int iscsi_session_set_params(struct iscsi_conn *conn)
|
|
|
786c6d |
},
|
|
|
786c6d |
};
|
|
|
786c6d |
|
|
|
786c6d |
- session->param_mask = ~0ULL;
|
|
|
786c6d |
- if (!(t->caps & CAP_MULTI_R2T))
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_MAX_R2T;
|
|
|
786c6d |
- if (!(t->caps & CAP_HDRDGST))
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_HDRDGST_EN;
|
|
|
786c6d |
- if (!(t->caps & CAP_DATADGST))
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_DATADGST_EN;
|
|
|
786c6d |
- if (!(t->caps & CAP_MARKERS)) {
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_IFMARKER_EN;
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_OFMARKER_EN;
|
|
|
786c6d |
- }
|
|
|
786c6d |
+ iscsi_session_init_params(session);
|
|
|
786c6d |
|
|
|
786c6d |
/* some llds will send nops internally */
|
|
|
786c6d |
if (!iscsi_sysfs_session_supports_nop(session->id)) {
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_PING_TMO;
|
|
|
786c6d |
- session->param_mask &= ~ISCSI_RECV_TMO;
|
|
|
786c6d |
+ iscsi_session_clear_param(session, ISCSI_PARAM_PING_TMO);
|
|
|
786c6d |
+ iscsi_session_clear_param(session, ISCSI_PARAM_RECV_TMO);
|
|
|
786c6d |
}
|
|
|
786c6d |
|
|
|
786c6d |
/* Entered full-feature phase! */
|
|
|
786c6d |
--
|
|
|
786c6d |
1.8.3.1
|
|
|
786c6d |
|