Commit 2ada7fc5 authored by Vikas Chaudhary's avatar Vikas Chaudhary Committed by James Bottomley

[SCSI] qla4xxx: added support to update initiator iscsi port

Signed-off-by: default avatarVikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent fcb5124e
...@@ -344,6 +344,8 @@ struct ipaddress_config { ...@@ -344,6 +344,8 @@ struct ipaddress_config {
struct in6_addr ipv6_addr1; struct in6_addr ipv6_addr1;
struct in6_addr ipv6_default_router_addr; struct in6_addr ipv6_default_router_addr;
uint16_t eth_mtu_size; uint16_t eth_mtu_size;
uint16_t ipv4_port;
uint16_t ipv6_port;
}; };
#define QL4_CHAP_MAX_NAME_LEN 256 #define QL4_CHAP_MAX_NAME_LEN 256
......
...@@ -335,6 +335,7 @@ qla4xxx_update_local_ip(struct scsi_qla_host *ha, ...@@ -335,6 +335,7 @@ qla4xxx_update_local_ip(struct scsi_qla_host *ha,
le16_to_cpu(init_fw_cb->ipv4_addr_state); le16_to_cpu(init_fw_cb->ipv4_addr_state);
ha->ip_config.eth_mtu_size = ha->ip_config.eth_mtu_size =
le16_to_cpu(init_fw_cb->eth_mtu_size); le16_to_cpu(init_fw_cb->eth_mtu_size);
ha->ip_config.ipv4_port = le16_to_cpu(init_fw_cb->ipv4_port);
if (ha->acb_version == ACB_SUPPORTED) { if (ha->acb_version == ACB_SUPPORTED) {
ha->ip_config.ipv6_options = le16_to_cpu(init_fw_cb->ipv6_opts); ha->ip_config.ipv6_options = le16_to_cpu(init_fw_cb->ipv6_opts);
...@@ -384,6 +385,7 @@ qla4xxx_update_local_ip(struct scsi_qla_host *ha, ...@@ -384,6 +385,7 @@ qla4xxx_update_local_ip(struct scsi_qla_host *ha,
sizeof(init_fw_cb->ipv6_dflt_rtr_addr))); sizeof(init_fw_cb->ipv6_dflt_rtr_addr)));
ha->ip_config.ipv6_vlan_tag = ha->ip_config.ipv6_vlan_tag =
be16_to_cpu(init_fw_cb->ipv6_vlan_tag); be16_to_cpu(init_fw_cb->ipv6_vlan_tag);
ha->ip_config.ipv6_port = le16_to_cpu(init_fw_cb->ipv6_port);
} }
} }
......
...@@ -231,6 +231,7 @@ static mode_t ql4_attr_is_visible(int param_type, int param) ...@@ -231,6 +231,7 @@ static mode_t ql4_attr_is_visible(int param_type, int param)
case ISCSI_NET_PARAM_VLAN_PRIORITY: case ISCSI_NET_PARAM_VLAN_PRIORITY:
case ISCSI_NET_PARAM_VLAN_ENABLED: case ISCSI_NET_PARAM_VLAN_ENABLED:
case ISCSI_NET_PARAM_MTU: case ISCSI_NET_PARAM_MTU:
case ISCSI_NET_PARAM_PORT:
return S_IRUGO; return S_IRUGO;
default: default:
return 0; return 0;
...@@ -339,6 +340,12 @@ static int qla4xxx_get_iface_param(struct iscsi_iface *iface, ...@@ -339,6 +340,12 @@ static int qla4xxx_get_iface_param(struct iscsi_iface *iface,
case ISCSI_NET_PARAM_MTU: case ISCSI_NET_PARAM_MTU:
len = sprintf(buf, "%d\n", ha->ip_config.eth_mtu_size); len = sprintf(buf, "%d\n", ha->ip_config.eth_mtu_size);
break; break;
case ISCSI_NET_PARAM_PORT:
if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4)
len = sprintf(buf, "%d\n", ha->ip_config.ipv4_port);
else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6)
len = sprintf(buf, "%d\n", ha->ip_config.ipv6_port);
break;
default: default:
len = -ENOSYS; len = -ENOSYS;
} }
...@@ -726,6 +733,14 @@ static void qla4xxx_set_ipv6(struct scsi_qla_host *ha, ...@@ -726,6 +733,14 @@ static void qla4xxx_set_ipv6(struct scsi_qla_host *ha,
init_fw_cb->eth_mtu_size = init_fw_cb->eth_mtu_size =
cpu_to_le16(*(uint16_t *)iface_param->value); cpu_to_le16(*(uint16_t *)iface_param->value);
break; break;
case ISCSI_NET_PARAM_PORT:
/* Autocfg applies to even interface */
if (iface_param->iface_num & 0x1)
break;
init_fw_cb->ipv6_port =
cpu_to_le16(*(uint16_t *)iface_param->value);
break;
default: default:
ql4_printk(KERN_ERR, ha, "Unknown IPv6 param = %d\n", ql4_printk(KERN_ERR, ha, "Unknown IPv6 param = %d\n",
iface_param->param); iface_param->param);
...@@ -790,6 +805,10 @@ static void qla4xxx_set_ipv4(struct scsi_qla_host *ha, ...@@ -790,6 +805,10 @@ static void qla4xxx_set_ipv4(struct scsi_qla_host *ha,
init_fw_cb->eth_mtu_size = init_fw_cb->eth_mtu_size =
cpu_to_le16(*(uint16_t *)iface_param->value); cpu_to_le16(*(uint16_t *)iface_param->value);
break; break;
case ISCSI_NET_PARAM_PORT:
init_fw_cb->ipv4_port =
cpu_to_le16(*(uint16_t *)iface_param->value);
break;
default: default:
ql4_printk(KERN_ERR, ha, "Unknown IPv4 param = %d\n", ql4_printk(KERN_ERR, ha, "Unknown IPv4 param = %d\n",
iface_param->param); iface_param->param);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment