UNDI PCI driver.
Definition in file undi.c.
Find UNDI ROM for PCI device.
- Parameters
-
- Return values
-
Try to find a driver for this device. Try an exact match on the ROM address first, then fall back to a vendor/device ID match only
Definition at line 48 of file undi.c.
48 {
50 unsigned long rombase;
51
54 if ( ! undirom )
56 return undirom;
57}
unsigned long pci_bar_start(struct pci_device *pci, unsigned int reg)
Find the start of a PCI BAR.
#define PCI_ROM_ADDRESS
PCI expansion ROM base address.
uint16_t vendor
Vendor ID.
uint16_t device
Device ID.
struct undi_rom * undirom_find_pci(unsigned int vendor_id, unsigned int device_id, unsigned int rombase)
Find UNDI ROM for PCI device.
References pci_device::device, pci_bar_start(), PCI_ROM_ADDRESS, undirom_find_pci(), and pci_device::vendor.
Referenced by undipci_probe().
Probe PCI device.
- Parameters
-
- Return values
-
Definition at line 66 of file undi.c.
66 {
70
71
72 undi =
zalloc (
sizeof ( *undi ) );
73 if ( ! undi )
76
77
79
80 DBGC ( undi,
"UNDI %p using preloaded UNDI device\n", undi );
83 } else {
84
87 goto err_find_rom;
88 }
89
90
93 goto err_load_pci;
94 }
95 }
96
97
99 goto err_undinet_probe;
100
101 return 0;
102
103 err_undinet_probe:
105 err_find_rom:
106 err_load_pci:
110}
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
#define ENOMEM
Not enough space.
#define ENODEV
No such device.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
void * zalloc(size_t size)
Allocate cleared memory.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
static void(* free)(struct refcnt *refcnt))
uint32_t busdevfn
Segment, bus, device, and function (bus:dev.fn) number.
struct device dev
Generic device.
static struct undi_rom * undipci_find_rom(struct pci_device *pci)
Find UNDI ROM for PCI device.
int undi_unload(struct undi_device *undi)
Unload a pixie.
static int undi_load_pci(struct undi_device *undi, struct undi_rom *undirom, unsigned int pci_busdevfn)
Call UNDI loader to create a pixie.
int undinet_probe(struct undi_device *undi, struct device *dev)
Probe UNDI device.
References pci_device::busdevfn, DBGC, pci_device::dev, ENODEV, ENOMEM, free, memcpy(), memset(), NULL, pci_set_drvdata(), preloaded_undi, rc, undi_load_pci(), undi_unload(), undinet_probe(), undipci_find_rom(), and zalloc().