From: Padmanabh Ratnakar Date: Sat, 20 Oct 2012 06:02:40 +0000 (+0000) Subject: be2net: Fix configuring VLAN for VF for Lancer X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a85e998681624ac85d423f34e833f95dffdd2a3c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git be2net: Fix configuring VLAN for VF for Lancer Allow adding VLANs for Lancer VF. VLAN ID 0 should not be added to list of VLANs sent to FW. Signed-off-by: Padmanabh Ratnakar Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 7a483fdd974b..fa895bcc66a3 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -879,11 +879,15 @@ static int be_vlan_add_vid(struct net_device *netdev, u16 vid) struct be_adapter *adapter = netdev_priv(netdev); int status = 0; - if (!be_physfn(adapter)) { + if (!lancer_chip(adapter) && !be_physfn(adapter)) { status = -EINVAL; goto ret; } + /* Packets with VID 0 are always received by Lancer by default */ + if (lancer_chip(adapter) && vid == 0) + goto ret; + adapter->vlan_tag[vid] = 1; if (adapter->vlans_added <= (adapter->max_vlans + 1)) status = be_vid_config(adapter); @@ -901,11 +905,15 @@ static int be_vlan_rem_vid(struct net_device *netdev, u16 vid) struct be_adapter *adapter = netdev_priv(netdev); int status = 0; - if (!be_physfn(adapter)) { + if (!lancer_chip(adapter) && !be_physfn(adapter)) { status = -EINVAL; goto ret; } + /* Packets with VID 0 are always received by Lancer by default */ + if (lancer_chip(adapter) && vid == 0) + goto ret; + adapter->vlan_tag[vid] = 0; if (adapter->vlans_added <= adapter->max_vlans) status = be_vid_config(adapter);