50 #define EIO_INVALID_CDB __einfo_error ( EINFO_EIO_INVALID_CDB ) 51 #define EINFO_EIO_INVALID_CDB \ 52 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_INVALID_CDB, \ 54 #define EIO_INVALID_CPB __einfo_error ( EINFO_EIO_INVALID_CPB ) 55 #define EINFO_EIO_INVALID_CPB \ 56 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_INVALID_CPB, \ 58 #define EIO_BUSY __einfo_error ( EINFO_EIO_BUSY ) 59 #define EINFO_EIO_BUSY \ 60 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_BUSY, \ 62 #define EIO_QUEUE_FULL __einfo_error ( EINFO_EIO_QUEUE_FULL ) 63 #define EINFO_EIO_QUEUE_FULL \ 64 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_QUEUE_FULL, \ 66 #define EIO_ALREADY_STARTED __einfo_error ( EINFO_EIO_ALREADY_STARTED ) 67 #define EINFO_EIO_ALREADY_STARTED \ 68 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_ALREADY_STARTED, \ 70 #define EIO_NOT_STARTED __einfo_error ( EINFO_EIO_NOT_STARTED ) 71 #define EINFO_EIO_NOT_STARTED \ 72 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NOT_STARTED, \ 74 #define EIO_NOT_SHUTDOWN __einfo_error ( EINFO_EIO_NOT_SHUTDOWN ) 75 #define EINFO_EIO_NOT_SHUTDOWN \ 76 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NOT_SHUTDOWN, \ 78 #define EIO_ALREADY_INITIALIZED __einfo_error ( EINFO_EIO_ALREADY_INITIALIZED ) 79 #define EINFO_EIO_ALREADY_INITIALIZED \ 80 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_ALREADY_INITIALIZED, \ 81 "Already initialized" ) 82 #define EIO_NOT_INITIALIZED __einfo_error ( EINFO_EIO_NOT_INITIALIZED ) 83 #define EINFO_EIO_NOT_INITIALIZED \ 84 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NOT_INITIALIZED, \ 86 #define EIO_DEVICE_FAILURE __einfo_error ( EINFO_EIO_DEVICE_FAILURE ) 87 #define EINFO_EIO_DEVICE_FAILURE \ 88 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_DEVICE_FAILURE, \ 90 #define EIO_NVDATA_FAILURE __einfo_error ( EINFO_EIO_NVDATA_FAILURE ) 91 #define EINFO_EIO_NVDATA_FAILURE \ 92 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NVDATA_FAILURE, \ 93 "Non-volatile data failure" ) 94 #define EIO_UNSUPPORTED __einfo_error ( EINFO_EIO_UNSUPPORTED ) 95 #define EINFO_EIO_UNSUPPORTED \ 96 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_UNSUPPORTED, \ 98 #define EIO_BUFFER_FULL __einfo_error ( EINFO_EIO_BUFFER_FULL ) 99 #define EINFO_EIO_BUFFER_FULL \ 100 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_BUFFER_FULL, \ 102 #define EIO_INVALID_PARAMETER __einfo_error ( EINFO_EIO_INVALID_PARAMETER ) 103 #define EINFO_EIO_INVALID_PARAMETER \ 104 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_INVALID_PARAMETER, \ 105 "Invalid parameter" ) 106 #define EIO_INVALID_UNDI __einfo_error ( EINFO_EIO_INVALID_UNDI ) 107 #define EINFO_EIO_INVALID_UNDI \ 108 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_INVALID_UNDI, \ 110 #define EIO_IPV4_NOT_SUPPORTED __einfo_error ( EINFO_EIO_IPV4_NOT_SUPPORTED ) 111 #define EINFO_EIO_IPV4_NOT_SUPPORTED \ 112 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_IPV4_NOT_SUPPORTED, \ 113 "IPv4 not supported" ) 114 #define EIO_IPV6_NOT_SUPPORTED __einfo_error ( EINFO_EIO_IPV6_NOT_SUPPORTED ) 115 #define EINFO_EIO_IPV6_NOT_SUPPORTED \ 116 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_IPV6_NOT_SUPPORTED, \ 117 "IPv6 not supported" ) 118 #define EIO_NOT_ENOUGH_MEMORY __einfo_error ( EINFO_EIO_NOT_ENOUGH_MEMORY ) 119 #define EINFO_EIO_NOT_ENOUGH_MEMORY \ 120 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NOT_ENOUGH_MEMORY, \ 121 "Not enough memory" ) 122 #define EIO_NO_DATA __einfo_error ( EINFO_EIO_NO_DATA ) 123 #define EINFO_EIO_NO_DATA \ 124 __einfo_uniqify ( EINFO_EIO, PXE_STATCODE_NO_DATA, \ 126 #define EIO_STAT( stat ) \ 127 EUNIQ ( EINFO_EIO, -(stat), EIO_INVALID_CDB, EIO_INVALID_CPB, \ 128 EIO_BUSY, EIO_QUEUE_FULL, EIO_ALREADY_STARTED, \ 129 EIO_NOT_STARTED, EIO_NOT_SHUTDOWN, EIO_ALREADY_INITIALIZED, \ 130 EIO_NOT_INITIALIZED, EIO_DEVICE_FAILURE, EIO_NVDATA_FAILURE, \ 131 EIO_UNSUPPORTED, EIO_BUFFER_FULL, EIO_INVALID_PARAMETER, \ 132 EIO_INVALID_UNDI, EIO_IPV4_NOT_SUPPORTED, \ 133 EIO_IPV6_NOT_SUPPORTED, EIO_NOT_ENOUGH_MEMORY, EIO_NO_DATA ) 140 #define PCI_MAX_BAR 6 200 #define NII_RX_QUOTA 4 227 DBGC ( nii,
"NII %s could not locate PCI I/O protocol: %s\n",
239 DBGC ( nii,
"NII %s could not open PCI I/O protocol: %s\n",
243 nii->
pci_io = pci_io.pci_io;
248 for ( bar = (
PCI_MAX_BAR - 1 ) ; bar >= 0 ; bar-- ) {
257 DBGC ( nii,
"NII %s could not get BAR %d attributes: " 259 goto err_get_bar_attributes;
272 DBGC ( nii,
"no memory BAR and " );
277 DBGC ( nii,
"no I/O BAR\n" );
282 err_get_bar_attributes:
303 DBGC ( nii,
"NII %s removing stale mapping %#llx\n",
304 nii->
dev.
name, ( (
unsigned long long )
map->addr ) );
336 access = &
nii->pci_io->Mem;
339 access = &
nii->pci_io->Io;
348 width = (
fls (
len ) - 1 );
351 if ( ( efirc = io (
nii->pci_io, width, bar,
addr, 1,
354 DBGC (
nii,
"NII %s I/O operation %#x failed: %s\n",
395 DBGC ( nii,
"NII %s unsupported mapping direction %d\n",
411 DBGC ( nii,
"NII %s map operation failed: %s\n",
418 DBGC2 ( nii,
"NII %s mapped %#llx+%#x->%#llx\n",
420 len, ( (
unsigned long long ) *
phys ) );
451 DBGC2 ( nii,
"NII %s unmapped %#llx+%#x->%#llx\n",
453 len, ( (
unsigned long long ) mapped ) );
458 DBGC ( nii,
"NII %s non-existent mapping %#llx+%#x->%#llx\n",
460 len, ( (
unsigned long long ) mapped ) );
478 if (
addr == mapped )
487 dst = ( (
void * ) (
intptr_t ) mapped );
534 #define NII_OP( opcode, opflags ) ( (opcode) | ( (opflags) << 16 ) ) 542 #define NII_OPCODE( op ) ( (op) & 0xffff ) 550 #define NII_OPFLAGS( op ) ( (op) >> 16 ) 564 size_t cpb_len,
void *
db,
size_t db_len ) {
570 memset ( &cdb, 0,
sizeof ( cdb ) );
583 DBGC2 (
nii,
"NII %s issuing %02x:%04x ifnum %d%s%s\n",
585 ( cpb ?
" cpb" :
"" ), (
db ?
" db" :
"" ) );
597 return -cdb.StatCode;
658 memset ( &cpb, 0,
sizeof ( cpb ) );
669 sizeof ( cpb ) ) ) < 0 ) {
671 DBGC (
nii,
"NII %s could not start: %s\n",
691 DBGC (
nii,
"NII %s could not stop: %s\n",
713 sizeof (
db ) ) ) < 0 ) {
715 DBGC (
nii,
"NII %s could not get initialisation info: %s\n",
721 switch (
db.IFtype ) {
726 DBGC (
nii,
"NII %s unknown interface type %#02x\n",
727 nii->dev.name,
db.IFtype );
737 nii->buffer_len =
db.MemoryRequired;
738 nii->mtu = (
db.FrameDataLen +
db.MediaHeaderLen );
761 if ( !
nii->buffer ) {
767 memset ( &cpb, 0,
sizeof ( cpb ) );
777 &
db,
sizeof (
db ) ) ) < 0 ) {
779 DBGC (
nii,
"NII %s could not initialise: %s\n",
832 DBGC (
nii,
"NII %s could not shut down: %s\n",
865 DBGC (
nii,
"NII %s could not get station address: %s\n",
867 goto err_station_address;
876 sizeof (
nii->broadcast ) );
904 memset ( &cpb, 0,
sizeof ( cpb ) );
913 DBGC (
nii,
"NII %s could not set station address: %s\n",
947 DBGC (
nii,
"NII %s could not %s%sable receive filters " 948 "%#04x: %s\n",
nii->dev.name,
1009 memset ( &cpb, 0,
sizeof ( cpb ) );
1019 DBGC (
nii,
"NII %s could not transmit: %s\n",
1069 if ( !
nii->rxbuf ) {
1071 if ( !
nii->rxbuf ) {
1078 memset ( &cpb, 0,
sizeof ( cpb ) );
1084 &cpb,
sizeof ( cpb ),
1085 &
db,
sizeof (
db ) ) ) < 0 ) {
1095 DBGC (
nii,
"NII %s could not receive: %s\n",
1146 DBGC (
nii,
"NII %s could not get status: %s\n",
1193 DBGC (
nii,
"NII %s could not initialise with cable " 1196 DBGC (
nii,
"NII %s could not initialise without " 1197 "cable detection: %s\n",
1199 goto err_initialise;
1205 DBGC (
nii,
"NII %s could not set station address: %s\n",
1224 goto err_enable_rx_filters;
1228 err_enable_rx_filters:
1296 nii->dev.driver_name =
"NII";
1308 DBGC (
nii,
"NII %s cannot open NII protocol: %s\n",
1311 goto err_open_protocol;
1317 if ( !
nii->undi ) {
1318 DBGC (
nii,
"NII %s has no UNDI\n",
nii->dev.name );
1323 DBGC (
nii,
"NII %s is a mythical hardware UNDI\n",
1331 nii->issue = ( ( (
void * )
nii->undi ) +
1332 nii->undi->EntryPoint );
1334 DBGC (
nii,
"NII %s using UNDI v%x.%x at %p entry %p impl %#08x\n",
1336 nii->undi,
nii->issue,
nii->undi->Implementation );
1344 goto err_start_undi;
1348 goto err_get_init_info;
1352 goto err_get_station_address;
1356 goto err_register_netdev;
1357 DBGC (
nii,
"NII %s registered as %s for %s\n",
nii->dev.name,
1367 err_register_netdev:
1368 err_get_station_address:
EFI_GUID efi_nii31_protocol_guid
Network interface identifier protocol GUID (new version)
static int nii_disable_rx_filters(struct nii_nic *nii)
Disable receive filters.
EFI_TPL saved_tpl
Saved task priority level.
#define NII_OPFLAGS(op)
Extract flags from operation.
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
#define EFI_UNSUPPORTED
Enumeration of EFI_STATUS.
UINT8 MinorVer
Minor version number.
struct arbelprm_rc_send_wqe rc
static void nii_poll_link(struct net_device *netdev, unsigned int stat)
Check for link state changes.
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
#define iob_put(iobuf, len)
UINT64 addr
Mapped address.
PXE_UINT32 BufferLen
Length of receive buffer.
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
#define PXE_OPCODE_SHUTDOWN
Change the UNDI operational state from Initialized to Started.
void netdev_tx_defer(struct net_device *netdev, struct io_buffer *iobuf)
Defer transmitted packet.
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
static void nii_poll(struct net_device *netdev)
Poll for completed packets.
EFI_HANDLE pci_device
PCI device.
uint8_t ll_header_len
Link-layer header length.
uint8_t ll_addr_len
Link-layer address length.
int(* open)(struct net_device *netdev)
Open network device.
PXE_UINT32 MemoryLength
MemoryLength must be greater than or equal to MemoryRequired returned by the Get Init Info command.
#define list_add(new, head)
Add a new entry to the head of a list.
#define PXE_OPFLAGS_RECEIVE_FILTER_DISABLE
static int nii_issue_db(struct nii_nic *nii, unsigned int op, void *db, size_t db_len)
Issue command with data block.
EFI_GUID efi_pci_io_protocol_guid
PCI I/O protocol GUID.
int nii_start(struct efi_device *efidev)
Attach driver to device.
static EFIAPI VOID nii_delay(UINT64 unique_id __unused, UINTN microseconds)
Delay callback.
An optional protocol that is used to describe details about the software layer that is used to produc...
A read operation from system memory by a bus master.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define NII_OPCODE(op)
Extract opcode from operation.
#define PXE_ROMID_IMP_BROADCAST_RX_SUPPORTED
PXE_UINT32 DataLen
Length of the data portion of the frame buffer in bytes.
EFI_PCI_IO_PROTOCOL_MAP Map
uint64_t desc
Microcode descriptor list physical address.
#define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN
This flag is set if no transmitted buffer addresses were written into the DB.
static int nii_initialise_flags(struct nii_nic *nii, unsigned int flags)
Initialise UNDI.
const uint8_t * ll_broadcast
Link-layer broadcast address.
#define PXE_ROMID_IMP_STATION_ADDR_SETTABLE
#define EFI_OPEN_PROTOCOL_BY_DRIVER
UINT8 MajorVer
Major version number.
#define EFI_OPEN_PROTOCOL_EXCLUSIVE
EFI Network Interface Identifier Protocol.
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
#define DBGC_EFI_OPENERS(...)
#define PXE_OPCODE_INITIALIZE
Changed UNDI operational state from Started to Initialized.
EFI_HANDLE device
EFI device handle.
PACKED struct @530 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
The common definition of QWORD, DWORD, and WORD Address Space Descriptors.
#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS
Return list of transmitted buffers for recycling.
void nii_stop(struct efi_device *efidev)
Detach driver from device.
PXE_MAC_ADDR StationAddr
If supplied and supported, the current station MAC address will be changed.
userptr_t buffer
Hardware transmit/receive buffer.
uint32_t implementation
Implementation.
#define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST
Enable broadcast packet receiving.
#define PXE_OPFLAGS_INITIALIZE_DETECT_CABLE
EFI_CLOSE_PROTOCOL CloseProtocol
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
EFI_TPL efi_internal_tpl
Internal task priority level.
static EFIAPI VOID nii_sync(UINT64 unique_id __unused, UINT64 addr, UINT32 len, UINT32 dir, UINT64 mapped)
Sync callback.
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
ACPI 1.0b definitions from the ACPI Specification, revision 1.0b.
#define PXE_IFTYPE_ETHERNET
This information is from the ARP section of RFC 1700.
PXE_SW_UNDI * undi
!PXE structure
#define PXE_OPCODE_STATION_ADDRESS
Read & change station MAC address.
#define ECANCELED
Operation canceled.
#define ENOTSUP
Operation not supported.
A doubly-linked list entry (or list head)
UINT64 Id
The address of the first byte of the identifying structure for this network interface.
static void nii_poll_tx(struct net_device *netdev, unsigned int stat)
Poll for completed packets.
static EFIAPI VOID nii_map(UINT64 unique_id, UINT64 addr, UINT32 len, UINT32 dir, UINT64 mapped)
Map callback.
#define ACPI_ADDRESS_SPACE_TYPE_MEM
static void nii_shutdown(struct nii_nic *nii)
Shut down UNDI.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
struct net_device * alloc_netdev(size_t priv_len)
Allocate network device.
#define list_del(list)
Delete an entry from a list.
PXE_UINT64 FrameAddr
Address of first byte of frame buffer.
PXE_UINT64 MemoryAddr
Address of first (lowest) byte of the memory buffer.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static signed char phys[4]
uint32_t userptr_t
A pointer to a user buffer.
#define __unused
Declare a variable or data structure as unused.
#define PXE_OPFLAGS_TRANSMIT_WHOLE
#define PXE_OPCODE_TRANSMIT
Transmit packet(s).
UINT64 Mem_IO
PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port, UINT64 buf_addr);.
#define PXE_STATFLAGS_STATUS_MASK
Common StatFlags that can be returned by all commands.
static int nii_set_station_address(struct nii_nic *nii, struct net_device *netdev)
Set station address.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
uint8_t hw_addr_len
Hardware address length.
static int nii_open(struct net_device *netdev)
Open network device.
static int nii_set_rx_filters(struct nii_nic *nii, unsigned int flags)
Set receive filters.
void * priv
Driver private data.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define PCI_MAX_BAR
Maximum PCI BAR.
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.
static EFI_ACPI_TABLE_PROTOCOL * acpi
ACPI table protocol protocol.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
EFI_PCI_IO_PROTOCOL * pci_io
PCI I/O protocol.
static EFIAPI VOID nii_io(UINT64 unique_id, UINT8 op, UINT8 len, UINT64 addr, UINT64 data)
I/O callback.
EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
static struct net_device * netdev
EFI_PCI_IO_PROTOCOL_WIDTH
#define PXE_OPFLAGS_GET_INTERRUPT_STATUS
UNDI Get Status.
uint16_t count
Number of entries.
#define PXE_OPFLAGS_RECEIVE_FILTER_ENABLE
#define PXE_ROMID_IMP_HW_UNDI
Implementation flags.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
static struct net_device_operations nii_operations
NII network device operations.
#define PXE_ROMID_IMP_SW_VIRT_ADDR
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
UINT64 Map_Mem
PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size, UINT32 Direction,...
unsigned int mem_bar
Memory BAR.
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
EFI_PCI_IO_PROTOCOL_UNMAP Unmap
EFI_PCI_IO_PROTOCOL_IO_MEM Write
Write PCI controller registers in the PCI memory or I/O space.
PXE_UINT64 BufferAddr
Address of first byte of receive buffer.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
void * zalloc(size_t size)
Allocate cleared memory.
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
int media
Media status is supported.
#define PXE_OPFLAGS_STATION_ADDRESS_WRITE
int register_netdev(struct net_device *netdev)
Register network device.
PXE_MAC_ADDR broadcast
Broadcast address.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
static void * efidev_get_drvdata(struct efi_device *efidev)
Get EFI driver-private data.
static EFIAPI VOID nii_block(UINT64 unique_id, UINT32 acquire)
Block callback.
#define PXE_ROMID_IMP_PROMISCUOUS_RX_SUPPORTED
#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA
This flag is set if there is no media detected.
static int nii_initialise_cable(struct nii_nic *nii)
Initialise UNDI with cable detection.
struct efi_device * efidev
EFI device.
static size_t iob_tailroom(struct io_buffer *iobuf)
Calculate available space at end of an I/O buffer.
#define ENODEV
No such device.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
#define ACPI_ADDRESS_SPACE_TYPE_IO
#define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK
EFIAPI VOID(* issue)(UINT64 cdb)
Entry point.
UINT64 UINTN
Unsigned value of native width.
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.
#define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST
Enable unicast packet receiving.
#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED
unsigned int io_bar
I/O BAR.
static void nii_close(struct net_device *netdev)
Close network device.
#define PXE_OPCODE_STOP
Change UNDI operational state from Started to Stopped.
#define PXE_OPCODE_GET_STATUS
Get & clear interrupt status.
Provides both read and write access to system memory by both the processor and a bus master.
static __always_inline int struct dma_mapping * map
int efi_locate_device(EFI_HANDLE device, EFI_GUID *protocol, EFI_HANDLE *parent, unsigned int skip)
Locate parent device supporting a given protocol.
static int nii_issue(struct nii_nic *nii, unsigned int op)
Issue command.
#define VOID
Undeclared type.
struct io_buffer * txbuf
Current transmit buffer.
unsigned long long UINT64
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL * nii
Network interface identifier protocol.
EFI_PCI_IO_PROTOCOL_OPERATION
static int nii_initialise(struct nii_nic *nii)
Initialise UNDI.
static int nii_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
Network device operations.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
struct device * dev
Underlying hardware device.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Network device management.
static int nii_enable_rx_filters(struct nii_nic *nii)
Enable receive filters.
static struct dmfe_private * db
static int nii_get_station_address(struct nii_nic *nii, struct net_device *netdev)
Get station addresses.
VOID * mapping
Mapping cookie created by PCI I/O protocol.
static uint16_t struct vmbus_xfer_pages_operations * op
#define INIT_LIST_HEAD(list)
Initialise a list head.
void netdev_tx_complete_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Complete network transmission.
char name[NETDEV_NAME_LEN]
Name of this network device.
UINTN EFI_TPL
Task priority level.
#define PXE_STATCODE_NO_DATA
static __always_inline void ufree(userptr_t userptr)
Free external memory.
static __always_inline userptr_t umalloc(size_t size)
Allocate external memory.
UINT64 Delay
PXE_VOID Delay(UINT64 UnqId, UINTN microseconds);.
UINT64 Sync_Mem
PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual, UINT32 size, UINT32 Direction, UINT64 mapped_addr);.
static int nii_start_undi(struct nii_nic *nii)
Start UNDI.
EFI_PCI_IO_PROTOCOL_IO_MEM Read
Read PCI controller registers in the PCI memory or I/O space.
void * data
Start of data.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
struct list_head children
Devices attached to this device.
struct device dev
Generic device.
#define TO_AND_FROM_DEVICE
struct list_head list
List of mappings.
UINT64 Block
PXE_VOID Block(UINT64 unq_id, UINT32 enable);.
UINT64 Unique_ID
protocol driver can provide anything for this Unique_ID, UNDI remembers that as just a 64bit value as...
#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST
Enable promiscuous multicast packet receiving.
#define PXE_OPCODE_RECEIVE
Receive packet.
uint8_t data[48]
Additional event data.
static void nii_pci_close(struct nii_nic *nii)
Close PCI I/O protocol.
static int nii_get_init_info(struct nii_nic *nii, struct net_device *netdev)
Get initialisation information.
#define PXE_OPCODE_RECEIVE_FILTERS
Read & change state of packet receive filters.
#define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS
Enable promiscuous packet receiving.
size_t buffer_len
Hardware transmit/receive buffer length.
PXE_UINT8 PXE_MAC_ADDR[PXE_MAC_LENGTH]
static EFIAPI VOID nii_unmap(UINT64 unique_id, UINT64 addr, UINT32 len, UINT32 dir __unused, UINT64 mapped)
Unmap callback.
size_t mtu
Maximum packet length.
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
A write operation from system memory by a bus master.
static void nii_stop_undi(struct nii_nic *nii)
Stop UNDI.
UINT16 IfNum
The network interface number that is being identified by this Network Interface Identifier Protocol.
#define PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
size_t max_pkt_len
Maximum packet length.
EFI_RESTORE_TPL RestoreTPL
#define NII_RX_QUOTA
Maximum number of received packets per poll.
static void nii_poll_rx(struct net_device *netdev)
Poll for received packets.
#define PXE_OPCODE_GET_INIT_INFO
Get UNDI initialization information.
#define PXE_OPFLAGS_STATION_ADDRESS_READ
UNDI Station Address.
#define fls(x)
Find last (i.e.
static void efidev_set_drvdata(struct efi_device *efidev, void *priv)
Set EFI driver-private data.
The EFI_PCI_IO_PROTOCOL provides the basic Memory, I/O, PCI configuration, and DMA interfaces used to...
struct device dev
Generic device.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
struct list_head mappings
Mapping list.
#define PXE_OPCODE_START
Change UNDI operational state from Stopped to Started.
void iob_pad(struct io_buffer *iobuf, size_t min_len)
Pad I/O buffer.
UINT64 UnMap_Mem
PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size, UINT32 Direction,...
#define PXE_OPFLAGS_GET_MEDIA_STATUS
Return current media status.
struct ll_protocol * ll_protocol
Link-layer protocol.
static int nii_issue_cpb(struct nii_nic *nii, unsigned int op, void *cpb, size_t cpb_len)
Issue command with parameter block.
void efi_device_info(EFI_HANDLE device, const char *prefix, struct device *dev)
Get underlying device information.
#define NII_OP(opcode, opflags)
Construct operation from opcode and flags.
static int nii_pci_open(struct nii_nic *nii)
Open PCI I/O protocol and identify BARs.
#define PXE_STATCODE_SUCCESS
Common StatCodes returned by all UNDI commands, UNDI protocol functions and BC protocol functions.
void * memset(void *dest, int character, size_t len) __nonnull
struct io_buffer * rxbuf
Current receive buffer.
#define PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE