46 unsigned int pxeromid ) {
48 unsigned int undiloader;
50 DBGC ( undirom,
"UNDIROM %p has PXE ROM ID at %04x:%04x\n", undirom,
57 DBGC ( undirom,
"UNDIROM %p has bad PXE ROM ID signature " 65 DBGC ( undirom,
"UNDIROM %p has no UNDI loader\n", undirom );
75 DBGC ( undirom,
"UNDIROM %p has UNDI loader at %04x:%04x " 76 "(code %04zx data %04zx)\n", undirom,
89 unsigned int pcirheader ) {
92 DBGC ( undirom,
"UNDIROM %p has PCI expansion header at %04x:%04x\n",
99 DBGC ( undirom,
"UNDIROM %p has bad PCI expansion header " 109 DBGC ( undirom,
"UNDIROM %p is for PCI devices %04x:%04x\n", undirom,
125 unsigned int pxeromid;
126 unsigned int pcirheader;
130 copy_from_real ( &romheader, rom_segment, 0,
sizeof ( romheader ) );
138 undirom =
zalloc (
sizeof ( *undirom ) );
140 DBG (
"Could not allocate UNDI ROM structure\n" );
144 DBGC ( undirom,
"UNDIROM %p trying expansion ROM at %04x:0000 " 145 "(%zdkB)\n", undirom, rom_segment, ( rom_len / 1024 ) );
151 DBGC ( undirom,
"UNDIROM %p has no PXE ROM ID\n", undirom );
155 if ( pxeromid > rom_len ) {
156 DBGC ( undirom,
"UNDIROM %p PXE ROM ID outside ROM\n",
170 DBGC ( undirom,
"UNDIROM %p registered\n", undirom );
185 static int probed = 0;
186 unsigned int rom_segment;
192 DBG (
"Scanning for PXE expansion ROMs\n" );
195 for ( rom_segment = 0xc000 ; rom_segment < 0x10000 ;
196 rom_segment += 0x20 ) {
213 unsigned int rombase ) {
225 if ( rombase && ( ( undirom->
rom_segment << 4 ) != rombase ) )
227 DBGC ( undirom,
"UNDIROM %p matched PCI %04x:%04x (%08x)\n",
232 DBG (
"No UNDI ROM matched PCI %04x:%04x (%08x)\n",
#define EINVAL
Invalid argument.
unsigned int rom_segment
ROM segment address.
struct arbelprm_rc_send_wqe rc
size_t code_size
Code segment size.
#define PCI_NIC
PCI network card.
static LIST_HEAD(undiroms)
List of all UNDI ROMs.
UINT16_t DataSize
Minimum required data segment size.
size_t data_size
Data segment size.
static int undirom_parse_pxeromid(struct undi_rom *undirom, unsigned int pxeromid)
Parse PXE ROM ID structure.
static int undirom_probe(unsigned int rom_segment)
Probe UNDI ROM.
unsigned int bus_type
Bus type.
UINT16_t UNDILoader
Offset to UNDI loader.
#define ENOMEM
Not enough space.
An UNDI ROM ID structure.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
#define UNDI_ROM_ID_SIGNATURE
Signature for an UNDI ROM ID structure.
#define ROM_SIGNATURE
Signature for an expansion ROM.
unsigned int vendor_id
PCI vendor ID.
SEGOFF16_t loader_entry
UNDI loader entry point.
#define PCIR_SIGNATURE
Signature for an UNDI ROM ID structure.
struct list_head list
List of UNDI ROMs.
union undi_device_id bus_id
Device ID.
static void(* free)(struct refcnt *refcnt))
void * zalloc(size_t size)
Allocate cleared memory.
static int undirom_parse_pcirheader(struct undi_rom *undirom, unsigned int pcirheader)
Parse PCI expansion header.
UINT16_t CodeSize
Minimum required code segment size.
unsigned int device_id
PCI device ID.
UINT32_t Signature
Signature.
FILE_LICENCE(GPL2_OR_LATER)
struct undi_pci_device_id pci
PCI device ID.
static void undirom_probe_all_roms(void)
Create UNDI ROMs for all possible expansion ROMs.
#define DBG(...)
Print a debugging message.
struct undi_rom * undirom_find_pci(unsigned int vendor_id, unsigned int device_id, unsigned int rombase)
Find UNDI ROM for PCI device.
#define NULL
NULL pointer (VOID *)