blob: 39c917fd1b96a81b0d0ee223eb6f18211c1f002f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Chas Williams1c9d3e72006-09-29 17:13:24 -07002 * ATM Lan Emulation Daemon driver interface
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
Chas Williams1c9d3e72006-09-29 17:13:24 -07004 * Marko Kiiskila <mkiiskila@yahoo.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
6
7#ifndef _ATMLEC_H_
8#define _ATMLEC_H_
9
10#include <linux/atmapi.h>
11#include <linux/atmioc.h>
12#include <linux/atm.h>
13#include <linux/if_ether.h>
Arnd Bergmann9adfbfb2009-02-26 00:51:40 +010014#include <linux/types.h>
Chas Williams1c9d3e72006-09-29 17:13:24 -070015
Linus Torvalds1da177e2005-04-16 15:20:36 -070016/* ATM lec daemon control socket */
Chas Williams1c9d3e72006-09-29 17:13:24 -070017#define ATMLEC_CTRL _IO('a', ATMIOC_LANE)
18#define ATMLEC_DATA _IO('a', ATMIOC_LANE+1)
19#define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2)
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
21/* Maximum number of LEC interfaces (tweakable) */
22#define MAX_LEC_ITF 48
23
Chas Williams1c9d3e72006-09-29 17:13:24 -070024/*
25 * From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring.
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for
27 * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS.
28 */
29#define NUM_TR_DEVS 8
30
Chas Williams1c9d3e72006-09-29 17:13:24 -070031typedef enum {
32 l_set_mac_addr,
33 l_del_mac_addr,
34 l_svc_setup,
35 l_addr_delete,
36 l_topology_change,
37 l_flush_complete,
38 l_arp_update,
39 l_narp_req, /* LANE2 mandates the use of this */
40 l_config,
41 l_flush_tran_id,
42 l_set_lecid,
43 l_arp_xmt,
44 l_rdesc_arp_xmt,
45 l_associate_req,
46 l_should_bridge /* should we bridge this MAC? */
Linus Torvalds1da177e2005-04-16 15:20:36 -070047} atmlec_msg_type;
48
49#define ATMLEC_MSG_TYPE_MAX l_should_bridge
50
51struct atmlec_config_msg {
Chas Williams1c9d3e72006-09-29 17:13:24 -070052 unsigned int maximum_unknown_frame_count;
53 unsigned int max_unknown_frame_time;
54 unsigned short max_retry_count;
55 unsigned int aging_time;
56 unsigned int forward_delay_time;
57 unsigned int arp_response_time;
58 unsigned int flush_timeout;
59 unsigned int path_switching_delay;
60 unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */
61 int mtu;
62 int is_proxy;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063};
Chas Williams1c9d3e72006-09-29 17:13:24 -070064
Linus Torvalds1da177e2005-04-16 15:20:36 -070065struct atmlec_msg {
Chas Williams1c9d3e72006-09-29 17:13:24 -070066 atmlec_msg_type type;
67 int sizeoftlvs; /* LANE2: if != 0, tlvs follow */
68 union {
69 struct {
70 unsigned char mac_addr[ETH_ALEN];
71 unsigned char atm_addr[ATM_ESA_LEN];
72 unsigned int flag; /*
73 * Topology_change flag,
74 * remoteflag, permanent flag,
75 * lecid, transaction id
76 */
77 unsigned int targetless_le_arp; /* LANE2 */
78 unsigned int no_source_le_narp; /* LANE2 */
79 } normal;
80 struct atmlec_config_msg config;
81 struct {
Arnd Bergmann9adfbfb2009-02-26 00:51:40 +010082 __u16 lec_id; /* requestor lec_id */
83 __u32 tran_id; /* transaction id */
Chas Williams1c9d3e72006-09-29 17:13:24 -070084 unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */
85 unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */
86 } proxy; /*
87 * For mapping LE_ARP requests to responses. Filled by
88 * zeppelin, returned by kernel. Used only when proxying
89 */
90 } content;
Linus Torvalds1da177e2005-04-16 15:20:36 -070091} __ATM_API_ALIGN;
92
93struct atmlec_ioc {
Chas Williams1c9d3e72006-09-29 17:13:24 -070094 int dev_num;
95 unsigned char atm_addr[ATM_ESA_LEN];
96 unsigned char receive; /* 1= receive vcc, 0 = send vcc */
Linus Torvalds1da177e2005-04-16 15:20:36 -070097};
98#endif /* _ATMLEC_H_ */