Skip to content

Commit c29c08b

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (28 commits) [SCSI] qla4xxx: fix compilation warning [SCSI] make error handling more robust in the face of reservations [SCSI] tgt: fix warning [SCSI] drivers/message/fusion: Adjust confusing if indentation [SCSI] Return NEEDS_RETRY for eh commands with status BUSY [SCSI] ibmvfc: Driver version 1.0.9 [SCSI] ibmvfc: Fix terminate_rport_io [SCSI] ibmvfc: Fix rport add/delete race resulting in oops [SCSI] lpfc 8.3.16: Change LPFC driver version to 8.3.16 [SCSI] lpfc 8.3.16: FCoE Discovery and Failover Fixes [SCSI] lpfc 8.3.16: SLI Additions, updates, and code cleanup [SCSI] pm8001: introduce missing kfree [SCSI] qla4xxx: Update driver version to 5.02.00-k3 [SCSI] qla4xxx: Added AER support for ISP82xx [SCSI] qla4xxx: Handle outstanding mbx cmds on hung f/w scenarios [SCSI] qla4xxx: updated mbx_sys_info struct to sync with FW 4.6.x [SCSI] qla4xxx: clear AF_DPC_SCHEDULED flage when exit from do_dpc [SCSI] qla4xxx: Stop firmware before doing init firmware. [SCSI] qla4xxx: Use the correct request queue. [SCSI] qla4xxx: set correct value in sess->recovery_tmo ...
2 parents bbbfb91 + 3c3e210 commit c29c08b

41 files changed

Lines changed: 1516 additions & 365 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/firmware/Kconfig‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ config ISCSI_IBFT_FIND
122122
is necessary for iSCSI Boot Firmware Table Attributes module to work
123123
properly.
124124

125-
config ISCSI_BOOT_SYSFS
126-
tristate "iSCSI Boot Sysfs Interface"
127-
default n
128-
help
129-
This option enables support for exposing iSCSI boot information
130-
via sysfs to userspace. If you wish to export this information,
131-
say Y. Otherwise, say N.
132-
133125
config ISCSI_IBFT
134126
tristate "iSCSI Boot Firmware Table Attributes module"
135127
select ISCSI_BOOT_SYSFS

‎drivers/firmware/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ obj-$(CONFIG_DCDBAS) += dcdbas.o
1010
obj-$(CONFIG_DMIID) += dmi-id.o
1111
obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o
1212
obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
13-
obj-$(CONFIG_ISCSI_BOOT_SYSFS) += iscsi_boot_sysfs.o
1413
obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o

