xref: /haiku/headers/private/net/ether_driver.h (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
1 /*
2  * ether_driver.h
3  *
4  * Ethernet driver: handles NE2000 and 3C503 cards
5  */
6 /*
7 	Copyright 1999, Be Incorporated.   All Rights Reserved.
8 	This file may be used under the terms of the Be Sample Code License.
9 */
10 #ifndef _ETHER_DRIVER_H
11 #define _ETHER_DRIVER_H
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #include <Drivers.h>
18 
19 /*
20  * ioctls: belongs in a public header file
21  * somewhere, so that the net_server and other ethernet drivers can use.
22  */
23 enum {
24 	ETHER_GETADDR = B_DEVICE_OP_CODES_END,	/* get ethernet address */
25 	ETHER_INIT,								/* set irq and port */
26 	ETHER_NONBLOCK,							/* set/unset nonblocking mode */
27 	ETHER_ADDMULTI,							/* add multicast addr */
28 	ETHER_REMMULTI,							/* rem multicast addr */
29 	ETHER_SETPROMISC,						/* set promiscuous */
30 	ETHER_GETFRAMESIZE,						/* get frame size */
31 	ETHER_ADDTIMESTAMP,						/* (try to) add timestamps to packets (BONE ext) */
32 	ETHER_HASIOVECS,						/* does the driver implement writev ? (BONE ext) (bool *) */
33 	ETHER_GETIFTYPE,						/* get the IFT_ type of the interface (int *) */
34 	ETHER_GETLINKSTATE						/* get line speed, quality, duplex mode, etc. */
35 };
36 
37 
38 /*
39  * 48-bit ethernet address, passed back from ETHER_GETADDR
40  */
41 typedef struct {
42 	unsigned char ebyte[6];
43 } ether_address_t;
44 
45 
46 /*
47  *	info passed to ETHER_INIT
48  */
49 
50 typedef struct ether_init_params {
51 	short port;
52 	short irq;
53 	unsigned long mem;
54 } ether_init_params_t;
55 
56 /*
57  *  info returned from ETHER_GETLINKSTATE
58  */
59 
60 typedef struct ether_link_state {
61 	float  link_speed; 	 /* In Mbits per second */
62 	float  link_quality; /* Set to zero if not connected */
63 	char   duplex_mode;  /* Set to 1 for full duplex, 0 for half */
64 } ether_link_state_t;
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 
71 #endif /* _ETHER_DRIVER_H */
72