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. More...
 
unsigned int size
 Device size (in words) More...
 
unsigned int block_size
 Data block size (in words) More...
 
int(* read )(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
 Read data from device. More...
 
int(* write )(struct nvs_device *nvs, unsigned int address, const void *data, size_t len)
 Write data to device. More...
 

Detailed Description

A non-volatile storage device.

Definition at line 15 of file nvs.h.

Field Documentation

◆ word_len_log2

unsigned int nvs_device::word_len_log2

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 a3c90x_probe(), icplus_init_eeprom(), intel_init_eeprom(), nvs_frag_len(), nvs_read(), nvs_write(), and threewire_detect_address_len().

◆ size

unsigned int nvs_device::size

Device size (in words)

Definition at line 24 of file nvs.h.

Referenced by a3c90x_probe(), icplus_init_eeprom(), and intel_init_eeprom().

◆ block_size

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 a3c90x_probe(), falcon_init_spi_device(), icplus_init_eeprom(), intel_init_eeprom(), and nvs_frag_len().

◆ read

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 a3c90x_probe(), icplus_init_eeprom(), intel_init_eeprom(), nvs_read(), and nvs_vpd_init().

◆ write

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 a3c90x_probe(), icplus_init_eeprom(), intel_init_eeprom(), nvs_vpd_init(), and nvs_write().


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