diff options
author | Rajesh Borundia <rajesh.borundia@qlogic.com> | 2010-08-31 13:17:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-01 13:41:56 -0400 |
commit | 7373373d100e5aebe751af0b2609a9a01dad5ac1 (patch) | |
tree | 3816ae48d6f3f33beeb20f2c66b2b4ab333dc1fa /drivers/net/qlcnic/qlcnic_ctx.c | |
parent | dcb50afff747d15fc2ffff762c08c325e4c229e5 (diff) |
qlcnic: fix mac override capability
o Rename mac_learning to mac_override
o Added check in set_mac to return error if mac override is disabled.
o Disabling mac_override only supported for Non priviledged functions.
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_ctx.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_ctx.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c index bd4b06b2d86d..95a821e0b66f 100644 --- a/drivers/net/qlcnic/qlcnic_ctx.c +++ b/drivers/net/qlcnic/qlcnic_ctx.c | |||
@@ -1100,10 +1100,11 @@ __qlcnic_get_eswitch_port_config(struct qlcnic_adapter *adapter, | |||
1100 | *arg1 = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET); | 1100 | *arg1 = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET); |
1101 | *arg2 = QLCRD32(adapter, QLCNIC_ARG2_CRB_OFFSET); | 1101 | *arg2 = QLCRD32(adapter, QLCNIC_ARG2_CRB_OFFSET); |
1102 | dev_info(&adapter->pdev->dev, | 1102 | dev_info(&adapter->pdev->dev, |
1103 | "eSwitch port config for pci func%d\n", pci_func); | 1103 | "eSwitch port config for pci func %d\n", pci_func); |
1104 | } else { | 1104 | } else { |
1105 | dev_err(&adapter->pdev->dev, | 1105 | dev_err(&adapter->pdev->dev, |
1106 | "Failed to get eswitch port config%d\n", pci_func); | 1106 | "Failed to get eswitch port config for pci func %d\n", |
1107 | pci_func); | ||
1107 | } | 1108 | } |
1108 | return err; | 1109 | return err; |
1109 | } | 1110 | } |
@@ -1142,7 +1143,7 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter, | |||
1142 | arg1 &= ~BIT_4; | 1143 | arg1 &= ~BIT_4; |
1143 | if (!(esw_cfg->promisc_mode)) | 1144 | if (!(esw_cfg->promisc_mode)) |
1144 | arg1 &= ~BIT_6; | 1145 | arg1 &= ~BIT_6; |
1145 | if (!(esw_cfg->mac_learning)) | 1146 | if (!(esw_cfg->mac_override)) |
1146 | arg1 &= ~BIT_7; | 1147 | arg1 &= ~BIT_7; |
1147 | if (!(esw_cfg->mac_anti_spoof)) | 1148 | if (!(esw_cfg->mac_anti_spoof)) |
1148 | arg2 &= ~BIT_0; | 1149 | arg2 &= ~BIT_0; |
@@ -1175,10 +1176,10 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter, | |||
1175 | 1176 | ||
1176 | if (err != QLCNIC_RCODE_SUCCESS) { | 1177 | if (err != QLCNIC_RCODE_SUCCESS) { |
1177 | dev_err(&adapter->pdev->dev, | 1178 | dev_err(&adapter->pdev->dev, |
1178 | "Failed to configure eswitch port%d\n", pci_func); | 1179 | "Failed to configure eswitch pci func %d\n", pci_func); |
1179 | } else { | 1180 | } else { |
1180 | dev_info(&adapter->pdev->dev, | 1181 | dev_info(&adapter->pdev->dev, |
1181 | "Configured eSwitch for port %d\n", pci_func); | 1182 | "Configured eSwitch for pci func %d\n", pci_func); |
1182 | } | 1183 | } |
1183 | 1184 | ||
1184 | return err; | 1185 | return err; |
@@ -1202,7 +1203,7 @@ qlcnic_get_eswitch_port_config(struct qlcnic_adapter *adapter, | |||
1202 | esw_cfg->discard_tagged = !!(arg1 & BIT_4); | 1203 | esw_cfg->discard_tagged = !!(arg1 & BIT_4); |
1203 | esw_cfg->host_vlan_tag = !!(arg1 & BIT_5); | 1204 | esw_cfg->host_vlan_tag = !!(arg1 & BIT_5); |
1204 | esw_cfg->promisc_mode = !!(arg1 & BIT_6); | 1205 | esw_cfg->promisc_mode = !!(arg1 & BIT_6); |
1205 | esw_cfg->mac_learning = !!(arg1 & BIT_7); | 1206 | esw_cfg->mac_override = !!(arg1 & BIT_7); |
1206 | esw_cfg->vlan_id = LSW(arg1 >> 16); | 1207 | esw_cfg->vlan_id = LSW(arg1 >> 16); |
1207 | esw_cfg->mac_anti_spoof = (arg2 & 0x1); | 1208 | esw_cfg->mac_anti_spoof = (arg2 & 0x1); |
1208 | esw_cfg->offload_flags = ((arg2 >> 1) & 0x7); | 1209 | esw_cfg->offload_flags = ((arg2 >> 1) & 0x7); |