1
2
3
4
5
6#ifndef _UAPILINUX_ATMDEV_H
7#define _UAPILINUX_ATMDEV_H
8
9
10#include <linux/atmapi.h>
11#include <linux/atm.h>
12#include <linux/atmioc.h>
13
14
15#define ESI_LEN 6
16
17#define ATM_OC3_PCR (155520000/270*260/8/53)
18
19
20
21
22#define ATM_25_PCR ((25600000/8-8000)/54)
23
24#define ATM_OC12_PCR (622080000/1080*1040/8/53)
25
26
27
28
29#define ATM_DS3_PCR (8000*12)
30
31
32
33#define __AAL_STAT_ITEMS \
34 __HANDLE_ITEM(tx); \
35 __HANDLE_ITEM(tx_err); \
36 __HANDLE_ITEM(rx); \
37 __HANDLE_ITEM(rx_err); \
38 __HANDLE_ITEM(rx_drop);
39
40struct atm_aal_stats {
41#define __HANDLE_ITEM(i) int i
42 __AAL_STAT_ITEMS
43#undef __HANDLE_ITEM
44};
45
46
47struct atm_dev_stats {
48 struct atm_aal_stats aal0;
49 struct atm_aal_stats aal34;
50 struct atm_aal_stats aal5;
51} __ATM_API_ALIGN;
52
53
54#define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
55
56#define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
57
58#define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
59
60#define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
61
62#define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
63
64#define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
65
66#define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
67
68#define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
69
70#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
71
72#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
73
74#define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
75
76#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
77
78#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
79
80#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
81
82#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
83
84
85#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
86
87#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
88
89#define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
90
91#define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
92
93#define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
94
95#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
96
97#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
98
99#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
100
101#define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
102
103#ifdef CONFIG_COMPAT
104
105#define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf)
106#endif
107#define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int)
108
109
110
111
112
113
114
115#define ATM_BACKEND_RAW 0
116#define ATM_BACKEND_PPP 1
117#define ATM_BACKEND_BR2684 2
118
119
120#define ATM_ITFTYP_LEN 8
121
122
123
124
125
126
127#define __ATM_LM_NONE 0
128#define __ATM_LM_AAL 1
129#define __ATM_LM_ATM 2
130
131#define __ATM_LM_PHY 8
132#define __ATM_LM_ANALOG 16
133
134
135#define __ATM_LM_MKLOC(n) ((n))
136#define __ATM_LM_MKRMT(n) ((n) << 8)
137
138#define __ATM_LM_XTLOC(n) ((n) & 0xff)
139#define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff)
140
141#define ATM_LM_NONE 0
142
143#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
144#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
145#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
146#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
147
148#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
149#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
150#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
151#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
152
153
154
155
156
157
158
159struct atm_iobuf {
160 int length;
161 void __user *buffer;
162};
163
164
165
166#define ATM_CI_MAX -1
167
168struct atm_cirange {
169 signed char vpi_bits;
170 signed char vci_bits;
171};
172
173
174
175#define ATM_SC_RX 1024
176#define ATM_SC_TX 2048
177
178#define ATM_BACKLOG_DEFAULT 32
179
180
181
182
183#define ATM_MF_IMMED 1
184#define ATM_MF_INC_RSV 2
185#define ATM_MF_INC_SHP 4
186#define ATM_MF_DEC_RSV 8
187#define ATM_MF_DEC_SHP 16
188#define ATM_MF_BWD 32
189
190#define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \
191 ATM_MF_DEC_SHP | ATM_MF_BWD)
192
193
194
195
196
197#define ATM_VS_IDLE 0
198#define ATM_VS_CONNECTED 1
199#define ATM_VS_CLOSING 2
200#define ATM_VS_LISTEN 3
201#define ATM_VS_INUSE 4
202#define ATM_VS_BOUND 5
203
204#define ATM_VS2TXT_MAP \
205 "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
206
207#define ATM_VF2TXT_MAP \
208 "ADDR", "READY", "PARTIAL", "REGIS", \
209 "RELEASED", "HASQOS", "LISTEN", "META", \
210 "256", "512", "1024", "2048", \
211 "SESSION", "HASSAP", "BOUND", "CLOSE"
212
213
214
215#endif
216