1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef _SCMECM_
16#define _SCMECM_
17
18#if defined(PCI) && !defined(OSDEF)
19
20
21
22#define OSDEF
23#endif
24
25#ifdef PCI
26#ifndef SUPERNET_3
27#define SUPERNET_3
28#endif
29#ifndef TAG_MODE
30#define TAG_MODE
31#endif
32#endif
33
34
35
36
37
38
39
40#ifdef OSDEF
41#include "osdef1st.h"
42#endif
43#ifdef OEM_CONCEPT
44#include "oemdef.h"
45#endif
46#include "smt.h"
47#include "cmtdef.h"
48#include "fddimib.h"
49#include "targethw.h"
50#include "targetos.h"
51#ifdef ESS
52#include "sba.h"
53#endif
54
55
56
57
58
59
60
61
62struct event_queue {
63 u_short class ;
64 u_short event ;
65} ;
66
67
68
69
70#ifdef CONCENTRATOR
71#define MAX_EVENT 128
72#else
73#define MAX_EVENT 64
74#endif
75
76struct s_queue {
77
78 struct event_queue ev_queue[MAX_EVENT];
79 struct event_queue *ev_put ;
80 struct event_queue *ev_get ;
81} ;
82
83
84
85
86
87struct s_ecm {
88 u_char path_test ;
89 u_char sb_flag ;
90 u_char DisconnectFlag ;
91
92 u_char ecm_line_state ;
93 u_long trace_prop ;
94
95
96
97
98 char ec_pad[2] ;
99 struct smt_timer ecm_timer ;
100} ;
101
102
103
104
105
106
107struct s_rmt {
108 u_char dup_addr_test ;
109 u_char da_flag ;
110 u_char loop_avail ;
111 u_char sm_ma_avail ;
112 u_char no_flag ;
113 u_char bn_flag ;
114 u_char jm_flag ;
115 u_char rm_join ;
116 u_char rm_loop ;
117
118 long fast_rm_join ;
119
120
121
122 struct smt_timer rmt_timer0 ;
123 struct smt_timer rmt_timer1 ;
124 struct smt_timer rmt_timer2 ;
125 u_char timer0_exp ;
126 u_char timer1_exp ;
127 u_char timer2_exp ;
128
129 u_char rm_pad1[1] ;
130} ;
131
132
133
134
135
136
137struct s_cfm {
138 u_char cf_state;
139 u_char cf_pad[3] ;
140} ;
141
142
143
144
145
146
147#ifdef CONCENTRATOR
148struct s_cem {
149 int ce_state ;
150 int ce_port ;
151 int ce_type ;
152} ;
153
154
155
156
157struct s_c_ring {
158 struct s_c_ring *c_next ;
159 char c_entity ;
160} ;
161
162struct mib_path_config {
163 u_long fddimibPATHConfigSMTIndex;
164 u_long fddimibPATHConfigPATHIndex;
165 u_long fddimibPATHConfigTokenOrder;
166 u_long fddimibPATHConfigResourceType;
167#define SNMP_RES_TYPE_MAC 2
168#define SNMP_RES_TYPE_PORT 4
169 u_long fddimibPATHConfigResourceIndex;
170 u_long fddimibPATHConfigCurrentPath;
171#define SNMP_PATH_ISOLATED 1
172#define SNMP_PATH_LOCAL 2
173#define SNMP_PATH_SECONDARY 3
174#define SNMP_PATH_PRIMARY 4
175#define SNMP_PATH_CONCATENATED 5
176#define SNMP_PATH_THRU 6
177};
178
179
180#endif
181
182
183
184
185#define PCM_DISABLED 0
186#define PCM_CONNECTING 1
187#define PCM_STANDBY 2
188#define PCM_ACTIVE 3
189
190struct s_pcm {
191 u_char pcm_pad[3] ;
192} ;
193
194
195
196
197
198struct s_phy {
199
200 struct fddi_mib_p *mib ;
201
202 u_char np ;
203 u_char cf_join ;
204 u_char cf_loop ;
205 u_char wc_flag ;
206 u_char pc_mode ;
207 u_char pc_lem_fail ;
208 u_char lc_test ;
209 u_char scrub ;
210 char phy_name ;
211 u_char pmd_type[2] ;
212#define PMD_SK_CONN 0
213#define PMD_SK_PMD 1
214 u_char pmd_scramble ;
215
216
217 u_char curr_ls ;
218 u_char ls_flag ;
219 u_char rc_flag ;
220 u_char tc_flag ;
221 u_char td_flag ;
222 u_char bitn ;
223 u_char tr_flag ;
224 u_char twisted ;
225 u_char t_val[NUMBITS] ;
226 u_char r_val[NUMBITS] ;
227 u_long t_next[NUMBITS] ;
228 struct smt_timer pcm_timer0 ;
229 struct smt_timer pcm_timer1 ;
230 struct smt_timer pcm_timer2 ;
231 u_char timer0_exp ;
232 u_char timer1_exp ;
233 u_char timer2_exp ;
234 u_char pcm_pad1[1] ;
235 int cem_pst ;
236 struct lem_counter lem ;
237#ifdef AMDPLC
238 struct s_plc plc ;
239#endif
240} ;
241
242
243
244
245
246struct s_timer {
247 struct smt_timer *st_queue ;
248 struct smt_timer st_fast ;
249} ;
250
251
252
253
254#define SMT_EVENT_BASE 1
255#define SMT_EVENT_MAC_PATH_CHANGE (SMT_EVENT_BASE+0)
256#define SMT_EVENT_MAC_NEIGHBOR_CHANGE (SMT_EVENT_BASE+1)
257#define SMT_EVENT_PORT_PATH_CHANGE (SMT_EVENT_BASE+2)
258#define SMT_EVENT_PORT_CONNECTION (SMT_EVENT_BASE+3)
259
260#define SMT_IS_CONDITION(x) ((x)>=SMT_COND_BASE)
261
262#define SMT_COND_BASE (SMT_EVENT_PORT_CONNECTION+1)
263#define SMT_COND_SMT_PEER_WRAP (SMT_COND_BASE+0)
264#define SMT_COND_SMT_HOLD (SMT_COND_BASE+1)
265#define SMT_COND_MAC_FRAME_ERROR (SMT_COND_BASE+2)
266#define SMT_COND_MAC_DUP_ADDR (SMT_COND_BASE+3)
267#define SMT_COND_MAC_NOT_COPIED (SMT_COND_BASE+4)
268#define SMT_COND_PORT_EB_ERROR (SMT_COND_BASE+5)
269#define SMT_COND_PORT_LER (SMT_COND_BASE+6)
270
271#define SR0_WAIT 0
272#define SR1_HOLDOFF 1
273#define SR2_DISABLED 2
274
275struct s_srf {
276 u_long SRThreshold ;
277 u_char RT_Flag ;
278 u_char sr_state ;
279 u_char any_report ;
280 u_long TSR ;
281 u_short ring_status ;
282} ;
283
284
285
286
287#define RS_RES15 (1<<15)
288#define RS_HARDERROR (1<<14)
289#define RS_SOFTERROR (1<<13)
290#define RS_BEACON (1<<12)
291#define RS_PATHTEST (1<<11)
292#define RS_SELFTEST (1<<10)
293#define RS_RES9 (1<< 9)
294#define RS_DISCONNECT (1<< 8)
295#define RS_RES7 (1<< 7)
296#define RS_DUPADDR (1<< 6)
297#define RS_NORINGOP (1<< 5)
298#define RS_VERSION (1<< 4)
299#define RS_STUCKBYPASSS (1<< 3)
300#define RS_EVENT (1<< 2)
301#define RS_RINGOPCHANGE (1<< 1)
302#define RS_RES0 (1<< 0)
303
304#define RS_SET(smc,bit) \
305 ring_status_indication(smc,smc->srf.ring_status |= bit)
306#define RS_CLEAR(smc,bit) \
307 ring_status_indication(smc,smc->srf.ring_status &= ~bit)
308
309#define RS_CLEAR_EVENT (0xffff & ~(RS_NORINGOP))
310
311
312
313#ifndef AIX_EVENT
314#define AIX_EVENT(smc,opt0,opt1,opt2,opt3)
315#endif
316
317struct s_srf_evc {
318 u_char evc_code ;
319 u_char evc_index ;
320 u_char evc_rep_required ;
321 u_short evc_para ;
322 u_char *evc_cond_state ;
323 u_char *evc_multiple ;
324} ;
325
326
327
328
329
330#define SMT_MAX_TEST 5
331#define SMT_TID_NIF 0
332#define SMT_TID_NIF_TEST 1
333#define SMT_TID_ECF_UNA 2
334#define SMT_TID_ECF_DNA 3
335#define SMT_TID_ECF 4
336
337struct smt_values {
338 u_long smt_tvu ;
339 u_long smt_tvd ;
340 u_long smt_tid ;
341 u_long pend[SMT_MAX_TEST] ;
342 u_long uniq_time ;
343 u_short uniq_ticks ;
344 u_short please_reconnect ;
345 u_long smt_last_lem ;
346 u_long smt_last_notify ;
347 struct smt_timer smt_timer ;
348 u_long last_tok_time[NUMMACS];
349} ;
350
351
352
353
354#define SMT_DAS 0
355#define SMT_SAS 1
356#define SMT_NAC 2
357
358struct smt_config {
359 u_char attach_s ;
360 u_char sas ;
361 u_char build_ring_map ;
362 u_char numphys ;
363 u_char sc_pad[1] ;
364
365 u_long pcm_tb_min ;
366 u_long pcm_tb_max ;
367 u_long pcm_c_min ;
368 u_long pcm_t_out ;
369 u_long pcm_tl_min ;
370 u_long pcm_lc_short ;
371 u_long pcm_lc_medium ;
372 u_long pcm_lc_long ;
373 u_long pcm_lc_extended ;
374 u_long pcm_t_next_9 ;
375 u_long pcm_ns_max ;
376
377 u_long ecm_i_max ;
378 u_long ecm_in_max ;
379 u_long ecm_td_min ;
380 u_long ecm_test_done ;
381 u_long ecm_check_poll ;
382
383 u_long rmt_t_non_op ;
384 u_long rmt_t_stuck ;
385 u_long rmt_t_direct ;
386 u_long rmt_t_jam ;
387 u_long rmt_t_announce ;
388 u_long rmt_t_poll ;
389 u_long rmt_dup_mac_behavior ;
390
391
392
393
394 u_long mac_d_max ;
395
396 u_long lct_short ;
397 u_long lct_medium ;
398 u_long lct_long ;
399 u_long lct_extended ;
400} ;
401
402#ifdef DEBUG
403
404
405
406struct smt_debug {
407 int d_smtf ;
408 int d_smt ;
409 int d_ecm ;
410 int d_rmt ;
411 int d_cfm ;
412 int d_pcm ;
413 int d_plc ;
414#ifdef ESS
415 int d_ess ;
416#endif
417#ifdef SBA
418 int d_sba ;
419#endif
420 struct os_debug d_os;
421} ;
422
423#ifndef DEBUG_BRD
424
425extern struct smt_debug debug;
426#endif
427
428#endif
429
430
431
432
433
434struct s_smc {
435 struct s_smt_os os ;
436 struct s_smt_hw hw ;
437
438
439
440
441
442 struct smt_config s ;
443 struct smt_values sm ;
444 struct s_ecm e ;
445 struct s_rmt r ;
446 struct s_cfm cf ;
447#ifdef CONCENTRATOR
448 struct s_cem ce[NUMPHYS] ;
449 struct s_c_ring cr[NUMPHYS+NUMMACS] ;
450#endif
451 struct s_pcm p ;
452 struct s_phy y[NUMPHYS] ;
453 struct s_queue q ;
454 struct s_timer t ;
455 struct s_srf srf ;
456 struct s_srf_evc evcs[6+NUMPHYS*4] ;
457 struct fddi_mib mib ;
458#ifdef SBA
459 struct s_sba sba ;
460#endif
461#ifdef ESS
462 struct s_ess ess ;
463#endif
464#if defined(DEBUG) && defined(DEBUG_BRD)
465
466 struct smt_debug debug;
467#endif
468} ;
469
470extern const struct fddi_addr fddi_broadcast;
471
472void all_selection_criteria(struct s_smc *smc);
473void card_stop(struct s_smc *smc);
474void init_board(struct s_smc *smc, u_char *mac_addr);
475int init_fplus(struct s_smc *smc);
476void init_plc(struct s_smc *smc);
477int init_smt(struct s_smc *smc, u_char *mac_addr);
478void mac1_irq(struct s_smc *smc, u_short stu, u_short stl);
479void mac2_irq(struct s_smc *smc, u_short code_s2u, u_short code_s2l);
480void mac3_irq(struct s_smc *smc, u_short code_s3u, u_short code_s3l);
481int pcm_status_twisted(struct s_smc *smc);
482void plc1_irq(struct s_smc *smc);
483void plc2_irq(struct s_smc *smc);
484void read_address(struct s_smc *smc, u_char *mac_addr);
485void timer_irq(struct s_smc *smc);
486
487#endif
488
489