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 a3c90x_probe(), 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 a3c90x_probe().

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(), nvs_read(), and nvs_write().

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

Read data from device.

Parameters:
nvs NVS device
address Address from which to read
data Data buffer
len Length of data buffer
Return values:
rc Return status code
Reads may not cross a block boundary.

Referenced by a3c90x_probe(), and nvs_read().

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

Write data to device.

Parameters:
nvs NVS device
address Address to which to write
data Data buffer
len Length of data buffer
Return values:
rc Return status code
Writes may not cross a block boundary.

Referenced by a3c90x_probe(), and nvs_write().


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

Generated on Tue Apr 6 20:02:07 2010 for gPXE by  doxygen 1.5.7.1