1
2 #ifndef _LMC_IOCTL_H_
3 #define _LMC_IOCTL_H_
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #define LMCIOCGINFO SIOCDEVPRIVATE+3
18 #define LMCIOCSINFO SIOCDEVPRIVATE+4
19 #define LMCIOCGETLMCSTATS SIOCDEVPRIVATE+5
20 #define LMCIOCCLEARLMCSTATS SIOCDEVPRIVATE+6
21 #define LMCIOCDUMPEVENTLOG SIOCDEVPRIVATE+7
22 #define LMCIOCGETXINFO SIOCDEVPRIVATE+8
23 #define LMCIOCSETCIRCUIT SIOCDEVPRIVATE+9
24 #define LMCIOCUNUSEDATM SIOCDEVPRIVATE+10
25 #define LMCIOCRESET SIOCDEVPRIVATE+11
26 #define LMCIOCT1CONTROL SIOCDEVPRIVATE+12
27 #define LMCIOCIFTYPE SIOCDEVPRIVATE+13
28 #define LMCIOCXILINX SIOCDEVPRIVATE+14
29
30 #define LMC_CARDTYPE_UNKNOWN -1
31 #define LMC_CARDTYPE_HSSI 1
32 #define LMC_CARDTYPE_DS3 2
33 #define LMC_CARDTYPE_SSI 3
34 #define LMC_CARDTYPE_T1 4
35
36 #define LMC_CTL_CARDTYPE_LMC5200 0
37 #define LMC_CTL_CARDTYPE_LMC5245 1
38 #define LMC_CTL_CARDTYPE_LMC1000 2
39 #define LMC_CTL_CARDTYPE_LMC1200 3
40
41 #define LMC_CTL_OFF 0
42 #define LMC_CTL_ON 1
43
44 #define LMC_CTL_CLOCK_SOURCE_EXT 0
45 #define LMC_CTL_CLOCK_SOURCE_INT 1
46
47 #define LMC_CTL_CRC_LENGTH_16 16
48 #define LMC_CTL_CRC_LENGTH_32 32
49 #define LMC_CTL_CRC_BYTESIZE_2 2
50 #define LMC_CTL_CRC_BYTESIZE_4 4
51
52
53 #define LMC_CTL_CABLE_LENGTH_LT_100FT 0
54 #define LMC_CTL_CABLE_LENGTH_GT_100FT 1
55
56 #define LMC_CTL_CIRCUIT_TYPE_E1 0
57 #define LMC_CTL_CIRCUIT_TYPE_T1 1
58
59
60
61
62 #define LMC_PPP 1
63 #define LMC_NET 2
64 #define LMC_RAW 3
65
66
67
68
69
70
71
72 #define LMC_GEP_INIT 0x01
73 #define LMC_GEP_RESET 0x02
74 #define LMC_GEP_MODE 0x10
75 #define LMC_GEP_DP 0x20
76 #define LMC_GEP_DATA 0x40
77 #define LMC_GEP_CLK 0x80
78
79
80
81
82 #define LMC_GEP_HSSI_ST 0x04
83 #define LMC_GEP_HSSI_CLOCK 0x08
84
85
86
87
88 #define LMC_GEP_SSI_GENERATOR 0x04
89 #define LMC_GEP_SSI_TXCLOCK 0x08
90
91
92
93
94 #define LMC_MII16_LED0 0x0080
95 #define LMC_MII16_LED1 0x0100
96 #define LMC_MII16_LED2 0x0200
97 #define LMC_MII16_LED3 0x0400
98 #define LMC_MII16_LED_ALL 0x0780
99 #define LMC_MII16_FIFO_RESET 0x0800
100
101
102
103
104 #define LMC_MII16_HSSI_TA 0x0001
105 #define LMC_MII16_HSSI_CA 0x0002
106 #define LMC_MII16_HSSI_LA 0x0004
107 #define LMC_MII16_HSSI_LB 0x0008
108 #define LMC_MII16_HSSI_LC 0x0010
109 #define LMC_MII16_HSSI_TM 0x0020
110 #define LMC_MII16_HSSI_CRC 0x0040
111
112
113
114
115 #define LMC_MII16_DS3_ZERO 0x0001
116 #define LMC_MII16_DS3_TRLBK 0x0002
117 #define LMC_MII16_DS3_LNLBK 0x0004
118 #define LMC_MII16_DS3_RAIS 0x0008
119 #define LMC_MII16_DS3_TAIS 0x0010
120 #define LMC_MII16_DS3_BIST 0x0020
121 #define LMC_MII16_DS3_DLOS 0x0040
122 #define LMC_MII16_DS3_CRC 0x1000
123 #define LMC_MII16_DS3_SCRAM 0x2000
124 #define LMC_MII16_DS3_SCRAM_LARS 0x4000
125
126
127
128 #define LMC_DS3_LED0 0x0100
129 #define LMC_DS3_LED1 0x0080
130 #define LMC_DS3_LED2 0x0400
131 #define LMC_DS3_LED3 0x0200
132
133
134
135
136 #define LMC_FRAMER_REG0_DLOS 0x80
137 #define LMC_FRAMER_REG0_OOFS 0x40
138 #define LMC_FRAMER_REG0_AIS 0x20
139 #define LMC_FRAMER_REG0_CIS 0x10
140 #define LMC_FRAMER_REG0_LOC 0x08
141
142
143
144
145 #define LMC_FRAMER_REG9_RBLUE 0x02
146
147
148
149
150 #define LMC_FRAMER_REG10_XBIT 0x01
151
152
153
154
155 #define LMC_MII16_SSI_DTR 0x0001
156 #define LMC_MII16_SSI_DSR 0x0002
157 #define LMC_MII16_SSI_RTS 0x0004
158 #define LMC_MII16_SSI_CTS 0x0008
159 #define LMC_MII16_SSI_DCD 0x0010
160 #define LMC_MII16_SSI_RI 0x0020
161 #define LMC_MII16_SSI_CRC 0x1000
162
163
164
165
166
167 #define LMC_MII16_SSI_LL 0x1000
168 #define LMC_MII16_SSI_RL 0x2000
169 #define LMC_MII16_SSI_TM 0x4000
170 #define LMC_MII16_SSI_LOOP 0x8000
171
172
173
174
175
176
177 #define LMC_MII17_SSI_CABLE_MASK 0x0038
178 #define LMC_MII17_SSI_CABLE_SHIFT 3
179
180
181
182
183 #define LMC_MII16_T1_UNUSED1 0x0003
184 #define LMC_MII16_T1_XOE 0x0004
185 #define LMC_MII16_T1_RST 0x0008
186 #define LMC_MII16_T1_Z 0x0010
187 #define LMC_MII16_T1_INTR 0x0020
188 #define LMC_MII16_T1_ONESEC 0x0040
189
190 #define LMC_MII16_T1_LED0 0x0100
191 #define LMC_MII16_T1_LED1 0x0080
192 #define LMC_MII16_T1_LED2 0x0400
193 #define LMC_MII16_T1_LED3 0x0200
194 #define LMC_MII16_T1_FIFO_RESET 0x0800
195
196 #define LMC_MII16_T1_CRC 0x1000
197 #define LMC_MII16_T1_UNUSED2 0xe000
198
199
200
201
202 #define T1FRAMER_ALARM1_STATUS 0x47
203 #define T1FRAMER_ALARM2_STATUS 0x48
204 #define T1FRAMER_FERR_LSB 0x50
205 #define T1FRAMER_FERR_MSB 0x51
206 #define T1FRAMER_LCV_LSB 0x54
207 #define T1FRAMER_LCV_MSB 0x55
208 #define T1FRAMER_AERR 0x5A
209
210
211 #define T1FRAMER_LOF_MASK (0x0f0)
212 #define T1FRAMER_COFA_MASK (0x0c0)
213 #define T1FRAMER_SEF_MASK (0x03)
214
215
216
217
218
219 #define T1F_SIGFRZ 0x01
220 #define T1F_RLOF 0x02
221 #define T1F_RLOS 0x04
222 #define T1F_RALOS 0x08
223 #define T1F_RAIS 0x10
224 #define T1F_UNUSED 0x20
225 #define T1F_RYEL 0x40
226 #define T1F_RMYEL 0x80
227
228 #define LMC_T1F_WRITE 0
229 #define LMC_T1F_READ 1
230
231 typedef struct lmc_st1f_control {
232 int command;
233 int address;
234 int value;
235 char __user *data;
236 } lmc_t1f_control;
237
238 enum lmc_xilinx_c {
239 lmc_xilinx_reset = 1,
240 lmc_xilinx_load_prom = 2,
241 lmc_xilinx_load = 3
242 };
243
244 struct lmc_xilinx_control {
245 enum lmc_xilinx_c command;
246 int len;
247 char __user *data;
248 };
249
250
251
252 #define LMC_MII_LedMask 0x0780
253 #define LMC_MII_LedBitPos 7
254
255 #endif