This source file includes following definitions.
- lmc_av9110_t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 #define LMCIOCGINFO _IOW('i', 240, struct ifreq)
46 #define LMCIOCSINFO _IOWR('i', 241, struct ifreq)
47
48 typedef struct {
49 u_int32_t n;
50 u_int32_t m;
51 u_int32_t v;
52 u_int32_t x;
53 u_int32_t r;
54 u_int32_t f;
55 u_int32_t exact;
56 } lmc_av9110_t;
57
58
59
60
61 struct lmc___ctl {
62 u_int32_t cardtype;
63 u_int32_t clock_source;
64 u_int32_t clock_rate;
65 u_int32_t crc_length;
66 u_int32_t cable_length;
67 u_int32_t scrambler_onoff;
68 u_int32_t cable_type;
69 u_int32_t keepalive_onoff;
70 u_int32_t ticks;
71 union {
72 lmc_av9110_t ssi;
73 } cardspec;
74 u_int32_t circuit_type;
75 };
76
77 #define LMC_CARDTYPE_UNKNOWN -1
78 #define LMC_CARDTYPE_HSSI 1
79 #define LMC_CARDTYPE_DS3 2
80 #define LMC_CARDTYPE_SSI 3
81 #define LMC_CARDTYPE_T1 4
82
83 #define LMC_CTL_CARDTYPE_LMC5200 0
84 #define LMC_CTL_CARDTYPE_LMC5245 1
85 #define LMC_CTL_CARDTYPE_LMC1000 2
86 #define LMC_CTL_CARDTYPE_LMC1200 3
87
88 #define LMC_CTL_OFF 0
89 #define LMC_CTL_ON 1
90
91 #define LMC_CTL_CLOCK_SOURCE_EXT 0
92 #define LMC_CTL_CLOCK_SOURCE_INT 1
93
94 #define LMC_CTL_CRC_LENGTH_16 16
95 #define LMC_CTL_CRC_LENGTH_32 32
96 #define LMC_CTL_CRC_BYTESIZE_2 2
97 #define LMC_CTL_CRC_BYTESIZE_4 4
98
99 #define LMC_CTL_CABLE_LENGTH_LT_100FT 0
100 #define LMC_CTL_CABLE_LENGTH_GT_100FT 1
101
102 #define LMC_CTL_CIRCUIT_TYPE_E1 0
103 #define LMC_CTL_CIRCUIT_TYPE_T1 1
104
105
106
107
108
109
110
111 #define LMC_GEP_INIT 0x01
112 #define LMC_GEP_RESET 0x02
113 #define LMC_GEP_LOAD 0x10
114 #define LMC_GEP_DP 0x20
115 #define LMC_GEP_SERIAL 0x40
116 #define LMC_GEP_SERIALCLK 0x80
117
118
119
120
121 #define LMC_GEP_HSSI_ST 0x04
122 #define LMC_GEP_HSSI_CLOCK 0x08
123
124
125
126
127 #define LMC_GEP_SSI_GENERATOR 0x04
128 #define LMC_GEP_SSI_TXCLOCK 0x08
129
130
131
132
133 #define LMC_MII16_LED0 0x0080
134 #define LMC_MII16_LED1 0x0100
135 #define LMC_MII16_LED2 0x0200
136 #define LMC_MII16_LED3 0x0400
137 #define LMC_MII16_LED_ALL 0x0780
138 #define LMC_MII16_FIFO_RESET 0x0800
139
140
141
142
143 #define LMC_MII16_HSSI_TA 0x0001
144 #define LMC_MII16_HSSI_CA 0x0002
145 #define LMC_MII16_HSSI_LA 0x0004
146 #define LMC_MII16_HSSI_LB 0x0008
147 #define LMC_MII16_HSSI_LC 0x0010
148 #define LMC_MII16_HSSI_TM 0x0020
149 #define LMC_MII16_HSSI_CRC 0x0040
150
151
152
153
154 #define LMC_MII16_DS3_ZERO 0x0001
155 #define LMC_MII16_DS3_TRLBK 0x0002
156 #define LMC_MII16_DS3_LNLBK 0x0004
157 #define LMC_MII16_DS3_RAIS 0x0008
158 #define LMC_MII16_DS3_TAIS 0x0010
159 #define LMC_MII16_DS3_BIST 0x0020
160 #define LMC_MII16_DS3_DLOS 0x0040
161 #define LMC_MII16_DS3_CRC 0x1000
162 #define LMC_MII16_DS3_SCRAM 0x2000
163
164
165
166 #define LMC_DS3_LED0 0x0100
167 #define LMC_DS3_LED1 0x0080
168 #define LMC_DS3_LED2 0x0400
169 #define LMC_DS3_LED3 0x0200
170
171
172
173
174 #define LMC_FRAMER_REG0_DLOS 0x80
175 #define LMC_FRAMER_REG0_OOFS 0x40
176 #define LMC_FRAMER_REG0_AIS 0x20
177 #define LMC_FRAMER_REG0_CIS 0x10
178 #define LMC_FRAMER_REG0_LOC 0x08
179
180
181
182
183 #define LMC_MII16_SSI_DTR 0x0001
184 #define LMC_MII16_SSI_DSR 0x0002
185 #define LMC_MII16_SSI_RTS 0x0004
186 #define LMC_MII16_SSI_CTS 0x0008
187 #define LMC_MII16_SSI_DCD 0x0010
188 #define LMC_MII16_SSI_RI 0x0020
189 #define LMC_MII16_SSI_CRC 0x1000
190
191
192
193
194
195 #define LMC_MII16_SSI_LL 0x1000
196 #define LMC_MII16_SSI_RL 0x2000
197 #define LMC_MII16_SSI_TM 0x4000
198 #define LMC_MII16_SSI_LOOP 0x8000
199
200
201
202
203
204
205 #define LMC_MII17_SSI_CABLE_MASK 0x0038
206 #define LMC_MII17_SSI_CABLE_SHIFT 3
207
208
209
210
211 #define LMC_MII16_T1_UNUSED1 0x0003
212 #define LMC_MII16_T1_XOE 0x0004
213 #define LMC_MII16_T1_RST 0x0008
214 #define LMC_MII16_T1_Z 0x0010
215 #define LMC_MII16_T1_INTR 0x0020
216 #define LMC_MII16_T1_ONESEC 0x0040
217
218 #define LMC_MII16_T1_LED0 0x0100
219 #define LMC_MII16_T1_LED1 0x0080
220 #define LMC_MII16_T1_LED2 0x0400
221 #define LMC_MII16_T1_LED3 0x0200
222 #define LMC_MII16_T1_FIFO_RESET 0x0800
223
224 #define LMC_MII16_T1_CRC 0x1000
225 #define LMC_MII16_T1_UNUSED2 0xe000
226
227
228
229 #define T1FRAMER_ALARM1_STATUS 0x47
230 #define T1FRAMER_ALARM2_STATUS 0x48
231 #define T1FRAMER_FERR_LSB 0x50
232 #define T1FRAMER_FERR_MSB 0x51
233 #define T1FRAMER_LCV_LSB 0x54
234 #define T1FRAMER_LCV_MSB 0x55
235 #define T1FRAMER_AERR 0x5A
236
237
238 #define T1FRAMER_LOF_MASK (0x0f0)
239 #define T1FRAMER_COFA_MASK (0x0c0)
240 #define T1FRAMER_SEF_MASK (0x03)
241
242
243
244
245
246 #define T1F_SIGFRZ 0x01
247 #define T1F_RLOF 0x02
248 #define T1F_RLOS 0x04
249 #define T1F_RALOS 0x08
250 #define T1F_RAIS 0x10
251 #define T1F_UNUSED 0x20
252 #define T1F_RYEL 0x40
253 #define T1F_RMYEL 0x80
254
255
256
257 #define LMC_MII_LedMask 0x0780
258 #define LMC_MII_LedBitPos 7
259
260 #if defined(_KERNEL)
261
262
263
264
265 struct lmc___media {
266 void (* init)(lmc_softc_t * const);
267 void (* defaults)(lmc_softc_t * const);
268 void (* set_status)(lmc_softc_t * const, lmc_ctl_t *);
269 void (* set_clock_source)(lmc_softc_t * const, int);
270 void (* set_speed)(lmc_softc_t * const, lmc_ctl_t *);
271 void (* set_cable_length)(lmc_softc_t * const, int);
272 void (* set_scrambler)(lmc_softc_t * const, int);
273 int (* get_link_status)(lmc_softc_t * const);
274 void (* set_link_status)(lmc_softc_t * const, int);
275 void (* set_crc_length)(lmc_softc_t * const, int);
276 void (* set_circuit_type)(lmc_softc_t * const, int);
277 void (* watchdog)(lmc_softc_t * const);
278 };
279
280 u_int32_t lmc_mii_readreg(lmc_softc_t * const sc, u_int32_t devaddr,
281 u_int32_t regno);
282 void lmc_mii_writereg(lmc_softc_t * const sc, u_int32_t devaddr,
283 u_int32_t regno, u_int32_t data);
284 void lmc_initcsrs(lmc_softc_t * const sc, lmc_csrptr_t csr_base,
285 size_t csr_size);
286 void lmc_dec_reset(lmc_softc_t * const sc);
287 void lmc_reset(lmc_softc_t * const sc);
288 void lmc_led_on(lmc_softc_t * const sc, u_int32_t led);
289 void lmc_led_off(lmc_softc_t * const sc, u_int32_t led);
290 void lmc_gpio_mkinput(lmc_softc_t * const sc, u_int32_t bits);
291 void lmc_gpio_mkoutput(lmc_softc_t * const sc, u_int32_t bits);
292 lmc_intrfunc_t lmc_intr_normal(void *);
293 int lmc_read_macaddr(lmc_softc_t * const sc);
294 void lmc_attach(lmc_softc_t * const sc);
295 void lmc_initring(lmc_softc_t * const sc, lmc_ringinfo_t * const ri,
296 lmc_desc_t *descs, int ndescs);
297 #endif