From 53f78346bf65c7080da1c750c7590cc343d55726 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 24 Apr 2006 15:38:53 +0000 Subject: Network API now allows for multiple network devices (although the 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. --- src/include/gpxe/ethernet.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/include/gpxe/ethernet.h (limited to 'src/include') diff --git a/src/include/gpxe/ethernet.h b/src/include/gpxe/ethernet.h new file mode 100644 index 000000000..e62eb09b5 --- /dev/null +++ b/src/include/gpxe/ethernet.h @@ -0,0 +1,28 @@ +#ifndef _GPXE_ETHERNET_H +#define _GPXE_ETHERNET_H + +/** @file + * + * Ethernet protocol + * + */ + +#include +#include + +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 */ -- cgit v1.2.3-55-g7522