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