Commit 72dccb01 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51def0be
...@@ -8023,6 +8023,13 @@ static const struct net_device_ops bnx2_netdev_ops = { ...@@ -8023,6 +8023,13 @@ static const struct net_device_ops bnx2_netdev_ops = {
#endif #endif
}; };
static void inline vlan_features_add(struct net_device *dev, unsigned long flags)
{
#ifdef BCM_VLAN
dev->vlan_features |= flags;
#endif
}
static int __devinit static int __devinit
bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
...@@ -8064,16 +8071,20 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8064,16 +8071,20 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
memcpy(dev->perm_addr, bp->mac_addr, 6); memcpy(dev->perm_addr, bp->mac_addr, 6);
dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
if (CHIP_NUM(bp) == CHIP_NUM_5709) vlan_features_add(dev, NETIF_F_IP_CSUM | NETIF_F_SG);
if (CHIP_NUM(bp) == CHIP_NUM_5709) {
dev->features |= NETIF_F_IPV6_CSUM; dev->features |= NETIF_F_IPV6_CSUM;
vlan_features_add(dev, NETIF_F_IPV6_CSUM);
}
#ifdef BCM_VLAN #ifdef BCM_VLAN
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
#endif #endif
dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN; dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN;
if (CHIP_NUM(bp) == CHIP_NUM_5709) vlan_features_add(dev, NETIF_F_TSO | NETIF_F_TSO_ECN);
if (CHIP_NUM(bp) == CHIP_NUM_5709) {
dev->features |= NETIF_F_TSO6; dev->features |= NETIF_F_TSO6;
vlan_features_add(dev, NETIF_F_TSO6);
}
if ((rc = register_netdev(dev))) { if ((rc = register_netdev(dev))) {
dev_err(&pdev->dev, "Cannot register net device\n"); dev_err(&pdev->dev, "Cannot register net device\n");
goto error; goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment