iPXE
undirom.h File Reference

UNDI expansion ROMs. More...

#include <pxe_types.h>

Go to the source code of this file.

Data Structures

struct  undi_pci_device_id
 An UNDI PCI device ID. More...
union  undi_device_id
 An UNDI device ID. More...
struct  undi_rom
 An UNDI ROM. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
struct undi_romundirom_find_pci (unsigned int vendor_id, unsigned int device_id, unsigned int rombase)
 Find UNDI ROM for PCI device.

Detailed Description

UNDI expansion ROMs.

Definition in file undirom.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ undirom_find_pci()

struct undi_rom * undirom_find_pci ( unsigned int vendor_id,
unsigned int device_id,
unsigned int rombase )
extern

Find UNDI ROM for PCI device.

Parameters
vendor_idPCI vendor ID
device_idPCI device ID
rombaseROM base address, or 0 for any
Return values
undiromUNDI ROM, or NULL

Definition at line 211 of file undirom.c.

213 {
214 struct undi_rom *undirom;
215
217
218 list_for_each_entry ( undirom, &undiroms, list ) {
219 if ( undirom->bus_type != PCI_NIC )
220 continue;
221 if ( undirom->bus_id.pci.vendor_id != vendor_id )
222 continue;
223 if ( undirom->bus_id.pci.device_id != device_id )
224 continue;
225 if ( rombase && ( ( undirom->rom_segment << 4 ) != rombase ) )
226 continue;
227 DBGC ( undirom, "UNDIROM %p matched PCI %04x:%04x (%08x)\n",
228 undirom, vendor_id, device_id, rombase );
229 return undirom;
230 }
231
232 DBG ( "No UNDI ROM matched PCI %04x:%04x (%08x)\n",
233 vendor_id, device_id, rombase );
234 return NULL;
235}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
#define DBGC(...)
Definition compiler.h:505
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
#define PCI_NIC
PCI network card.
Definition pxe_api.h:1301
uint8_t vendor_id[3]
Definition ib_mad.h:11
uint16_t device_id
Definition ib_mad.h:8
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition list.h:432
unsigned int device_id
PCI device ID.
Definition undirom.h:19
unsigned int vendor_id
PCI vendor ID.
Definition undirom.h:17
An UNDI ROM.
Definition undirom.h:29
struct list_head list
List of UNDI ROMs.
Definition undirom.h:31
unsigned int rom_segment
ROM segment address.
Definition undirom.h:33
unsigned int bus_type
Bus type.
Definition undirom.h:44
union undi_device_id bus_id
Device ID.
Definition undirom.h:46
static void undirom_probe_all_roms(void)
Create UNDI ROMs for all possible expansion ROMs.
Definition undirom.c:184
struct undi_pci_device_id pci
PCI device ID.
Definition undirom.h:25

References undi_rom::bus_id, undi_rom::bus_type, DBG, DBGC, device_id, undi_pci_device_id::device_id, undi_rom::list, list_for_each_entry, NULL, undi_device_id::pci, PCI_NIC, undi_rom::rom_segment, undirom_probe_all_roms(), undi_pci_device_id::vendor_id, and vendor_id.

Referenced by undipci_find_rom().