diff options
author | Rajesh Borundia <rajesh.borundia@qlogic.com> | 2010-10-07 19:46:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-08 16:59:10 -0400 |
commit | ee07c1a70117fe93cf71686d481791c2498f80d2 (patch) | |
tree | f275d7b88a23a48257b0941ca69b9809a16cc9b7 /drivers/net/qlcnic | |
parent | 6336acd5522b150e7695cb3b42221999b352baa5 (diff) |
qlcnic: fix promiscous mode for VF
o Allow promiscous mode setting for VF's depending upon the configuration.
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')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 1 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_hw.c | 3 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 9 |
3 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 46a54b3ccea6..4025e203e8ae 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -920,6 +920,7 @@ struct qlcnic_ipaddr { | |||
920 | #define QLCNIC_TAGGING_ENABLED 0x100 | 920 | #define QLCNIC_TAGGING_ENABLED 0x100 |
921 | #define QLCNIC_MACSPOOF 0x200 | 921 | #define QLCNIC_MACSPOOF 0x200 |
922 | #define QLCNIC_MAC_OVERRIDE_DISABLED 0x400 | 922 | #define QLCNIC_MAC_OVERRIDE_DISABLED 0x400 |
923 | #define QLCNIC_PROMISC_DISABLED 0x800 | ||
923 | #define QLCNIC_IS_MSI_FAMILY(adapter) \ | 924 | #define QLCNIC_IS_MSI_FAMILY(adapter) \ |
924 | ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) | 925 | ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) |
925 | 926 | ||
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c index 7f1f9b4ca0ff..53e805316f4a 100644 --- a/drivers/net/qlcnic/qlcnic_hw.c +++ b/drivers/net/qlcnic/qlcnic_hw.c | |||
@@ -442,7 +442,8 @@ void qlcnic_set_multi(struct net_device *netdev) | |||
442 | qlcnic_nic_add_mac(adapter, bcast_addr); | 442 | qlcnic_nic_add_mac(adapter, bcast_addr); |
443 | 443 | ||
444 | if (netdev->flags & IFF_PROMISC) { | 444 | if (netdev->flags & IFF_PROMISC) { |
445 | mode = VPORT_MISS_MODE_ACCEPT_ALL; | 445 | if (!(adapter->flags & QLCNIC_PROMISC_DISABLED)) |
446 | mode = VPORT_MISS_MODE_ACCEPT_ALL; | ||
446 | goto send_fw_cmd; | 447 | goto send_fw_cmd; |
447 | } | 448 | } |
448 | 449 | ||
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index e3c1b80e00b1..4aada0b8ceb1 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -718,8 +718,8 @@ static void | |||
718 | qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter, | 718 | qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter, |
719 | struct qlcnic_esw_func_cfg *esw_cfg) | 719 | struct qlcnic_esw_func_cfg *esw_cfg) |
720 | { | 720 | { |
721 | adapter->flags &= ~QLCNIC_MACSPOOF; | 721 | adapter->flags &= ~(QLCNIC_MACSPOOF | QLCNIC_MAC_OVERRIDE_DISABLED | |
722 | adapter->flags &= ~QLCNIC_MAC_OVERRIDE_DISABLED; | 722 | QLCNIC_PROMISC_DISABLED); |
723 | 723 | ||
724 | if (esw_cfg->mac_anti_spoof) | 724 | if (esw_cfg->mac_anti_spoof) |
725 | adapter->flags |= QLCNIC_MACSPOOF; | 725 | adapter->flags |= QLCNIC_MACSPOOF; |
@@ -727,6 +727,9 @@ qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter, | |||
727 | if (!esw_cfg->mac_override) | 727 | if (!esw_cfg->mac_override) |
728 | adapter->flags |= QLCNIC_MAC_OVERRIDE_DISABLED; | 728 | adapter->flags |= QLCNIC_MAC_OVERRIDE_DISABLED; |
729 | 729 | ||
730 | if (!esw_cfg->promisc_mode) | ||
731 | adapter->flags |= QLCNIC_PROMISC_DISABLED; | ||
732 | |||
730 | qlcnic_set_netdev_features(adapter, esw_cfg); | 733 | qlcnic_set_netdev_features(adapter, esw_cfg); |
731 | } | 734 | } |
732 | 735 | ||
@@ -845,6 +848,7 @@ qlcnic_set_default_offload_settings(struct qlcnic_adapter *adapter) | |||
845 | esw_cfg.pci_func = i; | 848 | esw_cfg.pci_func = i; |
846 | esw_cfg.offload_flags = BIT_0; | 849 | esw_cfg.offload_flags = BIT_0; |
847 | esw_cfg.mac_override = BIT_0; | 850 | esw_cfg.mac_override = BIT_0; |
851 | esw_cfg.promisc_mode = BIT_0; | ||
848 | if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO) | 852 | if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO) |
849 | esw_cfg.offload_flags |= (BIT_1 | BIT_2); | 853 | esw_cfg.offload_flags |= (BIT_1 | BIT_2); |
850 | if (qlcnic_config_switch_port(adapter, &esw_cfg)) | 854 | if (qlcnic_config_switch_port(adapter, &esw_cfg)) |
@@ -3571,6 +3575,7 @@ validate_esw_config(struct qlcnic_adapter *adapter, | |||
3571 | QLCNIC_NON_PRIV_FUNC) { | 3575 | QLCNIC_NON_PRIV_FUNC) { |
3572 | esw_cfg[i].mac_anti_spoof = 0; | 3576 | esw_cfg[i].mac_anti_spoof = 0; |
3573 | esw_cfg[i].mac_override = 1; | 3577 | esw_cfg[i].mac_override = 1; |
3578 | esw_cfg[i].promisc_mode = 1; | ||
3574 | } | 3579 | } |
3575 | break; | 3580 | break; |
3576 | case QLCNIC_ADD_VLAN: | 3581 | case QLCNIC_ADD_VLAN: |