Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
e1000_nvm.c File Reference
#include <linux/if_ether.h>
#include <linux/delay.h>
#include "e1000_mac.h"
#include "e1000_nvm.h"

Go to the source code of this file.

Functions

s32 igb_acquire_nvm (struct e1000_hw *hw)
 
void igb_release_nvm (struct e1000_hw *hw)
 
s32 igb_read_nvm_spi (struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
 
s32 igb_read_nvm_eerd (struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
 
s32 igb_write_nvm_spi (struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
 
s32 igb_read_part_string (struct e1000_hw *hw, u8 *part_num, u32 part_num_size)
 
s32 igb_read_mac_addr (struct e1000_hw *hw)
 
s32 igb_validate_nvm_checksum (struct e1000_hw *hw)
 
s32 igb_update_nvm_checksum (struct e1000_hw *hw)
 

Function Documentation

s32 igb_acquire_nvm ( struct e1000_hw hw)

igb_acquire_nvm - Generic request for access to EEPROM : pointer to the HW structure

Set the EEPROM access request bit and wait for EEPROM access grant bit. Return successful if access grant bit set, else clear the request for EEPROM access and return -E1000_ERR_NVM (-1).

Definition at line 182 of file e1000_nvm.c.

s32 igb_read_mac_addr ( struct e1000_hw hw)

igb_read_mac_addr - Read device MAC address : pointer to the HW structure

Reads the device MAC address from the EEPROM and stores the value. Since devices with two ports use the same EEPROM, we increment the last bit in the MAC address for the second port.

Definition at line 630 of file e1000_nvm.c.

s32 igb_read_nvm_eerd ( struct e1000_hw hw,
u16  offset,
u16  words,
u16 data 
)

igb_read_nvm_eerd - Reads EEPROM using EERD register : pointer to the HW structure : offset of word in the EEPROM to read : number of words to read : word read from the EEPROM

Reads a 16 bit word from the EEPROM using the EERD register.

Definition at line 392 of file e1000_nvm.c.

s32 igb_read_nvm_spi ( struct e1000_hw hw,
u16  offset,
u16  words,
u16 data 
)

igb_read_nvm_spi - Read EEPROM's using SPI : pointer to the HW structure : offset of word in the EEPROM to read : number of words to read : word read from the EEPROM

Reads a 16 bit word from the EEPROM.

Definition at line 330 of file e1000_nvm.c.

s32 igb_read_part_string ( struct e1000_hw hw,
u8 part_num,
u32  part_num_size 
)

igb_read_part_string - Read device part number : pointer to the HW structure : pointer to device part number : size of part number buffer

Reads the product board assembly (PBA) number from the EEPROM and stores the value in part_num.

Definition at line 519 of file e1000_nvm.c.

void igb_release_nvm ( struct e1000_hw hw)

igb_release_nvm - Release exclusive access to EEPROM : pointer to the HW structure

Stop any current commands to the EEPROM and clear the EEPROM request bit.

Definition at line 258 of file e1000_nvm.c.

s32 igb_update_nvm_checksum ( struct e1000_hw hw)

igb_update_nvm_checksum - Update EEPROM checksum : pointer to the HW structure

Updates the EEPROM checksum by reading/adding each word of the EEPROM up to the checksum. Then calculates the EEPROM checksum and writes the value to the EEPROM.

Definition at line 691 of file e1000_nvm.c.

s32 igb_validate_nvm_checksum ( struct e1000_hw hw)

igb_validate_nvm_checksum - Validate EEPROM checksum : pointer to the HW structure

Calculates the EEPROM checksum by reading/adding each word of the EEPROM and then verifies that the sum of the EEPROM is equal to 0xBABA.

Definition at line 658 of file e1000_nvm.c.

s32 igb_write_nvm_spi ( struct e1000_hw hw,
u16  offset,
u16  words,
u16 data 
)

igb_write_nvm_spi - Write to EEPROM using SPI : pointer to the HW structure : offset within the EEPROM to be written to : number of words to write : 16 bit word(s) to be written to the EEPROM

Writes data to EEPROM at offset using SPI interface.

If e1000_update_nvm_checksum is not called after this function , the EEPROM will most likley contain an invalid checksum.

Definition at line 438 of file e1000_nvm.c.