mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 20:10:18 +03:00
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.
This commit is contained in:
28
src/include/gpxe/ethernet.h
Normal file
28
src/include/gpxe/ethernet.h
Normal file
@@ -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 */
|
||||
Reference in New Issue
Block a user