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