Lines Matching refs:smc
78 static void ess_send_response(struct s_smc *smc, struct smt_header *sm,
80 static void ess_config_fifo(struct s_smc *smc);
81 static void ess_send_alc_req(struct s_smc *smc);
82 static void ess_send_frame(struct s_smc *smc, SMbuf *mb);
96 void ess_timer_poll(struct s_smc *smc);
97 void ess_para_change(struct s_smc *smc);
98 int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
100 static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead);
112 int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, in ess_raf_received_pack() argument
131 if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) { in ess_raf_received_pack()
140 if (!(cmd = (struct smt_p_0016 *) sm_to_para(smc,sm,SMT_P0016))) { in ess_raf_received_pack()
172 if (!local || smc->mib.fddiESSPayload) in ess_raf_received_pack()
175 p = (void *) sm_to_para(smc,sm,SMT_P0019) ; in ess_raf_received_pack()
186 smc->ess.alloc_trans_id = sm->smt_tid ; in ess_raf_received_pack()
188 p = (void *) sm_to_para(smc,sm,SMT_P320F) ; in ess_raf_received_pack()
190 smc->mib.a[PATH0].fddiPATHSbaPayload ; in ess_raf_received_pack()
191 p = (void *) sm_to_para(smc,sm,SMT_P3210) ; in ess_raf_received_pack()
193 smc->mib.a[PATH0].fddiPATHSbaOverhead ; in ess_raf_received_pack()
196 if (smc->ess.local_sba_active) in ess_raf_received_pack()
199 if (!(db = smt_get_mbuf(smc))) in ess_raf_received_pack()
206 dump_smt(smc, in ess_raf_received_pack()
209 smt_send_frame(smc,db,FC_SMT_INFO,0) ; in ess_raf_received_pack()
217 if (smt_check_para(smc,sm,plist_raf_alc_res)) { in ess_raf_received_pack()
232 if ((((struct smt_p_320b *)sm_to_para(smc,sm,SMT_P320B))->path_index in ess_raf_received_pack()
235 (((struct smt_p_reason *)sm_to_para(smc,sm,SMT_P0012))->rdf_reason in ess_raf_received_pack()
237 (sm->smt_tid != smc->ess.alloc_trans_id)) { in ess_raf_received_pack()
246 p = (void *) sm_to_para(smc,sm,SMT_P320F) ; in ess_raf_received_pack()
252 p = (void *) sm_to_para(smc,sm,SMT_P3210) ; in ess_raf_received_pack()
265 (void)process_bw_alloc(smc,(long)payload,(long)overhead) ; in ess_raf_received_pack()
285 if (smt_check_para(smc,sm,plist_raf_chg_req)) { in ess_raf_received_pack()
296 if ((((struct smt_p_320b *)sm_to_para(smc,sm,SMT_P320B))->path_index in ess_raf_received_pack()
305 p = (void *) sm_to_para(smc,sm,SMT_P320F) ; in ess_raf_received_pack()
307 p = (void *) sm_to_para(smc,sm,SMT_P3210) ; in ess_raf_received_pack()
318 if(!process_bw_alloc(smc,(long)payload,(long)overhead)) in ess_raf_received_pack()
324 ess_send_response(smc,sm,CHANGE_ALLOCATION) ; in ess_raf_received_pack()
355 ess_send_response(smc,sm,REPORT_ALLOCATION) ; in ess_raf_received_pack()
375 static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead) in process_bw_alloc() argument
435 if (smc->mib.fddiESSPayload && in process_bw_alloc()
436 ((u_long)payload != smc->mib.fddiESSPayload || in process_bw_alloc()
437 (u_long)overhead != smc->mib.fddiESSOverhead)) { in process_bw_alloc()
438 smc->ess.raf_act_timer_poll = TRUE ; in process_bw_alloc()
439 smc->ess.timer_count = 0 ; in process_bw_alloc()
447 smc->ess.sync_bw_available = TRUE ; in process_bw_alloc()
449 smc->ess.sync_bw = overhead - in process_bw_alloc()
450 (long)smc->mib.m[MAC0].fddiMACT_Neg * in process_bw_alloc()
455 smc->ess.sync_bw_available = FALSE ; in process_bw_alloc()
456 smc->ess.sync_bw = 0 ; in process_bw_alloc()
460 smc->mib.a[PATH0].fddiPATHSbaPayload = payload ; in process_bw_alloc()
461 smc->mib.a[PATH0].fddiPATHSbaOverhead = overhead ; in process_bw_alloc()
464 DB_ESSN(2, "tsync = %lx", smc->ess.sync_bw); in process_bw_alloc()
466 ess_config_fifo(smc) ; in process_bw_alloc()
467 set_formac_tsync(smc,smc->ess.sync_bw) ; in process_bw_alloc()
471 static void ess_send_response(struct s_smc *smc, struct smt_header *sm, in ess_send_response() argument
482 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REPLY, in ess_send_response()
487 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REPLY, in ess_send_response()
517 chg->payload.mib_payload = smc->mib.a[PATH0].fddiPATHSbaPayload ; in ess_send_response()
523 chg->overhead.mib_overhead = smc->mib.a[PATH0].fddiPATHSbaOverhead ; in ess_send_response()
529 p = (void *) sm_to_para(smc,sm,SMT_P001A) ; in ess_send_response()
532 dump_smt(smc,(struct smt_header *)chg,"RAF") ; in ess_send_response()
533 ess_send_frame(smc,mb) ; in ess_send_response()
536 void ess_timer_poll(struct s_smc *smc) in ess_timer_poll() argument
538 if (!smc->ess.raf_act_timer_poll) in ess_timer_poll()
543 smc->ess.timer_count++ ; in ess_timer_poll()
544 if (smc->ess.timer_count == 10) { in ess_timer_poll()
545 smc->ess.timer_count = 0 ; in ess_timer_poll()
546 ess_send_alc_req(smc) ; in ess_timer_poll()
550 static void ess_send_alc_req(struct s_smc *smc) in ess_send_alc_req() argument
560 if (!smc->mib.fddiESSPayload) { in ess_send_alc_req()
561 smc->mib.fddiESSOverhead = 0 ; in ess_send_alc_req()
564 if (!smc->mib.fddiESSOverhead) in ess_send_alc_req()
565 smc->mib.fddiESSOverhead = DEFAULT_OV ; in ess_send_alc_req()
568 if (smc->mib.fddiESSOverhead == in ess_send_alc_req()
569 smc->mib.a[PATH0].fddiPATHSbaOverhead && in ess_send_alc_req()
570 smc->mib.fddiESSPayload == in ess_send_alc_req()
571 smc->mib.a[PATH0].fddiPATHSbaPayload){ in ess_send_alc_req()
572 smc->ess.raf_act_timer_poll = FALSE ; in ess_send_alc_req()
573 smc->ess.timer_count = 7 ; /* next RAF alc req after 3 s */ in ess_send_alc_req()
580 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REQUEST, in ess_send_alc_req()
584 req->smt.smt_tid = smc->ess.alloc_trans_id = smt_get_tid(smc) ; in ess_send_alc_req()
612 req->pl_req.sba_pl_req = smc->mib.fddiESSPayload - in ess_send_alc_req()
613 smc->mib.a[PATH0].fddiPATHSbaPayload ; in ess_send_alc_req()
618 req->ov_req.sba_ov_req = smc->mib.fddiESSOverhead - in ess_send_alc_req()
619 smc->mib.a[PATH0].fddiPATHSbaOverhead ; in ess_send_alc_req()
625 req->payload.mib_payload = smc->mib.a[PATH0].fddiPATHSbaPayload ; in ess_send_alc_req()
631 req->overhead.mib_overhead = smc->mib.a[PATH0].fddiPATHSbaOverhead ; in ess_send_alc_req()
642 req->cat.category = smc->mib.fddiESSCategory ; in ess_send_alc_req()
647 req->tneg.max_t_neg = smc->mib.fddiESSMaxTNeg ; in ess_send_alc_req()
652 req->segm.min_seg_siz = smc->mib.fddiESSMinSegmentSize ; in ess_send_alc_req()
654 dump_smt(smc,(struct smt_header *)req,"RAF") ; in ess_send_alc_req()
655 ess_send_frame(smc,mb) ; in ess_send_alc_req()
658 static void ess_send_frame(struct s_smc *smc, SMbuf *mb) in ess_send_frame() argument
663 if (smc->ess.local_sba_active) { in ess_send_frame()
668 if (!smc->ess.sba_reply_pend) in ess_send_frame()
669 smc->ess.sba_reply_pend = mb ; in ess_send_frame()
672 smt_free_mbuf(smc,mb) ; in ess_send_frame()
680 smt_send_frame(smc,mb,FC_SMT_INFO,0) ; in ess_send_frame()
684 void ess_para_change(struct s_smc *smc) in ess_para_change() argument
686 (void)process_bw_alloc(smc,(long)smc->mib.a[PATH0].fddiPATHSbaPayload, in ess_para_change()
687 (long)smc->mib.a[PATH0].fddiPATHSbaOverhead) ; in ess_para_change()
690 static void ess_config_fifo(struct s_smc *smc) in ess_config_fifo() argument
695 if (smc->mib.a[PATH0].fddiPATHSbaPayload) { in ess_config_fifo()
696 if (smc->hw.fp.fifo.fifo_config_mode & SYNC_TRAFFIC_ON && in ess_config_fifo()
697 (smc->hw.fp.fifo.fifo_config_mode&SEND_ASYNC_AS_SYNC) == in ess_config_fifo()
698 smc->mib.fddiESSSynchTxMode) { in ess_config_fifo()
703 if (!(smc->hw.fp.fifo.fifo_config_mode & SYNC_TRAFFIC_ON)) { in ess_config_fifo()
711 formac_reinit_tx(smc) ; in ess_config_fifo()