Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279150
b: refs/heads/master
c: 80817cb
h: refs/heads/master
v: v3
  • Loading branch information
Ajit Khaparde authored and David S. Miller committed Dec 30, 2011
1 parent aad9243 commit 773d9eb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50612537e9ab29693122fab20fc1eed235054ffe
refs/heads/master: 80817cbf5ac13da76f3ee2b9259f26c09b385e84
35 changes: 24 additions & 11 deletions trunk/drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,32 +817,45 @@ static int be_vid_config(struct be_adapter *adapter, bool vf, u32 vf_num)
static int be_vlan_add_vid(struct net_device *netdev, u16 vid)
{
struct be_adapter *adapter = netdev_priv(netdev);
int status = 0;

adapter->vlans_added++;
if (!be_physfn(adapter))
return 0;
if (!be_physfn(adapter)) {
status = -EINVAL;
goto ret;
}

adapter->vlan_tag[vid] = 1;
if (adapter->vlans_added <= (adapter->max_vlans + 1))
be_vid_config(adapter, false, 0);
status = be_vid_config(adapter, false, 0);

return 0;
if (!status)
adapter->vlans_added++;
else
adapter->vlan_tag[vid] = 0;
ret:
return status;
}

static int be_vlan_rem_vid(struct net_device *netdev, u16 vid)
{
struct be_adapter *adapter = netdev_priv(netdev);
int status = 0;

adapter->vlans_added--;

if (!be_physfn(adapter))
return 0;
if (!be_physfn(adapter)) {
status = -EINVAL;
goto ret;
}

adapter->vlan_tag[vid] = 0;
if (adapter->vlans_added <= adapter->max_vlans)
be_vid_config(adapter, false, 0);
status = be_vid_config(adapter, false, 0);

return 0;
if (!status)
adapter->vlans_added--;
else
adapter->vlan_tag[vid] = 1;
ret:
return status;
}

static void be_set_rx_mode(struct net_device *netdev)
Expand Down

0 comments on commit 773d9eb

Please sign in to comment.