diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-07-22 22:01:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-26 22:25:49 -0400 |
commit | 72dccb01e8632aa5ffe58070003d0fa19d007116 (patch) | |
tree | a147d7247f5ddddafe4277afb0e00f9d98f2c67b /drivers/net/bnx2.c | |
parent | 51def0bea92629dff02ff1de40603eb90c609c55 (diff) |
bnx2: Update vlan_features
[PATCH net-next-2.6] bnx2: Update vlan_features
In order to get full use of some advanced features of BNX2, we now need to
fill dev->vlan_features.
Patch successfully tested with vlan devices built on top of bonding.
(bond0 : one bnx2 slave, one tg3 slave (not yet vlan_features enabled)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index b70cc99962fc..cec1b1746ae0 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -8023,6 +8023,13 @@ static const struct net_device_ops bnx2_netdev_ops = { | |||
8023 | #endif | 8023 | #endif |
8024 | }; | 8024 | }; |
8025 | 8025 | ||
8026 | static void inline vlan_features_add(struct net_device *dev, unsigned long flags) | ||
8027 | { | ||
8028 | #ifdef BCM_VLAN | ||
8029 | dev->vlan_features |= flags; | ||
8030 | #endif | ||
8031 | } | ||
8032 | |||
8026 | static int __devinit | 8033 | static int __devinit |
8027 | bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | 8034 | bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
8028 | { | 8035 | { |
@@ -8064,16 +8071,20 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
8064 | memcpy(dev->perm_addr, bp->mac_addr, 6); | 8071 | memcpy(dev->perm_addr, bp->mac_addr, 6); |
8065 | 8072 | ||
8066 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; | 8073 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; |
8067 | if (CHIP_NUM(bp) == CHIP_NUM_5709) | 8074 | vlan_features_add(dev, NETIF_F_IP_CSUM | NETIF_F_SG); |
8075 | if (CHIP_NUM(bp) == CHIP_NUM_5709) { | ||
8068 | dev->features |= NETIF_F_IPV6_CSUM; | 8076 | dev->features |= NETIF_F_IPV6_CSUM; |
8069 | 8077 | vlan_features_add(dev, NETIF_F_IPV6_CSUM); | |
8078 | } | ||
8070 | #ifdef BCM_VLAN | 8079 | #ifdef BCM_VLAN |
8071 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 8080 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
8072 | #endif | 8081 | #endif |
8073 | dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN; | 8082 | dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN; |
8074 | if (CHIP_NUM(bp) == CHIP_NUM_5709) | 8083 | vlan_features_add(dev, NETIF_F_TSO | NETIF_F_TSO_ECN); |
8084 | if (CHIP_NUM(bp) == CHIP_NUM_5709) { | ||
8075 | dev->features |= NETIF_F_TSO6; | 8085 | dev->features |= NETIF_F_TSO6; |
8076 | 8086 | vlan_features_add(dev, NETIF_F_TSO6); | |
8087 | } | ||
8077 | if ((rc = register_netdev(dev))) { | 8088 | if ((rc = register_netdev(dev))) { |
8078 | dev_err(&pdev->dev, "Cannot register net device\n"); | 8089 | dev_err(&pdev->dev, "Cannot register net device\n"); |
8079 | goto error; | 8090 | goto error; |