51#define EIO_INVALID_CDB __einfo_error ( EINFO_EIO_INVALID_CDB )
52#define EINFO_EIO_INVALID_CDB \
53 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_INVALID_CDB, \
55#define EIO_INVALID_CPB __einfo_error ( EINFO_EIO_INVALID_CPB )
56#define EINFO_EIO_INVALID_CPB \
57 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_INVALID_CPB, \
59#define EIO_BUSY __einfo_error ( EINFO_EIO_BUSY )
60#define EINFO_EIO_BUSY \
61 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_BUSY, \
63#define EIO_QUEUE_FULL __einfo_error ( EINFO_EIO_QUEUE_FULL )
64#define EINFO_EIO_QUEUE_FULL \
65 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_QUEUE_FULL, \
67#define EIO_ALREADY_STARTED __einfo_error ( EINFO_EIO_ALREADY_STARTED )
68#define EINFO_EIO_ALREADY_STARTED \
69 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_ALREADY_STARTED, \
71#define EIO_NOT_STARTED __einfo_error ( EINFO_EIO_NOT_STARTED )
72#define EINFO_EIO_NOT_STARTED \
73 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NOT_STARTED, \
75#define EIO_NOT_SHUTDOWN __einfo_error ( EINFO_EIO_NOT_SHUTDOWN )
76#define EINFO_EIO_NOT_SHUTDOWN \
77 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NOT_SHUTDOWN, \
79#define EIO_ALREADY_INITIALIZED __einfo_error ( EINFO_EIO_ALREADY_INITIALIZED )
80#define EINFO_EIO_ALREADY_INITIALIZED \
81 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_ALREADY_INITIALIZED, \
82 "Already initialized" )
83#define EIO_NOT_INITIALIZED __einfo_error ( EINFO_EIO_NOT_INITIALIZED )
84#define EINFO_EIO_NOT_INITIALIZED \
85 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NOT_INITIALIZED, \
87#define EIO_DEVICE_FAILURE __einfo_error ( EINFO_EIO_DEVICE_FAILURE )
88#define EINFO_EIO_DEVICE_FAILURE \
89 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_DEVICE_FAILURE, \
91#define EIO_NVDATA_FAILURE __einfo_error ( EINFO_EIO_NVDATA_FAILURE )
92#define EINFO_EIO_NVDATA_FAILURE \
93 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NVDATA_FAILURE, \
94 "Non-volatile data failure" )
95#define EIO_UNSUPPORTED __einfo_error ( EINFO_EIO_UNSUPPORTED )
96#define EINFO_EIO_UNSUPPORTED \
97 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_UNSUPPORTED, \
99#define EIO_BUFFER_FULL __einfo_error ( EINFO_EIO_BUFFER_FULL )
100#define EINFO_EIO_BUFFER_FULL \
101 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_BUFFER_FULL, \
103#define EIO_INVALID_PARAMETER __einfo_error ( EINFO_EIO_INVALID_PARAMETER )
104#define EINFO_EIO_INVALID_PARAMETER \
105 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_INVALID_PARAMETER, \
106 "Invalid parameter" )
107#define EIO_INVALID_UNDI __einfo_error ( EINFO_EIO_INVALID_UNDI )
108#define EINFO_EIO_INVALID_UNDI \
109 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_INVALID_UNDI, \
111#define EIO_IPV4_NOT_SUPPORTED __einfo_error ( EINFO_EIO_IPV4_NOT_SUPPORTED )
112#define EINFO_EIO_IPV4_NOT_SUPPORTED \
113 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_IPV4_NOT_SUPPORTED, \
114 "IPv4 not supported" )
115#define EIO_IPV6_NOT_SUPPORTED __einfo_error ( EINFO_EIO_IPV6_NOT_SUPPORTED )
116#define EINFO_EIO_IPV6_NOT_SUPPORTED \
117 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_IPV6_NOT_SUPPORTED, \
118 "IPv6 not supported" )
119#define EIO_NOT_ENOUGH_MEMORY __einfo_error ( EINFO_EIO_NOT_ENOUGH_MEMORY )
120#define EINFO_EIO_NOT_ENOUGH_MEMORY \
121 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NOT_ENOUGH_MEMORY, \
122 "Not enough memory" )
123#define EIO_NO_DATA __einfo_error ( EINFO_EIO_NO_DATA )
124#define EINFO_EIO_NO_DATA \
125 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NO_DATA, \
127#define EIO_STAT( stat ) \
128 EUNIQ ( EINFO_EIO, -(stat), EIO_INVALID_CDB, EIO_INVALID_CPB, \
129 EIO_BUSY, EIO_QUEUE_FULL, EIO_ALREADY_STARTED, \
130 EIO_NOT_STARTED, EIO_NOT_SHUTDOWN, EIO_ALREADY_INITIALIZED, \
131 EIO_NOT_INITIALIZED, EIO_DEVICE_FAILURE, EIO_NVDATA_FAILURE, \
132 EIO_UNSUPPORTED, EIO_BUFFER_FULL, EIO_INVALID_PARAMETER, \
133 EIO_INVALID_UNDI, EIO_IPV4_NOT_SUPPORTED, \
134 EIO_IPV6_NOT_SUPPORTED, EIO_NOT_ENOUGH_MEMORY, EIO_NO_DATA )
201#define NII_RX_QUOTA 4
224 DBGC ( nii,
"NII %s could not locate PCI I/O protocol: %s\n",
238 DBGC ( nii,
"NII %s could not open PCI I/O protocol: %s\n",
246 for ( bar = (
PCI_MAX_BAR - 1 ) ; bar >= 0 ; bar-- ) {
255 DBGC ( nii,
"NII %s could not get BAR %d attributes: "
257 goto err_get_bar_attributes;
270 DBGC ( nii,
"no memory BAR and " );
275 DBGC ( nii,
"no I/O BAR\n" );
280 err_get_bar_attributes:
299 DBGC ( nii,
"NII %s removing stale mapping %#llx\n",
300 nii->
dev.
name, ( (
unsigned long long )
map->addr ) );
331 access = &
nii->pci_io->Mem;
334 access = &
nii->pci_io->Io;
343 width = (
fls (
len ) - 1 );
346 if ( ( efirc = io (
nii->pci_io, width, bar,
addr, 1,
349 DBGC (
nii,
"NII %s I/O operation %#x failed: %s\n",
390 DBGC ( nii,
"NII %s unsupported mapping direction %d\n",
406 DBGC ( nii,
"NII %s map operation failed: %s\n",
413 DBGC2 ( nii,
"NII %s mapped %#llx+%#x->%#llx\n",
415 len, ( (
unsigned long long ) *
phys ) );
446 DBGC2 ( nii,
"NII %s unmapped %#llx+%#x->%#llx\n",
448 len, ( (
unsigned long long ) mapped ) );
453 DBGC ( nii,
"NII %s non-existent mapping %#llx+%#x->%#llx\n",
455 len, ( (
unsigned long long ) mapped ) );
473 if (
addr == mapped )
482 dst = ( (
void * ) (
intptr_t ) mapped );
529#define NII_OP( opcode, opflags ) ( (opcode) | ( (opflags) << 16 ) )
537#define NII_OPCODE( op ) ( (op) & 0xffff )
545#define NII_OPFLAGS( op ) ( (op) >> 16 )
559 size_t cpb_len,
void *
db,
size_t db_len ) {
565 memset ( &cdb, 0,
sizeof ( cdb ) );
578 DBGC2 (
nii,
"NII %s issuing %02x:%04x ifnum %d%s%s\n",
580 ( cpb ?
" cpb" :
"" ), (
db ?
" db" :
"" ) );
653 memset ( &cpb, 0,
sizeof ( cpb ) );
664 sizeof ( cpb ) ) ) < 0 ) {
666 DBGC (
nii,
"NII %s could not start: %s\n",
686 DBGC (
nii,
"NII %s could not stop: %s\n",
708 sizeof (
db ) ) ) < 0 ) {
710 DBGC (
nii,
"NII %s could not get initialisation info: %s\n",
716 switch (
db.IFtype ) {
718 netdev->ll_protocol = ðernet_protocol;
721 DBGC (
nii,
"NII %s unknown interface type %#02x\n",
722 nii->dev.name,
db.IFtype );
727 assert (
db.MediaHeaderLen ==
netdev->ll_protocol->ll_header_len );
732 nii->buffer_len =
db.MemoryRequired;
733 nii->mtu = (
db.FrameDataLen +
db.MediaHeaderLen );
756 if ( !
nii->buffer ) {
762 memset ( &cpb, 0,
sizeof ( cpb ) );
772 &
db,
sizeof (
db ) ) ) < 0 ) {
774 DBGC (
nii,
"NII %s could not initialise: %s\n",
827 DBGC (
nii,
"NII %s could not shut down: %s\n",
860 DBGC (
nii,
"NII %s could not get station address: %s\n",
862 goto err_station_address;
867 netdev->ll_protocol->ll_addr_len );
869 netdev->ll_protocol->hw_addr_len );
871 sizeof (
nii->broadcast ) );
899 memset ( &cpb, 0,
sizeof ( cpb ) );
901 netdev->ll_protocol->ll_addr_len );
908 DBGC (
nii,
"NII %s could not set station address: %s\n",
942 DBGC (
nii,
"NII %s could not %s%sable receive filters "
943 "%#04x: %s\n",
nii->dev.name,
1004 memset ( &cpb, 0,
sizeof ( cpb ) );
1014 DBGC (
nii,
"NII %s could not transmit: %s\n",
1064 if ( !
nii->rxbuf ) {
1066 if ( !
nii->rxbuf ) {
1073 memset ( &cpb, 0,
sizeof ( cpb ) );
1079 &cpb,
sizeof ( cpb ),
1080 &
db,
sizeof (
db ) ) ) < 0 ) {
1090 DBGC (
nii,
"NII %s could not receive: %s\n",
1141 DBGC (
nii,
"NII %s could not get status: %s\n",
1188 DBGC (
nii,
"NII %s could not initialise with cable "
1191 DBGC (
nii,
"NII %s could not initialise without "
1192 "cable detection: %s\n",
1194 goto err_initialise;
1200 DBGC (
nii,
"NII %s could not set station address: %s\n",
1219 goto err_enable_rx_filters;
1223 err_enable_rx_filters:
1273 DBGC (
device,
"NII %s could not exclude drivers: %s\n",
1308 nii->dev.driver_name =
"NII";
1316 &
nii->nii ) ) != 0 ) {
1317 DBGC (
nii,
"NII %s cannot open NII protocol: %s\n",
1320 goto err_open_protocol;
1325 if ( !
nii->undi ) {
1326 DBGC (
nii,
"NII %s has no UNDI\n",
nii->dev.name );
1331 DBGC (
nii,
"NII %s is a mythical hardware UNDI\n",
1339 nii->issue = ( ( (
void * )
nii->undi ) +
1340 nii->undi->EntryPoint );
1342 DBGC (
nii,
"NII %s using UNDI v%x.%x at %p entry %p impl %#08x\n",
1344 nii->undi,
nii->issue,
nii->undi->Implementation );
1352 goto err_start_undi;
1356 goto err_get_init_info;
1360 goto err_get_station_address;
1364 goto err_register_netdev;
1365 DBGC (
nii,
"NII %s registered as %s for %s\n",
nii->dev.name,
1375 err_register_netdev:
1376 err_get_station_address:
UINT64 UINTN
Unsigned value of native width.
unsigned long long UINT64
8-byte unsigned value.
unsigned char UINT8
1-byte unsigned value.
unsigned int UINT32
4-byte unsigned value.
ACPI 1.0b definitions from the ACPI Specification, revision 1.0b.
#define ACPI_ADDRESS_SPACE_TYPE_IO
PACKED struct @070126363266142000122014272037224307124317056203 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
The common definition of QWORD, DWORD, and WORD Address Space Descriptors.
#define ACPI_ADDRESS_SPACE_TYPE_MEM
#define NULL
NULL pointer (VOID *)
#define VOID
Undeclared type.
EFI Network Interface Identifier Protocol.
struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL
Forward reference for pure ANSI compatability.
EFI_PCI_IO_PROTOCOL_WIDTH
EFI_PCI_IO_PROTOCOL_OPERATION
@ EfiPciIoOperationBusMasterWrite
A write operation from system memory by a bus master.
@ EfiPciIoOperationBusMasterRead
A read operation from system memory by a bus master.
@ EfiPciIoOperationBusMasterCommonBuffer
Provides both read and write access to system memory by both the processor and a bus master.
struct _EFI_PCI_IO_PROTOCOL EFI_PCI_IO_PROTOCOL
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_IO_MEM)(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
#define EFI_UNSUPPORTED
Enumeration of EFI_STATUS.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
UINTN EFI_TPL
Task priority level.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
PXE_UINT8 PXE_MAC_ADDR[PXE_MAC_LENGTH]
#define PXE_OPCODE_TRANSMIT
Transmit packet(s).
#define PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED
#define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST
Enable unicast packet receiving.
#define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK
struct s_pxe_db_initialize PXE_DB_INITIALIZE
#define PXE_OPCODE_STOP
Change UNDI operational state from Started to Stopped.
#define PXE_OPCODE_GET_STATUS
Get & clear interrupt status.
#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED
#define PXE_IFTYPE_ETHERNET
This information is from the ARP section of RFC 1700.
#define PXE_STATCODE_NO_DATA
struct s_pxe_dpb_station_address PXE_DB_STATION_ADDRESS
struct s_pxe_cpb_station_address PXE_CPB_STATION_ADDRESS
struct s_pxe_sw_undi PXE_SW_UNDI
#define PXE_OPCODE_STATION_ADDRESS
Read & change station MAC address.
struct s_pxe_cpb_transmit PXE_CPB_TRANSMIT
struct s_pxe_db_get_init_info PXE_DB_GET_INIT_INFO
#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA
This flag is set if there is no media detected.
#define PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE
#define TO_AND_FROM_DEVICE
#define PXE_OPFLAGS_RECEIVE_FILTER_DISABLE
struct s_pxe_cpb_start_31 PXE_CPB_START_31
#define PXE_ROMID_IMP_STATION_ADDR_SETTABLE
#define PXE_OPFLAGS_GET_INTERRUPT_STATUS
UNDI Get Status.
#define PXE_OPFLAGS_GET_MEDIA_STATUS
Return current media status.
#define PXE_OPFLAGS_RECEIVE_FILTER_ENABLE
#define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS
Enable promiscuous packet receiving.
#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS
Return list of transmitted buffers for recycling.
struct s_pxe_db_get_status PXE_DB_GET_STATUS
#define PXE_OPFLAGS_STATION_ADDRESS_READ
UNDI Station Address.
struct s_pxe_db_receive PXE_DB_RECEIVE
#define PXE_STATFLAGS_STATUS_MASK
Common StatFlags that can be returned by all commands.
#define PXE_OPCODE_RECEIVE
Receive packet.
struct s_pxe_cpb_initialize PXE_CPB_INITIALIZE
#define PXE_ROMID_IMP_PROMISCUOUS_RX_SUPPORTED
#define PXE_OPCODE_INITIALIZE
Changed UNDI operational state from Started to Initialized.
#define PXE_ROMID_IMP_HW_UNDI
Implementation flags.
#define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN
This flag is set if no transmitted buffer addresses were written into the DB.
#define PXE_OPFLAGS_TRANSMIT_WHOLE
#define PXE_ROMID_IMP_BROADCAST_RX_SUPPORTED
#define PXE_OPCODE_RECEIVE_FILTERS
Read & change state of packet receive filters.
#define PXE_OPFLAGS_STATION_ADDRESS_WRITE
#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST
Enable promiscuous multicast packet receiving.
#define PXE_OPCODE_START
Change UNDI operational state from Stopped to Started.
#define PXE_OPCODE_GET_INIT_INFO
Get UNDI initialization information.
#define PXE_ROMID_IMP_SW_VIRT_ADDR
struct s_pxe_cpb_receive PXE_CPB_RECEIVE
#define PXE_STATCODE_SUCCESS
Common StatCodes returned by all UNDI commands, UNDI protocol functions and BC protocol functions.
#define PXE_OPCODE_SHUTDOWN
Change the UNDI operational state from Initialized to Started.
#define PXE_OPFLAGS_INITIALIZE_DETECT_CABLE
#define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST
Enable broadcast packet receiving.
struct arbelprm_rc_send_wqe rc
#define assert(condition)
Assert a condition at run-time.
static struct dmfe_private * db
uint32_t stat
Completion status.
uint32_t addr
Buffer address.
static EFI_ACPI_TABLE_PROTOCOL * acpi
ACPI table protocol protocol.
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
int efi_driver_exclude(EFI_HANDLE device, EFI_GUID *protocol)
Try to disconnect an existing EFI driver.
static void * efidev_get_drvdata(struct efi_device *efidev)
Get EFI driver-private data.
static void efidev_set_drvdata(struct efi_device *efidev, void *priv)
Set EFI driver-private data.
EFI_GUID efi_nii31_protocol_guid
Network interface identifier protocol GUID (new version)
EFI_GUID efi_pci_io_protocol_guid
PCI I/O protocol GUID.
EFI_TPL efi_internal_tpl
Internal task priority level.
void efi_close_by_driver(EFI_HANDLE handle, EFI_GUID *protocol)
Close protocol opened for persistent use by a driver.
void efi_close_unsafe(EFI_HANDLE handle, EFI_GUID *protocol)
Close protocol opened for unsafe persistent use.
void efi_device_info(EFI_HANDLE device, const char *prefix, struct device *dev)
Get underlying device information.
int efi_locate_device(EFI_HANDLE device, EFI_GUID *protocol, EFI_HANDLE *parent, unsigned int skip)
Locate parent device supporting a given protocol.
uint8_t data[48]
Additional event data.
uint32_t implementation
Implementation.
struct ena_llq_option desc
Descriptor counts.
static signed char phys[4]
static struct net_device * netdev
#define __unused
Declare a variable or data structure as unused.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENOMEM
Not enough space.
#define ENOTSUP
Operation not supported.
#define ECANCELED
Operation canceled.
#define ENODEV
No such device.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define efi_open_by_driver(handle, protocol, interface)
Open protocol for persistent use by a driver.
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
#define efi_open_unsafe(handle, protocol, interface)
Open protocol for unsafe persistent use.
#define DBGC_EFI_OPENERS(...)
EFI_SYSTEM_TABLE * efi_systab
static __always_inline void * umalloc(size_t size)
Allocate external memory.
static __always_inline void ufree(void *ptr)
Free external memory.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
#define fls(x)
Find last (i.e.
void iob_pad(struct io_buffer *iobuf, size_t min_len)
Pad I/O buffer.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define iob_put(iobuf, len)
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
static size_t iob_tailroom(struct io_buffer *iobuf)
Calculate available space at end of an I/O buffer.
static __always_inline int struct dma_mapping * map
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define list_del(list)
Delete an entry from a list.
#define INIT_LIST_HEAD(list)
Initialise a list head.
#define list_add(new, head)
Add a new entry to the head of a list.
void * zalloc(size_t size)
Allocate cleared memory.
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
void netdev_tx_defer(struct net_device *netdev, struct io_buffer *iobuf)
Defer transmitted packet.
void netdev_tx_complete_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Complete network transmission.
struct net_device * alloc_netdev(size_t priv_len)
Allocate network device.
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
int register_netdev(struct net_device *netdev)
Register network device.
Network device management.
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
static uint16_t struct vmbus_xfer_pages_operations * op
static int nii_pci_open(struct nii_nic *nii)
Open PCI I/O protocol and identify BARs.
static void nii_shutdown(struct nii_nic *nii)
Shut down UNDI.
static void nii_poll(struct net_device *netdev)
Poll for completed packets.
static void nii_pci_close(struct nii_nic *nii)
Close PCI I/O protocol.
static void nii_stop_undi(struct nii_nic *nii)
Stop UNDI.
static int nii_initialise_cable(struct nii_nic *nii)
Initialise UNDI with cable detection.
static int nii_disable_rx_filters(struct nii_nic *nii)
Disable receive filters.
#define PCI_MAX_BAR
Maximum PCI BAR.
static int nii_start_undi(struct nii_nic *nii)
Start UNDI.
int nii_start(struct efi_device *efidev)
Attach driver to device.
static int nii_issue_db(struct nii_nic *nii, unsigned int op, void *db, size_t db_len)
Issue command with data block.
static EFIAPI VOID nii_map(UINT64 unique_id, UINT64 addr, UINT32 len, UINT32 dir, UINT64 mapped)
Map callback.
static EFIAPI VOID nii_io(UINT64 unique_id, UINT8 op, UINT8 len, UINT64 addr, UINT64 data)
I/O callback.
static int nii_initialise(struct nii_nic *nii)
Initialise UNDI.
static void nii_poll_rx(struct net_device *netdev)
Poll for received packets.
static int nii_initialise_flags(struct nii_nic *nii, unsigned int flags)
Initialise UNDI.
static EFIAPI VOID nii_block(UINT64 unique_id, UINT32 acquire)
Block callback.
static EFIAPI VOID nii_sync(UINT64 unique_id __unused, UINT64 addr, UINT32 len, UINT32 dir, UINT64 mapped)
Sync callback.
int nii_exclude(EFI_HANDLE device)
Exclude existing drivers.
static EFIAPI VOID nii_delay(UINT64 unique_id __unused, UINTN microseconds)
Delay callback.
#define NII_OPCODE(op)
Extract opcode from operation.
static void nii_poll_link(struct net_device *netdev, unsigned int stat)
Check for link state changes.
void nii_stop(struct efi_device *efidev)
Detach driver from device.
#define NII_OP(opcode, opflags)
Construct operation from opcode and flags.
static void nii_poll_tx(struct net_device *netdev, unsigned int stat)
Poll for completed packets.
static int nii_open(struct net_device *netdev)
Open network device.
static int nii_issue_cpb(struct nii_nic *nii, unsigned int op, void *cpb, size_t cpb_len)
Issue command with parameter block.
static struct net_device_operations nii_operations
NII network device operations.
#define NII_OPFLAGS(op)
Extract flags from operation.
static int nii_issue_cpb_db(struct nii_nic *nii, unsigned int op, void *cpb, size_t cpb_len, void *db, size_t db_len)
Issue command with parameter block and data block.
static int nii_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
static int nii_set_rx_filters(struct nii_nic *nii, unsigned int flags)
Set receive filters.
static EFIAPI VOID nii_unmap(UINT64 unique_id, UINT64 addr, UINT32 len, UINT32 dir __unused, UINT64 mapped)
Unmap callback.
static int nii_get_station_address(struct nii_nic *nii, struct net_device *netdev)
Get station addresses.
static int nii_set_station_address(struct nii_nic *nii, struct net_device *netdev)
Set station address.
static void nii_close(struct net_device *netdev)
Close network device.
static int nii_issue(struct nii_nic *nii, unsigned int op)
Issue command.
static int nii_get_init_info(struct nii_nic *nii, struct net_device *netdev)
Get initialisation information.
static int nii_enable_rx_filters(struct nii_nic *nii)
Enable receive filters.
#define NII_RX_QUOTA
Maximum number of received packets per poll.
static void(* free)(struct refcnt *refcnt))
uint16_t protocol
Protocol ID.
char * strerror(int errno)
Retrieve string representation of error number.
EFI_RESTORE_TPL RestoreTPL
EFI_PCI_IO_PROTOCOL_IO_MEM Write
Write PCI controller registers in the PCI memory or I/O space.
EFI_PCI_IO_PROTOCOL_IO_MEM Read
Read PCI controller registers in the PCI memory or I/O space.
UINT16 IfNum
The network interface number that is being identified by this Network Interface Identifier Protocol.
UINT8 MajorVer
Major version number.
UINT8 MinorVer
Minor version number.
UINT64 Id
The address of the first byte of the identifying structure for this network interface.
EFI_PCI_IO_PROTOCOL_UNMAP Unmap
EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes
EFI_PCI_IO_PROTOCOL_MAP Map
struct list_head children
Devices attached to this device.
EFI_HANDLE device
EFI device handle.
struct device dev
Generic device.
void * data
Start of data.
A doubly-linked list entry (or list head)
Network device operations.
VOID * mapping
Mapping cookie created by PCI I/O protocol.
struct list_head list
List of mappings.
UINT64 addr
Mapped address.
struct device dev
Generic device.
unsigned int io_bar
I/O BAR.
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL * nii
Network interface identifier protocol.
struct io_buffer * txbuf
Current transmit buffer.
PXE_SW_UNDI * undi
!PXE structure
PXE_MAC_ADDR broadcast
Broadcast address.
unsigned int mem_bar
Memory BAR.
int media
Media status is supported.
EFIAPI VOID(* issue)(UINT64 cdb)
Entry point.
struct io_buffer * rxbuf
Current receive buffer.
size_t buffer_len
Hardware transmit/receive buffer length.
struct efi_device * efidev
EFI device.
struct list_head mappings
Mapping list.
EFI_HANDLE pci_device
PCI device.
void * buffer
Hardware transmit/receive buffer.
EFI_TPL saved_tpl
Saved task priority level.
size_t mtu
Maximum packet length.
EFI_PCI_IO_PROTOCOL * pci_io
PCI I/O protocol.
PXE_UINT32 MemoryLength
MemoryLength must be greater than or equal to MemoryRequired returned by the Get Init Info command.
PXE_UINT64 MemoryAddr
Address of first (lowest) byte of the memory buffer.
PXE_UINT32 BufferLen
Length of receive buffer.
PXE_UINT64 BufferAddr
Address of first byte of receive buffer.
UINT64 UnMap_Mem
PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size, UINT32 Direction,...
UINT64 Sync_Mem
PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual, UINT32 size, UINT32 Direction,...
UINT64 Unique_ID
protocol driver can provide anything for this Unique_ID, UNDI remembers that as just a 64bit value as...
UINT64 Delay
PXE_VOID Delay(UINT64 UnqId, UINTN microseconds);.
UINT64 Map_Mem
PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size, UINT32 Direction,...
UINT64 Mem_IO
PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port, UINT64 buf_addr);...
UINT64 Block
PXE_VOID Block(UINT64 unq_id, UINT32 enable);.
PXE_MAC_ADDR StationAddr
If supplied and supported, the current station MAC address will be changed.
PXE_UINT32 DataLen
Length of the data portion of the frame buffer in bytes.
PXE_UINT64 FrameAddr
Address of first byte of frame buffer.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.