‎drivers/message/fusion/mptbase.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8049,7 +8049,7 @@ union loginfo_type {
80498049
code_desc = ir_code_str[sas_loginfo.dw.code];
80508050
if (sas_loginfo.dw.subcode >=
80518051
ARRAY_SIZE(raid_sub_code_str))
8052-
break;
8052+
break;
80538053
if (sas_loginfo.dw.code == 0)
80548054
sub_code_desc =
80558055
raid_sub_code_str[sas_loginfo.dw.subcode];

‎drivers/scsi/Kconfig‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,14 @@ config ISCSI_TCP
370370

371371
http://open-iscsi.org
372372

373+
config ISCSI_BOOT_SYSFS
374+
tristate "iSCSI Boot Sysfs Interface"
375+
default n
376+
help
377+
This option enables support for exposing iSCSI boot information
378+
via sysfs to userspace. If you wish to export this information,
379+
say Y. Otherwise, say N.
380+
373381
source "drivers/scsi/cxgb3i/Kconfig"
374382
source "drivers/scsi/bnx2i/Kconfig"
375383
source "drivers/scsi/be2iscsi/Kconfig"

‎drivers/scsi/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ obj-$(CONFIG_FCOE) += fcoe/
4242
obj-$(CONFIG_FCOE_FNIC) += fnic/
4343
obj-$(CONFIG_ISCSI_TCP) += libiscsi.o libiscsi_tcp.o iscsi_tcp.o
4444
obj-$(CONFIG_INFINIBAND_ISER) += libiscsi.o
45+
obj-$(CONFIG_ISCSI_BOOT_SYSFS) += iscsi_boot_sysfs.o
4546
obj-$(CONFIG_SCSI_A4000T) += 53c700.o a4000t.o
4647
obj-$(CONFIG_SCSI_ZORRO7XX) += 53c700.o zorro7xx.o
4748
obj-$(CONFIG_A3000_SCSI) += a3000.o wd33c93.o

‎drivers/scsi/be2iscsi/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ config BE2ISCSI
22
tristate "ServerEngines' 10Gbps iSCSI - BladeEngine 2"
33
depends on PCI && SCSI && NET
44
select SCSI_ISCSI_ATTRS
5+
select ISCSI_BOOT_SYSFS
56

67
help
78
This driver implements the iSCSI functionality for ServerEngines'

‎drivers/scsi/be2iscsi/be_cmds.h‎

Lines changed: 130 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ struct be_mcc_mailbox {
162162
#define OPCODE_COMMON_ISCSI_CFG_POST_SGL_PAGES 2
163163
#define OPCODE_COMMON_ISCSI_CFG_REMOVE_SGL_PAGES 3
164164
#define OPCODE_COMMON_ISCSI_NTWK_GET_NIC_CONFIG 7
165+
#define OPCODE_COMMON_ISCSI_NTWK_SET_VLAN 14
166+
#define OPCODE_COMMON_ISCSI_NTWK_CONFIGURE_STATELESS_IP_ADDR 17
167+
#define OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR 21
168+
#define OPCODE_COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY 22
169+
#define OPCODE_COMMON_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY 23
170+
#define OPCODE_COMMON_ISCSI_NTWK_GET_ALL_IF_ID 24
171+
#define OPCODE_COMMON_ISCSI_NTWK_GET_IF_INFO 25
165172
#define OPCODE_COMMON_ISCSI_SET_FRAGNUM_BITS_FOR_SGL_CRA 61
166173
#define OPCODE_COMMON_ISCSI_DEFQ_CREATE 64
167174
#define OPCODE_COMMON_ISCSI_DEFQ_DESTROY 65
@@ -237,11 +244,109 @@ struct be_cmd_resp_eq_create {
237244
u16 rsvd0; /* sword */
238245
} __packed;
239246

247+
struct mgmt_chap_format {
248+
u32 flags;
249+
u8 intr_chap_name[256];
250+
u8 intr_secret[16];
251+
u8 target_chap_name[256];
252+
u8 target_secret[16];
253+
u16 intr_chap_name_length;
254+
u16 intr_secret_length;
255+
u16 target_chap_name_length;
256+
u16 target_secret_length;
257+
} __packed;
258+
259+
struct mgmt_auth_method_format {
260+
u8 auth_method_type;
261+
u8 padding[3];
262+
struct mgmt_chap_format chap;
263+
} __packed;
264+
265+
struct mgmt_conn_login_options {
266+
u8 flags;
267+
u8 header_digest;
268+
u8 data_digest;
269+
u8 rsvd0;
270+
u32 max_recv_datasegment_len_ini;
271+
u32 max_recv_datasegment_len_tgt;
272+
u32 tcp_mss;
273+
u32 tcp_window_size;
274+
struct mgmt_auth_method_format auth_data;
275+
} __packed;
276+
277+
struct ip_address_format {
278+
u16 size_of_structure;
279+
u8 reserved;
280+
u8 ip_type;
281+
u8 ip_address[16];
282+
u32 rsvd0;
283+
} __packed;
284+
285+
struct mgmt_conn_info {
286+
u32 connection_handle;
287+
u32 connection_status;
288+
u16 src_port;
289+
u16 dest_port;
290+
u16 dest_port_redirected;
291+
u16 cid;
292+
u32 estimated_throughput;
293+
struct ip_address_format src_ipaddr;
294+
struct ip_address_format dest_ipaddr;
295+
struct ip_address_format dest_ipaddr_redirected;
296+
struct mgmt_conn_login_options negotiated_login_options;
297+
} __packed;
298+
299+
struct mgmt_session_login_options {
300+
u8 flags;
301+
u8 error_recovery_level;
302+
u16 rsvd0;
303+
u32 first_burst_length;
304+
u32 max_burst_length;
305+
u16 max_connections;
306+
u16 max_outstanding_r2t;
307+
u16 default_time2wait;
308+
u16 default_time2retain;
309+
} __packed;
310+
311+
struct mgmt_session_info {
312+
u32 session_handle;
313+
u32 status;
314+
u8 isid[6];
315+
u16 tsih;
316+
u32 session_flags;
317+
u16 conn_count;
318+
u16 pad;
319+
u8 target_name[224];
320+
u8 initiator_iscsiname[224];
321+
struct mgmt_session_login_options negotiated_login_options;
322+
struct mgmt_conn_info conn_list[1];
323+
} __packed;
324+
325+
struct be_cmd_req_get_session {
326+
struct be_cmd_req_hdr hdr;
327+
u32 session_handle;
328+
} __packed;
329+
330+
struct be_cmd_resp_get_session {
331+
struct be_cmd_resp_hdr hdr;
332+
struct mgmt_session_info session_info;
333+
} __packed;
334+
240335
struct mac_addr {
241336
u16 size_of_struct;
242337
u8 addr[ETH_ALEN];
243338
} __packed;
244339

340+
struct be_cmd_req_get_boot_target {
341+
struct be_cmd_req_hdr hdr;
342+
} __packed;
343+
344+
struct be_cmd_resp_get_boot_target {
345+
struct be_cmd_resp_hdr hdr;
346+
u32 boot_session_count;
347+
int boot_session_handle;
348+
};
349+
245350
struct be_cmd_req_mac_query {
246351
struct be_cmd_req_hdr hdr;
247352
u8 type;
@@ -426,6 +531,11 @@ int be_poll_mcc(struct be_ctrl_info *ctrl);
426531
int mgmt_check_supported_fw(struct be_ctrl_info *ctrl,
427532
struct beiscsi_hba *phba);
428533
unsigned int be_cmd_get_mac_addr(struct beiscsi_hba *phba);
534+
unsigned int beiscsi_get_boot_target(struct beiscsi_hba *phba);
535+
unsigned int beiscsi_get_session_info(struct beiscsi_hba *phba,
536+
u32 boot_session_handle,
537+
struct be_dma_mem *nonemb_cmd);
538+
429539
void free_mcc_tag(struct be_ctrl_info *ctrl, unsigned int tag);
430540
/*ISCSI Functuions */
431541
int be_cmd_fw_initialize(struct be_ctrl_info *ctrl);
@@ -601,14 +711,6 @@ struct be_eq_delay_params_in {
601711
struct eq_delay delay[8];
602712
} __packed;
603713

604-
struct ip_address_format {
605-
u16 size_of_structure;
606-
u8 reserved;
607-
u8 ip_type;
608-
u8 ip_address[16];
609-
u32 rsvd0;
610-
} __packed;
611-
612714
struct tcp_connect_and_offload_in {
613715
struct be_cmd_req_hdr hdr;
614716
struct ip_address_format ip_address;
@@ -688,18 +790,29 @@ struct be_fw_cfg {
688790
u32 function_caps;
689791
} __packed;
690792

691-
#define CMD_ISCSI_COMMAND_INVALIDATE 1
692-
#define ISCSI_OPCODE_SCSI_DATA_OUT 5
793+
struct be_all_if_id {
794+
struct be_cmd_req_hdr hdr;
795+
u32 if_count;
796+
u32 if_hndl_list[1];
797+
} __packed;
798+
799+
#define ISCSI_OPCODE_SCSI_DATA_OUT 5
800+
#define OPCODE_COMMON_MODIFY_EQ_DELAY 41
801+
#define OPCODE_COMMON_ISCSI_CLEANUP 59
802+
#define OPCODE_COMMON_TCP_UPLOAD 56
693803
#define OPCODE_COMMON_ISCSI_TCP_CONNECT_AND_OFFLOAD 70
694-
#define OPCODE_ISCSI_INI_DRIVER_OFFLOAD_SESSION 41
695-
#define OPCODE_COMMON_MODIFY_EQ_DELAY 41
696-
#define OPCODE_COMMON_ISCSI_CLEANUP 59
697-
#define OPCODE_COMMON_TCP_UPLOAD 56
698804
#define OPCODE_COMMON_ISCSI_ERROR_RECOVERY_INVALIDATE_COMMANDS 1
699-
/* --- CMD_ISCSI_INVALIDATE_CONNECTION_TYPE --- */
700-
#define CMD_ISCSI_CONNECTION_INVALIDATE 0x8001
701-
#define CMD_ISCSI_CONNECTION_ISSUE_TCP_RST 0x8002
805+
#define OPCODE_ISCSI_INI_CFG_GET_HBA_NAME 6
806+
#define OPCODE_ISCSI_INI_CFG_SET_HBA_NAME 7
807+
#define OPCODE_ISCSI_INI_SESSION_GET_A_SESSION 14
808+
#define OPCODE_ISCSI_INI_DRIVER_OFFLOAD_SESSION 41
702809
#define OPCODE_ISCSI_INI_DRIVER_INVALIDATE_CONNECTION 42
810+
#define OPCODE_ISCSI_INI_BOOT_GET_BOOT_TARGET 52
811+
812+
/* --- CMD_ISCSI_INVALIDATE_CONNECTION_TYPE --- */
813+
#define CMD_ISCSI_COMMAND_INVALIDATE 1
814+
#define CMD_ISCSI_CONNECTION_INVALIDATE 0x8001
815+
#define CMD_ISCSI_CONNECTION_ISSUE_TCP_RST 0x8002
703816

704817
#define INI_WR_CMD 1 /* Initiator write command */
705818
#define INI_TMF_CMD 2 /* Initiator TMF command */

‎drivers/scsi/be2iscsi/be_iscsi.c‎

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -300,40 +300,16 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
300300
enum iscsi_host_param param, char *buf)
301301
{
302302
struct beiscsi_hba *phba = (struct beiscsi_hba *)iscsi_host_priv(shost);
303-
struct be_cmd_resp_get_mac_addr *resp;
304-
struct be_mcc_wrb *wrb;
305-
unsigned int tag, wrb_num;
306303
int len = 0;
307-
unsigned short status, extd_status;
308-
struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q;
304+
int status;
309305

310306
SE_DEBUG(DBG_LVL_8, "In beiscsi_get_host_param, param= %d\n", param);
311307
switch (param) {
312308
case ISCSI_HOST_PARAM_HWADDRESS:
313-
tag = be_cmd_get_mac_addr(phba);
314-
if (!tag) {
315-
SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed\n");
316-
return -EAGAIN;
317-
} else
318-
wait_event_interruptible(phba->ctrl.mcc_wait[tag],
319-
phba->ctrl.mcc_numtag[tag]);
320-
321-
wrb_num = (phba->ctrl.mcc_numtag[tag] & 0x00FF0000) >> 16;
322-
extd_status = (phba->ctrl.mcc_numtag[tag] & 0x0000FF00) >> 8;
323-
status = phba->ctrl.mcc_numtag[tag] & 0x000000FF;
324-
if (status || extd_status) {
325-
SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed"
326-
" status = %d extd_status = %d\n",
327-
status, extd_status);
328-
free_mcc_tag(&phba->ctrl, tag);
329-
return -EAGAIN;
330-
} else {
331-
wrb = queue_get_wrb(mccq, wrb_num);
332-
free_mcc_tag(&phba->ctrl, tag);
333-
resp = embedded_payload(wrb);
334-
memcpy(phba->mac_address, resp->mac_address, ETH_ALEN);
335-
len = sysfs_format_mac(buf, phba->mac_address,
336-
ETH_ALEN);
309+
status = beiscsi_get_macaddr(buf, phba);
310+
if (status < 0) {
311+
SE_DEBUG(DBG_LVL_1, "beiscsi_get_macaddr Failed\n");
312+
return status;
337313
}
338314
break;
339315
default:
@@ -342,6 +318,48 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
342318
return len;
343319
}
344320

321+
int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba)
322+
{
323+
struct be_cmd_resp_get_mac_addr *resp;
324+
struct be_mcc_wrb *wrb;
325+
unsigned int tag, wrb_num;
326+
unsigned short status, extd_status;
327+
struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q;
328+
int rc;
329+
330+
if (phba->read_mac_address)
331+
return sysfs_format_mac(buf, phba->mac_address,
332+
ETH_ALEN);
333+
334+
tag = be_cmd_get_mac_addr(phba);
335+
if (!tag) {
336+
SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed\n");
337+
return -EBUSY;
338+
} else
339+
wait_event_interruptible(phba->ctrl.mcc_wait[tag],
340+
phba->ctrl.mcc_numtag[tag]);
341+
342+
wrb_num = (phba->ctrl.mcc_numtag[tag] & 0x00FF0000) >> 16;
343+
extd_status = (phba->ctrl.mcc_numtag[tag] & 0x0000FF00) >> 8;
344+
status = phba->ctrl.mcc_numtag[tag] & 0x000000FF;
345+
if (status || extd_status) {
346+
SE_DEBUG(DBG_LVL_1, "Failed to get be_cmd_get_mac_addr"
347+
" status = %d extd_status = %d\n",
348+
status, extd_status);
349+
free_mcc_tag(&phba->ctrl, tag);
350+
return -EAGAIN;
351+
}
352+
wrb = queue_get_wrb(mccq, wrb_num);
353+
free_mcc_tag(&phba->ctrl, tag);
354+
resp = embedded_payload(wrb);
355+
memcpy(phba->mac_address, resp->mac_address, ETH_ALEN);
356+
rc = sysfs_format_mac(buf, phba->mac_address,
357+
ETH_ALEN);
358+
phba->read_mac_address = 1;
359+
return rc;
360+
}
361+
362+
345363
/**
346364
* beiscsi_conn_get_stats - get the iscsi stats
347365
* @cls_conn: pointer to iscsi cls conn

‎drivers/scsi/be2iscsi/be_iscsi.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ int beiscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
5454
int beiscsi_get_host_param(struct Scsi_Host *shost,
5555
enum iscsi_host_param param, char *buf);
5656

57+
int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba);
58+
5759
int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
5860
enum iscsi_param param, char *buf, int buflen);
5961

0 commit comments

Comments
 (0)