Probe UNDI device.
910 memset ( undinic, 0,
sizeof ( *undinic ) );
912 DBGC ( undinic,
"UNDINIC %p using UNDI %p\n", undinic, undi );
916 memset ( &start_undi, 0,
sizeof ( start_undi ) );
924 sizeof ( start_undi ) ) ) != 0 )
931 memset ( &undi_startup, 0,
sizeof ( undi_startup ) );
934 sizeof ( undi_startup ) ) ) != 0 )
935 goto err_undi_startup;
942 for ( retry = 0 ; ; ) {
943 memset ( &undi_init, 0,
sizeof ( undi_init ) );
947 sizeof ( undi_init ) ) ) ==0)
950 goto err_undi_initialize;
951 DBGC ( undinic,
"UNDINIC %p retrying " 952 "PXENV_UNDI_INITIALIZE (retry %d)\n",
961 memset ( &undi_info, 0,
sizeof ( undi_info ) );
963 &undi_info,
sizeof ( undi_info ) ) ) != 0 )
964 goto err_undi_get_information;
967 undinic->
irq = undi_info.IntNumber;
969 DBGC ( undinic,
"UNDINIC %p ignoring invalid IRQ %d\n",
970 undinic, undinic->
irq );
973 DBGC ( undinic,
"UNDINIC %p has MAC address %s and IRQ %d\n",
977 memset ( &undi_iface, 0,
sizeof ( undi_iface ) );
979 &undi_iface,
sizeof ( undi_iface ) ) ) != 0 )
980 goto err_undi_get_iface_info;
981 DBGC ( undinic,
"UNDINIC %p has type %s, speed %d, flags %08x\n",
982 undinic, undi_iface.IfaceType, undi_iface.LinkSpeed,
983 undi_iface.ServiceFlags );
985 ( undinic->
irq != 0 ) ) {
988 DBGC ( undinic,
"UNDINIC %p using %s mode\n", undinic,
990 if (
strncmp ( ( (
char * ) undi_iface.IfaceType ),
"Etherboot",
991 sizeof ( undi_iface.IfaceType ) ) == 0 ) {
992 DBGC ( undinic,
"UNDINIC %p Etherboot 5.4 workaround enabled\n",
997 DBGC ( undinic,
"UNDINIC %p forcing polling mode due to " 998 "broken interrupts\n", undinic );
1009 DBGC ( undinic,
"UNDINIC %p added\n", undinic );
1013 err_undi_get_iface_info:
1014 err_undi_get_information:
1015 err_undi_initialize:
1017 memset ( &undi_shutdown, 0,
sizeof ( undi_shutdown ) );
1019 sizeof ( undi_shutdown ) );
1020 memset ( &undi_cleanup, 0,
sizeof ( undi_cleanup ) );
1022 sizeof ( undi_cleanup ) );
1026 memset ( &stop_undi, 0,
sizeof ( stop_undi ) );
1028 sizeof ( stop_undi ) );
#define UNDI_HACK_EB54
Work around Etherboot 5.4 bugs.
#define PXENV_UNDI_SHUTDOWN
PXE API function code for pxenv_undi_shutdown()
struct arbelprm_rc_send_wqe rc
#define SUPPORTED_IRQ
Interrupt Request supported.
#define PXENV_UNDI_CLEANUP
PXE API function code for pxenv_undi_cleanup()
#define PXENV_START_UNDI
PXE API function code for pxenv_start_undi()
#define PXENV_STOP_UNDI
PXE API function code for pxenv_stop_undi()
Parameter block for pxenv_undi_initialize()
#define PXENV_UNDI_GET_IFACE_INFO
PXE API function code for pxenv_undi_get_iface_info()
#define UNDI_FL_INITIALIZED
UNDI flag: UNDI_STARTUP and UNDI_INITIALIZE have been called.
int strncmp(const char *first, const char *second, size_t max)
Compare strings.
UINT16_t isapnp_csn
ISAPnP card select number, or UNDI_NO_ISAPNP_CSN.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
void * priv
Driver private data.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
static int undinet_irq_is_broken(struct device_description *desc)
Check for devices with broken support for generating interrupts.
static struct net_device * netdev
Parameter block for pxenv_undi_shutdown()
unsigned int irq
Assigned IRQ number.
Parameter block for pxenv_undi_startup()
SEGOFF16_t entry
Entry point.
int hacks
Bug workarounds.
int register_netdev(struct net_device *netdev)
Register network device.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
UINT16_t isapnp_read_port
ISAPnP read port, or UNDI_NO_ISAPNP_READ_PORT.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
static int undinet_call(struct undi_nic *undinic, unsigned int function, void *params, size_t params_len)
Issue UNDI API call.
struct device * dev
Underlying hardware device.
UINT16_t pci_busdevfn
PCI bus:dev.fn, or UNDI_NO_PCI_BUSDEVFN.
Parameter block for pxenv_undi_cleanup()
#define UNDI_INITIALIZE_RETRY_MAX
Maximum number of times to retry PXENV_UNDI_INITIALIZE.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
int find_pnp_bios(void)
Locate Plug-and-Play BIOS.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
Parameter block for pxenv_undi_get_iface_info()
#define undinet_entry_point
struct device_description desc
Device description.
static void undi_set_drvdata(struct undi_device *undi, void *priv)
Set UNDI driver-private data.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
Parameter block for pxenv_start_undi()
#define PXENV_UNDI_STARTUP
PXE API function code for pxenv_undi_startup()
#define PXENV_UNDI_INITIALIZE
PXE API function code for pxenv_undi_initialize()
static struct net_device_operations undinet_operations
UNDI network device operations.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
#define UNDI_INITIALIZE_RETRY_DELAY_MS
Delay between retries of PXENV_UNDI_INITIALIZE.
#define UNDI_FL_STARTED
UNDI flag: START_UNDI has been called.
Parameter block for pxenv_stop_undi()
int irq_supported
Device supports IRQs.
void * memset(void *dest, int character, size_t len) __nonnull