aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e/netdev.c
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2012-04-13 23:28:50 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-05-02 04:58:53 -0400
commit69e1e0197ce739d86ca33fd275962d6cbd1b107a (patch)
tree23b34df1c0fbe7d941146489655d26c028b0f31f /drivers/net/ethernet/intel/e1000e/netdev.c
parentcb17aab916b0467faecf241c9b3b396b6da045d9 (diff)
e1000e: fix .ndo_set_rx_mode for 82579
Secondary unicast and multicast addresses are added to the Receive Address registers (RAR) for most parts supported by the driver. For 82579, there is only one actual RAR and a number of Shared Receive Address registers (SHRAR) that are shared among the driver and f/w which can be reserved and write-protected by the f/w. On this device, use the SHRARs that are not taken by f/w for the additional addresses. Add a MAC ops function pointer infrastructure (similar to other MAC operations in the driver) for setting RARs, introduce a new rar_set function for 82579 and convert the existing code that sets RARs on other devices to a generic rar_set function. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e/netdev.c')
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 140fee14b313..c0e211b500cf 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3209,7 +3209,7 @@ static int e1000e_write_uc_addr_list(struct net_device *netdev)
3209 netdev_for_each_uc_addr(ha, netdev) { 3209 netdev_for_each_uc_addr(ha, netdev) {
3210 if (!rar_entries) 3210 if (!rar_entries)
3211 break; 3211 break;
3212 e1000e_rar_set(hw, ha->addr, rar_entries--); 3212 hw->mac.ops.rar_set(hw, ha->addr, rar_entries--);
3213 count++; 3213 count++;
3214 } 3214 }
3215 } 3215 }
@@ -4018,6 +4018,7 @@ static int e1000_close(struct net_device *netdev)
4018static int e1000_set_mac(struct net_device *netdev, void *p) 4018static int e1000_set_mac(struct net_device *netdev, void *p)
4019{ 4019{
4020 struct e1000_adapter *adapter = netdev_priv(netdev); 4020 struct e1000_adapter *adapter = netdev_priv(netdev);
4021 struct e1000_hw *hw = &adapter->hw;
4021 struct sockaddr *addr = p; 4022 struct sockaddr *addr = p;
4022 4023
4023 if (!is_valid_ether_addr(addr->sa_data)) 4024 if (!is_valid_ether_addr(addr->sa_data))
@@ -4026,7 +4027,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
4026 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); 4027 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
4027 memcpy(adapter->hw.mac.addr, addr->sa_data, netdev->addr_len); 4028 memcpy(adapter->hw.mac.addr, addr->sa_data, netdev->addr_len);
4028 4029
4029 e1000e_rar_set(&adapter->hw, adapter->hw.mac.addr, 0); 4030 hw->mac.ops.rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
4030 4031
4031 if (adapter->flags & FLAG_RESET_OVERWRITES_LAA) { 4032 if (adapter->flags & FLAG_RESET_OVERWRITES_LAA) {
4032 /* activate the work around */ 4033 /* activate the work around */
@@ -4040,9 +4041,8 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
4040 * are dropped. Eventually the LAA will be in RAR[0] and 4041 * are dropped. Eventually the LAA will be in RAR[0] and
4041 * RAR[14] 4042 * RAR[14]
4042 */ 4043 */
4043 e1000e_rar_set(&adapter->hw, 4044 hw->mac.ops.rar_set(&adapter->hw, adapter->hw.mac.addr,
4044 adapter->hw.mac.addr, 4045 adapter->hw.mac.rar_entry_count - 1);
4045 adapter->hw.mac.rar_entry_count - 1);
4046 } 4046 }
4047 4047
4048 return 0; 4048 return 0;
@@ -4621,7 +4621,7 @@ link_up:
4621 * reset from the other port. Set the appropriate LAA in RAR[0] 4621 * reset from the other port. Set the appropriate LAA in RAR[0]
4622 */ 4622 */
4623 if (e1000e_get_laa_state_82571(hw)) 4623 if (e1000e_get_laa_state_82571(hw))
4624 e1000e_rar_set(hw, adapter->hw.mac.addr, 0); 4624 hw->mac.ops.rar_set(hw, adapter->hw.mac.addr, 0);
4625 4625
4626 if (adapter->flags2 & FLAG2_CHECK_PHY_HANG) 4626 if (adapter->flags2 & FLAG2_CHECK_PHY_HANG)
4627 e1000e_check_82574_phy_workaround(adapter); 4627 e1000e_check_82574_phy_workaround(adapter);