diff options
author | Noe Rubinstein <nrubinstein@avencall.com> | 2012-07-18 16:57:27 +0200 |
---|---|---|
committer | Noe Rubinstein <nrubinstein@avencall.com> | 2012-07-18 16:57:27 +0200 |
commit | e877238db7811782dd761d20a26591e60eb3398f (patch) | |
tree | 8d05309062b44be93825fc00e7365d5992b02eb9 /e1000_hw.c | |
parent | e096033cbdf2432b73cf9afd172ae2f246d9ad40 (diff) |
Implement version 2 of MAC storage
Diffstat (limited to 'e1000_hw.c')
-rw-r--r-- | e1000_hw.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -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; |