1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef _FRAD_H_
20 #define _FRAD_H_
21
22
23
24 #define DLCI_DEVADD (SIOCDEVPRIVATE)
25 #define DLCI_DEVDEL (SIOCDEVPRIVATE + 1)
26
27 struct dlci_add
28 {
29 char devname[IFNAMSIZ];
30 short dlci;
31 };
32
33 #define DLCI_GET_CONF (SIOCDEVPRIVATE + 2)
34 #define DLCI_SET_CONF (SIOCDEVPRIVATE + 3)
35
36
37 struct dlci_conf {
38 short flags;
39 short CIR_fwd;
40 short Bc_fwd;
41 short Be_fwd;
42 short CIR_bwd;
43 short Bc_bwd;
44 short Be_bwd;
45
46
47 short Tc_fwd;
48 short Tc_bwd;
49 short Tf_max;
50 short Tb_max;
51 };
52
53 #define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
54
55
56 #define DLCI_IGNORE_CIR_OUT 0x0001
57 #define DLCI_ACCOUNT_CIR_IN 0x0002
58 #define DLCI_BUFFER_IF 0x0008
59
60 #define DLCI_VALID_FLAGS 0x000B
61
62
63
64 #define FRAD_GET_CONF (SIOCDEVPRIVATE)
65 #define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
66
67 #define FRAD_LAST_IOCTL FRAD_SET_CONF
68
69 struct frad_conf
70 {
71 short station;
72 short flags;
73 short kbaud;
74 short clocking;
75 short mtu;
76 short T391;
77 short T392;
78 short N391;
79 short N392;
80 short N393;
81 short CIR_fwd;
82 short Bc_fwd;
83 short Be_fwd;
84 short CIR_bwd;
85 short Bc_bwd;
86 short Be_bwd;
87
88
89
90 };
91
92 #define FRAD_STATION_CPE 0x0000
93 #define FRAD_STATION_NODE 0x0001
94
95 #define FRAD_TX_IGNORE_CIR 0x0001
96 #define FRAD_RX_ACCOUNT_CIR 0x0002
97 #define FRAD_DROP_ABORTED 0x0004
98 #define FRAD_BUFFERIF 0x0008
99 #define FRAD_STATS 0x0010
100 #define FRAD_MCI 0x0100
101 #define FRAD_AUTODLCI 0x8000
102 #define FRAD_VALID_FLAGS 0x811F
103
104 #define FRAD_CLOCK_INT 0x0001
105 #define FRAD_CLOCK_EXT 0x0000
106
107 #ifdef __KERNEL__
108
109 struct fradhdr
110 {
111
112 unsigned char control;
113 unsigned char pad;
114 unsigned char NLPID;
115 unsigned char OUI[3];
116 unsigned short PID;
117 };
118
119
120 #define FRAD_I_UI 0x03
121
122 #define FRAD_P_PADDING 0x00
123 #define FRAD_P_Q933 0x08
124 #define FRAD_P_SNAP 0x80
125 #define FRAD_P_CLNP 0x81
126 #define FRAD_P_IP 0xCC
127
128 struct dlci_local
129 {
130 struct enet_statistics stats;
131 struct device *slave;
132 struct dlci_conf config;
133 int configured;
134
135
136 void (*receive)(struct sk_buff *skb, struct device *);
137 };
138
139 struct frad_local
140 {
141 struct enet_statistics stats;
142 struct timer_list timer;
143
144
145 struct device *master[CONFIG_DLCI_MAX];
146 short dlci[CONFIG_DLCI_MAX];
147
148
149 int (*activate)(struct device *, struct device *);
150 int (*deactivate)(struct device *, struct device *);
151 int (*assoc)(struct device *, struct device *);
152 int (*deassoc)(struct device *, struct device *);
153 int (*dlci_conf)(struct device *, struct device *, int get);
154
155 int initialized;
156 int configured;
157 int type;
158 int state;
159 int buffer;
160 struct frad_conf config;
161 };
162
163 int register_frad(const char *name);
164 int unregister_frad(const char *name);
165
166 #endif __KERNEL__
167
168 #endif