|
| 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.
static int nvs_vpd_read |
( |
struct nvs_device * |
nvs, |
|
|
unsigned int |
field, |
|
|
void * |
data, |
|
|
size_t |
len |
|
) |
| |
|
static |
Read from VPD field.
- Parameters
-
nvs | NVS device |
field | VPD field descriptor |
data | Data buffer |
len | Length of data buffer |
- Return values
-
Definition at line 49 of file nvsvpd.c.
65 DBGC ( pci,
PCI_FMT " NVS VPD could not locate field " 72 if (
len > max_len ) {
73 DBGC ( pci,
PCI_FMT " NVS VPD cannot read %#02zx bytes " 82 DBGC ( pci,
PCI_FMT " NVS VPD could not read field " int pci_vpd_find(struct pci_vpd *vpd, unsigned int field, unsigned int *address, size_t *len)
Locate PCI VPD field.
struct arbelprm_rc_send_wqe rc
int pci_vpd_read(struct pci_vpd *vpd, unsigned int address, void *buf, size_t len)
Read PCI VPD.
uint64_t address
Base address.
#define container_of(ptr, type, field)
Get containing structure.
struct nvs_device nvs
NVS device.
#define PCI_VPD_FIELD_FMT
PCI VPD field debug message format.
struct pci_vpd vpd
PCI VPD device.
char * strerror(int errno)
Retrieve string representation of error number.
#define PCI_FMT
PCI device debug message format.
#define PCI_VPD_FIELD_ARGS(field)
PCI VPD field debug message arguments.
#define ENXIO
No such device or address.
struct pci_device * pci
PCI device.
#define PCI_ARGS(pci)
PCI device debug message arguments.
uint8_t data[48]
Additional event data.
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 int nvs_vpd_write |
( |
struct nvs_device * |
nvs, |
|
|
unsigned int |
field, |
|
|
const void * |
data, |
|
|
size_t |
len |
|
) |
| |
|
static |
Write to VPD field.
- Parameters
-
nvs | NVS device |
field | VPD field descriptor |
data | Data buffer |
len | Length of data buffer |
- Return values
-
Definition at line 101 of file nvsvpd.c.
112 &max_len ) ) != 0 ) {
113 DBGC ( pci,
PCI_FMT " NVS VPD could not locate field " 120 if (
len > max_len ) {
121 DBGC ( pci,
PCI_FMT " NVS VPD cannot write %#02zx bytes " 131 DBGC ( pci,
PCI_FMT " NVS VPD could not write field " int pci_vpd_find(struct pci_vpd *vpd, unsigned int field, unsigned int *address, size_t *len)
Locate PCI VPD field.
struct arbelprm_rc_send_wqe rc
uint64_t address
Base address.
#define container_of(ptr, type, field)
Get containing structure.
struct nvs_device nvs
NVS device.
#define PCI_VPD_FIELD_FMT
PCI VPD field debug message format.
struct pci_vpd vpd
PCI VPD device.
char * strerror(int errno)
Retrieve string representation of error number.
#define PCI_FMT
PCI device debug message format.
int pci_vpd_write(struct pci_vpd *vpd, unsigned int address, const void *buf, size_t len)
Write PCI VPD.
#define PCI_VPD_FIELD_ARGS(field)
PCI VPD field debug message arguments.
#define ENXIO
No such device or address.
struct pci_device * pci
PCI device.
#define PCI_ARGS(pci)
PCI device debug message arguments.
uint8_t data[48]
Additional event data.
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 int nvs_vpd_resize |
( |
struct nvs_device * |
nvs, |
|
|
unsigned int |
field, |
|
|
size_t |
len |
|
) |
| |
|
static |
Resize VPD field.
- Parameters
-
nvs | NVS device |
field | VPD field descriptor |
data | Data buffer |
len | Length of data buffer |
- Return values
-
Definition at line 150 of file nvsvpd.c.
161 DBGC ( pci,
PCI_FMT " NVS VPD could not resize field " struct arbelprm_rc_send_wqe rc
uint64_t address
Base address.
int pci_vpd_resize(struct pci_vpd *vpd, unsigned int field, size_t len, unsigned int *address)
Resize VPD field.
#define container_of(ptr, type, field)
Get containing structure.
struct nvs_device nvs
NVS device.
#define PCI_VPD_FIELD_FMT
PCI VPD field debug message format.
struct pci_vpd vpd
PCI VPD device.
char * strerror(int errno)
Retrieve string representation of error number.
#define PCI_FMT
PCI device debug message format.
#define PCI_VPD_FIELD_ARGS(field)
PCI VPD field debug message arguments.
struct pci_device * pci
PCI device.
#define PCI_ARGS(pci)
PCI device debug message arguments.
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().
Initialise NVS VPD device.
- Parameters
-
nvsvpd | NVS VPD device |
pci | PCI device |
- Return values
-
Definition at line 178 of file nvsvpd.c.
int(* write)(struct nvs_device *nvs, unsigned int address, const void *data, size_t len)
Write data to device.
struct arbelprm_rc_send_wqe rc
struct nvs_device nvs
NVS device.
struct pci_vpd vpd
PCI VPD device.
int(* read)(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read data from device.
static int nvs_vpd_read(struct nvs_device *nvs, unsigned int field, void *data, size_t len)
Read from VPD field.
char * strerror(int errno)
Retrieve string representation of error number.
#define PCI_FMT
PCI device debug message format.
static int nvs_vpd_write(struct nvs_device *nvs, unsigned int field, const void *data, size_t len)
Write to VPD field.
#define PCI_ARGS(pci)
PCI device debug message arguments.
int pci_vpd_init(struct pci_vpd *vpd, struct pci_device *pci)
Initialise PCI Vital Product Data.
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().
Initialise non-volatile option storage within NVS VPD device.
- Parameters
-
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.
231 " not present; assuming empty\n",
int pci_vpd_find(struct pci_vpd *vpd, unsigned int field, unsigned int *address, size_t *len)
Locate PCI VPD field.
struct arbelprm_rc_send_wqe rc
uint64_t address
Base address.
struct nvs_device nvs
NVS device.
#define PCI_VPD_FIELD_FMT
PCI VPD field debug message format.
struct pci_vpd vpd
PCI VPD device.
void nvo_init(struct nvo_block *nvo, struct nvs_device *nvs, size_t address, size_t len, int(*resize)(struct nvo_block *nvo, size_t len), struct refcnt *refcnt)
Initialise non-volatile stored options.
#define PCI_FMT
PCI device debug message format.
#define PCI_VPD_FIELD_ARGS(field)
PCI VPD field debug message arguments.
static int nvs_vpd_nvo_resize(struct nvo_block *nvo, size_t len)
Resize non-volatile option storage within NVS VPD device.
struct pci_device * pci
PCI device.
#define PCI_ARGS(pci)
PCI device debug message arguments.
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().