From 4fcf812ca392303aa79dd50e96e83a29faa13bd0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 29 Jul 2011 17:26:39 -0700 Subject: [SCSI] libsas: export sas_alloc_task() Now that isci has added a 3rd open coded user of this functionality just share the libsas version. Acked-by: Jack Wang Signed-off-by: Dan Williams Signed-off-by: James Bottomley --- include/scsi/libsas.h | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index ee866060f8a..2517254b840 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -555,36 +555,14 @@ struct sas_task { struct work_struct abort_work; }; -extern struct kmem_cache *sas_task_cache; - #define SAS_TASK_STATE_PENDING 1 #define SAS_TASK_STATE_DONE 2 #define SAS_TASK_STATE_ABORTED 4 #define SAS_TASK_NEED_DEV_RESET 8 #define SAS_TASK_AT_INITIATOR 16 -static inline struct sas_task *sas_alloc_task(gfp_t flags) -{ - struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags); - - if (task) { - INIT_LIST_HEAD(&task->list); - spin_lock_init(&task->task_state_lock); - task->task_state_flags = SAS_TASK_STATE_PENDING; - init_timer(&task->timer); - init_completion(&task->completion); - } - - return task; -} - -static inline void sas_free_task(struct sas_task *task) -{ - if (task) { - BUG_ON(!list_empty(&task->list)); - kmem_cache_free(sas_task_cache, task); - } -} +extern struct sas_task *sas_alloc_task(gfp_t flags); +extern void sas_free_task(struct sas_task *task); struct sas_domain_function_template { /* The class calls these to notify the LLDD of an event. */ -- cgit v1.2.3-18-g5258 From d834895c41d34b64a1923fa631e6a64f763ed31c Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Gollapudi Date: Thu, 4 Aug 2011 17:38:49 -0700 Subject: [SCSI] fcoe: Move common functions to fcoe_transport library Export fcoe_get_wwn, fcoe_validate_vport_create and fcoe_wwn_to_str so that all LLDs can use these common function. Signed-off-by: Bhanu Prakash Gollapudi Signed-off-by: James Bottomley --- include/scsi/libfcoe.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 8c1638b8c28..0b2f84304f3 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h @@ -229,6 +229,9 @@ int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *, const struct libfc_function_template *, int init_fcp); u32 fcoe_fc_crc(struct fc_frame *fp); int fcoe_start_io(struct sk_buff *skb); +int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type); +void fcoe_wwn_to_str(u64 wwn, char *buf, int len); +int fcoe_validate_vport_create(struct fc_vport *vport); /** * is_fip_mode() - returns true if FIP mode selected. -- cgit v1.2.3-18-g5258 From 56c155b5ca427c9a6312bb0e31865f1c8ab10b2b Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 25 Jul 2011 13:48:37 -0500 Subject: [SCSI] iscsi_transport: add support for net settings Allows user space (iscsiadm) to send down network configuration parameters for LLD to set private network configuration on the iSCSI adapters. Based on patch from Lalit Chandivade. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 63 +++++++++++++++++++++++++++++++++++++ include/scsi/scsi_transport_iscsi.h | 1 + 2 files changed, 64 insertions(+) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index ddb04568a50..e93831e8787 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -59,6 +59,7 @@ enum iscsi_uevent_e { ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, + ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21, /* up events */ ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, @@ -172,6 +173,10 @@ struct iscsi_uevent { struct msg_set_path { uint32_t host_no; } set_path; + struct msg_set_iface_params { + uint32_t host_no; + uint32_t count; + } set_iface_params; } u; union { /* messages k -> u */ @@ -214,6 +219,21 @@ struct iscsi_uevent { } r; } __attribute__ ((aligned (sizeof(uint64_t)))); +enum iscsi_param_type { + ISCSI_PARAM, /* iscsi_param (session, conn, target, LU) */ + ISCSI_HOST_PARAM, /* iscsi_host_param */ + ISCSI_NET_PARAM, /* iscsi_net_param */ +}; + +struct iscsi_iface_param_info { + uint32_t iface_num; /* iface number, 0 - n */ + uint32_t len; /* Actual length of the param */ + uint16_t param; /* iscsi param value */ + uint8_t iface_type; /* IPv4 or IPv6 */ + uint8_t param_type; /* iscsi_param_type */ + uint8_t value[0]; /* length sized value follows */ +} __packed; + /* * To keep the struct iscsi_uevent size the same for userspace code * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and @@ -237,6 +257,49 @@ struct iscsi_path { uint16_t pmtu; } __attribute__ ((aligned (sizeof(uint64_t)))); +/* iscsi iface enabled/disabled setting */ +#define ISCSI_IFACE_DISABLE 0x01 +#define ISCSI_IFACE_ENABLE 0x02 + +/* ipv4 bootproto */ +#define ISCSI_BOOTPROTO_STATIC 0x01 +#define ISCSI_BOOTPROTO_DHCP 0x02 + +/* ipv6 addr autoconfig type */ +#define ISCSI_IPV6_AUTOCFG_DISABLE 0x01 +#define ISCSI_IPV6_AUTOCFG_ND_ENABLE 0x02 +#define ISCSI_IPV6_AUTOCFG_DHCPV6_ENABLE 0x03 + +/* ipv6 link local addr type */ +#define ISCSI_IPV6_LINKLOCAL_AUTOCFG_ENABLE 0x01 +#define ISCSI_IPV6_LINKLOCAL_AUTOCFG_DISABLE 0x02 + +/* ipv6 router addr type */ +#define ISCSI_IPV6_ROUTER_AUTOCFG_ENABLE 0x01 +#define ISCSI_IPV6_ROUTER_AUTOCFG_DISABLE 0x02 + +#define ISCSI_IFACE_TYPE_IPV4 0x01 +#define ISCSI_IFACE_TYPE_IPV6 0x02 + +/* iSCSI network params */ +enum iscsi_net_param { + ISCSI_NET_PARAM_IPV4_ADDR = 1, + ISCSI_NET_PARAM_IPV4_SUBNET = 2, + ISCSI_NET_PARAM_IPV4_GW = 3, + ISCSI_NET_PARAM_IPV4_BOOTPROTO = 4, + ISCSI_NET_PARAM_MAC = 5, + ISCSI_NET_PARAM_IPV6_LINKLOCAL = 6, + ISCSI_NET_PARAM_IPV6_ADDR = 7, + ISCSI_NET_PARAM_IPV6_ROUTER = 8, + ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG = 9, + ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG = 10, + ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11, + ISCSI_NET_PARAM_IFACE_ENABLE = 12, + ISCSI_NET_PARAM_VLAN_ID = 13, + ISCSI_NET_IFACE_TYPE = 14, + ISCSI_NET_IFACE_NAME = 15, +}; + /* * Common error codes */ diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index bf8f5296567..9fcce7cd367 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -137,6 +137,7 @@ struct iscsi_transport { int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, uint32_t enable, struct sockaddr *dst_addr); int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); + int (*set_iface_param) (struct Scsi_Host *shost, char *data, int count); }; /* -- cgit v1.2.3-18-g5258 From 8d07913dbe79568eafe5bb73806a08aac294d4e6 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 25 Jul 2011 13:48:40 -0500 Subject: [SCSI] iscsi class: add iface representation A iscsi host can have multiple interfaces. This patch adds a new iface iscsi class for this. It exports the network settings now, and will be extended to also export iscsi initiator port settings like the isid and initiator name for drivers that can support multiple initiator ports. Based on patch from Lalit Chandivade. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 21 +++++++++++++++++++-- include/scsi/scsi_transport_iscsi.h | 26 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index e93831e8787..a563753d578 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -296,10 +296,27 @@ enum iscsi_net_param { ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11, ISCSI_NET_PARAM_IFACE_ENABLE = 12, ISCSI_NET_PARAM_VLAN_ID = 13, - ISCSI_NET_IFACE_TYPE = 14, - ISCSI_NET_IFACE_NAME = 15, + ISCSI_NET_PARAM_IFACE_TYPE = 14, + ISCSI_NET_PARAM_IFACE_NAME = 15, }; +#define ISCSI_NET_IPV4_ADDR (1ULL << ISCSI_NET_PARAM_IPV4_ADDR) +#define ISCSI_NET_IPV4_SUBNET (1ULL << ISCSI_NET_PARAM_IPV4_SUBNET) +#define ISCSI_NET_IPV4_GW (1ULL << ISCSI_NET_PARAM_IPV4_GW) +#define ISCSI_NET_IPV4_BOOTPROTO (1ULL << ISCSI_NET_PARAM_IPV4_BOOTPROTO) +#define ISCSI_NET_MAC (1ULL << ISCSI_NET_PARAM_MAC) +#define ISCSI_NET_IPV6_LINKLOCAL (1ULL << ISCSI_NET_PARAM_IPV6_LINKLOCAL) +#define ISCSI_NET_IPV6_ADDR (1ULL << ISCSI_NET_PARAM_IPV6_ADDR) +#define ISCSI_NET_IPV6_ROUTER (1ULL << ISCSI_NET_PARAM_IPV6_ROUTER) +#define ISCSI_NET_IPV6_ADDR_AUTOCFG \ + (1ULL << ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG) +#define ISCSI_NET_IPV6_LINKLOCAL_AUTOCFG \ + (1ULL << ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG) +#define ISCSI_NET_IPV6_ROUTER_AUTOCFG \ + (1ULL << ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG) +#define ISCSI_NET_IFACE_ENABLE (1ULL << ISCSI_NET_PARAM_IFACE_ENABLE) +#define ISCSI_NET_VLAN_ID (1ULL << ISCSI_NET_PARAM_VLAN_ID) + /* * Common error codes */ diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 9fcce7cd367..e1f210a173a 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -37,6 +37,7 @@ struct iscsi_cls_conn; struct iscsi_conn; struct iscsi_task; struct sockaddr; +struct iscsi_iface; /** * struct iscsi_transport - iSCSI Transport template @@ -87,6 +88,8 @@ struct iscsi_transport { /* LLD sets this to indicate what values it can export to sysfs */ uint64_t param_mask; uint64_t host_param_mask; + uint64_t iface_param_mask; + struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, uint16_t cmds_max, uint16_t qdepth, uint32_t sn); @@ -138,6 +141,9 @@ struct iscsi_transport { uint32_t enable, struct sockaddr *dst_addr); int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); int (*set_iface_param) (struct Scsi_Host *shost, char *data, int count); + int (*get_iface_param) (struct iscsi_iface *iface, + enum iscsi_param_type param_type, + int param, char *buf); }; /* @@ -229,6 +235,20 @@ struct iscsi_endpoint { struct iscsi_cls_conn *conn; }; +struct iscsi_iface { + struct device dev; + struct iscsi_transport *transport; + uint32_t iface_type; /* IPv4 or IPv6 */ + uint32_t iface_num; /* iface number, 0 - n */ + void *dd_data; /* LLD private data */ +}; + +#define iscsi_dev_to_iface(_dev) \ + container_of(_dev, struct iscsi_iface, dev) + +#define iscsi_iface_to_shost(_iface) \ + dev_to_shost(_iface->dev.parent) + /* * session and connection functions that can be used by HW iSCSI LLDs */ @@ -262,5 +282,11 @@ extern struct iscsi_endpoint *iscsi_create_endpoint(int dd_size); extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); extern int iscsi_block_scsi_eh(struct scsi_cmnd *cmd); +extern struct iscsi_iface *iscsi_create_iface(struct Scsi_Host *shost, + struct iscsi_transport *t, + uint32_t iface_type, + uint32_t iface_num, int dd_size); +extern void iscsi_destroy_iface(struct iscsi_iface *iface); +extern struct iscsi_iface *iscsi_lookup_iface(int handle); #endif -- cgit v1.2.3-18-g5258 From 3128c6c73cdf3df92c3165bfb785ae50114d18bf Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 25 Jul 2011 13:48:42 -0500 Subject: [SCSI] iscsi cls: sysfs group is_visible callout for conn attrs The iscsi class currently does not support writable sysfs attrs for LLD sysfs settings. This patch converts the iscsi class and drivers to use the attribute container sysfs group and the sysfs group's is_visible callout to be able to support readable or writable sysfs attrs. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/scsi_transport_iscsi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index e1f210a173a..8918329feaa 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -144,8 +144,10 @@ struct iscsi_transport { int (*get_iface_param) (struct iscsi_iface *iface, enum iscsi_param_type param_type, int param, char *buf); + mode_t (*attr_is_visible)(int param_type, int param); }; + /* * transport registration upcalls */ @@ -178,6 +180,9 @@ struct iscsi_cls_conn { #define iscsi_dev_to_conn(_dev) \ container_of(_dev, struct iscsi_cls_conn, dev) +#define transport_class_to_conn(_cdev) \ + iscsi_dev_to_conn(_cdev->parent) + #define iscsi_conn_to_session(_conn) \ iscsi_dev_to_session(_conn->dev.parent) -- cgit v1.2.3-18-g5258 From 1d063c17298d7cd26cfe350f1e93e1727b4aa53f Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 25 Jul 2011 13:48:43 -0500 Subject: [SCSI] iscsi class: sysfs group is_visible callout for session attrs The iscsi class currently does not support writable sysfs attrs for LLD sysfs settings. This patch converts the iscsi class and driver's session attrs to use the attribute container sysfs group and the sysfs group's is_visible callout to be able to support readable or writable sysfs attrs. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 38 ------------------------------------- include/scsi/scsi_transport_iscsi.h | 4 +++- 2 files changed, 3 insertions(+), 39 deletions(-) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index a563753d578..a4353ff563f 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -399,44 +399,6 @@ enum iscsi_param { ISCSI_PARAM_MAX, }; -#define ISCSI_MAX_RECV_DLENGTH (1ULL << ISCSI_PARAM_MAX_RECV_DLENGTH) -#define ISCSI_MAX_XMIT_DLENGTH (1ULL << ISCSI_PARAM_MAX_XMIT_DLENGTH) -#define ISCSI_HDRDGST_EN (1ULL << ISCSI_PARAM_HDRDGST_EN) -#define ISCSI_DATADGST_EN (1ULL << ISCSI_PARAM_DATADGST_EN) -#define ISCSI_INITIAL_R2T_EN (1ULL << ISCSI_PARAM_INITIAL_R2T_EN) -#define ISCSI_MAX_R2T (1ULL << ISCSI_PARAM_MAX_R2T) -#define ISCSI_IMM_DATA_EN (1ULL << ISCSI_PARAM_IMM_DATA_EN) -#define ISCSI_FIRST_BURST (1ULL << ISCSI_PARAM_FIRST_BURST) -#define ISCSI_MAX_BURST (1ULL << ISCSI_PARAM_MAX_BURST) -#define ISCSI_PDU_INORDER_EN (1ULL << ISCSI_PARAM_PDU_INORDER_EN) -#define ISCSI_DATASEQ_INORDER_EN (1ULL << ISCSI_PARAM_DATASEQ_INORDER_EN) -#define ISCSI_ERL (1ULL << ISCSI_PARAM_ERL) -#define ISCSI_IFMARKER_EN (1ULL << ISCSI_PARAM_IFMARKER_EN) -#define ISCSI_OFMARKER_EN (1ULL << ISCSI_PARAM_OFMARKER_EN) -#define ISCSI_EXP_STATSN (1ULL << ISCSI_PARAM_EXP_STATSN) -#define ISCSI_TARGET_NAME (1ULL << ISCSI_PARAM_TARGET_NAME) -#define ISCSI_TPGT (1ULL << ISCSI_PARAM_TPGT) -#define ISCSI_PERSISTENT_ADDRESS (1ULL << ISCSI_PARAM_PERSISTENT_ADDRESS) -#define ISCSI_PERSISTENT_PORT (1ULL << ISCSI_PARAM_PERSISTENT_PORT) -#define ISCSI_SESS_RECOVERY_TMO (1ULL << ISCSI_PARAM_SESS_RECOVERY_TMO) -#define ISCSI_CONN_PORT (1ULL << ISCSI_PARAM_CONN_PORT) -#define ISCSI_CONN_ADDRESS (1ULL << ISCSI_PARAM_CONN_ADDRESS) -#define ISCSI_USERNAME (1ULL << ISCSI_PARAM_USERNAME) -#define ISCSI_USERNAME_IN (1ULL << ISCSI_PARAM_USERNAME_IN) -#define ISCSI_PASSWORD (1ULL << ISCSI_PARAM_PASSWORD) -#define ISCSI_PASSWORD_IN (1ULL << ISCSI_PARAM_PASSWORD_IN) -#define ISCSI_FAST_ABORT (1ULL << ISCSI_PARAM_FAST_ABORT) -#define ISCSI_ABORT_TMO (1ULL << ISCSI_PARAM_ABORT_TMO) -#define ISCSI_LU_RESET_TMO (1ULL << ISCSI_PARAM_LU_RESET_TMO) -#define ISCSI_HOST_RESET_TMO (1ULL << ISCSI_PARAM_HOST_RESET_TMO) -#define ISCSI_PING_TMO (1ULL << ISCSI_PARAM_PING_TMO) -#define ISCSI_RECV_TMO (1ULL << ISCSI_PARAM_RECV_TMO) -#define ISCSI_IFACE_NAME (1ULL << ISCSI_PARAM_IFACE_NAME) -#define ISCSI_ISID (1ULL << ISCSI_PARAM_ISID) -#define ISCSI_INITIATOR_NAME (1ULL << ISCSI_PARAM_INITIATOR_NAME) -#define ISCSI_TGT_RESET_TMO (1ULL << ISCSI_PARAM_TGT_RESET_TMO) -#define ISCSI_TARGET_ALIAS (1ULL << ISCSI_PARAM_TARGET_ALIAS) - /* iSCSI HBA params */ enum iscsi_host_param { ISCSI_HOST_PARAM_HWADDRESS, diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 8918329feaa..53eb9384937 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -86,7 +86,6 @@ struct iscsi_transport { char *name; unsigned int caps; /* LLD sets this to indicate what values it can export to sysfs */ - uint64_t param_mask; uint64_t host_param_mask; uint64_t iface_param_mask; @@ -219,6 +218,9 @@ struct iscsi_cls_session { #define iscsi_dev_to_session(_dev) \ container_of(_dev, struct iscsi_cls_session, dev) +#define transport_class_to_session(_cdev) \ + iscsi_dev_to_session(_cdev->parent) + #define iscsi_session_to_shost(_session) \ dev_to_shost(_session->dev.parent) -- cgit v1.2.3-18-g5258 From b78dbba0053c6f14384d55b929d21b85d03c38bb Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 25 Jul 2011 13:48:44 -0500 Subject: [SCSI] iscsi class: remove iface param mask We can replace the iface param mask with the attr_is_visible callback. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 17 ----------------- include/scsi/scsi_transport_iscsi.h | 1 - 2 files changed, 18 deletions(-) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index a4353ff563f..164a753fdd3 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -300,23 +300,6 @@ enum iscsi_net_param { ISCSI_NET_PARAM_IFACE_NAME = 15, }; -#define ISCSI_NET_IPV4_ADDR (1ULL << ISCSI_NET_PARAM_IPV4_ADDR) -#define ISCSI_NET_IPV4_SUBNET (1ULL << ISCSI_NET_PARAM_IPV4_SUBNET) -#define ISCSI_NET_IPV4_GW (1ULL << ISCSI_NET_PARAM_IPV4_GW) -#define ISCSI_NET_IPV4_BOOTPROTO (1ULL << ISCSI_NET_PARAM_IPV4_BOOTPROTO) -#define ISCSI_NET_MAC (1ULL << ISCSI_NET_PARAM_MAC) -#define ISCSI_NET_IPV6_LINKLOCAL (1ULL << ISCSI_NET_PARAM_IPV6_LINKLOCAL) -#define ISCSI_NET_IPV6_ADDR (1ULL << ISCSI_NET_PARAM_IPV6_ADDR) -#define ISCSI_NET_IPV6_ROUTER (1ULL << ISCSI_NET_PARAM_IPV6_ROUTER) -#define ISCSI_NET_IPV6_ADDR_AUTOCFG \ - (1ULL << ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG) -#define ISCSI_NET_IPV6_LINKLOCAL_AUTOCFG \ - (1ULL << ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG) -#define ISCSI_NET_IPV6_ROUTER_AUTOCFG \ - (1ULL << ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG) -#define ISCSI_NET_IFACE_ENABLE (1ULL << ISCSI_NET_PARAM_IFACE_ENABLE) -#define ISCSI_NET_VLAN_ID (1ULL << ISCSI_NET_PARAM_VLAN_ID) - /* * Common error codes */ diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 53eb9384937..b9e9ef5a881 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -87,7 +87,6 @@ struct iscsi_transport { unsigned int caps; /* LLD sets this to indicate what values it can export to sysfs */ uint64_t host_param_mask; - uint64_t iface_param_mask; struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, uint16_t cmds_max, uint16_t qdepth, -- cgit v1.2.3-18-g5258 From f27fb2ef7bd88c9c5f67befe4d85e2155aa0e1a8 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 25 Jul 2011 13:48:45 -0500 Subject: [SCSI] iscsi class: sysfs group is_visible callout for iscsi host attrs The iscsi class currently does not support writable sysfs attrs for LLD sysfs settings. This patch converts the iscsi class and driver's host attrs to use the attribute container sysfs group and the sysfs group's is_visible callout to be able to support readable or writable sysfs attrs. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 5 ----- include/scsi/scsi_transport_iscsi.h | 2 -- 2 files changed, 7 deletions(-) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 164a753fdd3..3753f7e3638 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -391,11 +391,6 @@ enum iscsi_host_param { ISCSI_HOST_PARAM_MAX, }; -#define ISCSI_HOST_HWADDRESS (1ULL << ISCSI_HOST_PARAM_HWADDRESS) -#define ISCSI_HOST_INITIATOR_NAME (1ULL << ISCSI_HOST_PARAM_INITIATOR_NAME) -#define ISCSI_HOST_NETDEV_NAME (1ULL << ISCSI_HOST_PARAM_NETDEV_NAME) -#define ISCSI_HOST_IPADDRESS (1ULL << ISCSI_HOST_PARAM_IPADDRESS) - #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index b9e9ef5a881..77e6dd60fb4 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -85,8 +85,6 @@ struct iscsi_transport { struct module *owner; char *name; unsigned int caps; - /* LLD sets this to indicate what values it can export to sysfs */ - uint64_t host_param_mask; struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, uint16_t cmds_max, uint16_t qdepth, -- cgit v1.2.3-18-g5258 From 4223b9e919761ba1405a8505bda0b4efa17e8f0e Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 25 Jul 2011 13:48:47 -0500 Subject: [SCSI] iscsi class: expand vlan support Add support to set vlan priority and enable/disble a vlan. Patch based on code from Vikas Chaudhary. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 3753f7e3638..d3f256a232f 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -281,6 +281,13 @@ struct iscsi_path { #define ISCSI_IFACE_TYPE_IPV4 0x01 #define ISCSI_IFACE_TYPE_IPV6 0x02 +#define ISCSI_MAX_VLAN_ID 4095 +#define ISCSI_MAX_VLAN_PRIORITY 7 + +/* iscsi vlan enable/disabled setting */ +#define ISCSI_VLAN_DISABLE 0x01 +#define ISCSI_VLAN_ENABLE 0x02 + /* iSCSI network params */ enum iscsi_net_param { ISCSI_NET_PARAM_IPV4_ADDR = 1, @@ -296,8 +303,10 @@ enum iscsi_net_param { ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11, ISCSI_NET_PARAM_IFACE_ENABLE = 12, ISCSI_NET_PARAM_VLAN_ID = 13, - ISCSI_NET_PARAM_IFACE_TYPE = 14, - ISCSI_NET_PARAM_IFACE_NAME = 15, + ISCSI_NET_PARAM_VLAN_PRIORITY = 14, + ISCSI_NET_PARAM_VLAN_ENABLED = 15, + ISCSI_NET_PARAM_IFACE_TYPE = 16, + ISCSI_NET_PARAM_IFACE_NAME = 17, }; /* -- cgit v1.2.3-18-g5258 From 90eeb01a038e5fec0efdea4df008f3c18f67b82c Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 25 Jul 2011 13:48:50 -0500 Subject: [SCSI] iscsi class: add bsg support to iscsi class This patch adds bsg support to the iscsi class. There is only 1 request, the host vendor one, supported. It is expected that this would be used for things like flash updates. This patch is made over this one http://marc.info/?l=linux-scsi&m=131149780020992&w=2 Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/scsi_bsg_iscsi.h | 110 ++++++++++++++++++++++++++++++++++++ include/scsi/scsi_transport_iscsi.h | 7 ++- 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 include/scsi/scsi_bsg_iscsi.h (limited to 'include') diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h new file mode 100644 index 00000000000..fd5689d4c05 --- /dev/null +++ b/include/scsi/scsi_bsg_iscsi.h @@ -0,0 +1,110 @@ +/* + * iSCSI Transport BSG Interface + * + * Copyright (C) 2009 James Smart, Emulex Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef SCSI_BSG_ISCSI_H +#define SCSI_BSG_ISCSI_H + +/* + * This file intended to be included by both kernel and user space + */ + +#include + +/* + * iSCSI Transport SGIO v4 BSG Message Support + */ + +/* Default BSG request timeout (in seconds) */ +#define ISCSI_DEFAULT_BSG_TIMEOUT (10 * HZ) + + +/* + * Request Message Codes supported by the iSCSI Transport + */ + +/* define the class masks for the message codes */ +#define ISCSI_BSG_CLS_MASK 0xF0000000 /* find object class */ +#define ISCSI_BSG_HST_MASK 0x80000000 /* iscsi host class */ + +/* iscsi host Message Codes */ +#define ISCSI_BSG_HST_VENDOR (ISCSI_BSG_HST_MASK | 0x000000FF) + + +/* + * iSCSI Host Messages + */ + +/* ISCSI_BSG_HST_VENDOR : */ + +/* Request: + * Note: When specifying vendor_id, be sure to read the Vendor Type and ID + * formatting requirements specified in scsi_netlink.h + */ +struct iscsi_bsg_host_vendor { + /* + * Identifies the vendor that the message is formatted for. This + * should be the recipient of the message. + */ + uint64_t vendor_id; + + /* start of vendor command area */ + uint32_t vendor_cmd[0]; +}; + +/* Response: + */ +struct iscsi_bsg_host_vendor_reply { + /* start of vendor response area */ + uint32_t vendor_rsp[0]; +}; + + +/* request (CDB) structure of the sg_io_v4 */ +struct iscsi_bsg_request { + uint32_t msgcode; + union { + struct iscsi_bsg_host_vendor h_vendor; + } rqst_data; +} __attribute__((packed)); + + +/* response (request sense data) structure of the sg_io_v4 */ +struct iscsi_bsg_reply { + /* + * The completion result. Result exists in two forms: + * if negative, it is an -Exxx system errno value. There will + * be no further reply information supplied. + * else, it's the 4-byte scsi error result, with driver, host, + * msg and status fields. The per-msgcode reply structure + * will contain valid data. + */ + uint32_t result; + + /* If there was reply_payload, how much was recevied ? */ + uint32_t reply_payload_rcv_len; + + union { + struct iscsi_bsg_host_vendor_reply vendor_reply; + } reply_data; +}; + + +#endif /* SCSI_BSG_ISCSI_H */ diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 77e6dd60fb4..4a3edeeae8f 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -38,6 +38,7 @@ struct iscsi_conn; struct iscsi_task; struct sockaddr; struct iscsi_iface; +struct bsg_job; /** * struct iscsi_transport - iSCSI Transport template @@ -141,9 +142,9 @@ struct iscsi_transport { enum iscsi_param_type param_type, int param, char *buf); mode_t (*attr_is_visible)(int param_type, int param); + int (*bsg_request)(struct bsg_job *job); }; - /* * transport registration upcalls */ @@ -227,8 +228,12 @@ struct iscsi_cls_session { struct iscsi_cls_host { atomic_t nr_scans; struct mutex mutex; + struct request_queue *bsg_q; }; +#define iscsi_job_to_shost(_job) \ + dev_to_shost(_job->dev) + extern void iscsi_host_for_each_session(struct Scsi_Host *shost, void (*fn)(struct iscsi_cls_session *)); -- cgit v1.2.3-18-g5258 From 17fa575eec7254fb089f858cae135d64cd015440 Mon Sep 17 00:00:00 2001 From: Manish Rangankar Date: Mon, 25 Jul 2011 13:48:52 -0500 Subject: [SCSI] scsi_transport_iscsi: Add conn login, kernel to user, event to support offload session login. Offload drivers like qla4xxx will offload the sending of the login/logout pdus still, so this patch adds iscsi_conn_login_event which is used by these types of drivers to notify userspace that the connection has changed state. It also adds a iscsi_is_session_online helper so the lld can query the sessions state field. Signed-off-by: Manish Rangankar Signed-off-by: Lalit Chandivade Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 17 +++++++++++++++++ include/scsi/scsi_transport_iscsi.h | 3 +++ 2 files changed, 20 insertions(+) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index d3f256a232f..629ca42dfe7 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -71,6 +71,7 @@ enum iscsi_uevent_e { ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, + ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9, }; enum iscsi_tgt_dscvr { @@ -198,6 +199,11 @@ struct iscsi_uevent { uint32_t cid; uint64_t recv_handle; } recv_req; + struct msg_conn_login { + uint32_t sid; + uint32_t cid; + uint32_t state; /* enum iscsi_conn_state */ + } conn_login; struct msg_conn_error { uint32_t sid; uint32_t cid; @@ -309,6 +315,16 @@ enum iscsi_net_param { ISCSI_NET_PARAM_IFACE_NAME = 17, }; +enum iscsi_conn_state { + ISCSI_CONN_STATE_FREE, + ISCSI_CONN_STATE_XPT_WAIT, + ISCSI_CONN_STATE_IN_LOGIN, + ISCSI_CONN_STATE_LOGGED_IN, + ISCSI_CONN_STATE_IN_LOGOUT, + ISCSI_CONN_STATE_LOGOUT_REQUESTED, + ISCSI_CONN_STATE_CLEANUP_WAIT, +}; + /* * Common error codes */ @@ -421,6 +437,7 @@ enum iscsi_host_param { #define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ #define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, and verification */ +#define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */ /* * These flags describes reason of stop_conn() call diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 4a3edeeae8f..3389cd5ea94 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -156,6 +156,8 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt); */ extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, enum iscsi_err error); +extern void iscsi_conn_login_event(struct iscsi_cls_conn *conn, + enum iscsi_conn_state state); extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, char *data, uint32_t data_size); @@ -268,6 +270,7 @@ struct iscsi_iface { dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a) extern int iscsi_session_chkready(struct iscsi_cls_session *session); +extern int iscsi_is_session_online(struct iscsi_cls_session *session); extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, struct iscsi_transport *transport, int dd_size); extern int iscsi_add_session(struct iscsi_cls_session *session, -- cgit v1.2.3-18-g5258 From 8c7d40fb6b51ef37df64af0e6add35baaf48896c Mon Sep 17 00:00:00 2001 From: Vikas Chaudhary Date: Mon, 1 Aug 2011 03:26:12 -0700 Subject: [SCSI] scsi_transport_iscsi: Added support to update mtu Signed-off-by: Vikas Chaudhary Reviewed-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 629ca42dfe7..d1f092762df 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -313,6 +313,7 @@ enum iscsi_net_param { ISCSI_NET_PARAM_VLAN_ENABLED = 15, ISCSI_NET_PARAM_IFACE_TYPE = 16, ISCSI_NET_PARAM_IFACE_NAME = 17, + ISCSI_NET_PARAM_MTU = 18, }; enum iscsi_conn_state { -- cgit v1.2.3-18-g5258 From fcb5124e03c8158cfe06cb204e1633149edc5f88 Mon Sep 17 00:00:00 2001 From: Vikas Chaudhary Date: Mon, 1 Aug 2011 03:26:18 -0700 Subject: [SCSI] scsi_transport_iscsi: Added support to update initiator iscsi port Signed-off-by: Vikas Chaudhary Reviewed-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index d1f092762df..706a1bb1c59 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -314,6 +314,7 @@ enum iscsi_net_param { ISCSI_NET_PARAM_IFACE_TYPE = 16, ISCSI_NET_PARAM_IFACE_NAME = 17, ISCSI_NET_PARAM_MTU = 18, + ISCSI_NET_PARAM_PORT = 19, }; enum iscsi_conn_state { -- cgit v1.2.3-18-g5258 From 2944369144548432f3a5ffce7a2926bfb4ce4f0a Mon Sep 17 00:00:00 2001 From: Vikas Chaudhary Date: Fri, 12 Aug 2011 02:51:28 -0700 Subject: [SCSI] scsi: Added support for adapter and firmware reset Added new sysfs attr 'host_reset' in scsi_sysfs.c to perform adapter or firmware reset as suggested by Mike Christie here: http://marc.info/?l=linux-scsi&m=127359347111167&w=2 user/application can write "adapter" or "firmware" on this attr and it will call newly added function hook in scsi_host_template to call LDD adapter or firmware reset implementation. Signed-off-by: Vikas Chaudhary Reviewed-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/scsi_host.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index f1f2644137b..fc22ad9dba7 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -355,6 +355,19 @@ struct scsi_host_template { */ enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *); + /* This is an optional routine that allows transport to initiate + * LLD adapter or firmware reset using sysfs attribute. + * + * Return values: 0 on success, -ve value on failure. + * + * Status: OPTIONAL + */ + + int (*host_reset)(struct Scsi_Host *shost, int reset_type); +#define SCSI_ADAPTER_RESET 1 +#define SCSI_FIRMWARE_RESET 2 + + /* * Name of proc directory */ -- cgit v1.2.3-18-g5258 From 76e4e12ff2b3ef86773989fd897b194eb38016e6 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Thu, 25 Aug 2011 00:36:38 -0500 Subject: [SCSI] scsi scan: don't fail scans when host is in recovery The problem is that if we are doing a scsi scan then the device goes into recovery then we will wait for the recovery to complete. It waits because scsi-ml will send inquiries or report luns and the queueing code will have been blocked due to the host not being ready. However, if we are in recovery and then a scan is started the scan will silently fail and some devices will not be added. It is easy to hit the problem where devices do not show up with FC where we are doing tests that disrupt the target controllers. When the controller is disruprted (reboot, or setting firmware, etc), and we cause the dev loss tmo to fire then devices will be removed Then when the problem has been fixed, the rport will be scanned and devices should be added back. But if we cause another disruption before scanning has started then devices will not get added back. If the problem is not started until the scan is started then the devices will be added back. This patch fixes that problem by not failing scans when the host is in recovery. We will let scsi-ml send the IO and let the queueing and scsi error handling deal with it like is done if we went into recovery while scanning. For recovery cases where the host is being torn down then with the patch we will still fail the scan since there is not point in scanning. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/scsi_host.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index fc22ad9dba7..50266c9405f 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -804,7 +804,8 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost) **/ static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) { - return shost->shost_state == SHOST_RUNNING; + return shost->shost_state == SHOST_RUNNING || + shost->shost_state == SHOST_RECOVERY; } extern void scsi_unblock_requests(struct Scsi_Host *); -- cgit v1.2.3-18-g5258 From a72c5e5eb738033938ab30d6a634b74d1d060f10 Mon Sep 17 00:00:00 2001 From: Nao Nishijima Date: Thu, 25 Aug 2011 18:04:06 +0900 Subject: [SCSI] genhd: add a new attribute "alias" in gendisk This patch allows the user to set an "alias" of the disk via sysfs interface. This patch only adds a new attribute "alias" in gendisk structure. To show the alias instead of the device name in kernel messages, we need to revise printk messages and use alias_name() in them. Example: (current) printk("disk name is %s\n", disk->disk_name); (new) printk("disk name is %s\n", alias_name(disk)); Users can use alphabets, numbers, '-' and '_' in "alias" attribute. A disk can have an "alias" which length is up to 255 bytes. This attribute is write-once. Suggested-by: James Bottomley Suggested-by: Jon Masters Signed-off-by: Nao Nishijima Signed-off-by: James Bottomley --- include/linux/genhd.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 02fa4697a0e..6957350e122 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -21,6 +21,8 @@ #define dev_to_part(device) container_of((device), struct hd_struct, __dev) #define disk_to_dev(disk) (&(disk)->part0.__dev) #define part_to_dev(part) (&((part)->__dev)) +#define alias_name(disk) ((disk)->alias ? (disk)->alias : \ + (disk)->disk_name) extern struct device_type part_type; extern struct kobject *block_depr; @@ -58,6 +60,7 @@ enum { #define DISK_MAX_PARTS 256 #define DISK_NAME_LEN 32 +#define ALIAS_LEN 256 #include #include @@ -162,6 +165,7 @@ struct gendisk { * disks that can't be partitioned. */ char disk_name[DISK_NAME_LEN]; /* name of major driver */ + char *alias; /* alias name of disk */ char *(*devnode)(struct gendisk *gd, mode_t *mode); unsigned int events; /* supported events */ -- cgit v1.2.3-18-g5258 From d7c48feb38a5cb6d863d69fd5ef6c309971ebe31 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Wed, 24 Aug 2011 10:51:13 +0200 Subject: [SCSI] scsi_dh_alua: Evaluate TPGS setting from inquiry data Instead of issuing a standard inquiry from within the alua device handler we can evaluate the TPGS setting from the existing inquiry data of the sdev and save us the I/O. Signed-off-by: Hannes Reinecke Signed-off-by: James Bottomley --- include/scsi/scsi_device.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index d371c3ca90c..f751d37685e 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -471,6 +471,11 @@ static inline int scsi_device_protection(struct scsi_device *sdev) return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); } +static inline int scsi_device_tpgs(struct scsi_device *sdev) +{ + return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0; +} + #define MODULE_ALIAS_SCSI_DEVICE(type) \ MODULE_ALIAS("scsi:t-" __stringify(type) "*") #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" -- cgit v1.2.3-18-g5258 From 6c3633d08acf514e2e89aa95d2346ce9d64d719a Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Wed, 24 Aug 2011 10:51:15 +0200 Subject: [SCSI] scsi_dh: Implement match callback function Some device handler types are not tied to the vendor/model but rather to a specific capability. Eg ALUA is supported if the 'TPGS' setting in the standard inquiry is set. This patch implements a 'match' callback for device handler which supersedes the original vendor/model lookup and implements the callback for the ALUA handler. Signed-off-by: Hannes Reinecke Signed-off-by: James Bottomley --- include/scsi/scsi_device.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index f751d37685e..5591ed54dc9 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -197,6 +197,7 @@ struct scsi_device_handler { int (*activate)(struct scsi_device *, activate_complete, void *); int (*prep_fn)(struct scsi_device *, struct request *); int (*set_params)(struct scsi_device *, const char *); + bool (*match)(struct scsi_device *); }; struct scsi_dh_data { -- cgit v1.2.3-18-g5258 From 8ec6552f4a77d15f446b00aed364e3c12d38aa6c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 1 Sep 2011 21:18:20 -0700 Subject: [SCSI] libsas: sgpio write support Add SFF-8485 v0.7 / SAS-1 smp-write-gpio register support to libsas. Defer SAS-2 support unless/until it defines an sgpio interface. Minimum implementation needed to get the lights blinking. try_test_sas_gpio_gp_bit() provides a common method to parse the incoming write data (raw bitstream), and the to_sas_gpio_gp_bit() helper routine can be used as a basis for the set/clear operations for the 'read' implementation. Host implementations parse as many bits (ODx.[012]) as are locally supported and report the number of registers successfully written. If the submitted data overruns the internal number of registers available report the write as a success with the number of bytes remaining reported in ->resid_len. Example (assuming an active backplane) set the "identify" pattern for the first 21 devices: smp_write_gpio --count=2 --data=92,49,24,92,24,92,49,24 -t 4 --index=1 /dev/bsg/sas_hostX Signed-off-by: Dan Williams Signed-off-by: James Bottomley --- include/scsi/libsas.h | 11 +++++++++++ include/scsi/sas.h | 8 ++++++++ 2 files changed, 19 insertions(+) (limited to 'include') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 2517254b840..af0a1deac93 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -405,6 +405,13 @@ static inline void sas_phy_disconnected(struct asd_sas_phy *phy) phy->linkrate = SAS_LINK_RATE_UNKNOWN; } +static inline unsigned int to_sas_gpio_od(int device, int bit) +{ + return 3 * device + bit; +} + +int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count); + /* ---------- Tasks ---------- */ /* service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED | @@ -592,6 +599,10 @@ struct sas_domain_function_template { /* Phy management */ int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); + + /* GPIO support */ + int (*lldd_write_gpio)(struct sas_ha_struct *, u8 reg_type, + u8 reg_index, u8 reg_count, u8 *write_data); }; extern int sas_register_ha(struct sas_ha_struct *); diff --git a/include/scsi/sas.h b/include/scsi/sas.h index e9fd0228138..a3001add0c6 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h @@ -195,6 +195,14 @@ enum sas_open_rej_reason { SAS_OREJ_RSVD_RETRY = 18, }; +enum sas_gpio_reg_type { + SAS_GPIO_REG_CFG = 0, + SAS_GPIO_REG_RX = 1, + SAS_GPIO_REG_RX_GP = 2, + SAS_GPIO_REG_TX = 3, + SAS_GPIO_REG_TX_GP = 4, +}; + struct dev_to_host_fis { u8 fis_type; /* 0x34 */ u8 flags; -- cgit v1.2.3-18-g5258 From ffaac8f45bfb2dffb78179baa5740de34058eef8 Mon Sep 17 00:00:00 2001 From: Luben Tuikov Date: Thu, 22 Sep 2011 09:41:36 -0700 Subject: [SCSI] libsas: Allow expander T-T attachments Allow expander table-to-table attachments for expanders that support it. Signed-off-by: Luben Tuikov Signed-off-by: James Bottomley --- include/scsi/libsas.h | 3 +++ include/scsi/sas.h | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index af0a1deac93..ac9d80c93c6 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -142,8 +142,11 @@ struct expander_device { u16 ex_change_count; u16 max_route_indexes; u8 num_phys; + + u8 t2t_supp:1; u8 configuring:1; u8 conf_route_table:1; + u8 enclosure_logical_id[8]; struct ex_phy *ex_phy; diff --git a/include/scsi/sas.h b/include/scsi/sas.h index a3001add0c6..07d504f3981 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h @@ -349,7 +349,12 @@ struct report_general_resp { u8 conf_route_table:1; u8 configuring:1; - u8 _r_b:6; + u8 config_others:1; + u8 orej_retry_supp:1; + u8 stp_cont_awt:1; + u8 self_config:1; + u8 zone_config:1; + u8 t2t_supp:1; u8 _r_c; @@ -536,7 +541,12 @@ struct report_general_resp { u8 _r_a; u8 num_phys; - u8 _r_b:6; + u8 t2t_supp:1; + u8 zone_config:1; + u8 self_config:1; + u8 stp_cont_awt:1; + u8 orej_retry_supp:1; + u8 config_others:1; u8 configuring:1; u8 conf_route_table:1; -- cgit v1.2.3-18-g5258 From f6e67035a9edd79b8b202c159d5bec560bb9c358 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Sep 2011 15:10:33 -0700 Subject: [SCSI] libsas,libata: fix ->change_queue_{depth|type} for sata devices Pass queue_depth change requests to libata, and prevent queue_type changes for ATA devices. Otherwise: 1/ we do not honor the libata specific restrictions on the queue depth 2/ libsas drivers that do not set sdev->tagged_supported are unable to change the queue_depth of ata devices via sysfs Signed-off-by: Dan Williams Acked-by: Jeff Garzik Signed-off-by: James Bottomley --- include/linux/libata.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/libata.h b/include/linux/libata.h index efd6f980076..23fa829bf7a 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1052,6 +1052,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev); extern void ata_scsi_slave_destroy(struct scsi_device *sdev); extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth, int reason); +extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, + int queue_depth, int reason); extern struct ata_device *ata_dev_pair(struct ata_device *adev); extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); -- cgit v1.2.3-18-g5258 From d962480e9a061505637bb16543d49e247349e25d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Sep 2011 16:43:45 -0700 Subject: [SCSI] libsas: fix try_test_sas_gpio_gp_bit() build error If the user has disabled CONFIG_SCSI_SAS_HOST_SMP then libsas drivers will not be receiving smp-gpio frames and do not need this lookup code. Reported-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Dan Williams Signed-off-by: James Bottomley --- include/scsi/libsas.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index ac9d80c93c6..d455fa96dc8 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -413,7 +413,14 @@ static inline unsigned int to_sas_gpio_od(int device, int bit) return 3 * device + bit; } +#ifdef CONFIG_SCSI_SAS_HOST_SMP int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count); +#else +static inline int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count) +{ + return -1; +} +#endif /* ---------- Tasks ---------- */ /* -- cgit v1.2.3-18-g5258 From 05a2a17317b48eb16a167c8c2932ba7b3cdee89e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 23 Sep 2011 18:09:11 -0700 Subject: [SCSI] libsas: fix warnings when checking sata/stp protocol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Several sas drivers legitimately check the protocol against the union of SAS_PROTOCOL_SATA and SAS_PROTOCOL_STP. Provide a SAS_PROTOCOL_STP_ALL to silence warnings like: drivers/scsi/pm8001/pm8001_sas.c:438:3: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch] drivers/scsi/mvsas/mv_sas.c:798:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch] drivers/scsi/mvsas/mv_sas.c:1783:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch] drivers/scsi/mvsas/mv_sas.c:1886:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch] drivers/scsi/isci/request.c:3565:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch] Signed-off-by: Dan Williams Signed-off-by: James Bottomley --- include/scsi/sas.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/scsi/sas.h b/include/scsi/sas.h index 07d504f3981..cfdbe950159 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h @@ -108,6 +108,7 @@ enum sas_protocol { SAS_PROTOCOL_STP = 0x04, SAS_PROTOCOL_SSP = 0x08, SAS_PROTOCOL_ALL = 0x0E, + SAS_PROTOCOL_STP_ALL = SAS_PROTOCOL_STP|SAS_PROTOCOL_SATA, }; /* From the spec; local phys only */ -- cgit v1.2.3-18-g5258 From ed26cfece6177310ad8f5896651a3187ce02711c Mon Sep 17 00:00:00 2001 From: Vasu Dev Date: Tue, 27 Sep 2011 21:37:57 -0700 Subject: [SCSI] libfc: cache align struct fc_fcp_pkt fields Re-arrange its fields to avoid padding and have better cacheline alignments. Removed not used start_time, end_time and last_pkt_time fields. This all reduced this struct size to 448 from 480 and that also reduced one cacheline on x86_64 beside eliminating 8 pads. However kept logical fields together. Signed-off-by: Vasu Dev Tested-by: Ross Brattain Signed-off-by: Yi Zou Signed-off-by: James Bottomley --- include/scsi/libfc.h | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) (limited to 'include') diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 7d96829b0c0..05e2583d8fa 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h @@ -281,9 +281,6 @@ struct fc_seq_els_data { * @timer: The command timer * @tm_done: Completion indicator * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) - * @start_time: Timestamp indicating the start of the I/O (in jiffies) - * @end_time: Timestamp indicating the end of the I/O (in jiffies) - * @last_pkt_time: Timestamp of the last frame received (in jiffies) * @data_len: The length of the data * @cdb_cmd: The CDB command * @xfer_len: The transfer length @@ -304,50 +301,46 @@ struct fc_seq_els_data { * @recov_seq: The sequence for REC or SRR */ struct fc_fcp_pkt { - /* Housekeeping information */ - struct fc_lport *lp; - u16 state; - atomic_t ref_cnt; spinlock_t scsi_pkt_lock; + atomic_t ref_cnt; + + /* SCSI command and data transfer information */ + u32 data_len; /* SCSI I/O related information */ struct scsi_cmnd *cmd; struct list_head list; - /* Timeout related information */ - struct timer_list timer; - struct completion tm_done; - int wait_for_comp; - unsigned long start_time; - unsigned long end_time; - unsigned long last_pkt_time; - - /* SCSI command and data transfer information */ - u32 data_len; - - /* Transport related veriables */ - struct fcp_cmnd cdb_cmd; - size_t xfer_len; - u16 xfer_ddp; - u32 xfer_contig_end; - u16 max_payload; + /* Housekeeping information */ + struct fc_lport *lp; + u8 state; /* SCSI/FCP return status */ - u32 io_status; u8 cdb_status; u8 status_code; u8 scsi_comp_flags; + u32 io_status; u32 req_flags; u32 scsi_resid; + /* Transport related veriables */ + size_t xfer_len; + struct fcp_cmnd cdb_cmd; + u32 xfer_contig_end; + u16 max_payload; + u16 xfer_ddp; + /* Associated structures */ struct fc_rport *rport; struct fc_seq *seq_ptr; - /* Error Processing information */ - u8 recov_retry; + /* Timeout/error related information */ + struct timer_list timer; + int wait_for_comp; + u32 recov_retry; struct fc_seq *recov_seq; -}; + struct completion tm_done; +} ____cacheline_aligned_in_smp; /* * Structure and function definitions for managing Fibre Channel Exchanges -- cgit v1.2.3-18-g5258 From 49a198898e889038c6601288cd2b0e037edada24 Mon Sep 17 00:00:00 2001 From: Vasu Dev Date: Tue, 27 Sep 2011 21:38:02 -0700 Subject: [SCSI] libfc: cache align struct fc_exch fields cache aligned xid and ex_lock beside removing holes. Signed-off-by: Vasu Dev Tested-by: Ross Brattain Signed-off-by: Yi Zou Signed-off-by: James Bottomley --- include/scsi/libfc.h | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 05e2583d8fa..5d1a758e059 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h @@ -406,35 +406,32 @@ struct fc_seq { * sequence allocation */ struct fc_exch { + spinlock_t ex_lock; + atomic_t ex_refcnt; + enum fc_class class; struct fc_exch_mgr *em; struct fc_exch_pool *pool; - u32 state; - u16 xid; struct list_head ex_list; - spinlock_t ex_lock; - atomic_t ex_refcnt; - struct delayed_work timeout_work; struct fc_lport *lp; + u32 esb_stat; + u8 state; + u8 fh_type; + u8 seq_id; + u8 encaps; + u16 xid; u16 oxid; u16 rxid; u32 oid; u32 sid; u32 did; - u32 esb_stat; u32 r_a_tov; - u8 seq_id; - u8 encaps; u32 f_ctl; - u8 fh_type; - enum fc_class class; - struct fc_seq seq; - + struct fc_seq seq; void (*resp)(struct fc_seq *, struct fc_frame *, void *); void *arg; - void (*destructor)(struct fc_seq *, void *); - -}; + struct delayed_work timeout_work; +} ____cacheline_aligned_in_smp; #define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) -- cgit v1.2.3-18-g5258 From b50102d3e9a43a75379407c2080f696f61cb286b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Sep 2011 18:52:19 -0700 Subject: [SCSI] isci: atapi support Based on original implementation from Jiangbi Liu and Maciej Trela. ATAPI transfers happen in two-to-three stages. The two stage atapi commands are those that include a dma data transfer. The data transfer portion of these operations is handled by the hardware packet-dma acceleration. The three-stage commands do not have a data transfer and are handled without hardware assistance in raw frame mode. stage1: transmit host-to-device fis to notify the device of an incoming atapi cdb. Upon reception of the pio-setup-fis repost the task_context to perform the dma transfer of the cdb+data (go to stage3), or repost the task_context to transmit the cdb as a raw frame (go to stage 2). stage2: wait for hardware notification of the cdb transmission and then go to stage 3. stage3: wait for the arrival of the terminating device-to-host fis and terminate the command. To keep the implementation simple we only support ATAPI packet-dma protocol (for commands with data) to avoid needing to handle the data transfer manually (like we do for SATA-PIO). This may affect compatibility for a small number of devices (see ATA_HORKAGE_ATAPI_MOD16_DMA). If the data-transfer underruns, or encounters an error the device-to-host fis is expected to arrive in the unsolicited frame queue to pass to libata for disposition. However, in the DONE_UNEXP_FIS (data underrun) case it appears we need to craft a response. In the DONE_REG_ERR case we do receive the UF and propagate it to libsas. Signed-off-by: Maciej Trela Signed-off-by: Dan Williams Signed-off-by: James Bottomley --- include/scsi/libsas.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index d455fa96dc8..c4b7cd0b85e 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -389,6 +389,11 @@ sdev_to_domain_dev(struct scsi_device *sdev) { return starget_to_domain_dev(sdev->sdev_target); } +static inline struct ata_device *sas_to_ata_dev(struct domain_device *dev) +{ + return &dev->sata_dev.ap->link.device[0]; +} + static inline struct domain_device * cmd_to_domain_dev(struct scsi_cmnd *cmd) { -- cgit v1.2.3-18-g5258 From ac013ed1cb7b1b36113548ce83881a1b5f757b58 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 28 Sep 2011 18:48:02 -0700 Subject: [SCSI] isci: export phy events via ->lldd_control_phy() Allow the sas-transport-class to update events for local phys via a new PHY_FUNC_GET_EVENTS command to ->lldd_control_phy(). Fixup drivers that are not prepared for new enum phy_func values, and unify ->lldd_control_phy() error codes. These are the SAS defined phy events that are reported in a smp-report-phy-error-log command: * /sys/class/sas_phy//invalid_dword_count * /sys/class/sas_phy//running_disparity_error_count * /sys/class/sas_phy//loss_of_dword_sync_count * /sys/class/sas_phy//phy_reset_problem_count Signed-off-by: Dan Williams Signed-off-by: James Bottomley --- include/scsi/sas.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/scsi/sas.h b/include/scsi/sas.h index cfdbe950159..3673d685e6a 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h @@ -122,6 +122,7 @@ enum phy_func { PHY_FUNC_TX_SATA_PS_SIGNAL, PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */ PHY_FUNC_SET_LINK_RATE, + PHY_FUNC_GET_EVENTS, }; /* SAS LLDD would need to report only _very_few_ of those, like BROADCAST. -- cgit v1.2.3-18-g5258 From 814740d5f67ae5f205349019bfaae38bcd0c8732 Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Gollapudi Date: Mon, 3 Oct 2011 16:45:01 -0700 Subject: [SCSI] fcoe,libfcoe: Move common code for fcoe_get_lesb to fcoe_transport Except for obtaining the netdev from lport, fcoe_get_lesb is the common code for the LLDs. Signed-off-by: Bhanu Prakash Gollapudi Acked-by: Yi Zou Signed-off-by: James Bottomley --- include/scsi/libfcoe.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 0b2f84304f3..d1e95c6ac77 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h @@ -230,6 +230,8 @@ int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *, u32 fcoe_fc_crc(struct fc_frame *fp); int fcoe_start_io(struct sk_buff *skb); int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type); +void __fcoe_get_lesb(struct fc_lport *lport, struct fc_els_lesb *fc_lesb, + struct net_device *netdev); void fcoe_wwn_to_str(u64 wwn, char *buf, int len); int fcoe_validate_vport_create(struct fc_vport *vport); -- cgit v1.2.3-18-g5258 From 1a34c0640137eed8dabdac3a68a7a84116ac9e0d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Sep 2011 22:05:34 -0700 Subject: [SCSI] libsas: fix port->dev_list locking port->dev_list maintains a list of devices attached to a given sas root port. It needs to be mutated under a lock as contexts outside of the single-threaded-libsas-workqueue access the list via sas_find_dev_by_rphy(). Fixup locations where the list was being mutated without a lock. This is a follow-up to commit 5911e963 "[SCSI] libsas: remove expander from dev list on error", where Luben noted [1]: > 2/ We have unlocked list manipulations in sas_ex_discover_end_dev(), > sas_unregister_common_dev(), and sas_ex_discover_end_dev() Yes, I can see that and that is very unfortunate. [1]: http://marc.info/?l=linux-scsi&m=131480962006471&w=2 Signed-off-by: Dan Williams Signed-off-by: James Bottomley --- include/scsi/libsas.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index c4b7cd0b85e..6a308d42d98 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -656,7 +656,7 @@ int sas_discover_event(struct asd_sas_port *, enum discover_event ev); int sas_discover_sata(struct domain_device *); int sas_discover_end_dev(struct domain_device *); -void sas_unregister_dev(struct domain_device *); +void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *); void sas_init_dev(struct domain_device *); -- cgit v1.2.3-18-g5258 From 8d4a690cd4f574bcb70c2cb89c227ba89a51351f Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Thu, 6 Oct 2011 03:56:57 -0500 Subject: [SCSI] iscsi class: Replace iscsi_get_next_target_id with IDA Replaced the iscsi_get_next_target_id with IDA to make target-id allocation efficient for iscsi offload drivers This patch should be applied after Jonathen Cameron Patch "ida : simplified functions for id allocation" Signed-off-by: John Soni Jose Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/scsi_transport_iscsi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 3389cd5ea94..a498ccecf6b 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -208,6 +208,7 @@ struct iscsi_cls_session { struct delayed_work recovery_work; unsigned int target_id; + bool ida_used; int state; int sid; /* session id */ -- cgit v1.2.3-18-g5258 From 00c31889f7513e9ffa6b2b4de8ad6d7f59a61c80 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Thu, 6 Oct 2011 03:56:59 -0500 Subject: [SCSI] qla4xxx: fix data alignment and use nl helpers This has the driver use helpers for a common operation and fixes a issue where if multiple iscsi params are sent they could be sent at offsets that cause unaligned accesses. The nla helpers account for the padding needed to align properly for the driver. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/scsi_transport_iscsi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index a498ccecf6b..5994bcc1b01 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -137,7 +137,8 @@ struct iscsi_transport { int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, uint32_t enable, struct sockaddr *dst_addr); int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); - int (*set_iface_param) (struct Scsi_Host *shost, char *data, int count); + int (*set_iface_param) (struct Scsi_Host *shost, void *data, + uint32_t len); int (*get_iface_param) (struct iscsi_iface *iface, enum iscsi_param_type param_type, int param, char *buf); -- cgit v1.2.3-18-g5258 From 2d63673b4d469cf2ddba309a916090b54e31cc35 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Tue, 11 Oct 2011 17:55:11 -0500 Subject: [SCSI] iscsi class: fix vlan configuration Userspace was sending the priority/id part of the vlan tag and sysfs was displaying the id in the vlan file. This renames the vlan sysfs file to vlan_id to reflect that it was showing the id and to match the vlan_priority file. This also adds a ISCSI_NET_PARAM_VLAN_TAG iscsi nl command to relfect that we are sending down the vlan/priority part of the tag. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- include/scsi/iscsi_if.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 706a1bb1c59..2703e3bedbf 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -311,10 +311,11 @@ enum iscsi_net_param { ISCSI_NET_PARAM_VLAN_ID = 13, ISCSI_NET_PARAM_VLAN_PRIORITY = 14, ISCSI_NET_PARAM_VLAN_ENABLED = 15, - ISCSI_NET_PARAM_IFACE_TYPE = 16, - ISCSI_NET_PARAM_IFACE_NAME = 17, - ISCSI_NET_PARAM_MTU = 18, - ISCSI_NET_PARAM_PORT = 19, + ISCSI_NET_PARAM_VLAN_TAG = 16, + ISCSI_NET_PARAM_IFACE_TYPE = 17, + ISCSI_NET_PARAM_IFACE_NAME = 18, + ISCSI_NET_PARAM_MTU = 19, + ISCSI_NET_PARAM_PORT = 20, }; enum iscsi_conn_state { -- cgit v1.2.3-18-g5258