diff options
Diffstat (limited to 'gpxe/src/include/gpxe/ethernet.h')
-rw-r--r-- | gpxe/src/include/gpxe/ethernet.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gpxe/src/include/gpxe/ethernet.h b/gpxe/src/include/gpxe/ethernet.h new file mode 100644 index 00000000..158fe066 --- /dev/null +++ b/gpxe/src/include/gpxe/ethernet.h @@ -0,0 +1,33 @@ +#ifndef _GPXE_ETHERNET_H +#define _GPXE_ETHERNET_H + +/** @file + * + * Ethernet protocol + * + */ + +#include <stdint.h> +#include <gpxe/netdevice.h> + +extern struct ll_protocol ethernet_protocol; + +extern const char * eth_ntoa ( const void *ll_addr ); + +/** + * Allocate Ethernet device + * + * @v priv_size Size of driver private data + * @ret netdev Network device, or NULL + */ +static inline struct net_device * alloc_etherdev ( size_t priv_size ) { + struct net_device *netdev; + + netdev = alloc_netdev ( priv_size ); + if ( netdev ) { + netdev->ll_protocol = ðernet_protocol; + } + return netdev; +} + +#endif /* _GPXE_ETHERNET_H */ |