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

Go to the source code of this file.

Functions

int qib_eeprom_read (struct qib_devdata *dd, u8 eeprom_offset, void *buff, int len)
 
int qib_eeprom_write (struct qib_devdata *dd, u8 eeprom_offset, const void *buff, int len)
 
void qib_get_eeprom_info (struct qib_devdata *dd)
 
int qib_update_eeprom_log (struct qib_devdata *dd)
 
void qib_inc_eeprom_err (struct qib_devdata *dd, u32 eidx, u32 incr)
 

Function Documentation

int qib_eeprom_read ( struct qib_devdata dd,
u8  eeprom_offset,
void buff,
int  len 
)

qib_eeprom_read - receives bytes from the eeprom via I2C : the qlogic_ib device : address to read from : where to store result : number of bytes to receive

Definition at line 53 of file qib_eeprom.c.

int qib_eeprom_write ( struct qib_devdata dd,
u8  eeprom_offset,
const void buff,
int  len 
)

qib_eeprom_write - writes data to the eeprom via I2C : the qlogic_ib device : where to place data : data to write : number of bytes to write

Definition at line 100 of file qib_eeprom.c.

void qib_get_eeprom_info ( struct qib_devdata dd)

qib_get_eeprom_info- get the GUID et al. from the TSWI EEPROM device : the qlogic_ib device

We have the capability to use the nguid field, and get the guid from the first chip's flash, to use for all of them.

Definition at line 144 of file qib_eeprom.c.

void qib_inc_eeprom_err ( struct qib_devdata dd,
u32  eidx,
u32  incr 
)

qib_inc_eeprom_err - increment one of the four error counters that are logged to EEPROM. : the qlogic_ib device : 0..3, the counter to increment : how much to add

Each counter is 8-bits, and saturates at 255 (0xFF). They are copied to the EEPROM (aka flash) whenever qib_update_eeprom_log() is called, but it can only be called in a context that allows sleep. This function can be called even at interrupt level.

Definition at line 445 of file qib_eeprom.c.

int qib_update_eeprom_log ( struct qib_devdata dd)

qib_update_eeprom_log - copy active-time and error counters to eeprom : the qlogic_ib device

Although the time is kept as seconds in the qib_devdata struct, it is rounded to hours for re-write, as we have only 16 bits in EEPROM. First-cut code reads whole (expected) struct qib_flash, modifies, re-writes. Future direction: read/write only what we need, assuming that the EEPROM had to have been "good enough" for driver init, and if not, we aren't making it worse.

Definition at line 297 of file qib_eeprom.c.