Lines Matching refs:smc
41 static void clear_all_rep(struct s_smc *smc);
42 static void clear_reported(struct s_smc *smc);
43 static void smt_send_srf(struct s_smc *smc);
44 static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index);
46 #define MAX_EVCS ARRAY_SIZE(smc->evcs)
72 void smt_init_evc(struct s_smc *smc) in smt_init_evc() argument
82 memset((char *)smc->evcs,0,sizeof(smc->evcs)) ; in smt_init_evc()
84 evc = smc->evcs ; in smt_init_evc()
101 if ((unsigned int) (evc - smc->evcs) > MAX_EVCS) { in smt_init_evc()
102 SMT_PANIC(smc,SMT_E0127, SMT_E0127_MSG) ; in smt_init_evc()
108 smc->evcs[0].evc_cond_state = &smc->mib.fddiSMTPeerWrapFlag ; in smt_init_evc()
109 smc->evcs[1].evc_cond_state = in smt_init_evc()
110 &smc->mib.m[MAC0].fddiMACDuplicateAddressCond ; in smt_init_evc()
111 smc->evcs[2].evc_cond_state = in smt_init_evc()
112 &smc->mib.m[MAC0].fddiMACFrameErrorFlag ; in smt_init_evc()
113 smc->evcs[3].evc_cond_state = in smt_init_evc()
114 &smc->mib.m[MAC0].fddiMACNotCopiedFlag ; in smt_init_evc()
119 smc->evcs[4].evc_multiple = &smc->mib.m[MAC0].fddiMACMultiple_N ; in smt_init_evc()
120 smc->evcs[5].evc_multiple = &smc->mib.m[MAC0].fddiMACMultiple_P ; in smt_init_evc()
127 smc->evcs[offset + 0*NUMPHYS].evc_cond_state = in smt_init_evc()
128 &smc->mib.p[i].fddiPORTLerFlag ; in smt_init_evc()
129 smc->evcs[offset + 1*NUMPHYS].evc_cond_state = in smt_init_evc()
130 &smc->mib.p[i].fddiPORTEB_Condition ; in smt_init_evc()
135 smc->evcs[offset + 2*NUMPHYS].evc_multiple = in smt_init_evc()
136 &smc->mib.p[i].fddiPORTMultiple_U ; in smt_init_evc()
137 smc->evcs[offset + 3*NUMPHYS].evc_multiple = in smt_init_evc()
138 &smc->mib.p[i].fddiPORTMultiple_P ; in smt_init_evc()
142 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in smt_init_evc()
145 SMT_PANIC(smc,SMT_E0128, SMT_E0128_MSG) ; in smt_init_evc()
151 SMT_PANIC(smc,SMT_E0129, SMT_E0129_MSG) ; in smt_init_evc()
157 smc->srf.TSR = smt_get_time() ; in smt_init_evc()
158 smc->srf.sr_state = SR0_WAIT ; in smt_init_evc()
161 static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index) in smt_get_evc() argument
166 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in smt_get_evc()
187 void smt_srf_event(struct s_smc *smc, int code, int index, int cond) in smt_srf_event() argument
197 RS_SET(smc,RS_DUPADDR) ; in smt_srf_event()
203 if (!(evc = smt_get_evc(smc,code,index))) { in smt_srf_event()
218 smt_set_timestamp(smc,smc->mib.fddiSMTTransitionTimeStamp) ; in smt_srf_event()
224 smc->srf.any_report = TRUE ; in smt_srf_event()
240 smc->srf.any_report = TRUE ; in smt_srf_event()
244 snmp_srf_event(smc,evc) ; in smt_srf_event()
247 tsr = smt_get_time() - smc->srf.TSR ; in smt_srf_event()
249 switch (smc->srf.sr_state) { in smt_srf_event()
253 smc->srf.SRThreshold = THRESHOLD_2 ; in smt_srf_event()
254 smc->srf.sr_state = SR1_HOLDOFF ; in smt_srf_event()
259 smc->srf.sr_state = SR1_HOLDOFF ; in smt_srf_event()
264 smc->srf.sr_state = SR1_HOLDOFF ; in smt_srf_event()
269 smc->srf.SRThreshold = THRESHOLD_2 ; in smt_srf_event()
270 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
271 smt_send_srf(smc) ; in smt_srf_event()
276 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
277 smt_send_srf(smc) ; in smt_srf_event()
282 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
283 smt_send_srf(smc) ; in smt_srf_event()
287 if (smc->srf.any_report && (u_long) tsr >= in smt_srf_event()
288 smc->srf.SRThreshold) { in smt_srf_event()
289 smc->srf.SRThreshold *= 2 ; in smt_srf_event()
290 if (smc->srf.SRThreshold > THRESHOLD_32) in smt_srf_event()
291 smc->srf.SRThreshold = THRESHOLD_32 ; in smt_srf_event()
292 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
293 smt_send_srf(smc) ; in smt_srf_event()
297 if (!smc->mib.fddiSMTStatRptPolicy) { in smt_srf_event()
298 smc->srf.sr_state = SR2_DISABLED ; in smt_srf_event()
305 smc->srf.sr_state = SR0_WAIT ; in smt_srf_event()
306 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
307 smt_send_srf(smc) ; in smt_srf_event()
312 smc->srf.SRThreshold = THRESHOLD_2 ; in smt_srf_event()
318 if (!smc->mib.fddiSMTStatRptPolicy) { in smt_srf_event()
319 smc->srf.sr_state = SR2_DISABLED ; in smt_srf_event()
324 if (smc->mib.fddiSMTStatRptPolicy) { in smt_srf_event()
325 smc->srf.sr_state = SR0_WAIT ; in smt_srf_event()
326 smc->srf.TSR = smt_get_time() ; in smt_srf_event()
327 smc->srf.SRThreshold = THRESHOLD_2 ; in smt_srf_event()
328 clear_all_rep(smc) ; in smt_srf_event()
335 static void clear_all_rep(struct s_smc *smc) in clear_all_rep() argument
340 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in clear_all_rep()
345 smc->srf.any_report = FALSE ; in clear_all_rep()
348 static void clear_reported(struct s_smc *smc) in clear_reported() argument
353 smc->srf.any_report = FALSE ; in clear_reported()
354 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in clear_reported()
359 smc->srf.any_report = TRUE ; in clear_reported()
371 static void smt_send_srf(struct s_smc *smc) in smt_send_srf() argument
387 if (!smc->r.sm_ma_avail) in smt_send_srf()
389 if (!(mb = smt_build_frame(smc,SMT_SRF,SMT_ANNOUNCE,0))) in smt_send_srf()
392 RS_SET(smc,RS_SOFTERROR) ; in smt_send_srf()
405 smt_add_para(smc,&pcon,(u_short) SMT_P1033,0,0) ; in smt_send_srf()
406 smt_add_para(smc,&pcon,(u_short) SMT_P1034,0,0) ; in smt_send_srf()
408 for (i = 0, evc = smc->evcs ; i < MAX_EVCS ; i++, evc++) { in smt_send_srf()
410 smt_add_para(smc,&pcon,evc->evc_para, in smt_send_srf()
419 smc->srf.sr_state,smc->srf.SRThreshold/TICKS_PER_SECOND) ; in smt_send_srf()
421 dump_smt(smc,smt,"SRF Send") ; in smt_send_srf()
423 smt_send_frame(smc,mb,FC_SMT_INFO,0) ; in smt_send_srf()
424 clear_reported(smc) ; in smt_send_srf()