diff options
author | Harish Zunjarrao <harish.zunjarrao@qlogic.com> | 2013-10-18 09:01:42 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-12-16 13:57:51 -0500 |
commit | f8e934122424ab1f9a538fc2b7062d7d5b10fd6f (patch) | |
tree | 322c4573391e8a00c10642c4604236e23d3c97df | |
parent | 3e0f65b34cc972d462c32769cd85b4eee6949139 (diff) |
[SCSI] qla4xxx: Add support for additional network parameters settings
Added support to display and update additional network parameters
through iscsiadm.
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_def.h | 32 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_fw.h | 43 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_glbl.h | 1 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_isr.c | 32 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_mbx.c | 111 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 1126 |
6 files changed, 1212 insertions, 133 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h index 084d1fd59c9e..e2be308c0d9e 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h | |||
@@ -179,6 +179,10 @@ | |||
179 | n &= ~v; \ | 179 | n &= ~v; \ |
180 | } | 180 | } |
181 | 181 | ||
182 | #define OP_STATE(o, f, p) { \ | ||
183 | p = (o & f) ? "enable" : "disable"; \ | ||
184 | } | ||
185 | |||
182 | /* | 186 | /* |
183 | * Retry & Timeout Values | 187 | * Retry & Timeout Values |
184 | */ | 188 | */ |
@@ -476,6 +480,34 @@ struct ipaddress_config { | |||
476 | uint16_t eth_mtu_size; | 480 | uint16_t eth_mtu_size; |
477 | uint16_t ipv4_port; | 481 | uint16_t ipv4_port; |
478 | uint16_t ipv6_port; | 482 | uint16_t ipv6_port; |
483 | uint8_t control; | ||
484 | uint16_t ipv6_tcp_options; | ||
485 | uint8_t tcp_wsf; | ||
486 | uint8_t ipv6_tcp_wsf; | ||
487 | uint8_t ipv4_tos; | ||
488 | uint8_t ipv4_cache_id; | ||
489 | uint8_t ipv6_cache_id; | ||
490 | uint8_t ipv4_alt_cid_len; | ||
491 | uint8_t ipv4_alt_cid[11]; | ||
492 | uint8_t ipv4_vid_len; | ||
493 | uint8_t ipv4_vid[11]; | ||
494 | uint8_t ipv4_ttl; | ||
495 | uint16_t ipv6_flow_lbl; | ||
496 | uint8_t ipv6_traffic_class; | ||
497 | uint8_t ipv6_hop_limit; | ||
498 | uint32_t ipv6_nd_reach_time; | ||
499 | uint32_t ipv6_nd_rexmit_timer; | ||
500 | uint32_t ipv6_nd_stale_timeout; | ||
501 | uint8_t ipv6_dup_addr_detect_count; | ||
502 | uint32_t ipv6_gw_advrt_mtu; | ||
503 | uint16_t def_timeout; | ||
504 | uint8_t abort_timer; | ||
505 | uint16_t iscsi_options; | ||
506 | uint16_t iscsi_max_pdu_size; | ||
507 | uint16_t iscsi_first_burst_len; | ||
508 | uint16_t iscsi_max_outstnd_r2t; | ||
509 | uint16_t iscsi_max_burst_len; | ||
510 | uint8_t iscsi_name[224]; | ||
479 | }; | 511 | }; |
480 | 512 | ||
481 | #define QL4_CHAP_MAX_NAME_LEN 256 | 513 | #define QL4_CHAP_MAX_NAME_LEN 256 |
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h index 1243e5942b76..306065275707 100644 --- a/drivers/scsi/qla4xxx/ql4_fw.h +++ b/drivers/scsi/qla4xxx/ql4_fw.h | |||
@@ -551,6 +551,7 @@ struct addr_ctrl_blk { | |||
551 | #define IFCB_VER_MIN 0x01 | 551 | #define IFCB_VER_MIN 0x01 |
552 | #define IFCB_VER_MAX 0x02 | 552 | #define IFCB_VER_MAX 0x02 |
553 | uint8_t control; /* 01 */ | 553 | uint8_t control; /* 01 */ |
554 | #define CTRLOPT_NEW_CONN_DISABLE 0x0002 | ||
554 | 555 | ||
555 | uint16_t fw_options; /* 02-03 */ | 556 | uint16_t fw_options; /* 02-03 */ |
556 | #define FWOPT_HEARTBEAT_ENABLE 0x1000 | 557 | #define FWOPT_HEARTBEAT_ENABLE 0x1000 |
@@ -582,11 +583,40 @@ struct addr_ctrl_blk { | |||
582 | uint32_t shdwreg_addr_hi; /* 2C-2F */ | 583 | uint32_t shdwreg_addr_hi; /* 2C-2F */ |
583 | 584 | ||
584 | uint16_t iscsi_opts; /* 30-31 */ | 585 | uint16_t iscsi_opts; /* 30-31 */ |
586 | #define ISCSIOPTS_HEADER_DIGEST_EN 0x2000 | ||
587 | #define ISCSIOPTS_DATA_DIGEST_EN 0x1000 | ||
588 | #define ISCSIOPTS_IMMEDIATE_DATA_EN 0x0800 | ||
589 | #define ISCSIOPTS_INITIAL_R2T_EN 0x0400 | ||
590 | #define ISCSIOPTS_DATA_SEQ_INORDER_EN 0x0200 | ||
591 | #define ISCSIOPTS_DATA_PDU_INORDER_EN 0x0100 | ||
592 | #define ISCSIOPTS_CHAP_AUTH_EN 0x0080 | ||
593 | #define ISCSIOPTS_SNACK_EN 0x0040 | ||
594 | #define ISCSIOPTS_DISCOVERY_LOGOUT_EN 0x0020 | ||
595 | #define ISCSIOPTS_BIDI_CHAP_EN 0x0010 | ||
596 | #define ISCSIOPTS_DISCOVERY_AUTH_EN 0x0008 | ||
597 | #define ISCSIOPTS_STRICT_LOGIN_COMP_EN 0x0004 | ||
598 | #define ISCSIOPTS_ERL 0x0003 | ||
585 | uint16_t ipv4_tcp_opts; /* 32-33 */ | 599 | uint16_t ipv4_tcp_opts; /* 32-33 */ |
600 | #define TCPOPT_DELAYED_ACK_DISABLE 0x8000 | ||
586 | #define TCPOPT_DHCP_ENABLE 0x0200 | 601 | #define TCPOPT_DHCP_ENABLE 0x0200 |
602 | #define TCPOPT_DNS_SERVER_IP_EN 0x0100 | ||
603 | #define TCPOPT_SLP_DA_INFO_EN 0x0080 | ||
604 | #define TCPOPT_NAGLE_ALGO_DISABLE 0x0020 | ||
605 | #define TCPOPT_WINDOW_SCALE_DISABLE 0x0010 | ||
606 | #define TCPOPT_TIMER_SCALE 0x000E | ||
607 | #define TCPOPT_TIMESTAMP_ENABLE 0x0001 | ||
587 | uint16_t ipv4_ip_opts; /* 34-35 */ | 608 | uint16_t ipv4_ip_opts; /* 34-35 */ |
588 | #define IPOPT_IPV4_PROTOCOL_ENABLE 0x8000 | 609 | #define IPOPT_IPV4_PROTOCOL_ENABLE 0x8000 |
610 | #define IPOPT_IPV4_TOS_EN 0x4000 | ||
589 | #define IPOPT_VLAN_TAGGING_ENABLE 0x2000 | 611 | #define IPOPT_VLAN_TAGGING_ENABLE 0x2000 |
612 | #define IPOPT_GRAT_ARP_EN 0x1000 | ||
613 | #define IPOPT_ALT_CID_EN 0x0800 | ||
614 | #define IPOPT_REQ_VID_EN 0x0400 | ||
615 | #define IPOPT_USE_VID_EN 0x0200 | ||
616 | #define IPOPT_LEARN_IQN_EN 0x0100 | ||
617 | #define IPOPT_FRAGMENTATION_DISABLE 0x0010 | ||
618 | #define IPOPT_IN_FORWARD_EN 0x0008 | ||
619 | #define IPOPT_ARP_REDIRECT_EN 0x0004 | ||
590 | 620 | ||
591 | uint16_t iscsi_max_pdu_size; /* 36-37 */ | 621 | uint16_t iscsi_max_pdu_size; /* 36-37 */ |
592 | uint8_t ipv4_tos; /* 38 */ | 622 | uint8_t ipv4_tos; /* 38 */ |
@@ -637,15 +667,24 @@ struct addr_ctrl_blk { | |||
637 | uint32_t cookie; /* 200-203 */ | 667 | uint32_t cookie; /* 200-203 */ |
638 | uint16_t ipv6_port; /* 204-205 */ | 668 | uint16_t ipv6_port; /* 204-205 */ |
639 | uint16_t ipv6_opts; /* 206-207 */ | 669 | uint16_t ipv6_opts; /* 206-207 */ |
640 | #define IPV6_OPT_IPV6_PROTOCOL_ENABLE 0x8000 | 670 | #define IPV6_OPT_IPV6_PROTOCOL_ENABLE 0x8000 |
641 | #define IPV6_OPT_VLAN_TAGGING_ENABLE 0x2000 | 671 | #define IPV6_OPT_VLAN_TAGGING_ENABLE 0x2000 |
672 | #define IPV6_OPT_GRAT_NEIGHBOR_ADV_EN 0x1000 | ||
673 | #define IPV6_OPT_REDIRECT_EN 0x0004 | ||
642 | 674 | ||
643 | uint16_t ipv6_addtl_opts; /* 208-209 */ | 675 | uint16_t ipv6_addtl_opts; /* 208-209 */ |
676 | #define IPV6_ADDOPT_IGNORE_ICMP_ECHO_REQ 0x0040 | ||
677 | #define IPV6_ADDOPT_MLD_EN 0x0004 | ||
644 | #define IPV6_ADDOPT_NEIGHBOR_DISCOVERY_ADDR_ENABLE 0x0002 /* Pri ACB | 678 | #define IPV6_ADDOPT_NEIGHBOR_DISCOVERY_ADDR_ENABLE 0x0002 /* Pri ACB |
645 | Only */ | 679 | Only */ |
646 | #define IPV6_ADDOPT_AUTOCONFIG_LINK_LOCAL_ADDR 0x0001 | 680 | #define IPV6_ADDOPT_AUTOCONFIG_LINK_LOCAL_ADDR 0x0001 |
647 | 681 | ||
648 | uint16_t ipv6_tcp_opts; /* 20A-20B */ | 682 | uint16_t ipv6_tcp_opts; /* 20A-20B */ |
683 | #define IPV6_TCPOPT_DELAYED_ACK_DISABLE 0x8000 | ||
684 | #define IPV6_TCPOPT_NAGLE_ALGO_DISABLE 0x0020 | ||
685 | #define IPV6_TCPOPT_WINDOW_SCALE_DISABLE 0x0010 | ||
686 | #define IPV6_TCPOPT_TIMER_SCALE 0x000E | ||
687 | #define IPV6_TCPOPT_TIMESTAMP_EN 0x0001 | ||
649 | uint8_t ipv6_tcp_wsf; /* 20C */ | 688 | uint8_t ipv6_tcp_wsf; /* 20C */ |
650 | uint16_t ipv6_flow_lbl; /* 20D-20F */ | 689 | uint16_t ipv6_flow_lbl; /* 20D-20F */ |
651 | uint8_t ipv6_dflt_rtr_addr[16]; /* 210-21F */ | 690 | uint8_t ipv6_dflt_rtr_addr[16]; /* 210-21F */ |
diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h index 5cef2527180a..b8e87b33b48e 100644 --- a/drivers/scsi/qla4xxx/ql4_glbl.h +++ b/drivers/scsi/qla4xxx/ql4_glbl.h | |||
@@ -276,6 +276,7 @@ int qla4xxx_get_acb(struct scsi_qla_host *ha, dma_addr_t acb_dma, | |||
276 | int qla4_84xx_config_acb(struct scsi_qla_host *ha, int acb_config); | 276 | int qla4_84xx_config_acb(struct scsi_qla_host *ha, int acb_config); |
277 | int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha, | 277 | int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha, |
278 | uint64_t addr, uint32_t *data, uint32_t count); | 278 | uint64_t addr, uint32_t *data, uint32_t count); |
279 | uint8_t qla4xxx_set_ipaddr_state(uint8_t fw_ipaddr_state); | ||
279 | 280 | ||
280 | extern int ql4xextended_error_logging; | 281 | extern int ql4xextended_error_logging; |
281 | extern int ql4xdontresethba; | 282 | extern int ql4xdontresethba; |
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c index 7dff09f09b71..66cc9c1ba53c 100644 --- a/drivers/scsi/qla4xxx/ql4_isr.c +++ b/drivers/scsi/qla4xxx/ql4_isr.c | |||
@@ -606,6 +606,36 @@ static int qla4_83xx_loopback_in_progress(struct scsi_qla_host *ha) | |||
606 | return rval; | 606 | return rval; |
607 | } | 607 | } |
608 | 608 | ||
609 | static void qla4xxx_update_ipaddr_state(struct scsi_qla_host *ha, | ||
610 | uint32_t ipaddr_idx, | ||
611 | uint32_t ipaddr_fw_state) | ||
612 | { | ||
613 | uint8_t ipaddr_state; | ||
614 | uint8_t ip_idx; | ||
615 | |||
616 | ip_idx = ipaddr_idx & 0xF; | ||
617 | ipaddr_state = qla4xxx_set_ipaddr_state((uint8_t)ipaddr_fw_state); | ||
618 | |||
619 | switch (ip_idx) { | ||
620 | case 0: | ||
621 | ha->ip_config.ipv4_addr_state = ipaddr_state; | ||
622 | break; | ||
623 | case 1: | ||
624 | ha->ip_config.ipv6_link_local_state = ipaddr_state; | ||
625 | break; | ||
626 | case 2: | ||
627 | ha->ip_config.ipv6_addr0_state = ipaddr_state; | ||
628 | break; | ||
629 | case 3: | ||
630 | ha->ip_config.ipv6_addr1_state = ipaddr_state; | ||
631 | break; | ||
632 | default: | ||
633 | ql4_printk(KERN_INFO, ha, "%s: Invalid IPADDR index %d\n", | ||
634 | __func__, ip_idx); | ||
635 | } | ||
636 | } | ||
637 | |||
638 | |||
609 | /** | 639 | /** |
610 | * qla4xxx_isr_decode_mailbox - decodes mailbox status | 640 | * qla4xxx_isr_decode_mailbox - decodes mailbox status |
611 | * @ha: Pointer to host adapter structure. | 641 | * @ha: Pointer to host adapter structure. |
@@ -741,6 +771,8 @@ static void qla4xxx_isr_decode_mailbox(struct scsi_qla_host * ha, | |||
741 | "mbox_sts[3]=%04x\n", ha->host_no, mbox_sts[0], | 771 | "mbox_sts[3]=%04x\n", ha->host_no, mbox_sts[0], |
742 | mbox_sts[2], mbox_sts[3]); | 772 | mbox_sts[2], mbox_sts[3]); |
743 | 773 | ||
774 | qla4xxx_update_ipaddr_state(ha, mbox_sts[5], | ||
775 | mbox_sts[3]); | ||
744 | /* mbox_sts[2] = Old ACB state | 776 | /* mbox_sts[2] = Old ACB state |
745 | * mbox_sts[3] = new ACB state */ | 777 | * mbox_sts[3] = new ACB state */ |
746 | if ((mbox_sts[3] == ACB_STATE_VALID) && | 778 | if ((mbox_sts[3] == ACB_STATE_VALID) && |
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index 22cbd005bdf4..351793c0e18f 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c | |||
@@ -418,6 +418,38 @@ qla4xxx_get_ifcb(struct scsi_qla_host *ha, uint32_t *mbox_cmd, | |||
418 | return QLA_SUCCESS; | 418 | return QLA_SUCCESS; |
419 | } | 419 | } |
420 | 420 | ||
421 | uint8_t qla4xxx_set_ipaddr_state(uint8_t fw_ipaddr_state) | ||
422 | { | ||
423 | uint8_t ipaddr_state; | ||
424 | |||
425 | switch (fw_ipaddr_state) { | ||
426 | case IP_ADDRSTATE_UNCONFIGURED: | ||
427 | ipaddr_state = ISCSI_IPDDRESS_STATE_UNCONFIGURED; | ||
428 | break; | ||
429 | case IP_ADDRSTATE_INVALID: | ||
430 | ipaddr_state = ISCSI_IPDDRESS_STATE_INVALID; | ||
431 | break; | ||
432 | case IP_ADDRSTATE_ACQUIRING: | ||
433 | ipaddr_state = ISCSI_IPDDRESS_STATE_ACQUIRING; | ||
434 | break; | ||
435 | case IP_ADDRSTATE_TENTATIVE: | ||
436 | ipaddr_state = ISCSI_IPDDRESS_STATE_TENTATIVE; | ||
437 | break; | ||
438 | case IP_ADDRSTATE_DEPRICATED: | ||
439 | ipaddr_state = ISCSI_IPDDRESS_STATE_DEPRECATED; | ||
440 | break; | ||
441 | case IP_ADDRSTATE_PREFERRED: | ||
442 | ipaddr_state = ISCSI_IPDDRESS_STATE_VALID; | ||
443 | break; | ||
444 | case IP_ADDRSTATE_DISABLING: | ||
445 | ipaddr_state = ISCSI_IPDDRESS_STATE_DISABLING; | ||
446 | break; | ||
447 | default: | ||
448 | ipaddr_state = ISCSI_IPDDRESS_STATE_UNCONFIGURED; | ||
449 | } | ||
450 | return ipaddr_state; | ||
451 | } | ||
452 | |||
421 | static void | 453 | static void |
422 | qla4xxx_update_local_ip(struct scsi_qla_host *ha, | 454 | qla4xxx_update_local_ip(struct scsi_qla_host *ha, |
423 | struct addr_ctrl_blk *init_fw_cb) | 455 | struct addr_ctrl_blk *init_fw_cb) |
@@ -425,7 +457,7 @@ qla4xxx_update_local_ip(struct scsi_qla_host *ha, | |||
425 | ha->ip_config.tcp_options = le16_to_cpu(init_fw_cb->ipv4_tcp_opts); | 457 | ha->ip_config.tcp_options = le16_to_cpu(init_fw_cb->ipv4_tcp_opts); |
426 | ha->ip_config.ipv4_options = le16_to_cpu(init_fw_cb->ipv4_ip_opts); | 458 | ha->ip_config.ipv4_options = le16_to_cpu(init_fw_cb->ipv4_ip_opts); |
427 | ha->ip_config.ipv4_addr_state = | 459 | ha->ip_config.ipv4_addr_state = |
428 | le16_to_cpu(init_fw_cb->ipv4_addr_state); | 460 | qla4xxx_set_ipaddr_state(init_fw_cb->ipv4_addr_state); |
429 | ha->ip_config.eth_mtu_size = | 461 | ha->ip_config.eth_mtu_size = |
430 | le16_to_cpu(init_fw_cb->eth_mtu_size); | 462 | le16_to_cpu(init_fw_cb->eth_mtu_size); |
431 | ha->ip_config.ipv4_port = le16_to_cpu(init_fw_cb->ipv4_port); | 463 | ha->ip_config.ipv4_port = le16_to_cpu(init_fw_cb->ipv4_port); |
@@ -434,6 +466,8 @@ qla4xxx_update_local_ip(struct scsi_qla_host *ha, | |||
434 | ha->ip_config.ipv6_options = le16_to_cpu(init_fw_cb->ipv6_opts); | 466 | ha->ip_config.ipv6_options = le16_to_cpu(init_fw_cb->ipv6_opts); |
435 | ha->ip_config.ipv6_addl_options = | 467 | ha->ip_config.ipv6_addl_options = |
436 | le16_to_cpu(init_fw_cb->ipv6_addtl_opts); | 468 | le16_to_cpu(init_fw_cb->ipv6_addtl_opts); |
469 | ha->ip_config.ipv6_tcp_options = | ||
470 | le16_to_cpu(init_fw_cb->ipv6_tcp_opts); | ||
437 | } | 471 | } |
438 | 472 | ||
439 | /* Save IPv4 Address Info */ | 473 | /* Save IPv4 Address Info */ |
@@ -448,17 +482,65 @@ qla4xxx_update_local_ip(struct scsi_qla_host *ha, | |||
448 | sizeof(init_fw_cb->ipv4_gw_addr))); | 482 | sizeof(init_fw_cb->ipv4_gw_addr))); |
449 | 483 | ||
450 | ha->ip_config.ipv4_vlan_tag = be16_to_cpu(init_fw_cb->ipv4_vlan_tag); | 484 | ha->ip_config.ipv4_vlan_tag = be16_to_cpu(init_fw_cb->ipv4_vlan_tag); |
485 | ha->ip_config.control = init_fw_cb->control; | ||
486 | ha->ip_config.tcp_wsf = init_fw_cb->ipv4_tcp_wsf; | ||
487 | ha->ip_config.ipv4_tos = init_fw_cb->ipv4_tos; | ||
488 | ha->ip_config.ipv4_cache_id = init_fw_cb->ipv4_cacheid; | ||
489 | ha->ip_config.ipv4_alt_cid_len = init_fw_cb->ipv4_dhcp_alt_cid_len; | ||
490 | memcpy(ha->ip_config.ipv4_alt_cid, init_fw_cb->ipv4_dhcp_alt_cid, | ||
491 | min(sizeof(ha->ip_config.ipv4_alt_cid), | ||
492 | sizeof(init_fw_cb->ipv4_dhcp_alt_cid))); | ||
493 | ha->ip_config.ipv4_vid_len = init_fw_cb->ipv4_dhcp_vid_len; | ||
494 | memcpy(ha->ip_config.ipv4_vid, init_fw_cb->ipv4_dhcp_vid, | ||
495 | min(sizeof(ha->ip_config.ipv4_vid), | ||
496 | sizeof(init_fw_cb->ipv4_dhcp_vid))); | ||
497 | ha->ip_config.ipv4_ttl = init_fw_cb->ipv4_ttl; | ||
498 | ha->ip_config.def_timeout = le16_to_cpu(init_fw_cb->def_timeout); | ||
499 | ha->ip_config.abort_timer = init_fw_cb->abort_timer; | ||
500 | ha->ip_config.iscsi_options = le16_to_cpu(init_fw_cb->iscsi_opts); | ||
501 | ha->ip_config.iscsi_max_pdu_size = | ||
502 | le16_to_cpu(init_fw_cb->iscsi_max_pdu_size); | ||
503 | ha->ip_config.iscsi_first_burst_len = | ||
504 | le16_to_cpu(init_fw_cb->iscsi_fburst_len); | ||
505 | ha->ip_config.iscsi_max_outstnd_r2t = | ||
506 | le16_to_cpu(init_fw_cb->iscsi_max_outstnd_r2t); | ||
507 | ha->ip_config.iscsi_max_burst_len = | ||
508 | le16_to_cpu(init_fw_cb->iscsi_max_burst_len); | ||
509 | memcpy(ha->ip_config.iscsi_name, init_fw_cb->iscsi_name, | ||
510 | min(sizeof(ha->ip_config.iscsi_name), | ||
511 | sizeof(init_fw_cb->iscsi_name))); | ||
451 | 512 | ||
452 | if (is_ipv6_enabled(ha)) { | 513 | if (is_ipv6_enabled(ha)) { |
453 | /* Save IPv6 Address */ | 514 | /* Save IPv6 Address */ |
454 | ha->ip_config.ipv6_link_local_state = | 515 | ha->ip_config.ipv6_link_local_state = |
455 | le16_to_cpu(init_fw_cb->ipv6_lnk_lcl_addr_state); | 516 | qla4xxx_set_ipaddr_state(init_fw_cb->ipv6_lnk_lcl_addr_state); |
456 | ha->ip_config.ipv6_addr0_state = | 517 | ha->ip_config.ipv6_addr0_state = |
457 | le16_to_cpu(init_fw_cb->ipv6_addr0_state); | 518 | qla4xxx_set_ipaddr_state(init_fw_cb->ipv6_addr0_state); |
458 | ha->ip_config.ipv6_addr1_state = | 519 | ha->ip_config.ipv6_addr1_state = |
459 | le16_to_cpu(init_fw_cb->ipv6_addr1_state); | 520 | qla4xxx_set_ipaddr_state(init_fw_cb->ipv6_addr1_state); |
460 | ha->ip_config.ipv6_default_router_state = | 521 | |
461 | le16_to_cpu(init_fw_cb->ipv6_dflt_rtr_state); | 522 | switch (le16_to_cpu(init_fw_cb->ipv6_dflt_rtr_state)) { |
523 | case IPV6_RTRSTATE_UNKNOWN: | ||
524 | ha->ip_config.ipv6_default_router_state = | ||
525 | ISCSI_ROUTER_STATE_UNKNOWN; | ||
526 | break; | ||
527 | case IPV6_RTRSTATE_MANUAL: | ||
528 | ha->ip_config.ipv6_default_router_state = | ||
529 | ISCSI_ROUTER_STATE_MANUAL; | ||
530 | break; | ||
531 | case IPV6_RTRSTATE_ADVERTISED: | ||
532 | ha->ip_config.ipv6_default_router_state = | ||
533 | ISCSI_ROUTER_STATE_ADVERTISED; | ||
534 | break; | ||
535 | case IPV6_RTRSTATE_STALE: | ||
536 | ha->ip_config.ipv6_default_router_state = | ||
537 | ISCSI_ROUTER_STATE_STALE; | ||
538 | break; | ||
539 | default: | ||
540 | ha->ip_config.ipv6_default_router_state = | ||
541 | ISCSI_ROUTER_STATE_UNKNOWN; | ||
542 | } | ||
543 | |||
462 | ha->ip_config.ipv6_link_local_addr.in6_u.u6_addr8[0] = 0xFE; | 544 | ha->ip_config.ipv6_link_local_addr.in6_u.u6_addr8[0] = 0xFE; |
463 | ha->ip_config.ipv6_link_local_addr.in6_u.u6_addr8[1] = 0x80; | 545 | ha->ip_config.ipv6_link_local_addr.in6_u.u6_addr8[1] = 0x80; |
464 | 546 | ||
@@ -479,6 +561,23 @@ qla4xxx_update_local_ip(struct scsi_qla_host *ha, | |||
479 | ha->ip_config.ipv6_vlan_tag = | 561 | ha->ip_config.ipv6_vlan_tag = |
480 | be16_to_cpu(init_fw_cb->ipv6_vlan_tag); | 562 | be16_to_cpu(init_fw_cb->ipv6_vlan_tag); |
481 | ha->ip_config.ipv6_port = le16_to_cpu(init_fw_cb->ipv6_port); | 563 | ha->ip_config.ipv6_port = le16_to_cpu(init_fw_cb->ipv6_port); |
564 | ha->ip_config.ipv6_cache_id = init_fw_cb->ipv6_cache_id; | ||
565 | ha->ip_config.ipv6_flow_lbl = | ||
566 | le16_to_cpu(init_fw_cb->ipv6_flow_lbl); | ||
567 | ha->ip_config.ipv6_traffic_class = | ||
568 | init_fw_cb->ipv6_traffic_class; | ||
569 | ha->ip_config.ipv6_hop_limit = init_fw_cb->ipv6_hop_limit; | ||
570 | ha->ip_config.ipv6_nd_reach_time = | ||
571 | le32_to_cpu(init_fw_cb->ipv6_nd_reach_time); | ||
572 | ha->ip_config.ipv6_nd_rexmit_timer = | ||
573 | le32_to_cpu(init_fw_cb->ipv6_nd_rexmit_timer); | ||
574 | ha->ip_config.ipv6_nd_stale_timeout = | ||
575 | le32_to_cpu(init_fw_cb->ipv6_nd_stale_timeout); | ||
576 | ha->ip_config.ipv6_dup_addr_detect_count = | ||
577 | init_fw_cb->ipv6_dup_addr_detect_count; | ||
578 | ha->ip_config.ipv6_gw_advrt_mtu = | ||
579 | le32_to_cpu(init_fw_cb->ipv6_gw_advrt_mtu); | ||
580 | ha->ip_config.ipv6_tcp_wsf = init_fw_cb->ipv6_tcp_wsf; | ||
482 | } | 581 | } |
483 | } | 582 | } |
484 | 583 | ||
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index a28d5e624aab..b04afaefde84 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -440,6 +440,65 @@ static umode_t qla4_attr_is_visible(int param_type, int param) | |||
440 | case ISCSI_NET_PARAM_VLAN_ENABLED: | 440 | case ISCSI_NET_PARAM_VLAN_ENABLED: |
441 | case ISCSI_NET_PARAM_MTU: | 441 | case ISCSI_NET_PARAM_MTU: |
442 | case ISCSI_NET_PARAM_PORT: | 442 | case ISCSI_NET_PARAM_PORT: |
443 | case ISCSI_NET_PARAM_IPADDR_STATE: | ||
444 | case ISCSI_NET_PARAM_IPV6_LINKLOCAL_STATE: | ||
445 | case ISCSI_NET_PARAM_IPV6_ROUTER_STATE: | ||
446 | case ISCSI_NET_PARAM_DELAYED_ACK_EN: | ||
447 | case ISCSI_NET_PARAM_TCP_NAGLE_DISABLE: | ||
448 | case ISCSI_NET_PARAM_TCP_WSF_DISABLE: | ||
449 | case ISCSI_NET_PARAM_TCP_WSF: | ||
450 | case ISCSI_NET_PARAM_TCP_TIMER_SCALE: | ||
451 | case ISCSI_NET_PARAM_TCP_TIMESTAMP_EN: | ||
452 | case ISCSI_NET_PARAM_CACHE_ID: | ||
453 | case ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN: | ||
454 | case ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN: | ||
455 | case ISCSI_NET_PARAM_IPV4_TOS_EN: | ||
456 | case ISCSI_NET_PARAM_IPV4_TOS: | ||
457 | case ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN: | ||
458 | case ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN: | ||
459 | case ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID: | ||
460 | case ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN: | ||
461 | case ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN: | ||
462 | case ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID: | ||
463 | case ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN: | ||
464 | case ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE: | ||
465 | case ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN: | ||
466 | case ISCSI_NET_PARAM_REDIRECT_EN: | ||
467 | case ISCSI_NET_PARAM_IPV4_TTL: | ||
468 | case ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN: | ||
469 | case ISCSI_NET_PARAM_IPV6_MLD_EN: | ||
470 | case ISCSI_NET_PARAM_IPV6_FLOW_LABEL: | ||
471 | case ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS: | ||
472 | case ISCSI_NET_PARAM_IPV6_HOP_LIMIT: | ||
473 | case ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO: | ||
474 | case ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME: | ||
475 | case ISCSI_NET_PARAM_IPV6_ND_STALE_TMO: | ||
476 | case ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT: | ||
477 | case ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU: | ||
478 | return S_IRUGO; | ||
479 | default: | ||
480 | return 0; | ||
481 | } | ||
482 | case ISCSI_IFACE_PARAM: | ||
483 | switch (param) { | ||
484 | case ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO: | ||
485 | case ISCSI_IFACE_PARAM_HDRDGST_EN: | ||
486 | case ISCSI_IFACE_PARAM_DATADGST_EN: | ||
487 | case ISCSI_IFACE_PARAM_IMM_DATA_EN: | ||
488 | case ISCSI_IFACE_PARAM_INITIAL_R2T_EN: | ||
489 | case ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN: | ||
490 | case ISCSI_IFACE_PARAM_PDU_INORDER_EN: | ||
491 | case ISCSI_IFACE_PARAM_ERL: | ||
492 | case ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH: | ||
493 | case ISCSI_IFACE_PARAM_FIRST_BURST: | ||
494 | case ISCSI_IFACE_PARAM_MAX_R2T: | ||
495 | case ISCSI_IFACE_PARAM_MAX_BURST: | ||
496 | case ISCSI_IFACE_PARAM_CHAP_AUTH_EN: | ||
497 | case ISCSI_IFACE_PARAM_BIDI_CHAP_EN: | ||
498 | case ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL: | ||
499 | case ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN: | ||
500 | case ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN: | ||
501 | case ISCSI_IFACE_PARAM_INITIATOR_NAME: | ||
443 | return S_IRUGO; | 502 | return S_IRUGO; |
444 | default: | 503 | default: |
445 | return 0; | 504 | return 0; |
@@ -894,107 +953,437 @@ static int qla4xxx_get_iface_param(struct iscsi_iface *iface, | |||
894 | { | 953 | { |
895 | struct Scsi_Host *shost = iscsi_iface_to_shost(iface); | 954 | struct Scsi_Host *shost = iscsi_iface_to_shost(iface); |
896 | struct scsi_qla_host *ha = to_qla_host(shost); | 955 | struct scsi_qla_host *ha = to_qla_host(shost); |
956 | int ival; | ||
957 | char *pval = NULL; | ||
897 | int len = -ENOSYS; | 958 | int len = -ENOSYS; |
898 | 959 | ||
899 | if (param_type != ISCSI_NET_PARAM) | 960 | if (param_type == ISCSI_NET_PARAM) { |
900 | return -ENOSYS; | 961 | switch (param) { |
962 | case ISCSI_NET_PARAM_IPV4_ADDR: | ||
963 | len = sprintf(buf, "%pI4\n", &ha->ip_config.ip_address); | ||
964 | break; | ||
965 | case ISCSI_NET_PARAM_IPV4_SUBNET: | ||
966 | len = sprintf(buf, "%pI4\n", | ||
967 | &ha->ip_config.subnet_mask); | ||
968 | break; | ||
969 | case ISCSI_NET_PARAM_IPV4_GW: | ||
970 | len = sprintf(buf, "%pI4\n", &ha->ip_config.gateway); | ||
971 | break; | ||
972 | case ISCSI_NET_PARAM_IFACE_ENABLE: | ||
973 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { | ||
974 | OP_STATE(ha->ip_config.ipv4_options, | ||
975 | IPOPT_IPV4_PROTOCOL_ENABLE, pval); | ||
976 | } else { | ||
977 | OP_STATE(ha->ip_config.ipv6_options, | ||
978 | IPV6_OPT_IPV6_PROTOCOL_ENABLE, pval); | ||
979 | } | ||
901 | 980 | ||
902 | switch (param) { | 981 | len = sprintf(buf, "%s\n", pval); |
903 | case ISCSI_NET_PARAM_IPV4_ADDR: | 982 | break; |
904 | len = sprintf(buf, "%pI4\n", &ha->ip_config.ip_address); | 983 | case ISCSI_NET_PARAM_IPV4_BOOTPROTO: |
905 | break; | ||
906 | case ISCSI_NET_PARAM_IPV4_SUBNET: | ||
907 | len = sprintf(buf, "%pI4\n", &ha->ip_config.subnet_mask); | ||
908 | break; | ||
909 | case ISCSI_NET_PARAM_IPV4_GW: | ||
910 | len = sprintf(buf, "%pI4\n", &ha->ip_config.gateway); | ||
911 | break; | ||
912 | case ISCSI_NET_PARAM_IFACE_ENABLE: | ||
913 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | ||
914 | len = sprintf(buf, "%s\n", | ||
915 | (ha->ip_config.ipv4_options & | ||
916 | IPOPT_IPV4_PROTOCOL_ENABLE) ? | ||
917 | "enabled" : "disabled"); | ||
918 | else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6) | ||
919 | len = sprintf(buf, "%s\n", | 984 | len = sprintf(buf, "%s\n", |
920 | (ha->ip_config.ipv6_options & | 985 | (ha->ip_config.tcp_options & |
921 | IPV6_OPT_IPV6_PROTOCOL_ENABLE) ? | 986 | TCPOPT_DHCP_ENABLE) ? |
922 | "enabled" : "disabled"); | 987 | "dhcp" : "static"); |
923 | break; | 988 | break; |
924 | case ISCSI_NET_PARAM_IPV4_BOOTPROTO: | 989 | case ISCSI_NET_PARAM_IPV6_ADDR: |
925 | len = sprintf(buf, "%s\n", | 990 | if (iface->iface_num == 0) |
926 | (ha->ip_config.tcp_options & TCPOPT_DHCP_ENABLE) ? | 991 | len = sprintf(buf, "%pI6\n", |
927 | "dhcp" : "static"); | 992 | &ha->ip_config.ipv6_addr0); |
928 | break; | 993 | if (iface->iface_num == 1) |
929 | case ISCSI_NET_PARAM_IPV6_ADDR: | 994 | len = sprintf(buf, "%pI6\n", |
930 | if (iface->iface_num == 0) | 995 | &ha->ip_config.ipv6_addr1); |
931 | len = sprintf(buf, "%pI6\n", &ha->ip_config.ipv6_addr0); | 996 | break; |
932 | if (iface->iface_num == 1) | 997 | case ISCSI_NET_PARAM_IPV6_LINKLOCAL: |
933 | len = sprintf(buf, "%pI6\n", &ha->ip_config.ipv6_addr1); | 998 | len = sprintf(buf, "%pI6\n", |
934 | break; | 999 | &ha->ip_config.ipv6_link_local_addr); |
935 | case ISCSI_NET_PARAM_IPV6_LINKLOCAL: | 1000 | break; |
936 | len = sprintf(buf, "%pI6\n", | 1001 | case ISCSI_NET_PARAM_IPV6_ROUTER: |
937 | &ha->ip_config.ipv6_link_local_addr); | 1002 | len = sprintf(buf, "%pI6\n", |
938 | break; | 1003 | &ha->ip_config.ipv6_default_router_addr); |
939 | case ISCSI_NET_PARAM_IPV6_ROUTER: | 1004 | break; |
940 | len = sprintf(buf, "%pI6\n", | 1005 | case ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG: |
941 | &ha->ip_config.ipv6_default_router_addr); | 1006 | pval = (ha->ip_config.ipv6_addl_options & |
942 | break; | 1007 | IPV6_ADDOPT_NEIGHBOR_DISCOVERY_ADDR_ENABLE) ? |
943 | case ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG: | 1008 | "nd" : "static"; |
944 | len = sprintf(buf, "%s\n", | 1009 | |
945 | (ha->ip_config.ipv6_addl_options & | 1010 | len = sprintf(buf, "%s\n", pval); |
946 | IPV6_ADDOPT_NEIGHBOR_DISCOVERY_ADDR_ENABLE) ? | 1011 | break; |
947 | "nd" : "static"); | 1012 | case ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG: |
948 | break; | 1013 | pval = (ha->ip_config.ipv6_addl_options & |
949 | case ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG: | 1014 | IPV6_ADDOPT_AUTOCONFIG_LINK_LOCAL_ADDR) ? |
950 | len = sprintf(buf, "%s\n", | 1015 | "auto" : "static"; |
951 | (ha->ip_config.ipv6_addl_options & | 1016 | |
952 | IPV6_ADDOPT_AUTOCONFIG_LINK_LOCAL_ADDR) ? | 1017 | len = sprintf(buf, "%s\n", pval); |
953 | "auto" : "static"); | 1018 | break; |
954 | break; | 1019 | case ISCSI_NET_PARAM_VLAN_ID: |
955 | case ISCSI_NET_PARAM_VLAN_ID: | 1020 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) |
956 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | 1021 | ival = ha->ip_config.ipv4_vlan_tag & |
1022 | ISCSI_MAX_VLAN_ID; | ||
1023 | else | ||
1024 | ival = ha->ip_config.ipv6_vlan_tag & | ||
1025 | ISCSI_MAX_VLAN_ID; | ||
1026 | |||
1027 | len = sprintf(buf, "%d\n", ival); | ||
1028 | break; | ||
1029 | case ISCSI_NET_PARAM_VLAN_PRIORITY: | ||
1030 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | ||
1031 | ival = (ha->ip_config.ipv4_vlan_tag >> 13) & | ||
1032 | ISCSI_MAX_VLAN_PRIORITY; | ||
1033 | else | ||
1034 | ival = (ha->ip_config.ipv6_vlan_tag >> 13) & | ||
1035 | ISCSI_MAX_VLAN_PRIORITY; | ||
1036 | |||
1037 | len = sprintf(buf, "%d\n", ival); | ||
1038 | break; | ||
1039 | case ISCSI_NET_PARAM_VLAN_ENABLED: | ||
1040 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { | ||
1041 | OP_STATE(ha->ip_config.ipv4_options, | ||
1042 | IPOPT_VLAN_TAGGING_ENABLE, pval); | ||
1043 | } else { | ||
1044 | OP_STATE(ha->ip_config.ipv6_options, | ||
1045 | IPV6_OPT_VLAN_TAGGING_ENABLE, pval); | ||
1046 | } | ||
1047 | len = sprintf(buf, "%s\n", pval); | ||
1048 | break; | ||
1049 | case ISCSI_NET_PARAM_MTU: | ||
1050 | len = sprintf(buf, "%d\n", ha->ip_config.eth_mtu_size); | ||
1051 | break; | ||
1052 | case ISCSI_NET_PARAM_PORT: | ||
1053 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | ||
1054 | len = sprintf(buf, "%d\n", | ||
1055 | ha->ip_config.ipv4_port); | ||
1056 | else | ||
1057 | len = sprintf(buf, "%d\n", | ||
1058 | ha->ip_config.ipv6_port); | ||
1059 | break; | ||
1060 | case ISCSI_NET_PARAM_IPADDR_STATE: | ||
1061 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { | ||
1062 | pval = iscsi_get_ipaddress_state_name( | ||
1063 | ha->ip_config.ipv4_addr_state); | ||
1064 | } else { | ||
1065 | if (iface->iface_num == 0) | ||
1066 | pval = iscsi_get_ipaddress_state_name( | ||
1067 | ha->ip_config.ipv6_addr0_state); | ||
1068 | else if (iface->iface_num == 1) | ||
1069 | pval = iscsi_get_ipaddress_state_name( | ||
1070 | ha->ip_config.ipv6_addr1_state); | ||
1071 | } | ||
1072 | |||
1073 | len = sprintf(buf, "%s\n", pval); | ||
1074 | break; | ||
1075 | case ISCSI_NET_PARAM_IPV6_LINKLOCAL_STATE: | ||
1076 | pval = iscsi_get_ipaddress_state_name( | ||
1077 | ha->ip_config.ipv6_link_local_state); | ||
1078 | len = sprintf(buf, "%s\n", pval); | ||
1079 | break; | ||
1080 | case ISCSI_NET_PARAM_IPV6_ROUTER_STATE: | ||
1081 | pval = iscsi_get_router_state_name( | ||
1082 | ha->ip_config.ipv6_default_router_state); | ||
1083 | len = sprintf(buf, "%s\n", pval); | ||
1084 | break; | ||
1085 | case ISCSI_NET_PARAM_DELAYED_ACK_EN: | ||
1086 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { | ||
1087 | OP_STATE(~ha->ip_config.tcp_options, | ||
1088 | TCPOPT_DELAYED_ACK_DISABLE, pval); | ||
1089 | } else { | ||
1090 | OP_STATE(~ha->ip_config.ipv6_tcp_options, | ||
1091 | IPV6_TCPOPT_DELAYED_ACK_DISABLE, pval); | ||
1092 | } | ||
1093 | len = sprintf(buf, "%s\n", pval); | ||
1094 | break; | ||
1095 | case ISCSI_NET_PARAM_TCP_NAGLE_DISABLE: | ||
1096 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { | ||
1097 | OP_STATE(~ha->ip_config.tcp_options, | ||
1098 | TCPOPT_NAGLE_ALGO_DISABLE, pval); | ||
1099 | } else { | ||
1100 | OP_STATE(~ha->ip_config.ipv6_tcp_options, | ||
1101 | IPV6_TCPOPT_NAGLE_ALGO_DISABLE, pval); | ||
1102 | } | ||
1103 | len = sprintf(buf, "%s\n", pval); | ||
1104 | break; | ||
1105 | case ISCSI_NET_PARAM_TCP_WSF_DISABLE: | ||
1106 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { | ||
1107 | OP_STATE(~ha->ip_config.tcp_options, | ||
1108 | TCPOPT_WINDOW_SCALE_DISABLE, pval); | ||
1109 | } else { | ||
1110 | OP_STATE(~ha->ip_config.ipv6_tcp_options, | ||
1111 | IPV6_TCPOPT_WINDOW_SCALE_DISABLE, | ||
1112 | pval); | ||
1113 | } | ||
1114 | len = sprintf(buf, "%s\n", pval); | ||
1115 | break; | ||
1116 | case ISCSI_NET_PARAM_TCP_WSF: | ||
1117 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | ||
1118 | len = sprintf(buf, "%d\n", | ||
1119 | ha->ip_config.tcp_wsf); | ||
1120 | else | ||
1121 | len = sprintf(buf, "%d\n", | ||
1122 | ha->ip_config.ipv6_tcp_wsf); | ||
1123 | break; | ||
1124 | case ISCSI_NET_PARAM_TCP_TIMER_SCALE: | ||
1125 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | ||
1126 | ival = (ha->ip_config.tcp_options & | ||
1127 | TCPOPT_TIMER_SCALE) >> 1; | ||
1128 | else | ||
1129 | ival = (ha->ip_config.ipv6_tcp_options & | ||
1130 | IPV6_TCPOPT_TIMER_SCALE) >> 1; | ||
1131 | |||
1132 | len = sprintf(buf, "%d\n", ival); | ||
1133 | break; | ||
1134 | case ISCSI_NET_PARAM_TCP_TIMESTAMP_EN: | ||
1135 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { | ||
1136 | OP_STATE(ha->ip_config.tcp_options, | ||
1137 | TCPOPT_TIMESTAMP_ENABLE, pval); | ||
1138 | } else { | ||
1139 | OP_STATE(ha->ip_config.ipv6_tcp_options, | ||
1140 | IPV6_TCPOPT_TIMESTAMP_EN, pval); | ||
1141 | } | ||
1142 | len = sprintf(buf, "%s\n", pval); | ||
1143 | break; | ||
1144 | case ISCSI_NET_PARAM_CACHE_ID: | ||
1145 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | ||
1146 | len = sprintf(buf, "%d\n", | ||
1147 | ha->ip_config.ipv4_cache_id); | ||
1148 | else | ||
1149 | len = sprintf(buf, "%d\n", | ||
1150 | ha->ip_config.ipv6_cache_id); | ||
1151 | break; | ||
1152 | case ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN: | ||
1153 | OP_STATE(ha->ip_config.tcp_options, | ||
1154 | TCPOPT_DNS_SERVER_IP_EN, pval); | ||
1155 | |||
1156 | len = sprintf(buf, "%s\n", pval); | ||
1157 | break; | ||
1158 | case ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN: | ||
1159 | OP_STATE(ha->ip_config.tcp_options, | ||
1160 | TCPOPT_SLP_DA_INFO_EN, pval); | ||
1161 | |||
1162 | len = sprintf(buf, "%s\n", pval); | ||
1163 | break; | ||
1164 | case ISCSI_NET_PARAM_IPV4_TOS_EN: | ||
1165 | OP_STATE(ha->ip_config.ipv4_options, | ||
1166 | IPOPT_IPV4_TOS_EN, pval); | ||
1167 | |||
1168 | len = sprintf(buf, "%s\n", pval); | ||
1169 | break; | ||
1170 | case ISCSI_NET_PARAM_IPV4_TOS: | ||
1171 | len = sprintf(buf, "%d\n", ha->ip_config.ipv4_tos); | ||
1172 | break; | ||
1173 | case ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN: | ||
1174 | OP_STATE(ha->ip_config.ipv4_options, | ||
1175 | IPOPT_GRAT_ARP_EN, pval); | ||
1176 | |||
1177 | len = sprintf(buf, "%s\n", pval); | ||
1178 | break; | ||
1179 | case ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN: | ||
1180 | OP_STATE(ha->ip_config.ipv4_options, IPOPT_ALT_CID_EN, | ||
1181 | pval); | ||
1182 | |||
1183 | len = sprintf(buf, "%s\n", pval); | ||
1184 | break; | ||
1185 | case ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID: | ||
1186 | pval = (ha->ip_config.ipv4_alt_cid_len) ? | ||
1187 | (char *)ha->ip_config.ipv4_alt_cid : ""; | ||
1188 | |||
1189 | len = sprintf(buf, "%s\n", pval); | ||
1190 | break; | ||
1191 | case ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN: | ||
1192 | OP_STATE(ha->ip_config.ipv4_options, | ||
1193 | IPOPT_REQ_VID_EN, pval); | ||
1194 | |||
1195 | len = sprintf(buf, "%s\n", pval); | ||
1196 | break; | ||
1197 | case ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN: | ||
1198 | OP_STATE(ha->ip_config.ipv4_options, | ||
1199 | IPOPT_USE_VID_EN, pval); | ||
1200 | |||
1201 | len = sprintf(buf, "%s\n", pval); | ||
1202 | break; | ||
1203 | case ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID: | ||
1204 | pval = (ha->ip_config.ipv4_vid_len) ? | ||
1205 | (char *)ha->ip_config.ipv4_vid : ""; | ||
1206 | |||
1207 | len = sprintf(buf, "%s\n", pval); | ||
1208 | break; | ||
1209 | case ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN: | ||
1210 | OP_STATE(ha->ip_config.ipv4_options, | ||
1211 | IPOPT_LEARN_IQN_EN, pval); | ||
1212 | |||
1213 | len = sprintf(buf, "%s\n", pval); | ||
1214 | break; | ||
1215 | case ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE: | ||
1216 | OP_STATE(~ha->ip_config.ipv4_options, | ||
1217 | IPOPT_FRAGMENTATION_DISABLE, pval); | ||
1218 | |||
1219 | len = sprintf(buf, "%s\n", pval); | ||
1220 | break; | ||
1221 | case ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN: | ||
1222 | OP_STATE(ha->ip_config.ipv4_options, | ||
1223 | IPOPT_IN_FORWARD_EN, pval); | ||
1224 | |||
1225 | len = sprintf(buf, "%s\n", pval); | ||
1226 | break; | ||
1227 | case ISCSI_NET_PARAM_REDIRECT_EN: | ||
1228 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { | ||
1229 | OP_STATE(ha->ip_config.ipv4_options, | ||
1230 | IPOPT_ARP_REDIRECT_EN, pval); | ||
1231 | } else { | ||
1232 | OP_STATE(ha->ip_config.ipv6_options, | ||
1233 | IPV6_OPT_REDIRECT_EN, pval); | ||
1234 | } | ||
1235 | len = sprintf(buf, "%s\n", pval); | ||
1236 | break; | ||
1237 | case ISCSI_NET_PARAM_IPV4_TTL: | ||
1238 | len = sprintf(buf, "%d\n", ha->ip_config.ipv4_ttl); | ||
1239 | break; | ||
1240 | case ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN: | ||
1241 | OP_STATE(ha->ip_config.ipv6_options, | ||
1242 | IPV6_OPT_GRAT_NEIGHBOR_ADV_EN, pval); | ||
1243 | |||
1244 | len = sprintf(buf, "%s\n", pval); | ||
1245 | break; | ||
1246 | case ISCSI_NET_PARAM_IPV6_MLD_EN: | ||
1247 | OP_STATE(ha->ip_config.ipv6_addl_options, | ||
1248 | IPV6_ADDOPT_MLD_EN, pval); | ||
1249 | |||
1250 | len = sprintf(buf, "%s\n", pval); | ||
1251 | break; | ||
1252 | case ISCSI_NET_PARAM_IPV6_FLOW_LABEL: | ||
1253 | len = sprintf(buf, "%u\n", ha->ip_config.ipv6_flow_lbl); | ||
1254 | break; | ||
1255 | case ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS: | ||
957 | len = sprintf(buf, "%d\n", | 1256 | len = sprintf(buf, "%d\n", |
958 | (ha->ip_config.ipv4_vlan_tag & | 1257 | ha->ip_config.ipv6_traffic_class); |
959 | ISCSI_MAX_VLAN_ID)); | 1258 | break; |
960 | else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6) | 1259 | case ISCSI_NET_PARAM_IPV6_HOP_LIMIT: |
961 | len = sprintf(buf, "%d\n", | 1260 | len = sprintf(buf, "%d\n", |
962 | (ha->ip_config.ipv6_vlan_tag & | 1261 | ha->ip_config.ipv6_hop_limit); |
963 | ISCSI_MAX_VLAN_ID)); | 1262 | break; |
964 | break; | 1263 | case ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO: |
965 | case ISCSI_NET_PARAM_VLAN_PRIORITY: | ||
966 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | ||
967 | len = sprintf(buf, "%d\n", | 1264 | len = sprintf(buf, "%d\n", |
968 | ((ha->ip_config.ipv4_vlan_tag >> 13) & | 1265 | ha->ip_config.ipv6_nd_reach_time); |
969 | ISCSI_MAX_VLAN_PRIORITY)); | 1266 | break; |
970 | else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6) | 1267 | case ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME: |
971 | len = sprintf(buf, "%d\n", | 1268 | len = sprintf(buf, "%d\n", |
972 | ((ha->ip_config.ipv6_vlan_tag >> 13) & | 1269 | ha->ip_config.ipv6_nd_rexmit_timer); |
973 | ISCSI_MAX_VLAN_PRIORITY)); | 1270 | break; |
974 | break; | 1271 | case ISCSI_NET_PARAM_IPV6_ND_STALE_TMO: |
975 | case ISCSI_NET_PARAM_VLAN_ENABLED: | 1272 | len = sprintf(buf, "%d\n", |
976 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | 1273 | ha->ip_config.ipv6_nd_stale_timeout); |
977 | len = sprintf(buf, "%s\n", | 1274 | break; |
978 | (ha->ip_config.ipv4_options & | 1275 | case ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT: |
979 | IPOPT_VLAN_TAGGING_ENABLE) ? | 1276 | len = sprintf(buf, "%d\n", |
980 | "enabled" : "disabled"); | 1277 | ha->ip_config.ipv6_dup_addr_detect_count); |
981 | else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6) | 1278 | break; |
982 | len = sprintf(buf, "%s\n", | 1279 | case ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU: |
983 | (ha->ip_config.ipv6_options & | 1280 | len = sprintf(buf, "%d\n", |
984 | IPV6_OPT_VLAN_TAGGING_ENABLE) ? | 1281 | ha->ip_config.ipv6_gw_advrt_mtu); |
985 | "enabled" : "disabled"); | 1282 | break; |
986 | break; | 1283 | default: |
987 | case ISCSI_NET_PARAM_MTU: | 1284 | len = -ENOSYS; |
988 | len = sprintf(buf, "%d\n", ha->ip_config.eth_mtu_size); | 1285 | } |
989 | break; | 1286 | } else if (param_type == ISCSI_IFACE_PARAM) { |
990 | case ISCSI_NET_PARAM_PORT: | 1287 | switch (param) { |
991 | if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) | 1288 | case ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO: |
992 | len = sprintf(buf, "%d\n", ha->ip_config.ipv4_port); | 1289 | len = sprintf(buf, "%d\n", ha->ip_config.def_timeout); |
993 | else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6) | 1290 | break; |
994 | len = sprintf(buf, "%d\n", ha->ip_config.ipv6_port); | 1291 | case ISCSI_IFACE_PARAM_HDRDGST_EN: |
995 | break; | 1292 | OP_STATE(ha->ip_config.iscsi_options, |
996 | default: | 1293 | ISCSIOPTS_HEADER_DIGEST_EN, pval); |
997 | len = -ENOSYS; | 1294 | |
1295 | len = sprintf(buf, "%s\n", pval); | ||
1296 | break; | ||
1297 | case ISCSI_IFACE_PARAM_DATADGST_EN: | ||
1298 | OP_STATE(ha->ip_config.iscsi_options, | ||
1299 | ISCSIOPTS_DATA_DIGEST_EN, pval); | ||
1300 | |||
1301 | len = sprintf(buf, "%s\n", pval); | ||
1302 | break; | ||
1303 | case ISCSI_IFACE_PARAM_IMM_DATA_EN: | ||
1304 | OP_STATE(ha->ip_config.iscsi_options, | ||
1305 | ISCSIOPTS_IMMEDIATE_DATA_EN, pval); | ||
1306 | |||
1307 | len = sprintf(buf, "%s\n", pval); | ||
1308 | break; | ||
1309 | case ISCSI_IFACE_PARAM_INITIAL_R2T_EN: | ||
1310 | OP_STATE(ha->ip_config.iscsi_options, | ||
1311 | ISCSIOPTS_INITIAL_R2T_EN, pval); | ||
1312 | |||
1313 | len = sprintf(buf, "%s\n", pval); | ||
1314 | break; | ||
1315 | case ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN: | ||
1316 | OP_STATE(ha->ip_config.iscsi_options, | ||
1317 | ISCSIOPTS_DATA_SEQ_INORDER_EN, pval); | ||
1318 | |||
1319 | len = sprintf(buf, "%s\n", pval); | ||
1320 | break; | ||
1321 | case ISCSI_IFACE_PARAM_PDU_INORDER_EN: | ||
1322 | OP_STATE(ha->ip_config.iscsi_options, | ||
1323 | ISCSIOPTS_DATA_PDU_INORDER_EN, pval); | ||
1324 | |||
1325 | len = sprintf(buf, "%s\n", pval); | ||
1326 | break; | ||
1327 | case ISCSI_IFACE_PARAM_ERL: | ||
1328 | len = sprintf(buf, "%d\n", | ||
1329 | (ha->ip_config.iscsi_options & | ||
1330 | ISCSIOPTS_ERL)); | ||
1331 | break; | ||
1332 | case ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH: | ||
1333 | len = sprintf(buf, "%u\n", | ||
1334 | ha->ip_config.iscsi_max_pdu_size * | ||
1335 | BYTE_UNITS); | ||
1336 | break; | ||
1337 | case ISCSI_IFACE_PARAM_FIRST_BURST: | ||
1338 | len = sprintf(buf, "%u\n", | ||
1339 | ha->ip_config.iscsi_first_burst_len * | ||
1340 | BYTE_UNITS); | ||
1341 | break; | ||
1342 | case ISCSI_IFACE_PARAM_MAX_R2T: | ||
1343 | len = sprintf(buf, "%d\n", | ||
1344 | ha->ip_config.iscsi_max_outstnd_r2t); | ||
1345 | break; | ||
1346 | case ISCSI_IFACE_PARAM_MAX_BURST: | ||
1347 | len = sprintf(buf, "%u\n", | ||
1348 | ha->ip_config.iscsi_max_burst_len * | ||
1349 | BYTE_UNITS); | ||
1350 | break; | ||
1351 | case ISCSI_IFACE_PARAM_CHAP_AUTH_EN: | ||
1352 | OP_STATE(ha->ip_config.iscsi_options, | ||
1353 | ISCSIOPTS_CHAP_AUTH_EN, pval); | ||
1354 | |||
1355 | len = sprintf(buf, "%s\n", pval); | ||
1356 | break; | ||
1357 | case ISCSI_IFACE_PARAM_BIDI_CHAP_EN: | ||
1358 | OP_STATE(ha->ip_config.iscsi_options, | ||
1359 | ISCSIOPTS_BIDI_CHAP_EN, pval); | ||
1360 | |||
1361 | len = sprintf(buf, "%s\n", pval); | ||
1362 | break; | ||
1363 | case ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL: | ||
1364 | OP_STATE(ha->ip_config.iscsi_options, | ||
1365 | ISCSIOPTS_DISCOVERY_AUTH_EN, pval); | ||
1366 | |||
1367 | len = sprintf(buf, "%s\n", pval); | ||
1368 | break; | ||
1369 | case ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN: | ||
1370 | OP_STATE(ha->ip_config.iscsi_options, | ||
1371 | ISCSIOPTS_DISCOVERY_LOGOUT_EN, pval); | ||
1372 | |||
1373 | len = sprintf(buf, "%s\n", pval); | ||
1374 | break; | ||
1375 | case ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN: | ||
1376 | OP_STATE(ha->ip_config.iscsi_options, | ||
1377 | ISCSIOPTS_STRICT_LOGIN_COMP_EN, pval); | ||
1378 | |||
1379 | len = sprintf(buf, "%s\n", pval); | ||
1380 | break; | ||
1381 | case ISCSI_IFACE_PARAM_INITIATOR_NAME: | ||
1382 | len = sprintf(buf, "%s\n", ha->ip_config.iscsi_name); | ||
1383 | break; | ||
1384 | default: | ||
1385 | len = -ENOSYS; | ||
1386 | } | ||
998 | } | 1387 | } |
999 | 1388 | ||
1000 | return len; | 1389 | return len; |
@@ -1366,8 +1755,8 @@ static void qla4xxx_set_ipv6(struct scsi_qla_host *ha, | |||
1366 | cpu_to_le16( | 1755 | cpu_to_le16( |
1367 | IPV6_ADDOPT_NEIGHBOR_DISCOVERY_ADDR_ENABLE); | 1756 | IPV6_ADDOPT_NEIGHBOR_DISCOVERY_ADDR_ENABLE); |
1368 | else | 1757 | else |
1369 | ql4_printk(KERN_ERR, ha, "Invalid autocfg setting for " | 1758 | ql4_printk(KERN_ERR, ha, |
1370 | "IPv6 addr\n"); | 1759 | "Invalid autocfg setting for IPv6 addr\n"); |
1371 | break; | 1760 | break; |
1372 | case ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG: | 1761 | case ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG: |
1373 | /* Autocfg applies to even interface */ | 1762 | /* Autocfg applies to even interface */ |
@@ -1383,8 +1772,8 @@ static void qla4xxx_set_ipv6(struct scsi_qla_host *ha, | |||
1383 | init_fw_cb->ipv6_addtl_opts &= cpu_to_le16( | 1772 | init_fw_cb->ipv6_addtl_opts &= cpu_to_le16( |
1384 | ~IPV6_ADDOPT_AUTOCONFIG_LINK_LOCAL_ADDR); | 1773 | ~IPV6_ADDOPT_AUTOCONFIG_LINK_LOCAL_ADDR); |
1385 | else | 1774 | else |
1386 | ql4_printk(KERN_ERR, ha, "Invalid autocfg setting for " | 1775 | ql4_printk(KERN_ERR, ha, |
1387 | "IPv6 linklocal addr\n"); | 1776 | "Invalid autocfg setting for IPv6 linklocal addr\n"); |
1388 | break; | 1777 | break; |
1389 | case ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG: | 1778 | case ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG: |
1390 | /* Autocfg applies to even interface */ | 1779 | /* Autocfg applies to even interface */ |
@@ -1433,6 +1822,135 @@ static void qla4xxx_set_ipv6(struct scsi_qla_host *ha, | |||
1433 | init_fw_cb->ipv6_port = | 1822 | init_fw_cb->ipv6_port = |
1434 | cpu_to_le16(*(uint16_t *)iface_param->value); | 1823 | cpu_to_le16(*(uint16_t *)iface_param->value); |
1435 | break; | 1824 | break; |
1825 | case ISCSI_NET_PARAM_DELAYED_ACK_EN: | ||
1826 | if (iface_param->iface_num & 0x1) | ||
1827 | break; | ||
1828 | if (iface_param->value[0] == ISCSI_NET_PARAM_DISABLE) | ||
1829 | init_fw_cb->ipv6_tcp_opts |= | ||
1830 | cpu_to_le16(IPV6_TCPOPT_DELAYED_ACK_DISABLE); | ||
1831 | else | ||
1832 | init_fw_cb->ipv6_tcp_opts &= | ||
1833 | cpu_to_le16(~IPV6_TCPOPT_DELAYED_ACK_DISABLE); | ||
1834 | break; | ||
1835 | case ISCSI_NET_PARAM_TCP_NAGLE_DISABLE: | ||
1836 | if (iface_param->iface_num & 0x1) | ||
1837 | break; | ||
1838 | if (iface_param->value[0] == ISCSI_NET_PARAM_DISABLE) | ||
1839 | init_fw_cb->ipv6_tcp_opts |= | ||
1840 | cpu_to_le16(IPV6_TCPOPT_NAGLE_ALGO_DISABLE); | ||
1841 | else | ||
1842 | init_fw_cb->ipv6_tcp_opts &= | ||
1843 | cpu_to_le16(~IPV6_TCPOPT_NAGLE_ALGO_DISABLE); | ||
1844 | break; | ||
1845 | case ISCSI_NET_PARAM_TCP_WSF_DISABLE: | ||
1846 | if (iface_param->iface_num & 0x1) | ||
1847 | break; | ||
1848 | if (iface_param->value[0] == ISCSI_NET_PARAM_DISABLE) | ||
1849 | init_fw_cb->ipv6_tcp_opts |= | ||
1850 | cpu_to_le16(IPV6_TCPOPT_WINDOW_SCALE_DISABLE); | ||
1851 | else | ||
1852 | init_fw_cb->ipv6_tcp_opts &= | ||
1853 | cpu_to_le16(~IPV6_TCPOPT_WINDOW_SCALE_DISABLE); | ||
1854 | break; | ||
1855 | case ISCSI_NET_PARAM_TCP_WSF: | ||
1856 | if (iface_param->iface_num & 0x1) | ||
1857 | break; | ||
1858 | init_fw_cb->ipv6_tcp_wsf = iface_param->value[0]; | ||
1859 | break; | ||
1860 | case ISCSI_NET_PARAM_TCP_TIMER_SCALE: | ||
1861 | if (iface_param->iface_num & 0x1) | ||
1862 | break; | ||
1863 | init_fw_cb->ipv6_tcp_opts &= | ||
1864 | cpu_to_le16(~IPV6_TCPOPT_TIMER_SCALE); | ||
1865 | init_fw_cb->ipv6_tcp_opts |= | ||
1866 | cpu_to_le16((iface_param->value[0] << 1) & | ||
1867 | IPV6_TCPOPT_TIMER_SCALE); | ||
1868 | break; | ||
1869 | case ISCSI_NET_PARAM_TCP_TIMESTAMP_EN: | ||
1870 | if (iface_param->iface_num & 0x1) | ||
1871 | break; | ||
1872 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
1873 | init_fw_cb->ipv6_tcp_opts |= | ||
1874 | cpu_to_le16(IPV6_TCPOPT_TIMESTAMP_EN); | ||
1875 | else | ||
1876 | init_fw_cb->ipv6_tcp_opts &= | ||
1877 | cpu_to_le16(~IPV6_TCPOPT_TIMESTAMP_EN); | ||
1878 | break; | ||
1879 | case ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN: | ||
1880 | if (iface_param->iface_num & 0x1) | ||
1881 | break; | ||
1882 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
1883 | init_fw_cb->ipv6_opts |= | ||
1884 | cpu_to_le16(IPV6_OPT_GRAT_NEIGHBOR_ADV_EN); | ||
1885 | else | ||
1886 | init_fw_cb->ipv6_opts &= | ||
1887 | cpu_to_le16(~IPV6_OPT_GRAT_NEIGHBOR_ADV_EN); | ||
1888 | break; | ||
1889 | case ISCSI_NET_PARAM_REDIRECT_EN: | ||
1890 | if (iface_param->iface_num & 0x1) | ||
1891 | break; | ||
1892 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
1893 | init_fw_cb->ipv6_opts |= | ||
1894 | cpu_to_le16(IPV6_OPT_REDIRECT_EN); | ||
1895 | else | ||
1896 | init_fw_cb->ipv6_opts &= | ||
1897 | cpu_to_le16(~IPV6_OPT_REDIRECT_EN); | ||
1898 | break; | ||
1899 | case ISCSI_NET_PARAM_IPV6_MLD_EN: | ||
1900 | if (iface_param->iface_num & 0x1) | ||
1901 | break; | ||
1902 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
1903 | init_fw_cb->ipv6_addtl_opts |= | ||
1904 | cpu_to_le16(IPV6_ADDOPT_MLD_EN); | ||
1905 | else | ||
1906 | init_fw_cb->ipv6_addtl_opts &= | ||
1907 | cpu_to_le16(~IPV6_ADDOPT_MLD_EN); | ||
1908 | break; | ||
1909 | case ISCSI_NET_PARAM_IPV6_FLOW_LABEL: | ||
1910 | if (iface_param->iface_num & 0x1) | ||
1911 | break; | ||
1912 | init_fw_cb->ipv6_flow_lbl = | ||
1913 | cpu_to_le16(*(uint16_t *)iface_param->value); | ||
1914 | break; | ||
1915 | case ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS: | ||
1916 | if (iface_param->iface_num & 0x1) | ||
1917 | break; | ||
1918 | init_fw_cb->ipv6_traffic_class = iface_param->value[0]; | ||
1919 | break; | ||
1920 | case ISCSI_NET_PARAM_IPV6_HOP_LIMIT: | ||
1921 | if (iface_param->iface_num & 0x1) | ||
1922 | break; | ||
1923 | init_fw_cb->ipv6_hop_limit = iface_param->value[0]; | ||
1924 | break; | ||
1925 | case ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO: | ||
1926 | if (iface_param->iface_num & 0x1) | ||
1927 | break; | ||
1928 | init_fw_cb->ipv6_nd_reach_time = | ||
1929 | cpu_to_le32(*(uint32_t *)iface_param->value); | ||
1930 | break; | ||
1931 | case ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME: | ||
1932 | if (iface_param->iface_num & 0x1) | ||
1933 | break; | ||
1934 | init_fw_cb->ipv6_nd_rexmit_timer = | ||
1935 | cpu_to_le32(*(uint32_t *)iface_param->value); | ||
1936 | break; | ||
1937 | case ISCSI_NET_PARAM_IPV6_ND_STALE_TMO: | ||
1938 | if (iface_param->iface_num & 0x1) | ||
1939 | break; | ||
1940 | init_fw_cb->ipv6_nd_stale_timeout = | ||
1941 | cpu_to_le32(*(uint32_t *)iface_param->value); | ||
1942 | break; | ||
1943 | case ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT: | ||
1944 | if (iface_param->iface_num & 0x1) | ||
1945 | break; | ||
1946 | init_fw_cb->ipv6_dup_addr_detect_count = iface_param->value[0]; | ||
1947 | break; | ||
1948 | case ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU: | ||
1949 | if (iface_param->iface_num & 0x1) | ||
1950 | break; | ||
1951 | init_fw_cb->ipv6_gw_advrt_mtu = | ||
1952 | cpu_to_le32(*(uint32_t *)iface_param->value); | ||
1953 | break; | ||
1436 | default: | 1954 | default: |
1437 | ql4_printk(KERN_ERR, ha, "Unknown IPv6 param = %d\n", | 1955 | ql4_printk(KERN_ERR, ha, "Unknown IPv6 param = %d\n", |
1438 | iface_param->param); | 1956 | iface_param->param); |
@@ -1501,6 +2019,195 @@ static void qla4xxx_set_ipv4(struct scsi_qla_host *ha, | |||
1501 | init_fw_cb->ipv4_port = | 2019 | init_fw_cb->ipv4_port = |
1502 | cpu_to_le16(*(uint16_t *)iface_param->value); | 2020 | cpu_to_le16(*(uint16_t *)iface_param->value); |
1503 | break; | 2021 | break; |
2022 | case ISCSI_NET_PARAM_DELAYED_ACK_EN: | ||
2023 | if (iface_param->iface_num & 0x1) | ||
2024 | break; | ||
2025 | if (iface_param->value[0] == ISCSI_NET_PARAM_DISABLE) | ||
2026 | init_fw_cb->ipv4_tcp_opts |= | ||
2027 | cpu_to_le16(TCPOPT_DELAYED_ACK_DISABLE); | ||
2028 | else | ||
2029 | init_fw_cb->ipv4_tcp_opts &= | ||
2030 | cpu_to_le16(~TCPOPT_DELAYED_ACK_DISABLE); | ||
2031 | break; | ||
2032 | case ISCSI_NET_PARAM_TCP_NAGLE_DISABLE: | ||
2033 | if (iface_param->iface_num & 0x1) | ||
2034 | break; | ||
2035 | if (iface_param->value[0] == ISCSI_NET_PARAM_DISABLE) | ||
2036 | init_fw_cb->ipv4_tcp_opts |= | ||
2037 | cpu_to_le16(TCPOPT_NAGLE_ALGO_DISABLE); | ||
2038 | else | ||
2039 | init_fw_cb->ipv4_tcp_opts &= | ||
2040 | cpu_to_le16(~TCPOPT_NAGLE_ALGO_DISABLE); | ||
2041 | break; | ||
2042 | case ISCSI_NET_PARAM_TCP_WSF_DISABLE: | ||
2043 | if (iface_param->iface_num & 0x1) | ||
2044 | break; | ||
2045 | if (iface_param->value[0] == ISCSI_NET_PARAM_DISABLE) | ||
2046 | init_fw_cb->ipv4_tcp_opts |= | ||
2047 | cpu_to_le16(TCPOPT_WINDOW_SCALE_DISABLE); | ||
2048 | else | ||
2049 | init_fw_cb->ipv4_tcp_opts &= | ||
2050 | cpu_to_le16(~TCPOPT_WINDOW_SCALE_DISABLE); | ||
2051 | break; | ||
2052 | case ISCSI_NET_PARAM_TCP_WSF: | ||
2053 | if (iface_param->iface_num & 0x1) | ||
2054 | break; | ||
2055 | init_fw_cb->ipv4_tcp_wsf = iface_param->value[0]; | ||
2056 | break; | ||
2057 | case ISCSI_NET_PARAM_TCP_TIMER_SCALE: | ||
2058 | if (iface_param->iface_num & 0x1) | ||
2059 | break; | ||
2060 | init_fw_cb->ipv4_tcp_opts &= cpu_to_le16(~TCPOPT_TIMER_SCALE); | ||
2061 | init_fw_cb->ipv4_tcp_opts |= | ||
2062 | cpu_to_le16((iface_param->value[0] << 1) & | ||
2063 | TCPOPT_TIMER_SCALE); | ||
2064 | break; | ||
2065 | case ISCSI_NET_PARAM_TCP_TIMESTAMP_EN: | ||
2066 | if (iface_param->iface_num & 0x1) | ||
2067 | break; | ||
2068 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2069 | init_fw_cb->ipv4_tcp_opts |= | ||
2070 | cpu_to_le16(TCPOPT_TIMESTAMP_ENABLE); | ||
2071 | else | ||
2072 | init_fw_cb->ipv4_tcp_opts &= | ||
2073 | cpu_to_le16(~TCPOPT_TIMESTAMP_ENABLE); | ||
2074 | break; | ||
2075 | case ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN: | ||
2076 | if (iface_param->iface_num & 0x1) | ||
2077 | break; | ||
2078 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2079 | init_fw_cb->ipv4_tcp_opts |= | ||
2080 | cpu_to_le16(TCPOPT_DNS_SERVER_IP_EN); | ||
2081 | else | ||
2082 | init_fw_cb->ipv4_tcp_opts &= | ||
2083 | cpu_to_le16(~TCPOPT_DNS_SERVER_IP_EN); | ||
2084 | break; | ||
2085 | case ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN: | ||
2086 | if (iface_param->iface_num & 0x1) | ||
2087 | break; | ||
2088 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2089 | init_fw_cb->ipv4_tcp_opts |= | ||
2090 | cpu_to_le16(TCPOPT_SLP_DA_INFO_EN); | ||
2091 | else | ||
2092 | init_fw_cb->ipv4_tcp_opts &= | ||
2093 | cpu_to_le16(~TCPOPT_SLP_DA_INFO_EN); | ||
2094 | break; | ||
2095 | case ISCSI_NET_PARAM_IPV4_TOS_EN: | ||
2096 | if (iface_param->iface_num & 0x1) | ||
2097 | break; | ||
2098 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2099 | init_fw_cb->ipv4_ip_opts |= | ||
2100 | cpu_to_le16(IPOPT_IPV4_TOS_EN); | ||
2101 | else | ||
2102 | init_fw_cb->ipv4_ip_opts &= | ||
2103 | cpu_to_le16(~IPOPT_IPV4_TOS_EN); | ||
2104 | break; | ||
2105 | case ISCSI_NET_PARAM_IPV4_TOS: | ||
2106 | if (iface_param->iface_num & 0x1) | ||
2107 | break; | ||
2108 | init_fw_cb->ipv4_tos = iface_param->value[0]; | ||
2109 | break; | ||
2110 | case ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN: | ||
2111 | if (iface_param->iface_num & 0x1) | ||
2112 | break; | ||
2113 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2114 | init_fw_cb->ipv4_ip_opts |= | ||
2115 | cpu_to_le16(IPOPT_GRAT_ARP_EN); | ||
2116 | else | ||
2117 | init_fw_cb->ipv4_ip_opts &= | ||
2118 | cpu_to_le16(~IPOPT_GRAT_ARP_EN); | ||
2119 | break; | ||
2120 | case ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN: | ||
2121 | if (iface_param->iface_num & 0x1) | ||
2122 | break; | ||
2123 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2124 | init_fw_cb->ipv4_ip_opts |= | ||
2125 | cpu_to_le16(IPOPT_ALT_CID_EN); | ||
2126 | else | ||
2127 | init_fw_cb->ipv4_ip_opts &= | ||
2128 | cpu_to_le16(~IPOPT_ALT_CID_EN); | ||
2129 | break; | ||
2130 | case ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID: | ||
2131 | if (iface_param->iface_num & 0x1) | ||
2132 | break; | ||
2133 | memcpy(init_fw_cb->ipv4_dhcp_alt_cid, iface_param->value, | ||
2134 | (sizeof(init_fw_cb->ipv4_dhcp_alt_cid) - 1)); | ||
2135 | init_fw_cb->ipv4_dhcp_alt_cid_len = | ||
2136 | strlen(init_fw_cb->ipv4_dhcp_alt_cid); | ||
2137 | break; | ||
2138 | case ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN: | ||
2139 | if (iface_param->iface_num & 0x1) | ||
2140 | break; | ||
2141 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2142 | init_fw_cb->ipv4_ip_opts |= | ||
2143 | cpu_to_le16(IPOPT_REQ_VID_EN); | ||
2144 | else | ||
2145 | init_fw_cb->ipv4_ip_opts &= | ||
2146 | cpu_to_le16(~IPOPT_REQ_VID_EN); | ||
2147 | break; | ||
2148 | case ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN: | ||
2149 | if (iface_param->iface_num & 0x1) | ||
2150 | break; | ||
2151 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2152 | init_fw_cb->ipv4_ip_opts |= | ||
2153 | cpu_to_le16(IPOPT_USE_VID_EN); | ||
2154 | else | ||
2155 | init_fw_cb->ipv4_ip_opts &= | ||
2156 | cpu_to_le16(~IPOPT_USE_VID_EN); | ||
2157 | break; | ||
2158 | case ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID: | ||
2159 | if (iface_param->iface_num & 0x1) | ||
2160 | break; | ||
2161 | memcpy(init_fw_cb->ipv4_dhcp_vid, iface_param->value, | ||
2162 | (sizeof(init_fw_cb->ipv4_dhcp_vid) - 1)); | ||
2163 | init_fw_cb->ipv4_dhcp_vid_len = | ||
2164 | strlen(init_fw_cb->ipv4_dhcp_vid); | ||
2165 | break; | ||
2166 | case ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN: | ||
2167 | if (iface_param->iface_num & 0x1) | ||
2168 | break; | ||
2169 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2170 | init_fw_cb->ipv4_ip_opts |= | ||
2171 | cpu_to_le16(IPOPT_LEARN_IQN_EN); | ||
2172 | else | ||
2173 | init_fw_cb->ipv4_ip_opts &= | ||
2174 | cpu_to_le16(~IPOPT_LEARN_IQN_EN); | ||
2175 | break; | ||
2176 | case ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE: | ||
2177 | if (iface_param->iface_num & 0x1) | ||
2178 | break; | ||
2179 | if (iface_param->value[0] == ISCSI_NET_PARAM_DISABLE) | ||
2180 | init_fw_cb->ipv4_ip_opts |= | ||
2181 | cpu_to_le16(IPOPT_FRAGMENTATION_DISABLE); | ||
2182 | else | ||
2183 | init_fw_cb->ipv4_ip_opts &= | ||
2184 | cpu_to_le16(~IPOPT_FRAGMENTATION_DISABLE); | ||
2185 | break; | ||
2186 | case ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN: | ||
2187 | if (iface_param->iface_num & 0x1) | ||
2188 | break; | ||
2189 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2190 | init_fw_cb->ipv4_ip_opts |= | ||
2191 | cpu_to_le16(IPOPT_IN_FORWARD_EN); | ||
2192 | else | ||
2193 | init_fw_cb->ipv4_ip_opts &= | ||
2194 | cpu_to_le16(~IPOPT_IN_FORWARD_EN); | ||
2195 | break; | ||
2196 | case ISCSI_NET_PARAM_REDIRECT_EN: | ||
2197 | if (iface_param->iface_num & 0x1) | ||
2198 | break; | ||
2199 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2200 | init_fw_cb->ipv4_ip_opts |= | ||
2201 | cpu_to_le16(IPOPT_ARP_REDIRECT_EN); | ||
2202 | else | ||
2203 | init_fw_cb->ipv4_ip_opts &= | ||
2204 | cpu_to_le16(~IPOPT_ARP_REDIRECT_EN); | ||
2205 | break; | ||
2206 | case ISCSI_NET_PARAM_IPV4_TTL: | ||
2207 | if (iface_param->iface_num & 0x1) | ||
2208 | break; | ||
2209 | init_fw_cb->ipv4_ttl = iface_param->value[0]; | ||
2210 | break; | ||
1504 | default: | 2211 | default: |
1505 | ql4_printk(KERN_ERR, ha, "Unknown IPv4 param = %d\n", | 2212 | ql4_printk(KERN_ERR, ha, "Unknown IPv4 param = %d\n", |
1506 | iface_param->param); | 2213 | iface_param->param); |
@@ -1508,6 +2215,168 @@ static void qla4xxx_set_ipv4(struct scsi_qla_host *ha, | |||
1508 | } | 2215 | } |
1509 | } | 2216 | } |
1510 | 2217 | ||
2218 | static void qla4xxx_set_iscsi_param(struct scsi_qla_host *ha, | ||
2219 | struct iscsi_iface_param_info *iface_param, | ||
2220 | struct addr_ctrl_blk *init_fw_cb) | ||
2221 | { | ||
2222 | switch (iface_param->param) { | ||
2223 | case ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO: | ||
2224 | if (iface_param->iface_num & 0x1) | ||
2225 | break; | ||
2226 | init_fw_cb->def_timeout = | ||
2227 | cpu_to_le16(*(uint16_t *)iface_param->value); | ||
2228 | break; | ||
2229 | case ISCSI_IFACE_PARAM_HDRDGST_EN: | ||
2230 | if (iface_param->iface_num & 0x1) | ||
2231 | break; | ||
2232 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2233 | init_fw_cb->iscsi_opts |= | ||
2234 | cpu_to_le16(ISCSIOPTS_HEADER_DIGEST_EN); | ||
2235 | else | ||
2236 | init_fw_cb->iscsi_opts &= | ||
2237 | cpu_to_le16(~ISCSIOPTS_HEADER_DIGEST_EN); | ||
2238 | break; | ||
2239 | case ISCSI_IFACE_PARAM_DATADGST_EN: | ||
2240 | if (iface_param->iface_num & 0x1) | ||
2241 | break; | ||
2242 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2243 | init_fw_cb->iscsi_opts |= | ||
2244 | cpu_to_le16(ISCSIOPTS_DATA_DIGEST_EN); | ||
2245 | else | ||
2246 | init_fw_cb->iscsi_opts &= | ||
2247 | cpu_to_le16(~ISCSIOPTS_DATA_DIGEST_EN); | ||
2248 | break; | ||
2249 | case ISCSI_IFACE_PARAM_IMM_DATA_EN: | ||
2250 | if (iface_param->iface_num & 0x1) | ||
2251 | break; | ||
2252 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2253 | init_fw_cb->iscsi_opts |= | ||
2254 | cpu_to_le16(ISCSIOPTS_IMMEDIATE_DATA_EN); | ||
2255 | else | ||
2256 | init_fw_cb->iscsi_opts &= | ||
2257 | cpu_to_le16(~ISCSIOPTS_IMMEDIATE_DATA_EN); | ||
2258 | break; | ||
2259 | case ISCSI_IFACE_PARAM_INITIAL_R2T_EN: | ||
2260 | if (iface_param->iface_num & 0x1) | ||
2261 | break; | ||
2262 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2263 | init_fw_cb->iscsi_opts |= | ||
2264 | cpu_to_le16(ISCSIOPTS_INITIAL_R2T_EN); | ||
2265 | else | ||
2266 | init_fw_cb->iscsi_opts &= | ||
2267 | cpu_to_le16(~ISCSIOPTS_INITIAL_R2T_EN); | ||
2268 | break; | ||
2269 | case ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN: | ||
2270 | if (iface_param->iface_num & 0x1) | ||
2271 | break; | ||
2272 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2273 | init_fw_cb->iscsi_opts |= | ||
2274 | cpu_to_le16(ISCSIOPTS_DATA_SEQ_INORDER_EN); | ||
2275 | else | ||
2276 | init_fw_cb->iscsi_opts &= | ||
2277 | cpu_to_le16(~ISCSIOPTS_DATA_SEQ_INORDER_EN); | ||
2278 | break; | ||
2279 | case ISCSI_IFACE_PARAM_PDU_INORDER_EN: | ||
2280 | if (iface_param->iface_num & 0x1) | ||
2281 | break; | ||
2282 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2283 | init_fw_cb->iscsi_opts |= | ||
2284 | cpu_to_le16(ISCSIOPTS_DATA_PDU_INORDER_EN); | ||
2285 | else | ||
2286 | init_fw_cb->iscsi_opts &= | ||
2287 | cpu_to_le16(~ISCSIOPTS_DATA_PDU_INORDER_EN); | ||
2288 | break; | ||
2289 | case ISCSI_IFACE_PARAM_ERL: | ||
2290 | if (iface_param->iface_num & 0x1) | ||
2291 | break; | ||
2292 | init_fw_cb->iscsi_opts &= cpu_to_le16(~ISCSIOPTS_ERL); | ||
2293 | init_fw_cb->iscsi_opts |= cpu_to_le16(iface_param->value[0] & | ||
2294 | ISCSIOPTS_ERL); | ||
2295 | break; | ||
2296 | case ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH: | ||
2297 | if (iface_param->iface_num & 0x1) | ||
2298 | break; | ||
2299 | init_fw_cb->iscsi_max_pdu_size = | ||
2300 | cpu_to_le32(*(uint32_t *)iface_param->value) / | ||
2301 | BYTE_UNITS; | ||
2302 | break; | ||
2303 | case ISCSI_IFACE_PARAM_FIRST_BURST: | ||
2304 | if (iface_param->iface_num & 0x1) | ||
2305 | break; | ||
2306 | init_fw_cb->iscsi_fburst_len = | ||
2307 | cpu_to_le32(*(uint32_t *)iface_param->value) / | ||
2308 | BYTE_UNITS; | ||
2309 | break; | ||
2310 | case ISCSI_IFACE_PARAM_MAX_R2T: | ||
2311 | if (iface_param->iface_num & 0x1) | ||
2312 | break; | ||
2313 | init_fw_cb->iscsi_max_outstnd_r2t = | ||
2314 | cpu_to_le16(*(uint16_t *)iface_param->value); | ||
2315 | break; | ||
2316 | case ISCSI_IFACE_PARAM_MAX_BURST: | ||
2317 | if (iface_param->iface_num & 0x1) | ||
2318 | break; | ||
2319 | init_fw_cb->iscsi_max_burst_len = | ||
2320 | cpu_to_le32(*(uint32_t *)iface_param->value) / | ||
2321 | BYTE_UNITS; | ||
2322 | break; | ||
2323 | case ISCSI_IFACE_PARAM_CHAP_AUTH_EN: | ||
2324 | if (iface_param->iface_num & 0x1) | ||
2325 | break; | ||
2326 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2327 | init_fw_cb->iscsi_opts |= | ||
2328 | cpu_to_le16(ISCSIOPTS_CHAP_AUTH_EN); | ||
2329 | else | ||
2330 | init_fw_cb->iscsi_opts &= | ||
2331 | cpu_to_le16(~ISCSIOPTS_CHAP_AUTH_EN); | ||
2332 | break; | ||
2333 | case ISCSI_IFACE_PARAM_BIDI_CHAP_EN: | ||
2334 | if (iface_param->iface_num & 0x1) | ||
2335 | break; | ||
2336 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2337 | init_fw_cb->iscsi_opts |= | ||
2338 | cpu_to_le16(ISCSIOPTS_BIDI_CHAP_EN); | ||
2339 | else | ||
2340 | init_fw_cb->iscsi_opts &= | ||
2341 | cpu_to_le16(~ISCSIOPTS_BIDI_CHAP_EN); | ||
2342 | break; | ||
2343 | case ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL: | ||
2344 | if (iface_param->iface_num & 0x1) | ||
2345 | break; | ||
2346 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2347 | init_fw_cb->iscsi_opts |= | ||
2348 | cpu_to_le16(ISCSIOPTS_DISCOVERY_AUTH_EN); | ||
2349 | else | ||
2350 | init_fw_cb->iscsi_opts &= | ||
2351 | cpu_to_le16(~ISCSIOPTS_DISCOVERY_AUTH_EN); | ||
2352 | break; | ||
2353 | case ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN: | ||
2354 | if (iface_param->iface_num & 0x1) | ||
2355 | break; | ||
2356 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2357 | init_fw_cb->iscsi_opts |= | ||
2358 | cpu_to_le16(ISCSIOPTS_DISCOVERY_LOGOUT_EN); | ||
2359 | else | ||
2360 | init_fw_cb->iscsi_opts &= | ||
2361 | cpu_to_le16(~ISCSIOPTS_DISCOVERY_LOGOUT_EN); | ||
2362 | break; | ||
2363 | case ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN: | ||
2364 | if (iface_param->iface_num & 0x1) | ||
2365 | break; | ||
2366 | if (iface_param->value[0] == ISCSI_NET_PARAM_ENABLE) | ||
2367 | init_fw_cb->iscsi_opts |= | ||
2368 | cpu_to_le16(ISCSIOPTS_STRICT_LOGIN_COMP_EN); | ||
2369 | else | ||
2370 | init_fw_cb->iscsi_opts &= | ||
2371 | cpu_to_le16(~ISCSIOPTS_STRICT_LOGIN_COMP_EN); | ||
2372 | break; | ||
2373 | default: | ||
2374 | ql4_printk(KERN_ERR, ha, "Unknown iscsi param = %d\n", | ||
2375 | iface_param->param); | ||
2376 | break; | ||
2377 | } | ||
2378 | } | ||
2379 | |||
1511 | static void | 2380 | static void |
1512 | qla4xxx_initcb_to_acb(struct addr_ctrl_blk *init_fw_cb) | 2381 | qla4xxx_initcb_to_acb(struct addr_ctrl_blk *init_fw_cb) |
1513 | { | 2382 | { |
@@ -1565,40 +2434,47 @@ qla4xxx_iface_set_param(struct Scsi_Host *shost, void *data, uint32_t len) | |||
1565 | nla_for_each_attr(attr, data, len, rem) { | 2434 | nla_for_each_attr(attr, data, len, rem) { |
1566 | iface_param = nla_data(attr); | 2435 | iface_param = nla_data(attr); |
1567 | 2436 | ||
1568 | if (iface_param->param_type != ISCSI_NET_PARAM) | 2437 | if (iface_param->param_type == ISCSI_NET_PARAM) { |
1569 | continue; | 2438 | switch (iface_param->iface_type) { |
1570 | 2439 | case ISCSI_IFACE_TYPE_IPV4: | |
1571 | switch (iface_param->iface_type) { | 2440 | switch (iface_param->iface_num) { |
1572 | case ISCSI_IFACE_TYPE_IPV4: | 2441 | case 0: |
1573 | switch (iface_param->iface_num) { | 2442 | qla4xxx_set_ipv4(ha, iface_param, |
1574 | case 0: | 2443 | init_fw_cb); |
1575 | qla4xxx_set_ipv4(ha, iface_param, init_fw_cb); | 2444 | break; |
1576 | break; | 2445 | default: |
1577 | default: | ||
1578 | /* Cannot have more than one IPv4 interface */ | 2446 | /* Cannot have more than one IPv4 interface */ |
1579 | ql4_printk(KERN_ERR, ha, "Invalid IPv4 iface " | 2447 | ql4_printk(KERN_ERR, ha, |
1580 | "number = %d\n", | 2448 | "Invalid IPv4 iface number = %d\n", |
1581 | iface_param->iface_num); | 2449 | iface_param->iface_num); |
2450 | break; | ||
2451 | } | ||
1582 | break; | 2452 | break; |
1583 | } | 2453 | case ISCSI_IFACE_TYPE_IPV6: |
1584 | break; | 2454 | switch (iface_param->iface_num) { |
1585 | case ISCSI_IFACE_TYPE_IPV6: | 2455 | case 0: |
1586 | switch (iface_param->iface_num) { | 2456 | case 1: |
1587 | case 0: | 2457 | qla4xxx_set_ipv6(ha, iface_param, |
1588 | case 1: | 2458 | init_fw_cb); |
1589 | qla4xxx_set_ipv6(ha, iface_param, init_fw_cb); | 2459 | break; |
2460 | default: | ||
2461 | /* Cannot have more than two IPv6 interface */ | ||
2462 | ql4_printk(KERN_ERR, ha, | ||
2463 | "Invalid IPv6 iface number = %d\n", | ||
2464 | iface_param->iface_num); | ||
2465 | break; | ||
2466 | } | ||
1590 | break; | 2467 | break; |
1591 | default: | 2468 | default: |
1592 | /* Cannot have more than two IPv6 interface */ | 2469 | ql4_printk(KERN_ERR, ha, |
1593 | ql4_printk(KERN_ERR, ha, "Invalid IPv6 iface " | 2470 | "Invalid iface type\n"); |
1594 | "number = %d\n", | ||
1595 | iface_param->iface_num); | ||
1596 | break; | 2471 | break; |
1597 | } | 2472 | } |
1598 | break; | 2473 | } else if (iface_param->param_type == ISCSI_IFACE_PARAM) { |
1599 | default: | 2474 | qla4xxx_set_iscsi_param(ha, iface_param, |
1600 | ql4_printk(KERN_ERR, ha, "Invalid iface type\n"); | 2475 | init_fw_cb); |
1601 | break; | 2476 | } else { |
2477 | continue; | ||
1602 | } | 2478 | } |
1603 | } | 2479 | } |
1604 | 2480 | ||