diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-07-26 06:19:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-28 01:39:30 -0400 |
commit | 0891b0e08937aaec2c4734acb94c5ff8042313bb (patch) | |
tree | 4d02c8d55b2f51708d873c914a778935c18c3e9c /drivers/net/forcedeth.c | |
parent | b852b720877e6b8e12b95a7cb4e00ea351b8cbfc (diff) |
forcedeth: fix vlans
For some reason, when rxaccel is disabled, NV_RX3_VLAN_TAG_PRESENT is
still set and some pseudorandom vids appear. So check for
NETIF_F_HW_VLAN_RX as well. Also set correctly hw_features and set vlan
mode on probe.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r-- | drivers/net/forcedeth.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index e64cd9ceac3f..e55df308a3af 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -2764,7 +2764,14 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit) | |||
2764 | prefetch(skb->data); | 2764 | prefetch(skb->data); |
2765 | 2765 | ||
2766 | vlanflags = le32_to_cpu(np->get_rx.ex->buflow); | 2766 | vlanflags = le32_to_cpu(np->get_rx.ex->buflow); |
2767 | if (vlanflags & NV_RX3_VLAN_TAG_PRESENT) { | 2767 | |
2768 | /* | ||
2769 | * There's need to check for NETIF_F_HW_VLAN_RX here. | ||
2770 | * Even if vlan rx accel is disabled, | ||
2771 | * NV_RX3_VLAN_TAG_PRESENT is pseudo randomly set. | ||
2772 | */ | ||
2773 | if (dev->features & NETIF_F_HW_VLAN_RX && | ||
2774 | vlanflags & NV_RX3_VLAN_TAG_PRESENT) { | ||
2768 | u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK; | 2775 | u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK; |
2769 | 2776 | ||
2770 | __vlan_hwaccel_put_tag(skb, vid); | 2777 | __vlan_hwaccel_put_tag(skb, vid); |
@@ -5331,15 +5338,16 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5331 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; | 5338 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; |
5332 | dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_SG | | 5339 | dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_SG | |
5333 | NETIF_F_TSO | NETIF_F_RXCSUM; | 5340 | NETIF_F_TSO | NETIF_F_RXCSUM; |
5334 | dev->features |= dev->hw_features; | ||
5335 | } | 5341 | } |
5336 | 5342 | ||
5337 | np->vlanctl_bits = 0; | 5343 | np->vlanctl_bits = 0; |
5338 | if (id->driver_data & DEV_HAS_VLAN) { | 5344 | if (id->driver_data & DEV_HAS_VLAN) { |
5339 | np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE; | 5345 | np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE; |
5340 | dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX; | 5346 | dev->hw_features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX; |
5341 | } | 5347 | } |
5342 | 5348 | ||
5349 | dev->features |= dev->hw_features; | ||
5350 | |||
5343 | np->pause_flags = NV_PAUSEFRAME_RX_CAPABLE | NV_PAUSEFRAME_RX_REQ | NV_PAUSEFRAME_AUTONEG; | 5351 | np->pause_flags = NV_PAUSEFRAME_RX_CAPABLE | NV_PAUSEFRAME_RX_REQ | NV_PAUSEFRAME_AUTONEG; |
5344 | if ((id->driver_data & DEV_HAS_PAUSEFRAME_TX_V1) || | 5352 | if ((id->driver_data & DEV_HAS_PAUSEFRAME_TX_V1) || |
5345 | (id->driver_data & DEV_HAS_PAUSEFRAME_TX_V2) || | 5353 | (id->driver_data & DEV_HAS_PAUSEFRAME_TX_V2) || |
@@ -5607,6 +5615,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5607 | goto out_error; | 5615 | goto out_error; |
5608 | } | 5616 | } |
5609 | 5617 | ||
5618 | nv_vlan_mode(dev, dev->features); | ||
5619 | |||
5610 | netif_carrier_off(dev); | 5620 | netif_carrier_off(dev); |
5611 | 5621 | ||
5612 | dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n", | 5622 | dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n", |