diff options
author | Rajesh Borundia <rajesh.borundia@qlogic.com> | 2010-08-25 08:03:02 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-26 01:15:27 +0400 |
commit | e9a47700cb35bc84d4954f762a193b150722612e (patch) | |
tree | 4706a47822aa7c95a3344d3c8d62f6a6c8a6d7d4 /drivers/net/qlcnic/qlcnic_main.c | |
parent | e569aa78ba01f7f66e016a4d57310fd041524d17 (diff) | |
download | linux-e9a47700cb35bc84d4954f762a193b150722612e.tar.xz |
qlcnic: eswitch config fixes
o remove validation before deleting vlan id
o Add missing 'break' while deleting vlan id.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_main.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 46b9137ca893..5d93b464681a 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c @@ -3301,8 +3301,6 @@ validate_esw_config(struct qlcnic_adapter *adapter, return QL_STATUS_INVALID_PARAM; break; case QLCNIC_DEL_VLAN: - if (!IS_VALID_VLAN(esw_cfg[i].vlan_id)) - return QL_STATUS_INVALID_PARAM; if (!esw_cfg[i].op_type) return QL_STATUS_INVALID_PARAM; break; @@ -3338,21 +3336,25 @@ qlcnic_sysfs_write_esw_config(struct file *file, struct kobject *kobj, if (adapter->op_mode == QLCNIC_MGMT_FUNC) if (qlcnic_config_switch_port(adapter, &esw_cfg[i])) return QL_STATUS_INVALID_PARAM; - if (adapter->ahw.pci_func == esw_cfg[i].pci_func) - op_mode = esw_cfg[i].op_mode; - qlcnic_get_eswitch_port_config(adapter, &esw_cfg[i]); - esw_cfg[i].op_mode = op_mode; - esw_cfg[i].pci_func = adapter->ahw.pci_func; - switch (esw_cfg[i].op_mode) { - case QLCNIC_PORT_DEFAULTS: - qlcnic_set_eswitch_port_features(adapter, - &esw_cfg[i]); - break; + + if (adapter->ahw.pci_func != esw_cfg[i].pci_func) + continue; + + op_mode = esw_cfg[i].op_mode; + qlcnic_get_eswitch_port_config(adapter, &esw_cfg[i]); + esw_cfg[i].op_mode = op_mode; + esw_cfg[i].pci_func = adapter->ahw.pci_func; + + switch (esw_cfg[i].op_mode) { + case QLCNIC_PORT_DEFAULTS: + qlcnic_set_eswitch_port_features(adapter, &esw_cfg[i]); + break; } } if (adapter->op_mode != QLCNIC_MGMT_FUNC) goto out; + for (i = 0; i < count; i++) { pci_func = esw_cfg[i].pci_func; npar = &adapter->npars[pci_func]; |