128 DBGC ( mnp,
"MNP %s could not transmit: %s\n",
160 DBGC (
mnp,
"MNP %s could not receive: %s\n",
189 rc = ( efirc ? -
EEFI ( efirc ) : 0 );
275 .EnableMulticastReceive =
TRUE,
276 .EnableBroadcastReceive =
TRUE,
277 .EnablePromiscuousReceive =
TRUE,
278 .FlushQueuesOnReset =
TRUE,
279 .DisableBackgroundPolling =
TRUE,
288 &
mnp->tx.token.Event ) ) != 0 ) {
290 DBGC (
mnp,
"MNP %s could not create TX event: %s\n",
298 &
mnp->rx.token.Event ) ) != 0 ) {
300 DBGC (
mnp,
"MNP %s could not create RX event: %s\n",
308 DBGC (
mnp,
"MNP %s could not configure: %s\n",
396 mnp->dev.driver_name =
"MNP";
405 DBGC (
mnp,
"MNP %s could not create child: %s\n",
418 DBGC (
mnp,
"MNP %s could not open MNP protocol: %s\n",
428 DBGC (
mnp,
"MNP %s could not get mode data: %s\n",
435 DBGC (
device,
"MNP %s has invalid hardware address length " 438 goto err_hw_addr_len;
443 DBGC (
device,
"MNP %s has invalid link-layer address length " 446 goto err_ll_addr_len;
454 DBGC (
mnp,
"MNP %s registered as %s\n",
521 DBGC (
handle,
"MNP %s could not create temporary device\n",
529 DBGC (
handle,
"MNP %s could not start MNP: %s\n",
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
struct arbelprm_rc_send_wqe rc
#define iob_put(iobuf, len)
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
void netdev_tx_defer(struct net_device *netdev, struct io_buffer *iobuf)
Defer transmitted packet.
EFI_MANAGED_NETWORK_TRANSMIT Transmit
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.
The MNP is used by network applications (and drivers) to perform raw (unformatted) asynchronous netwo...
static int mnpnet_open(struct net_device *netdev)
Open network device.
#define list_add(new, head)
Add a new entry to the head of a list.
128 bit buffer containing a unique identifier value.
static void mnpnet_close(struct net_device *netdev)
Close network device.
static void mnpnet_poll(struct net_device *netdev)
Poll for completed packets.
VOID * EFI_EVENT
Handle to an event structure.
struct mnp_token tx
Transmit token.
int efi_service_del(EFI_HANDLE service, EFI_GUID *binding, EFI_HANDLE handle)
Remove service from child handle.
void efidev_free(struct efi_device *efidev)
Free EFI device.
#define EFI_OPEN_PROTOCOL_BY_DRIVER
#define EFI_OPEN_PROTOCOL_EXCLUSIVE
EFI_CLOSE_EVENT CloseEvent
EFI_HANDLE device
EFI device handle.
EFI_GUID efi_managed_network_service_binding_protocol_guid
Managed network service binding protocol GUID.
EFI_CLOSE_PROTOCOL CloseProtocol
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
EFI_MANAGED_NETWORK_PROTOCOL * mnp
Managed network protocol.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
EFI_MANAGED_NETWORK_POLL Poll
EFI_MAC_ADDRESS CurrentAddress
The current HW MAC address for the network interface.
#define ECANCELED
Operation canceled.
#define ENOTSUP
Operation not supported.
void cachedhcp_recycle(struct net_device *netdev)
Recycle cached DHCPACK.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
#define list_del(list)
Delete an entry from a list.
An MNP transmit or receive token.
EFI_HANDLE child
EFI child device handle (if present)
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define __unused
Declare a variable or data structure as unused.
struct mnp_token rx
Receive token.
void mnptemp_destroy(struct net_device *netdev)
Destroy temporary MNP network device.
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.
void * priv
Driver private data.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
static struct net_device * netdev
struct efi_device * efidev_alloc(EFI_HANDLE device)
Allocate new EFI device.
EFI_CREATE_EVENT CreateEvent
static VOID EFIAPI mnpnet_event(EFI_EVENT event __unused, VOID *context)
Transmit or receive token event.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
#define EFI_NOT_STARTED
Enumeration of EFI_STATUS.
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
EFI_SIGNAL_EVENT SignalEvent
char * strerror(int errno)
Retrieve string representation of error number.
static void mnpnet_refill_rx(struct net_device *netdev)
Refill receive token.
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
int register_netdev(struct net_device *netdev)
Register network device.
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 int mnpnet_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
#define EVT_NOTIFY_SIGNAL
#define VOID
Undeclared type.
int efi_service_add(EFI_HANDLE service, EFI_GUID *binding, EFI_HANDLE *handle)
Add service to child handle.
void mnpnet_stop(struct efi_device *efidev)
Detach driver from device.
int mnptemp_create(EFI_HANDLE handle, struct net_device **netdev)
Create temporary MNP network device.
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.
Network device management.
static void mnpnet_poll_tx(struct net_device *netdev)
Poll for completed packets.
#define INIT_LIST_HEAD(list)
Initialise a list head.
static struct net_device_operations mnpnet_operations
MNP network device operations.
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.
EFI_STATUS Status
The status that is returned to the caller at the end of the operation to indicate whether this operat...
EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1]
UINT32 HwAddressSize
The size, in bytes, of the network interface's HW address.
EFI_MANAGED_NETWORK_RECEIVE Receive
EFI_MANAGED_NETWORK_RECEIVE_DATA * RxData
When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.
void * data
Start of data.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
struct list_head children
Devices attached to this device.
int busy
Token is owned by MNP.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
EFI_MANAGED_NETWORK_CONFIGURE Configure
struct io_buffer * txbuf
Transmit I/O buffer.
EFI_MANAGED_NETWORK_COMPLETION_TOKEN token
MNP completion token.
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
static void efidev_set_drvdata(struct efi_device *efidev, void *priv)
Set EFI driver-private data.
EFI_MANAGED_NETWORK_TRANSMIT_DATA txdata
Transmit descriptor.
union EFI_MANAGED_NETWORK_COMPLETION_TOKEN::@577 Packet
struct device dev
Generic device.
static void mnpnet_poll_rx(struct net_device *netdev)
Poll for received packets.
struct efi_device * efidev
EFI device.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
BOOLEAN EnableUnicastReceive
Set to TRUE to receive packets that are sent to the network device MAC address.
int mnpnet_start(struct efi_device *efidev)
Attach driver to device.
struct ll_protocol * ll_protocol
Link-layer protocol.
void efi_device_info(EFI_HANDLE device, const char *prefix, struct device *dev)
Get underlying device information.
EFI_MANAGED_NETWORK_TRANSMIT_DATA * TxData
When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DAT...
EFI_MAC_ADDRESS PermanentAddress
The permanent HW MAC address for the network interface.
struct device dev
Generic device.
int efi_shutdown_in_progress
EFI shutdown is in progress.
EFI_GUID efi_managed_network_protocol_guid
Managed network protocol GUID.