diff options
Diffstat (limited to 'drivers/net/igb/e1000_mac.c')
-rw-r--r-- | drivers/net/igb/e1000_mac.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c index 5c249e2ce93b..2804db03e9d9 100644 --- a/drivers/net/igb/e1000_mac.c +++ b/drivers/net/igb/e1000_mac.c | |||
@@ -118,6 +118,30 @@ void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value) | |||
118 | } | 118 | } |
119 | 119 | ||
120 | /** | 120 | /** |
121 | * igb_vfta_set - enable or disable vlan in VLAN filter table | ||
122 | * @hw: pointer to the HW structure | ||
123 | * @vid: VLAN id to add or remove | ||
124 | * @add: if true add filter, if false remove | ||
125 | * | ||
126 | * Sets or clears a bit in the VLAN filter table array based on VLAN id | ||
127 | * and if we are adding or removing the filter | ||
128 | **/ | ||
129 | void igb_vfta_set(struct e1000_hw *hw, u32 vid, bool add) | ||
130 | { | ||
131 | u32 index = (vid >> E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK; | ||
132 | u32 mask = 1 < (vid & E1000_VFTA_ENTRY_BIT_SHIFT_MASK); | ||
133 | u32 vfta; | ||
134 | |||
135 | vfta = array_rd32(E1000_VFTA, index); | ||
136 | if (add) | ||
137 | vfta |= mask; | ||
138 | else | ||
139 | vfta &= ~mask; | ||
140 | |||
141 | igb_write_vfta(hw, index, vfta); | ||
142 | } | ||
143 | |||
144 | /** | ||
121 | * igb_check_alt_mac_addr - Check for alternate MAC addr | 145 | * igb_check_alt_mac_addr - Check for alternate MAC addr |
122 | * @hw: pointer to the HW structure | 146 | * @hw: pointer to the HW structure |
123 | * | 147 | * |