summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/ethernet.h
blob: 45ab9a0929e75a24465df70e4a27b0abf29cdda1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _GPXE_ETHERNET_H
#define _GPXE_ETHERNET_H

/** @file
 *
 * Ethernet protocol
 *
 */

FILE_LICENCE ( GPL2_OR_LATER );

#include <stdint.h>
#include <gpxe/netdevice.h>
#include <gpxe/if_ether.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 = &ethernet_protocol;
		netdev->max_pkt_len = ETH_FRAME_LEN;
	}
	return netdev;
}

#endif /* _GPXE_ETHERNET_H */