xref: /haiku/headers/private/net/ether_driver.h (revision 0d452c8f34013b611a54c746a71c05e28796eae2)
1 /*
2  * Copyright 2007, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _ETHER_DRIVER_H
6 #define _ETHER_DRIVER_H
7 
8 /*! Standard ethernet driver interface */
9 
10 
11 #include <Drivers.h>
12 
13 
14 /* ioctl() opcodes a driver should support */
15 enum {
16 	ETHER_GETADDR = B_DEVICE_OP_CODES_END,
17 		/* get ethernet address (required) */
18 	ETHER_INIT,								/* (obsolete) */
19 	ETHER_NONBLOCK,							/* change non blocking mode (int *) */
20 	ETHER_ADDMULTI,							/* add multicast address */
21 	ETHER_REMMULTI,							/* remove multicast address */
22 	ETHER_SETPROMISC,						/* set promiscuous mode (int *) */
23 	ETHER_GETFRAMESIZE,						/* get frame size (required) (int *) */
24 	ETHER_SET_LINK_STATE_SEM,
25 		/* pass over a semaphore to release on link state changes (sem_id *) */
26 	ETHER_GET_LINK_STATE
27 		/* get line speed, quality, duplex mode, etc. (ether_link_state_t *) */
28 };
29 
30 
31 /* ETHER_GETADDR - MAC address */
32 typedef struct ether_address {
33 	uint8	ebyte[6];
34 } ether_address_t;
35 
36 /* ETHER_GETLINKSTATE */
37 typedef struct ether_link_state {
38 	uint32	media;		/* as specified in net/if_media.h */
39 	uint32  quality;	/* in one tenth of a percent */
40 	uint64	speed;		/* in bit/s */
41 } ether_link_state_t;
42 
43 #endif	/* _ETHER_DRIVER_H */
44