iPXE
Data Fields
nvs_device Struct Reference

A non-volatile storage device. More...

#include <nvs.h>

Data Fields

unsigned int word_len_log2
 Word length.
unsigned int size
 Device size (in words)
unsigned int block_size
 Data block size (in words)
int(* read )(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
 Read data from device.
int(* write )(struct nvs_device *nvs, unsigned int address, const void *data, size_t len)
 Write data to device.

Detailed Description

A non-volatile storage device.

Definition at line 15 of file nvs.h.


Field Documentation

Word length.

This is expressed as the base-2 logarithm of the word length in bytes. A value of 0 therefore translates as 8-bit words, and a value of 1 translates as 16-bit words.

Definition at line 22 of file nvs.h.

Referenced by icplus_init_eeprom(), myri10ge_nv_init(), nvs_frag_len(), nvs_read(), nvs_write(), and threewire_detect_address_len().

unsigned int nvs_device::size

Device size (in words)

Definition at line 24 of file nvs.h.

Referenced by icplus_init_eeprom(), and myri10ge_nv_init().

unsigned int nvs_device::block_size

Data block size (in words)

This is the block size used by the device. It must be a power of two. Data reads and writes must not cross a block boundary.

Many devices allow reads to cross a block boundary, and restrict only writes. For the sake of simplicity, we assume that the same restriction applies to both reads and writes.

Definition at line 36 of file nvs.h.

Referenced by falcon_init_spi_device(), icplus_init_eeprom(), myri10ge_nv_init(), and nvs_frag_len().

int( * nvs_device::read)(struct nvs_device *nvs, unsigned int address, void *data, size_t len)

Read data from device.

Parameters:
nvsNVS device
addressAddress from which to read
dataData buffer
lenLength of data buffer
Return values:
rcReturn status code

Reads may not cross a block boundary.

Definition at line 47 of file nvs.h.

Referenced by icplus_init_eeprom(), myri10ge_nv_init(), nvs_read(), and nvs_vpd_init().

int( * nvs_device::write)(struct nvs_device *nvs, unsigned int address, const void *data, size_t len)

Write data to device.

Parameters:
nvsNVS device
addressAddress to which to write
dataData buffer
lenLength of data buffer
Return values:
rcReturn status code

Writes may not cross a block boundary.

Definition at line 59 of file nvs.h.

Referenced by icplus_init_eeprom(), myri10ge_nv_init(), nvs_vpd_init(), and nvs_write().


The documentation for this struct was generated from the following file: