aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/e1000/e1000_nvm.c
diff options
context:
space:
mode:
authorJack F Vogel <jfv@FreeBSD.org>2009-04-10 00:05:46 +0000
committerJack F Vogel <jfv@FreeBSD.org>2009-04-10 00:05:46 +0000
commitd035aa2db2f9b7ff561faf83704590a531a6d767 (patch)
treef981ffc31c178842e845ff35aa845659f6847a58 /sys/dev/e1000/e1000_nvm.c
parent14846f9b49e8c3ca22f30e84220badda0198b0a1 (diff)
downloadsrc-d035aa2db2f9b7ff561faf83704590a531a6d767.tar.gz
src-d035aa2db2f9b7ff561faf83704590a531a6d767.zip
This delta syncs the em and igb drivers with Intel,
adds header split and SCTP support into the igb driver. Various small improvements and fixes. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=190872
Diffstat (limited to 'sys/dev/e1000/e1000_nvm.c')
-rw-r--r--sys/dev/e1000/e1000_nvm.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c
index 8492d80a75ec..83557ef96503 100644
--- a/sys/dev/e1000/e1000_nvm.c
+++ b/sys/dev/e1000/e1000_nvm.c
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2001-2008, Intel Corporation
+ Copyright (c) 2001-2009, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,8 @@
#include "e1000_api.h"
+static void e1000_reload_nvm_generic(struct e1000_hw *hw);
+
/**
* e1000_init_nvm_ops_generic - Initialize NVM function pointers
* @hw: pointer to the HW structure
@@ -815,31 +817,23 @@ out:
**/
s32 e1000_read_mac_addr_generic(struct e1000_hw *hw)
{
- s32 ret_val = E1000_SUCCESS;
- u16 offset, nvm_data, i;
+ u32 rar_high;
+ u32 rar_low;
+ u16 i;
- DEBUGFUNC("e1000_read_mac_addr");
+ rar_high = E1000_READ_REG(hw, E1000_RAH(0));
+ rar_low = E1000_READ_REG(hw, E1000_RAL(0));
- for (i = 0; i < ETH_ADDR_LEN; i += 2) {
- offset = i >> 1;
- ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
- if (ret_val) {
- DEBUGOUT("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);
- }
+ 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_ADDR_LEN; i++)
hw->mac.addr[i] = hw->mac.perm_addr[i];
-out:
- return ret_val;
+ return E1000_SUCCESS;
}
/**
@@ -916,7 +910,7 @@ out:
* Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the
* extended control register.
**/
-void e1000_reload_nvm_generic(struct e1000_hw *hw)
+static void e1000_reload_nvm_generic(struct e1000_hw *hw)
{
u32 ctrl_ext;