Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135190
b: refs/heads/master
c: cad6d05
h: refs/heads/master
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Mar 14, 2009
1 parent 47de1ab commit 6f8f719
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 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: a2cf8b6ce17415fc84f51300fd6be372d95bfcea
refs/heads/master: cad6d05f5676d879bb2a48154aea26cd81ebf1bb
21 changes: 14 additions & 7 deletions trunk/drivers/net/igb/e1000_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,26 @@ void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
* Sets or clears a bit in the VLAN filter table array based on VLAN id
* and if we are adding or removing the filter
**/
void igb_vfta_set(struct e1000_hw *hw, u32 vid, bool add)
s32 igb_vfta_set(struct e1000_hw *hw, u32 vid, bool add)
{
u32 index = (vid >> E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK;
u32 mask = 1 < (vid & E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
u32 vfta;
u32 vfta = array_rd32(E1000_VFTA, index);
s32 ret_val = 0;

vfta = array_rd32(E1000_VFTA, index);
if (add)
vfta |= mask;
else
vfta &= ~mask;
/* bit was set/cleared before we started */
if ((!!(vfta & mask)) == add) {
ret_val = -E1000_ERR_CONFIG;
} else {
if (add)
vfta |= mask;
else
vfta &= ~mask;
}

igb_write_vfta(hw, index, vfta);

return ret_val;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/igb/e1000_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ s32 igb_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg,

void igb_clear_hw_cntrs_base(struct e1000_hw *hw);
void igb_clear_vfta(struct e1000_hw *hw);
void igb_vfta_set(struct e1000_hw *hw, u32 vid, bool add);
s32 igb_vfta_set(struct e1000_hw *hw, u32 vid, bool add);
void igb_config_collision_dist(struct e1000_hw *hw);
void igb_mta_set(struct e1000_hw *hw, u32 hash_value);
void igb_put_hw_semaphore(struct e1000_hw *hw);
Expand Down
9 changes: 7 additions & 2 deletions trunk/drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3895,10 +3895,15 @@ static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)

/* if !enabled we need to set this up in vfta */
if (!(reg & E1000_VLVF_VLANID_ENABLE)) {
/* add VID to filter table */
igb_vfta_set(hw, vid, true);
/* add VID to filter table, if bit already set
* PF must have added it outside of table */
if (igb_vfta_set(hw, vid, true))
reg |= 1 << (E1000_VLVF_POOLSEL_SHIFT +
adapter->vfs_allocated_count);
reg |= E1000_VLVF_VLANID_ENABLE;
}
reg &= ~E1000_VLVF_VLANID_MASK;
reg |= vid;

wr32(E1000_VLVF(i), reg);
return 0;
Expand Down

0 comments on commit 6f8f719

Please sign in to comment.