xref: /openbmc/linux/include/uapi/linux/atmlec.h (revision 607ca46e)
1607ca46eSDavid Howells /*
2607ca46eSDavid Howells  * ATM Lan Emulation Daemon driver interface
3607ca46eSDavid Howells  *
4607ca46eSDavid Howells  * Marko Kiiskila <mkiiskila@yahoo.com>
5607ca46eSDavid Howells  */
6607ca46eSDavid Howells 
7607ca46eSDavid Howells #ifndef _ATMLEC_H_
8607ca46eSDavid Howells #define _ATMLEC_H_
9607ca46eSDavid Howells 
10607ca46eSDavid Howells #include <linux/atmapi.h>
11607ca46eSDavid Howells #include <linux/atmioc.h>
12607ca46eSDavid Howells #include <linux/atm.h>
13607ca46eSDavid Howells #include <linux/if_ether.h>
14607ca46eSDavid Howells #include <linux/types.h>
15607ca46eSDavid Howells 
16607ca46eSDavid Howells /* ATM lec daemon control socket */
17607ca46eSDavid Howells #define ATMLEC_CTRL	_IO('a', ATMIOC_LANE)
18607ca46eSDavid Howells #define ATMLEC_DATA	_IO('a', ATMIOC_LANE+1)
19607ca46eSDavid Howells #define ATMLEC_MCAST	_IO('a', ATMIOC_LANE+2)
20607ca46eSDavid Howells 
21607ca46eSDavid Howells /* Maximum number of LEC interfaces (tweakable) */
22607ca46eSDavid Howells #define MAX_LEC_ITF 48
23607ca46eSDavid Howells 
24607ca46eSDavid Howells typedef enum {
25607ca46eSDavid Howells 	l_set_mac_addr,
26607ca46eSDavid Howells 	l_del_mac_addr,
27607ca46eSDavid Howells 	l_svc_setup,
28607ca46eSDavid Howells 	l_addr_delete,
29607ca46eSDavid Howells 	l_topology_change,
30607ca46eSDavid Howells 	l_flush_complete,
31607ca46eSDavid Howells 	l_arp_update,
32607ca46eSDavid Howells 	l_narp_req,		/* LANE2 mandates the use of this */
33607ca46eSDavid Howells 	l_config,
34607ca46eSDavid Howells 	l_flush_tran_id,
35607ca46eSDavid Howells 	l_set_lecid,
36607ca46eSDavid Howells 	l_arp_xmt,
37607ca46eSDavid Howells 	l_rdesc_arp_xmt,
38607ca46eSDavid Howells 	l_associate_req,
39607ca46eSDavid Howells 	l_should_bridge		/* should we bridge this MAC? */
40607ca46eSDavid Howells } atmlec_msg_type;
41607ca46eSDavid Howells 
42607ca46eSDavid Howells #define ATMLEC_MSG_TYPE_MAX l_should_bridge
43607ca46eSDavid Howells 
44607ca46eSDavid Howells struct atmlec_config_msg {
45607ca46eSDavid Howells 	unsigned int maximum_unknown_frame_count;
46607ca46eSDavid Howells 	unsigned int max_unknown_frame_time;
47607ca46eSDavid Howells 	unsigned short max_retry_count;
48607ca46eSDavid Howells 	unsigned int aging_time;
49607ca46eSDavid Howells 	unsigned int forward_delay_time;
50607ca46eSDavid Howells 	unsigned int arp_response_time;
51607ca46eSDavid Howells 	unsigned int flush_timeout;
52607ca46eSDavid Howells 	unsigned int path_switching_delay;
53607ca46eSDavid Howells 	unsigned int lane_version;	/* LANE2: 1 for LANEv1, 2 for LANEv2 */
54607ca46eSDavid Howells 	int mtu;
55607ca46eSDavid Howells 	int is_proxy;
56607ca46eSDavid Howells };
57607ca46eSDavid Howells 
58607ca46eSDavid Howells struct atmlec_msg {
59607ca46eSDavid Howells 	atmlec_msg_type type;
60607ca46eSDavid Howells 	int sizeoftlvs;		/* LANE2: if != 0, tlvs follow */
61607ca46eSDavid Howells 	union {
62607ca46eSDavid Howells 		struct {
63607ca46eSDavid Howells 			unsigned char mac_addr[ETH_ALEN];
64607ca46eSDavid Howells 			unsigned char atm_addr[ATM_ESA_LEN];
65607ca46eSDavid Howells 			unsigned int flag;	/*
66607ca46eSDavid Howells 						 * Topology_change flag,
67607ca46eSDavid Howells 						 * remoteflag, permanent flag,
68607ca46eSDavid Howells 						 * lecid, transaction id
69607ca46eSDavid Howells 						 */
70607ca46eSDavid Howells 			unsigned int targetless_le_arp;	/* LANE2 */
71607ca46eSDavid Howells 			unsigned int no_source_le_narp;	/* LANE2 */
72607ca46eSDavid Howells 		} normal;
73607ca46eSDavid Howells 		struct atmlec_config_msg config;
74607ca46eSDavid Howells 		struct {
75607ca46eSDavid Howells 			__u16 lec_id;				/* requestor lec_id  */
76607ca46eSDavid Howells 			__u32 tran_id;				/* transaction id    */
77607ca46eSDavid Howells 			unsigned char mac_addr[ETH_ALEN];	/* dst mac addr      */
78607ca46eSDavid Howells 			unsigned char atm_addr[ATM_ESA_LEN];	/* reqestor ATM addr */
79607ca46eSDavid Howells 		} proxy;	/*
80607ca46eSDavid Howells 				 * For mapping LE_ARP requests to responses. Filled by
81607ca46eSDavid Howells 				 * zeppelin, returned by kernel. Used only when proxying
82607ca46eSDavid Howells 				 */
83607ca46eSDavid Howells 	} content;
84607ca46eSDavid Howells } __ATM_API_ALIGN;
85607ca46eSDavid Howells 
86607ca46eSDavid Howells struct atmlec_ioc {
87607ca46eSDavid Howells 	int dev_num;
88607ca46eSDavid Howells 	unsigned char atm_addr[ATM_ESA_LEN];
89607ca46eSDavid Howells 	unsigned char receive;	/* 1= receive vcc, 0 = send vcc */
90607ca46eSDavid Howells };
91607ca46eSDavid Howells #endif /* _ATMLEC_H_ */
92