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_82575.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_82575.c')
-rw-r--r-- | drivers/net/igb/e1000_82575.c | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index 5d2c2fbf926b..95360dc4a566 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
@@ -765,39 +765,6 @@ static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed, | |||
765 | } | 765 | } |
766 | 766 | ||
767 | /** | 767 | /** |
768 | * igb_init_rx_addrs_82575 - Initialize receive address's | ||
769 | * @hw: pointer to the HW structure | ||
770 | * @rar_count: receive address registers | ||
771 | * | ||
772 | * Setups the receive address registers by setting the base receive address | ||
773 | * register to the devices MAC address and clearing all the other receive | ||
774 | * address registers to 0. | ||
775 | **/ | ||
776 | static void igb_init_rx_addrs_82575(struct e1000_hw *hw, u16 rar_count) | ||
777 | { | ||
778 | u32 i; | ||
779 | u8 addr[6] = {0,0,0,0,0,0}; | ||
780 | /* | ||
781 | * This function is essentially the same as that of | ||
782 | * e1000_init_rx_addrs_generic. However it also takes care | ||
783 | * of the special case where the register offset of the | ||
784 | * second set of RARs begins elsewhere. This is implicitly taken care by | ||
785 | * function e1000_rar_set_generic. | ||
786 | */ | ||
787 | |||
788 | hw_dbg("e1000_init_rx_addrs_82575"); | ||
789 | |||
790 | /* Setup the receive address */ | ||
791 | hw_dbg("Programming MAC Address into RAR[0]\n"); | ||
792 | hw->mac.ops.rar_set(hw, hw->mac.addr, 0); | ||
793 | |||
794 | /* Zero out the other (rar_entry_count - 1) receive addresses */ | ||
795 | hw_dbg("Clearing RAR[1-%u]\n", rar_count-1); | ||
796 | for (i = 1; i < rar_count; i++) | ||
797 | hw->mac.ops.rar_set(hw, addr, i); | ||
798 | } | ||
799 | |||
800 | /** | ||
801 | * igb_shutdown_fiber_serdes_link_82575 - Remove link during power down | 768 | * igb_shutdown_fiber_serdes_link_82575 - Remove link during power down |
802 | * @hw: pointer to the HW structure | 769 | * @hw: pointer to the HW structure |
803 | * | 770 | * |
@@ -889,7 +856,8 @@ static s32 igb_reset_hw_82575(struct e1000_hw *hw) | |||
889 | wr32(E1000_IMC, 0xffffffff); | 856 | wr32(E1000_IMC, 0xffffffff); |
890 | icr = rd32(E1000_ICR); | 857 | icr = rd32(E1000_ICR); |
891 | 858 | ||
892 | igb_check_alt_mac_addr(hw); | 859 | /* Install any alternate MAC address into RAR0 */ |
860 | ret_val = igb_check_alt_mac_addr(hw); | ||
893 | 861 | ||
894 | return ret_val; | 862 | return ret_val; |
895 | } | 863 | } |
@@ -918,7 +886,8 @@ static s32 igb_init_hw_82575(struct e1000_hw *hw) | |||
918 | igb_clear_vfta(hw); | 886 | igb_clear_vfta(hw); |
919 | 887 | ||
920 | /* Setup the receive address */ | 888 | /* Setup the receive address */ |
921 | igb_init_rx_addrs_82575(hw, rar_count); | 889 | igb_init_rx_addrs(hw, rar_count); |
890 | |||
922 | /* Zero out the Multicast HASH table */ | 891 | /* Zero out the Multicast HASH table */ |
923 | hw_dbg("Zeroing the MTA\n"); | 892 | hw_dbg("Zeroing the MTA\n"); |
924 | for (i = 0; i < mac->mta_reg_count; i++) | 893 | for (i = 0; i < mac->mta_reg_count; i++) |