mirror of
https://github.com/xcat2/xNBA.git
synced 2025-01-21 23:13:14 +00:00
53f78346bf
implementation allows for only one, and does so without compromising on the efficiency of static allocation). Link-layer protocols are cleanly separated from the device drivers. Network-layer protocols are cleanly separated from individual network devices. Link-layer and network-layer protocols are cleanly separated from each other.
29 lines
544 B
C
29 lines
544 B
C
#ifndef _GPXE_ETHERNET_H
|
|
#define _GPXE_ETHERNET_H
|
|
|
|
/** @file
|
|
*
|
|
* Ethernet protocol
|
|
*
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include <gpxe/netdevice.h>
|
|
|
|
extern struct ll_protocol ethernet_protocol;
|
|
|
|
/**
|
|
* Allocate Ethernet device
|
|
*
|
|
* @v priv_size Size of driver private data
|
|
* @ret netdev Network device, or NULL
|
|
*/
|
|
#define alloc_etherdev( priv_size ) ( { \
|
|
struct net_device *netdev; \
|
|
netdev = alloc_netdev ( priv_size ); \
|
|
if ( netdev ) \
|
|
netdev->ll_protocol = ðernet_protocol; \
|
|
netdev; } )
|
|
|
|
#endif /* _GPXE_ETHERNET_H */
|