iPXE
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...

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 ( GPL2_OR_LATER_OR_UBDL  )
struct undi_rom* undirom_find_pci ( unsigned int  vendor_id,
unsigned int  device_id,
unsigned int  rombase 
) [read]

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.

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

Referenced by undipci_find_rom().

                                                            {
        struct undi_rom *undirom;

        undirom_probe_all_roms();

        list_for_each_entry ( undirom, &undiroms, list ) {
                if ( undirom->bus_type != PCI_NIC )
                        continue;
                if ( undirom->bus_id.pci.vendor_id != vendor_id )
                        continue;
                if ( undirom->bus_id.pci.device_id != device_id )
                        continue;
                if ( rombase && ( ( undirom->rom_segment << 4 ) != rombase ) )
                        continue;
                DBGC ( undirom, "UNDIROM %p matched PCI %04x:%04x (%08x)\n",
                       undirom, vendor_id, device_id, rombase );
                return undirom;
        }

        DBG ( "No UNDI ROM matched PCI %04x:%04x (%08x)\n",
              vendor_id, device_id, rombase );
        return NULL;
}