30 DBG (
"Transmitting %zd bytes\n",
iob_len ( iobuf ) );
83 void ( * set_drvdata ) (
void *hwdev,
void *
priv ),
85 int ( * probe ) (
struct nic *
nic,
void *hwdev ),
86 void ( * disable ) (
struct nic *
nic,
void *hwdev ) ) {
99 set_drvdata ( hwdev,
netdev );
105 if ( ! probe ( &
nic, hwdev ) ) {
124 printf (
"WARNING: Using legacy NIC wrapper on %s\n",
131 disable ( &
nic, hwdev );
139 void * ( * get_drvdata ) (
void *hwdev ),
140 void ( * disable ) (
struct nic *
nic,
void *hwdev ) ) {
145 disable (
nic, hwdev );
uint16_t h_protocol
Protocol ID.
#define iob_pull(iobuf, len)
struct arbelprm_rc_send_wqe rc
int(* poll)(struct nic *, int retrieve)
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
#define iob_put(iobuf, len)
int printf(const char *fmt,...)
Write a formatted string to the console.
#define EBUSY
Device or resource busy.
int(* open)(struct net_device *netdev)
Open network device.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static int legacy_transmit(struct net_device *netdev, struct io_buffer *iobuf)
void(* irq)(struct nic *, irq_action_t)
void(* transmit)(struct nic *, const char *, unsigned int, unsigned int, const char *)
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
int dummy_connect(struct nic *nic __unused)
static struct net_device_operations legacy_operations
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
uint8_t h_dest[ETH_ALEN]
Destination MAC address.
#define ENOMEM
Not enough space.
#define __unused
Declare a variable or data structure as unused.
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 struct net_device * netdev
void unregister_netdev(struct net_device *netdev)
Unregister network device.
void dummy_irq(struct nic *nic __unused, irq_action_t irq_action __unused)
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.
#define ENODEV
No such device.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
void legacy_remove(void *hwdev, void *(*get_drvdata)(void *hwdev), void(*disable)(struct nic *nic, void *hwdev))
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.
unsigned char * node_addr
static struct tlan_private * priv
void * data
Start of data.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
struct device_description desc
Device description.
const char *(* ntoa)(const void *ll_addr)
Transcribe link-layer address.
#define DBG(...)
Print a debugging message.
static void legacy_close(struct net_device *netdev __unused)
struct nic_operations * nic_op
static void legacy_irq(struct net_device *netdev __unused, int enable)
static void legacy_poll(struct net_device *netdev)
An Ethernet link-layer header.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
static int legacy_registered
void iob_pad(struct io_buffer *iobuf, size_t min_len)
Pad I/O buffer.
struct ll_protocol * ll_protocol
Link-layer protocol.
void * memset(void *dest, int character, size_t len) __nonnull
int legacy_probe(void *hwdev, void(*set_drvdata)(void *hwdev, void *priv), struct device *dev, int(*probe)(struct nic *nic, void *hwdev), void(*disable)(struct nic *nic, void *hwdev))
static int legacy_open(struct net_device *netdev __unused)