30 DBG (
"Transmitting %zd bytes\n",
iob_len ( iobuf ) );
84 void ( * set_drvdata ) (
void *hwdev,
void *
priv ),
86 int ( * probe ) (
struct nic *
nic,
void *hwdev ),
87 void ( * disable ) (
struct nic *
nic,
void *hwdev ),
88 size_t fake_bss_len ) {
107 set_drvdata ( hwdev,
netdev );
122 if ( ! probe (
nic, hwdev ) ) {
141 printf (
"WARNING: Using legacy NIC wrapper on %s\n",
148 disable (
nic, hwdev );
161 void * ( * get_drvdata ) (
void *hwdev ),
162 void ( * disable ) (
struct nic *
nic,
void *hwdev ) ) {
167 disable (
nic, hwdev );
struct arbelprm_rc_send_wqe rc
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
static struct net_device * netdev
#define __unused
Declare a variable or data structure as unused.
#define DBG(...)
Print a debugging message.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENOMEM
Not enough space.
#define EBUSY
Device or resource busy.
#define ENODEV
No such device.
#define PAGE_SIZE
Page size.
void * memset(void *dest, int character, size_t len) __nonnull
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.
#define iob_pull(iobuf, len)
static int legacy_open(struct net_device *netdev __unused)
static void legacy_irq(struct net_device *netdev __unused, int enable)
static void legacy_close(struct net_device *netdev __unused)
int dummy_connect(struct nic *nic __unused)
static struct net_device_operations legacy_operations
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), size_t fake_bss_len)
static int legacy_transmit(struct net_device *netdev, struct io_buffer *iobuf)
static void legacy_poll(struct net_device *netdev)
void legacy_remove(void *hwdev, void *(*get_drvdata)(void *hwdev), void(*disable)(struct nic *nic, void *hwdev))
void dummy_irq(struct nic *nic __unused, irq_action_t irq_action __unused)
static int legacy_registered
void * malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
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.
int register_netdev(struct net_device *netdev)
Register network device.
Network device management.
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.
struct device_description desc
Device description.
An Ethernet link-layer header.
uint16_t h_protocol
Protocol ID.
uint8_t h_dest[ETH_ALEN]
Destination MAC address.
void * data
Start of data.
Network device operations.
void(* transmit)(struct nic *, const char *, unsigned int, unsigned int, const char *)
void(* irq)(struct nic *, irq_action_t)
int(* poll)(struct nic *, int retrieve)
unsigned char * node_addr
struct nic_operations * nic_op
static struct tlan_private * priv
int printf(const char *fmt,...)
Write a formatted string to the console.