Lines Matching refs:smc
32 static void clear_all_rep(struct s_smc *smc);
33 static void clear_reported(struct s_smc *smc);
34 static void smt_send_srf(struct s_smc *smc);
35 static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index);
37 #define MAX_EVCS ARRAY_SIZE(smc->evcs)
63 void smt_init_evc(struct s_smc *smc) in smt_init_evc() argument
73 memset((char *)smc->evcs,0,sizeof(smc->evcs)) ; in smt_init_evc()
75 evc = smc->evcs ; in smt_init_evc()
92 if ((unsigned int) (evc - smc->evcs) > MAX_EVCS) { in smt_init_evc()
93 SMT_PANIC(smc,SMT_E0127, SMT_E0127_MSG) ; in smt_init_evc()
99 smc->evcs[0].evc_cond_state = &smc->mib.fddiSMTPeerWrapFlag ; in smt_init_evc()
100 smc->evcs[1].evc_cond_state = in smt_init_evc()
101 &smc->mib.m[MAC0].fddiMACDuplicateAddressCond ; in smt_init_evc()
102 smc->evcs[2].evc_cond_state = in smt_init_evc()
103 &smc->mib.m[MAC0].fddiMACFrameErrorFlag ; in smt_init_evc()
104 smc->evcs[3].evc_cond_state = in smt_init_evc()
105 &smc->mib.m[MAC0].fddiMACNotCopiedFlag ; in smt_init_evc()
110 smc->evcs[4].evc_multiple = &smc->mib.m[MAC0].fddiMACMultiple_N ; in smt_init_evc()
111 smc->evcs[5].evc_multiple = &smc->mib.m[MAC0].fddiMACMultiple_P ; in smt_init_evc()
118 smc->evcs[offset + 0*NUMPHYS].evc_cond_state = in smt_init_evc()
119 &smc->mib.p[i].fddiPORTLerFlag ; in smt_init_evc()
120 smc->evcs[offset + 1*NUMPHYS].evc_cond_state = in smt_init_evc()
121 &smc->mib.p[i].fddiPORTEB_Condition ; in smt_init_evc()
126 smc->evcs[offset + 2*NUMPHYS].evc_multiple = in smt_init_evc()
127 &smc->mib.p[i].fddiPORTMultiple_U ; in smt_init_evc()
128 smc->evcs[offset + 3*NUMPHYS].evc_multiple = in smt_init_evc()
129 &smc->mib.p[i].fddiPORTMultiple_P ; in smt_init_evc()
133 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in smt_init_evc()
136 SMT_PANIC(smc,SMT_E0128, SMT_E0128_MSG) ; in smt_init_evc()
142 SMT_PANIC(smc,SMT_E0129, SMT_E0129_MSG) ; in smt_init_evc()
148 smc->srf.TSR = smt_get_time() ; in smt_init_evc()
149 smc->srf.sr_state = SR0_WAIT ; in smt_init_evc()
152 static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index) in smt_get_evc() argument
157 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in smt_get_evc()
176 void smt_srf_event(struct s_smc *smc, int code, int index, int cond) in smt_srf_event() argument
186 RS_SET(smc,RS_DUPADDR) ; in smt_srf_event()
192 if (!(evc = smt_get_evc(smc,code,index))) { in smt_srf_event()
207 smt_set_timestamp(smc,smc->mib.fddiSMTTransitionTimeStamp) ; in smt_srf_event()
213 smc->srf.any_report = TRUE ; in smt_srf_event()
229 smc->srf.any_report = TRUE ; in smt_srf_event()
233 snmp_srf_event(smc,evc) ; in smt_srf_event()
236 tsr = smt_get_time() - smc->srf.TSR ; in smt_srf_event()
238 switch (smc->srf.sr_state) { in smt_srf_event()
242 smc->srf.SRThreshold = THRESHOLD_2 ; in smt_srf_event()
243 smc->srf.sr_state = SR1_HOLDOFF ; in smt_srf_event()
248 smc->srf.sr_state = SR1_HOLDOFF ; in smt_srf_event()
253 smc->srf.sr_state = SR1_HOLDOFF ; in smt_srf_event()
258 smc->srf.SRThreshold = THRESHOLD_2 ; in smt_srf_event()
259 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
260 smt_send_srf(smc) ; in smt_srf_event()
265 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
266 smt_send_srf(smc) ; in smt_srf_event()
271 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
272 smt_send_srf(smc) ; in smt_srf_event()
276 if (smc->srf.any_report && (u_long) tsr >= in smt_srf_event()
277 smc->srf.SRThreshold) { in smt_srf_event()
278 smc->srf.SRThreshold *= 2 ; in smt_srf_event()
279 if (smc->srf.SRThreshold > THRESHOLD_32) in smt_srf_event()
280 smc->srf.SRThreshold = THRESHOLD_32 ; in smt_srf_event()
281 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
282 smt_send_srf(smc) ; in smt_srf_event()
286 if (!smc->mib.fddiSMTStatRptPolicy) { in smt_srf_event()
287 smc->srf.sr_state = SR2_DISABLED ; in smt_srf_event()
294 smc->srf.sr_state = SR0_WAIT ; in smt_srf_event()
295 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
296 smt_send_srf(smc) ; in smt_srf_event()
301 smc->srf.SRThreshold = THRESHOLD_2 ; in smt_srf_event()
307 if (!smc->mib.fddiSMTStatRptPolicy) { in smt_srf_event()
308 smc->srf.sr_state = SR2_DISABLED ; in smt_srf_event()
313 if (smc->mib.fddiSMTStatRptPolicy) { in smt_srf_event()
314 smc->srf.sr_state = SR0_WAIT ; in smt_srf_event()
315 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
316 smc->srf.SRThreshold = THRESHOLD_2 ; in smt_srf_event()
317 clear_all_rep(smc) ; in smt_srf_event()
324 static void clear_all_rep(struct s_smc *smc) in clear_all_rep() argument
329 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in clear_all_rep()
334 smc->srf.any_report = FALSE ; in clear_all_rep()
337 static void clear_reported(struct s_smc *smc) in clear_reported() argument
342 smc->srf.any_report = FALSE ; in clear_reported()
343 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in clear_reported()
348 smc->srf.any_report = TRUE ; in clear_reported()
360 static void smt_send_srf(struct s_smc *smc) in smt_send_srf() argument
376 if (!smc->r.sm_ma_avail) in smt_send_srf()
378 if (!(mb = smt_build_frame(smc,SMT_SRF,SMT_ANNOUNCE,0))) in smt_send_srf()
381 RS_SET(smc,RS_SOFTERROR) ; in smt_send_srf()
394 smt_add_para(smc,&pcon,(u_short) SMT_P1033,0,0) ; in smt_send_srf()
395 smt_add_para(smc,&pcon,(u_short) SMT_P1034,0,0) ; in smt_send_srf()
397 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in smt_send_srf()
399 smt_add_para(smc,&pcon,evc->evc_para, in smt_send_srf()
408 smc->srf.sr_state, smc->srf.SRThreshold / TICKS_PER_SECOND); in smt_send_srf()
410 dump_smt(smc,smt,"SRF Send") ; in smt_send_srf()
412 smt_send_frame(smc,mb,FC_SMT_INFO,0) ; in smt_send_srf()
413 clear_reported(smc) ; in smt_send_srf()