iPXE
|
Non-Volatile Storage using Vital Product Data. More...
#include <stdio.h>
#include <errno.h>
#include <ipxe/nvs.h>
#include <ipxe/pci.h>
#include <ipxe/pcivpd.h>
#include <ipxe/nvo.h>
#include <ipxe/nvsvpd.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | nvs_vpd_read (struct nvs_device *nvs, unsigned int field, void *data, size_t len) |
Read from VPD field. More... | |
static int | nvs_vpd_write (struct nvs_device *nvs, unsigned int field, const void *data, size_t len) |
Write to VPD field. More... | |
static int | nvs_vpd_resize (struct nvs_device *nvs, unsigned int field, size_t len) |
Resize VPD field. More... | |
int | nvs_vpd_init (struct nvs_vpd_device *nvsvpd, struct pci_device *pci) |
Initialise NVS VPD device. More... | |
static int | nvs_vpd_nvo_resize (struct nvo_block *nvo, size_t len) |
Resize non-volatile option storage within NVS VPD device. More... | |
void | nvs_vpd_nvo_init (struct nvs_vpd_device *nvsvpd, unsigned int field, struct nvo_block *nvo, struct refcnt *refcnt) |
Initialise non-volatile option storage within NVS VPD device. More... | |
Non-Volatile Storage using Vital Product Data.
Definition in file nvsvpd.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Read from VPD field.
nvs | NVS device |
field | VPD field descriptor |
data | Data buffer |
len | Length of data buffer |
rc | Return status code |
Definition at line 49 of file nvsvpd.c.
References address, container_of, data, DBGC, ENXIO, len, nvs_vpd_device::nvs, pci_vpd::pci, PCI_ARGS, PCI_FMT, PCI_VPD_FIELD_ARGS, PCI_VPD_FIELD_FMT, pci_vpd_find(), pci_vpd_read(), rc, strerror(), and nvs_vpd_device::vpd.
Referenced by nvs_vpd_init().
|
static |
Write to VPD field.
nvs | NVS device |
field | VPD field descriptor |
data | Data buffer |
len | Length of data buffer |
rc | Return status code |
Definition at line 101 of file nvsvpd.c.
References address, container_of, data, DBGC, ENXIO, len, nvs_vpd_device::nvs, pci_vpd::pci, PCI_ARGS, PCI_FMT, PCI_VPD_FIELD_ARGS, PCI_VPD_FIELD_FMT, pci_vpd_find(), pci_vpd_write(), rc, strerror(), and nvs_vpd_device::vpd.
Referenced by nvs_vpd_init().
|
static |
Resize VPD field.
nvs | NVS device |
field | VPD field descriptor |
data | Data buffer |
len | Length of data buffer |
rc | Return status code |
Definition at line 150 of file nvsvpd.c.
References address, container_of, DBGC, len, nvs_vpd_device::nvs, pci_vpd::pci, PCI_ARGS, PCI_FMT, PCI_VPD_FIELD_ARGS, PCI_VPD_FIELD_FMT, pci_vpd_resize(), rc, strerror(), and nvs_vpd_device::vpd.
Referenced by nvs_vpd_nvo_resize().
int nvs_vpd_init | ( | struct nvs_vpd_device * | nvsvpd, |
struct pci_device * | pci | ||
) |
Initialise NVS VPD device.
nvsvpd | NVS VPD device |
pci | PCI device |
rc | Return status code |
Definition at line 178 of file nvsvpd.c.
References DBGC, nvs_vpd_device::nvs, nvs_vpd_read(), nvs_vpd_write(), PCI_ARGS, PCI_FMT, pci_vpd_init(), rc, nvs_device::read, strerror(), nvs_vpd_device::vpd, and nvs_device::write.
Referenced by hermon_probe().
Resize non-volatile option storage within NVS VPD device.
nvo | Non-volatile options block |
len | New length |
rc | Return status code |
Definition at line 202 of file nvsvpd.c.
References nvo_block::address, len, nvo_block::nvs, nvs_vpd_resize(), and rc.
Referenced by nvs_vpd_nvo_init().
void nvs_vpd_nvo_init | ( | struct nvs_vpd_device * | nvsvpd, |
unsigned int | field, | ||
struct nvo_block * | nvo, | ||
struct refcnt * | refcnt | ||
) |
Initialise non-volatile option storage within NVS VPD device.
nvsvpd | NVS VPD device |
field | VPD field descriptor |
nvo | Non-volatile options block |
refcnt | Containing object reference counter, or NULL |
Definition at line 220 of file nvsvpd.c.
References address, DBGC, len, nvo_init(), nvs_vpd_device::nvs, nvs_vpd_nvo_resize(), pci_vpd::pci, PCI_ARGS, PCI_FMT, PCI_VPD_FIELD_ARGS, PCI_VPD_FIELD_FMT, pci_vpd_find(), rc, and nvs_vpd_device::vpd.
Referenced by hermon_probe().