aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_main.c
diff options
context:
space:
mode:
authorRajesh Borundia <rajesh.borundia@qlogic.com>2010-08-31 13:17:48 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-01 13:41:55 -0400
commit7613c87b2d805acf7c882935d47aa84d1947656f (patch)
tree3da9bfa25441bd4a509f5b0b62efbfc6dbaa9368 /drivers/net/qlcnic/qlcnic_main.c
parent174240a8efc441f01f2909ee167c0c15099c0212 (diff)
qlcnic: fix mac anti spoof policy
o Allow enabling/disabling mac anti spoof policy only for Non privilege 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_main.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index e0c6811610ab..9a3ebb8a8203 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -741,9 +741,9 @@ qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter,
741 struct qlcnic_esw_func_cfg *esw_cfg) 741 struct qlcnic_esw_func_cfg *esw_cfg)
742{ 742{
743 adapter->flags &= ~QLCNIC_MACSPOOF; 743 adapter->flags &= ~QLCNIC_MACSPOOF;
744 if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC) 744
745 if (esw_cfg->mac_anti_spoof) 745 if (esw_cfg->mac_anti_spoof)
746 adapter->flags |= QLCNIC_MACSPOOF; 746 adapter->flags |= QLCNIC_MACSPOOF;
747 747
748 qlcnic_set_netdev_features(adapter, esw_cfg); 748 qlcnic_set_netdev_features(adapter, esw_cfg);
749} 749}
@@ -3377,8 +3377,12 @@ static int
3377validate_esw_config(struct qlcnic_adapter *adapter, 3377validate_esw_config(struct qlcnic_adapter *adapter,
3378 struct qlcnic_esw_func_cfg *esw_cfg, int count) 3378 struct qlcnic_esw_func_cfg *esw_cfg, int count)
3379{ 3379{
3380 u32 op_mode;
3380 u8 pci_func; 3381 u8 pci_func;
3381 int i; 3382 int i;
3383
3384 op_mode = readl(adapter->ahw.pci_base0 + QLCNIC_DRV_OP_MODE);
3385
3382 for (i = 0; i < count; i++) { 3386 for (i = 0; i < count; i++) {
3383 pci_func = esw_cfg[i].pci_func; 3387 pci_func = esw_cfg[i].pci_func;
3384 if (pci_func >= QLCNIC_MAX_PCI_FUNC) 3388 if (pci_func >= QLCNIC_MAX_PCI_FUNC)
@@ -3390,6 +3394,9 @@ validate_esw_config(struct qlcnic_adapter *adapter,
3390 3394
3391 switch (esw_cfg[i].op_mode) { 3395 switch (esw_cfg[i].op_mode) {
3392 case QLCNIC_PORT_DEFAULTS: 3396 case QLCNIC_PORT_DEFAULTS:
3397 if (QLC_DEV_GET_DRV(op_mode, pci_func) !=
3398 QLCNIC_NON_PRIV_FUNC)
3399 esw_cfg[i].mac_anti_spoof = 0;
3393 break; 3400 break;
3394 case QLCNIC_ADD_VLAN: 3401 case QLCNIC_ADD_VLAN:
3395 if (!IS_VALID_VLAN(esw_cfg[i].vlan_id)) 3402 if (!IS_VALID_VLAN(esw_cfg[i].vlan_id))