Data Structures | Functions
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...


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

Detailed Description

UNDI expansion ROMs.

Definition in file undirom.h.

Function Documentation



◆ undirom_find_pci()

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

Find UNDI ROM for PCI device.

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;
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  }
232  DBG ( "No UNDI ROM matched PCI %04x:%04x (%08x)\n",
233  vendor_id, device_id, rombase );
234  return NULL;
235 }
unsigned int rom_segment
ROM segment address.
Definition: undirom.h:33
#define PCI_NIC
PCI network card.
Definition: pxe_api.h:1301
uint16_t device_id
Definition: ib_mad.h:19
#define DBGC(...)
Definition: compiler.h:505
Definition: undirom.h:29
unsigned int bus_type
Bus type.
Definition: undirom.h:44
uint8_t vendor_id[3]
Definition: ib_mad.h:22
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:420
unsigned int vendor_id
PCI vendor ID.
Definition: undirom.h:17
struct list_head list
List of UNDI ROMs.
Definition: undirom.h:31
union undi_device_id bus_id
Device ID.
Definition: undirom.h:46
unsigned int device_id
PCI device ID.
Definition: undirom.h:19
struct undi_pci_device_id pci
PCI device ID.
Definition: undirom.h:25
static void undirom_probe_all_roms(void)
Create UNDI ROMs for all possible expansion ROMs.
Definition: undirom.c:184
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References undi_rom::bus_id, undi_rom::bus_type, DBG, DBGC, undi_pci_device_id::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().