summaryrefslogtreecommitdiff
path: root/e1000_hw.c
diff options
context:
space:
mode:
authorNoe Rubinstein <nrubinstein@avencall.com>2012-07-18 16:57:27 +0200
committerNoe Rubinstein <nrubinstein@avencall.com>2012-07-18 16:57:27 +0200
commite877238db7811782dd761d20a26591e60eb3398f (patch)
tree8d05309062b44be93825fc00e7365d5992b02eb9 /e1000_hw.c
parente096033cbdf2432b73cf9afd172ae2f246d9ad40 (diff)
Implement version 2 of MAC storage
Diffstat (limited to 'e1000_hw.c')
-rw-r--r--e1000_hw.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/e1000_hw.c b/e1000_hw.c
index 966c68b..c0234c6 100644
--- a/e1000_hw.c
+++ b/e1000_hw.c
@@ -4298,13 +4298,23 @@ static int devnum(struct e1000_hw *hw)
s32 e1000_read_mac_addr(struct e1000_hw *hw)
{
#ifdef XIOH
-#define MAC_OFFSET_IN_RAM 0xfff00000
+#define XIOH_MAC_OFFSET 0xfff00000
+
+ static const u8 xioh_mac_magic[] = {'X','I','O','H', 0x00, 0x00};
+
int num = devnum(hw);
int i;
u8 *mac;
- mac = ioremap(MAC_OFFSET_IN_RAM,18);
+
+ mac = ioremap(XIOH_MAC_OFFSET, 24);
+ for (i = 0; i < ARRAY_SIZE(xioh_mac_magic); i++)
+ if (xioh_mac_magic[i] != mac[i])
+ return -E1000_ERR_EEPROM;
+
for (i = 0; i < 6; i++)
- hw->perm_mac_addr[i] = mac[6*num+i];
+ hw->perm_mac_addr[i] = mac[ARRAY_SIZE(xioh_mac_magic)+6*num+i];
+
+ iounmap(mac);
#else
u16 offset;