diff options
-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 315705b22be2..bd4b06b2d86d 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 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, | |||
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]; |