Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134331
b: refs/heads/master
c: 40a70b3
h: refs/heads/master
i:
  134329: 34d45e1
  134327: 3cc2fb3
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Feb 7, 2009
1 parent df459fc commit e1a5ce3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1889bfe687c22f74d1333913ffe8f8da173d601
refs/heads/master: 40a70b3889ea50daa10a7f3468920c1f5483155d
2 changes: 2 additions & 0 deletions trunk/drivers/net/igb/e1000_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
* manageability enabled, allowing us room for 15 multicast addresses.
*/
#define E1000_RAH_AV 0x80000000 /* Receive descriptor valid */
#define E1000_RAL_MAC_ADDR_LEN 4
#define E1000_RAH_MAC_ADDR_LEN 2

/* Error Codes */
#define E1000_ERR_NVM 1
Expand Down
28 changes: 11 additions & 17 deletions trunk/drivers/net/igb/e1000_nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,29 +515,23 @@ s32 igb_read_part_num(struct e1000_hw *hw, u32 *part_num)
**/
s32 igb_read_mac_addr(struct e1000_hw *hw)
{
s32 ret_val = 0;
u16 offset, nvm_data, i;
u32 rar_high;
u32 rar_low;
u16 i;

for (i = 0; i < ETH_ALEN; i += 2) {
offset = i >> 1;
ret_val = hw->nvm.ops.read_nvm(hw, offset, 1, &nvm_data);
if (ret_val) {
hw_dbg("NVM Read Error\n");
goto out;
}
hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
}
rar_high = rd32(E1000_RAH(0));
rar_low = rd32(E1000_RAL(0));

for (i = 0; i < E1000_RAL_MAC_ADDR_LEN; i++)
hw->mac.perm_addr[i] = (u8)(rar_low >> (i*8));

/* Flip last bit of mac address if we're on second port */
if (hw->bus.func == E1000_FUNC_1)
hw->mac.perm_addr[5] ^= 1;
for (i = 0; i < E1000_RAH_MAC_ADDR_LEN; i++)
hw->mac.perm_addr[i+4] = (u8)(rar_high >> (i*8));

for (i = 0; i < ETH_ALEN; i++)
hw->mac.addr[i] = hw->mac.perm_addr[i];

out:
return ret_val;
return 0;
}

/**
Expand Down

0 comments on commit e1a5ce3

Please sign in to comment.