diff options
author | Michael Brown | 2006-04-24 17:38:53 +0200 |
---|---|---|
committer | Michael Brown | 2006-04-24 17:38:53 +0200 |
commit | 53f78346bf65c7080da1c750c7590cc343d55726 (patch) | |
tree | e279237d8081272a0a9ca749a845c04093e17a13 /src/include | |
parent | Network API now allows for multiple network devices (although the (diff) | |
download | ipxe-53f78346bf65c7080da1c750c7590cc343d55726.tar.gz ipxe-53f78346bf65c7080da1c750c7590cc343d55726.tar.xz ipxe-53f78346bf65c7080da1c750c7590cc343d55726.zip |
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.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gpxe/ethernet.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/include/gpxe/ethernet.h b/src/include/gpxe/ethernet.h new file mode 100644 index 00000000..e62eb09b --- /dev/null +++ b/src/include/gpxe/ethernet.h @@ -0,0 +1,28 @@ +#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 */ |