320627d
Bugzilla: 1064516
320627d
Upstream-status: 3.15
320627d
320627d
From 96dee024ca4799d6d21588951240035c21ba1c67 Mon Sep 17 00:00:00 2001
320627d
From: David Ertman <davidx.m.ertman@intel.com>
320627d
Date: Wed, 5 Mar 2014 07:50:46 +0000
320627d
Subject: [PATCH] e1000e: Fix SHRA register access for 82579
320627d
320627d
Previous commit c3a0dce35af0 fixed an overrun for the RAR on i218 devices.
320627d
This commit also attempted to homogenize the RAR/SHRA access for all parts
320627d
accessed by the e1000e driver.  This change introduced an error for
320627d
assigning MAC addresses to guest OS's for 82579 devices.
320627d
320627d
Only RAR[0] is accessible to the driver for 82579 parts, and additional
320627d
addresses must be placed into the SHRA[L|H] registers.  The rar_entry_count
320627d
was changed in the previous commit to an inaccurate value that accounted
320627d
for all RAR and SHRA registers, not just the ones usable by the driver.
320627d
320627d
This patch fixes the count to the correct value and adjusts the
320627d
e1000_rar_set_pch2lan() function to user the correct index.
320627d
320627d
Cc: John Greene <jogreene@redhat.com>
320627d
Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com>
320627d
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
320627d
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
320627d
---
320627d
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +-
320627d
 drivers/net/ethernet/intel/e1000e/ich8lan.h | 2 +-
320627d
 2 files changed, 2 insertions(+), 2 deletions(-)
320627d
320627d
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
320627d
index 18984519a18d..9866f264f55e 100644
320627d
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
320627d
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
320627d
@@ -1675,7 +1675,7 @@ static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index)
320627d
 	/* RAR[1-6] are owned by manageability.  Skip those and program the
320627d
 	 * next address into the SHRA register array.
320627d
 	 */
320627d
-	if (index < (u32)(hw->mac.rar_entry_count - 6)) {
320627d
+	if (index < (u32)(hw->mac.rar_entry_count)) {
320627d
 		s32 ret_val;
320627d
 
320627d
 		ret_val = e1000_acquire_swflag_ich8lan(hw);
320627d
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h
320627d
index 553f05ec0278..bead50f9187b 100644
320627d
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
320627d
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
320627d
@@ -101,7 +101,7 @@
320627d
 #define PCIE_ICH8_SNOOP_ALL	PCIE_NO_SNOOP_ALL
320627d
 
320627d
 #define E1000_ICH_RAR_ENTRIES	7
320627d
-#define E1000_PCH2_RAR_ENTRIES	11      /* RAR[0-6], SHRA[0-3] */
320627d
+#define E1000_PCH2_RAR_ENTRIES	5	/* RAR[0], SHRA[0-3] */
320627d
 #define E1000_PCH_LPT_RAR_ENTRIES	12	/* RAR[0], SHRA[0-10] */
320627d
 
320627d
 #define PHY_PAGE_SHIFT		5
320627d
-- 
320627d
1.9.3
320627d