diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-07-23 14:09:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-26 12:46:53 -0400 |
commit | 5ac1665906559768029c398d9ede8e7cdd73004e (patch) | |
tree | e9b24ef5346d28ccd915fffb5047af7ff7cfaf4f /drivers/net/igb/e1000_mac.c | |
parent | 28fc06f58b1fe567bb86c7d0e3d93137e5c0126e (diff) |
igb: cleanup receive address register initialization
This update cleans up the receive address register initialization. The
main purpose of this is to clean out some redundancy that was introduced
due to having multiple ways of setting the receive address registers.
Instead of having a specialized function to set one register and one to set
all of them it makes more sense to just go through the list calling the
function that is needed to set the individual registers.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb/e1000_mac.c')
-rw-r--r-- | drivers/net/igb/e1000_mac.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c index 46e27e98254a..a1e3da78dbb1 100644 --- a/drivers/net/igb/e1000_mac.c +++ b/drivers/net/igb/e1000_mac.c | |||
@@ -104,6 +104,31 @@ static void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value) | |||
104 | } | 104 | } |
105 | 105 | ||
106 | /** | 106 | /** |
107 | * igb_init_rx_addrs - Initialize receive address's | ||
108 | * @hw: pointer to the HW structure | ||
109 | * @rar_count: receive address registers | ||
110 | * | ||
111 | * Setups the receive address registers by setting the base receive address | ||
112 | * register to the devices MAC address and clearing all the other receive | ||
113 | * address registers to 0. | ||
114 | **/ | ||
115 | void igb_init_rx_addrs(struct e1000_hw *hw, u16 rar_count) | ||
116 | { | ||
117 | u32 i; | ||
118 | u8 mac_addr[ETH_ALEN] = {0}; | ||
119 | |||
120 | /* Setup the receive address */ | ||
121 | hw_dbg("Programming MAC Address into RAR[0]\n"); | ||
122 | |||
123 | hw->mac.ops.rar_set(hw, hw->mac.addr, 0); | ||
124 | |||
125 | /* Zero out the other (rar_entry_count - 1) receive addresses */ | ||
126 | hw_dbg("Clearing RAR[1-%u]\n", rar_count-1); | ||
127 | for (i = 1; i < rar_count; i++) | ||
128 | hw->mac.ops.rar_set(hw, mac_addr, i); | ||
129 | } | ||
130 | |||
131 | /** | ||
107 | * igb_vfta_set - enable or disable vlan in VLAN filter table | 132 | * igb_vfta_set - enable or disable vlan in VLAN filter table |
108 | * @hw: pointer to the HW structure | 133 | * @hw: pointer to the HW structure |
109 | * @vid: VLAN id to add or remove | 134 | * @vid: VLAN id to add or remove |