diff options
author | Rajesh Borundia <rajesh.borundia@qlogic.com> | 2010-08-25 00:03:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-25 17:15:27 -0400 |
commit | e9a47700cb35bc84d4954f762a193b150722612e (patch) | |
tree | 4706a47822aa7c95a3344d3c8d62f6a6c8a6d7d4 | |
parent | e569aa78ba01f7f66e016a4d57310fd041524d17 (diff) |
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>
-rw-r--r-- | drivers/net/qlcnic/qlcnic_ctx.c | 1 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 26 |
2 files changed, 15 insertions, 12 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c index 315705b22be..bd4b06b2d86 100644 --- a/drivers/net/qlcnic/qlcnic_ctx.c +++ b/drivers/net/qlcnic/qlcnic_ctx.c | |||
@@ -1160,6 +1160,7 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter, | |||
1160 | case QLCNIC_DEL_VLAN: | 1160 | case QLCNIC_DEL_VLAN: |
1161 | arg1 |= (BIT_3 | BIT_5); | 1161 | arg1 |= (BIT_3 | BIT_5); |
1162 | arg1 &= ~(0x0ffff << 16); | 1162 | arg1 &= ~(0x0ffff << 16); |
1163 | break; | ||
1163 | default: | 1164 | default: |
1164 | return err; | 1165 | return err; |
1165 | } | 1166 | } |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 46b9137ca89..5d93b464681 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, | |||
3301 | return QL_STATUS_INVALID_PARAM; | 3301 | return QL_STATUS_INVALID_PARAM; |
3302 | break; | 3302 | break; |
3303 | case QLCNIC_DEL_VLAN: | 3303 | case QLCNIC_DEL_VLAN: |
3304 | if (!IS_VALID_VLAN(esw_cfg[i].vlan_id)) | ||
3305 | return QL_STATUS_INVALID_PARAM; | ||
3306 | if (!esw_cfg[i].op_type) | 3304 | if (!esw_cfg[i].op_type) |
3307 | return QL_STATUS_INVALID_PARAM; | 3305 | return QL_STATUS_INVALID_PARAM; |
3308 | break; | 3306 | break; |
@@ -3338,21 +3336,25 @@ qlcnic_sysfs_write_esw_config(struct file *file, struct kobject *kobj, | |||
3338 | if (adapter->op_mode == QLCNIC_MGMT_FUNC) | 3336 | if (adapter->op_mode == QLCNIC_MGMT_FUNC) |
3339 | if (qlcnic_config_switch_port(adapter, &esw_cfg[i])) | 3337 | if (qlcnic_config_switch_port(adapter, &esw_cfg[i])) |
3340 | return QL_STATUS_INVALID_PARAM; | 3338 | return QL_STATUS_INVALID_PARAM; |
3341 | if (adapter->ahw.pci_func == esw_cfg[i].pci_func) | 3339 | |
3342 | op_mode = esw_cfg[i].op_mode; | 3340 | if (adapter->ahw.pci_func != esw_cfg[i].pci_func) |
3343 | qlcnic_get_eswitch_port_config(adapter, &esw_cfg[i]); | 3341 | continue; |
3344 | esw_cfg[i].op_mode = op_mode; | 3342 | |
3345 | esw_cfg[i].pci_func = adapter->ahw.pci_func; | 3343 | op_mode = esw_cfg[i].op_mode; |
3346 | switch (esw_cfg[i].op_mode) { | 3344 | qlcnic_get_eswitch_port_config(adapter, &esw_cfg[i]); |
3347 | case QLCNIC_PORT_DEFAULTS: | 3345 | esw_cfg[i].op_mode = op_mode; |
3348 | qlcnic_set_eswitch_port_features(adapter, | 3346 | esw_cfg[i].pci_func = adapter->ahw.pci_func; |
3349 | &esw_cfg[i]); | 3347 | |
3350 | break; | 3348 | switch (esw_cfg[i].op_mode) { |
3349 | case QLCNIC_PORT_DEFAULTS: | ||
3350 | qlcnic_set_eswitch_port_features(adapter, &esw_cfg[i]); | ||
3351 | break; | ||
3351 | } | 3352 | } |
3352 | } | 3353 | } |
3353 | 3354 | ||
3354 | if (adapter->op_mode != QLCNIC_MGMT_FUNC) | 3355 | if (adapter->op_mode != QLCNIC_MGMT_FUNC) |
3355 | goto out; | 3356 | goto out; |
3357 | |||
3356 | for (i = 0; i < count; i++) { | 3358 | for (i = 0; i < count; i++) { |
3357 | pci_func = esw_cfg[i].pci_func; | 3359 | pci_func = esw_cfg[i].pci_func; |
3358 | npar = &adapter->npars[pci_func]; | 3360 | npar = &adapter->npars[pci_func]; |