52 DBG (
"BOFM: " PCI_FMT " registered using driver \"%s\"\n",
96 for ( i = 0 ; i < driver->
id_count ; i++ ) {
98 if ( (
id->vendor == pci->
vendor ) &&
119 DBG (
"BOFM: " PCI_FMT " could not load driver: %s\n",
166 sizeof ( *bofmsec ) );
189 DBG (
"BOFM: " PCI_FMT " mport %d could not harvest: %s\n",
196 DBG (
"BOFM: " PCI_FMT " mport %d harvested MAC %s\n",
215 DBG (
"BOFM: " PCI_FMT " mport %d applied MAC %s\n",
223 DBG (
"BOFM: " PCI_FMT " mport %d could not update: %s\n",
243 size_t en_region_offset;
255 goto err_bad_signature;
263 switch ( bofmhdr.
action ) {
284 goto err_find_driver;
296 if ( ! en_region_offset ) {
297 DBG (
"BOFM: No EN section found\n" );
299 goto err_no_en_section;
303 for ( en_offset = ( en_region_offset +
sizeof ( bofmsec ) ) ;
304 en_offset < ( en_region_offset +
sizeof ( bofmsec ) +
305 bofmsec.
length ) ; en_offset +=
sizeof (
en ) ) {
307 DBG2 (
"BOFM: EN entry found:\n" );
310 DBG (
"BOFM: slot %d port %d has no PCI mapping\n",
314 DBG (
"BOFM: slot %d port %d%s is " PCI_FMT " mport %d\n",
321 DBG (
"BOFM: " PCI_FMT " mport %d ignored\n", 0,
331 DBG2 (
"BOFM: EN entry after processing:\n" );
#define PCI_FUNC(busdevfn)
#define PCI_BUS(busdevfn)
struct arbelprm_rc_send_wqe rc
static void bofm_remove(struct pci_device *pci)
Remove PCI device.
uint8_t slot
Slot or mezzanine number.
#define list_add(new, head)
Add a new entry to the head of a list.
unsigned int id_count
Number of entries in PCI ID table.
#define BOFM_EN_CSM_FAILED
Entry has been used but failed.
struct pci_device_id * ids
PCI ID table.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
static void pci_set_driver(struct pci_device *pci, struct pci_driver *driver, struct pci_device_id *id)
Set PCI driver.
#define BOFM_EN_EN_A
MAC address A is present.
#define BOFM_EN_USAGE_HARVEST
Ignore values - it's harvest time.
#define BOFM_EN_MAGIC
EN start marker.
#define ENOENT
No such file or directory.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static LIST_HEAD(bofmdevs)
List of BOFM devices.
struct pci_device * pci
Underlying PCI device.
uint8_t mac[ETH_ALEN]
MAC address.
#define BOFM_SUCCESS
Successful.
Access to external ("user") memory.
struct list_head list
List of BOFM devices.
#define BOFM_ACTION_UPDT
Update MAC/WWN.
static int bofm_en(struct bofm_device *bofm, struct bofm_en *en)
Process BOFM Ethernet parameter entry.
uint8_t mport
Multi-port index.
#define list_del(list)
Delete an entry from a list.
uint16_t busdevfn
PCI bus:dev.fn address.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define BOFM_EN_CHG_CHANGED
Consumed entry is different than previous active entry.
uint32_t userptr_t
A pointer to a user buffer.
IBM BladeCenter Open Fabric Manager (BOFM)
uint16_t device
Device ID.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define BOFM_MAGIC_FMT
BOFM magic value debug message format.
#define BOFM_SKIP_INIT
Skip option ROM initialisation.
#define BOFM_EN_MAP_PFA
Port mapping is by PCI bus:dev.fn.
#define BOFM_ACTION_NONE
Just initialise the device.
uint16_t busdevfn
PCI bus:dev.fn.
#define BOFM_IOAA_MAGIC
BOFM table header signature.
static int bofm_probe(struct pci_device *pci)
Probe PCI device for BOFM driver.
#define BOFM_DONE_MAGIC
End marker.
uint8_t id
Request identifier.
#define BOFM_ERR_DEVICE_ERROR
Device error prohibited MAC/WWN update.
char * strerror(int errno)
Retrieve string representation of error number.
#define PCI_FMT
PCI device debug message format.
#define PCI_SLOT(busdevfn)
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define BOFM_EN_HVST
Harvest complete.
static __always_inline void copy_to_user(userptr_t dest, off_t dest_off, const void *src, size_t len)
Copy data to user buffer.
#define BOFM_MAGIC_ARGS(magic)
BOFM magic value debug message arguments.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
void pci_remove(struct pci_device *pci)
Remove a PCI device.
static struct bofm_device * bofm_find_busdevfn(unsigned int busdevfn)
Find BOFM device matching PCI bus:dev.fn address.
#define BOFM_EN_RQ_HVST_MASK
Harvest request mask.
#define BOFM_ACTION_PARM
Update MAC/WWN and initialise device.
#define BOFM_EN_USAGE_ENTRY
Use entry values for assignment.
uint16_t magic
Magic signature.
int bofm_register(struct bofm_device *bofm)
Register BOFM device.
A PCI device ID list entry.
uint16_t vendor
Vendor ID.
static size_t bofm_locate_section(userptr_t bofmtab, size_t len, uint32_t magic, struct bofm_section_header *bofmsec)
Locate BOFM table section.
uint8_t mac_a[6]
MAC address A.
#define BOFM_EN_MAP_MASK
Port mapping mask.
int bofm(userptr_t bofmtab, struct pci_device *pci)
Process BOFM table.
BOFM Ethernet parameter entry.
#define PCI_ARGS(pci)
PCI device debug message arguments.
#define BOFM_ERR_INVALID_ACTION
Invalid action string.
int bofm_find_driver(struct pci_device *pci)
Find BOFM driver for PCI device.
uint16_t offset
Offset to command line.
void bofm_unregister(struct bofm_device *bofm)
Unregister BOFM device.
#define BOFM_DRIVERS
BOFM driver table.
#define BOFM_EN_CSM_SUCCESS
Entry has been used successfully.
#define DBG(...)
Print a debugging message.
#define BOFM_ACTION_HVST
Harvest MAC/WWN.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
int pci_probe(struct pci_device *pci)
Probe a PCI device.
#define BOFM_ACTION_DFLT
Restore MAC/WWN to factory default.