Lines Matching refs:sm

172 	smc->sm.smt_tid = 0 ;  in smt_agent_init()
180 smc->sm.pend[i] = 0 ; in smt_agent_init()
181 smc->sm.please_reconnect = 0 ; in smt_agent_init()
182 smc->sm.uniq_ticks = 0 ; in smt_agent_init()
195 smt_timer_start(smc,&smc->sm.smt_timer, (u_long)1000000L, in smt_agent_task()
208 count = ((time - smc->sm.last_tok_time[mac_index]) * in smt_emulate_token_ct()
222 smc->sm.last_tok_time[mac_index] = time; in smt_emulate_token_ct()
236 if (smc->sm.please_reconnect) { in smt_event()
237 smc->sm.please_reconnect -- ; in smt_event()
238 if (smc->sm.please_reconnect == 0) { in smt_event()
271 if (time - smc->sm.smt_last_lem >= TICKS_PER_SECOND*8) { in smt_event()
286 smc->sm.smt_last_lem = time ; in smt_event()
370 if (time - smc->sm.smt_last_notify >= (u_long) in smt_event()
378 if (!smc->sm.pend[SMT_TID_NIF]) in smt_event()
379 smc->sm.pend[SMT_TID_NIF] = smt_get_tid(smc) ; in smt_event()
381 smc->sm.pend[SMT_TID_NIF], SMT_REQUEST,0) ; in smt_event()
382 smc->sm.smt_last_notify = time ; in smt_event()
388 if (smc->sm.smt_tvu && in smt_event()
389 time - smc->sm.smt_tvu > 228*TICKS_PER_SECOND) { in smt_event()
391 smc->sm.smt_tvu = 0 ; in smt_event()
411 if (smc->sm.smt_tvd && in smt_event()
412 time - smc->sm.smt_tvd > 228*TICKS_PER_SECOND) { in smt_event()
414 smc->sm.smt_tvd = 0 ; in smt_event()
434 if (time - smc->sm.last_tok_time[i] > 2*TICKS_PER_SECOND ){ in smt_event()
440 smt_timer_start(smc,&smc->sm.smt_timer, (u_long)1000000L, in smt_event()
463 struct smt_header *sm ; in smt_received_pack() local
480 sm = smtod(mb,struct smt_header *) ; in smt_received_pack()
482 hwm_conv_can(smc,(char *)sm,12) ; in smt_received_pack()
485 if (is_individual(&sm->smt_dest) && !is_my_addr(smc,&sm->smt_dest)) { in smt_received_pack()
491 if (is_my_addr(smc,&sm->smt_source) && !local) { in smt_received_pack()
497 smt_swap_para(sm,(int) mb->sm_len,1) ; in smt_received_pack()
499 smt_type_name[m_fc(mb) & 0xf], sm); in smt_received_pack()
501 sm->smt_version, in smt_received_pack()
502 smt_class_name[sm->smt_class > LAST_CLASS ? 0 : sm->smt_class]); in smt_received_pack()
508 if (m_fc(mb) == FC_SMT_NSA && sm->smt_class == SMT_NIF && in smt_received_pack()
509 (sm->smt_type == SMT_ANNOUNCE || sm->smt_type == SMT_REQUEST)) { in smt_received_pack()
510 smc->sba.sm = sm ; in smt_received_pack()
520 &sm->smt_source); in smt_received_pack()
528 if (((sm->smt_class == SMT_ECF) && (sm->smt_len > SMT_MAX_ECHO_LEN)) || in smt_received_pack()
529 ((sm->smt_class != SMT_ECF) && (sm->smt_len > SMT_MAX_INFO_LEN))) { in smt_received_pack()
537 switch (sm->smt_class) { in smt_received_pack()
542 if (sm->smt_version != SMT_VID) in smt_received_pack()
546 if (sm->smt_version != SMT_VID_2) in smt_received_pack()
552 sm->smt_version, &sm->smt_source); in smt_received_pack()
557 if ((sm->smt_len > mb->sm_len - sizeof(struct smt_header)) || in smt_received_pack()
558 ((sm->smt_len & 3) && (sm->smt_class != SMT_ECF))) { in smt_received_pack()
559 DB_SMT("SMT: info length error, len = %d", sm->smt_len); in smt_received_pack()
564 switch (sm->smt_class) { in smt_received_pack()
566 if (smt_check_para(smc,sm,plist_nif)) { in smt_received_pack()
570 switch (sm->smt_type) { in smt_received_pack()
574 && is_broadcast(&sm->smt_dest)) { in smt_received_pack()
580 &sm->smt_source)) { in smt_received_pack()
582 &sm->smt_source); in smt_received_pack()
591 sm->smt_source ; in smt_received_pack()
597 smc->sm.smt_tvu = smt_get_time() ; in smt_received_pack()
599 sm_to_para(smc,sm,SMT_P_STATE) ; in smt_received_pack()
607 if ((sm->smt_type == SMT_REQUEST) && in smt_received_pack()
608 is_individual(&sm->smt_source) && in smt_received_pack()
612 &sm->smt_source); in smt_received_pack()
613 smt_send_nif(smc,&sm->smt_source, in smt_received_pack()
615 sm->smt_tid, in smt_received_pack()
621 &sm->smt_source); in smt_received_pack()
623 smc->sm.pend[SMT_TID_NIF] = 0 ; in smt_received_pack()
633 if (sm->smt_tid == smc->sm.pend[SMT_TID_NIF]) { in smt_received_pack()
634 smc->sm.pend[SMT_TID_NIF] = 0 ; in smt_received_pack()
638 &sm->smt_source)) { in smt_received_pack()
648 sm->smt_source ; in smt_received_pack()
656 smc->sm.smt_tvd = smt_get_time() ; in smt_received_pack()
664 else if (sm->smt_tid == in smt_received_pack()
665 smc->sm.pend[SMT_TID_NIF_TEST]) { in smt_received_pack()
670 smc->sm.pend[SMT_TID_NIF], sm->smt_tid); in smt_received_pack()
679 if (sm->smt_type != SMT_REQUEST) in smt_received_pack()
682 &sm->smt_source); in smt_received_pack()
683 smt_send_sif_config(smc,&sm->smt_source,sm->smt_tid,local) ; in smt_received_pack()
686 if (sm->smt_type != SMT_REQUEST) in smt_received_pack()
689 &sm->smt_source); in smt_received_pack()
690 smt_send_sif_operation(smc,&sm->smt_source,sm->smt_tid,local) ; in smt_received_pack()
693 switch (sm->smt_type) { in smt_received_pack()
697 &sm->smt_source); in smt_received_pack()
698 if (sm_to_para(smc,sm,SMT_P_ECHODATA) == NULL) { in smt_received_pack()
702 if (sm->smt_tid == smc->sm.pend[SMT_TID_ECF]) { in smt_received_pack()
705 else if (sm->smt_tid == smc->sm.pend[SMT_TID_ECF_UNA]) { in smt_received_pack()
708 else if (sm->smt_tid == smc->sm.pend[SMT_TID_ECF_DNA]) { in smt_received_pack()
713 smc->sm.pend[SMT_TID_ECF], in smt_received_pack()
714 sm->smt_tid); in smt_received_pack()
720 if (sm->smt_len && !sm_to_para(smc,sm,SMT_P_ECHODATA)) { in smt_received_pack()
727 &sm->smt_source); in smt_received_pack()
730 sm->smt_dest = sm->smt_source ; in smt_received_pack()
731 sm->smt_type = SMT_REPLY ; in smt_received_pack()
732 dump_smt(smc,sm,"ECF REPLY") ; in smt_received_pack()
746 fs = ess_raf_received_pack(smc,mb,sm,fs) ; in smt_received_pack()
751 sba_raf_received_pack(smc,sm,fs) ; in smt_received_pack()
758 if (sm->smt_type == SMT_REQUEST) { in smt_received_pack()
765 if (sm->smt_type != SMT_REQUEST) in smt_received_pack()
768 if (sm->smt_class == SMT_PMF_GET) in smt_received_pack()
775 if ((sm->smt_class == SMT_PMF_SET) && in smt_received_pack()
776 !is_individual(&sm->smt_dest)) { in smt_received_pack()
783 dump_smt(smc,sm,"SRF received") ; in smt_received_pack()
786 if (sm->smt_type != SMT_REQUEST) in smt_received_pack()
794 sm->smt_class, &sm->smt_source); in smt_received_pack()
828 struct smt_header *sm ; in smt_send_frame() local
834 sm = smtod(mb,struct smt_header *) ; in smt_send_frame()
835 sm->smt_source = smc->mib.m[MAC0].fddiMACSMTAddress ; in smt_send_frame()
836 sm->smt_sid = smc->mib.fddiSMTStationId ; in smt_send_frame()
838 smt_swap_para(sm,(int) mb->sm_len,0) ; /* swap para & header */ in smt_send_frame()
839 hwm_conv_can(smc,(char *)sm,12) ; /* convert SA and DA */ in smt_send_frame()
854 struct smt_header *sm ; /* header of offending frame */ in smt_send_rdf() local
859 sm = smtod(rej,struct smt_header *) ; in smt_send_rdf()
860 if (sm->smt_type != SMT_REQUEST) in smt_send_rdf()
864 &sm->smt_source, reason); in smt_send_rdf()
876 rdf->smt.smt_tid = sm->smt_tid ; /* use TID from sm */ in smt_send_rdf()
877 rdf->smt.smt_dest = sm->smt_source ; /* set dest = source */ in smt_send_rdf()
908 smt_swap_para(sm,frame_len,0) ; in smt_send_rdf()
910 memcpy((char *) &rdf->refused.ref_header,(char *) sm,len) ; in smt_send_rdf()
955 smc->sm.pend[SMT_TID_NIF_TEST] = smt_get_tid(smc) ; in smt_send_nif_request()
956 smt_send_nif(smc,dest, FC_SMT_INFO, smc->sm.pend[SMT_TID_NIF_TEST], in smt_send_nif_request()
966 smc->sm.pend[SMT_TID_ECF] = smt_get_tid(smc) ; in smt_send_ecf_request()
967 smt_send_ecf(smc,dest, FC_SMT_INFO, smc->sm.pend[SMT_TID_ECF], in smt_send_ecf_request()
979 smc->sm.pend[dna ? SMT_TID_ECF_DNA : SMT_TID_ECF_UNA] = in smt_echo_test()
1239 p[6] = (u_char)(smc->sm.uniq_ticks>>8) ; in smt_set_timestamp()
1240 p[7] = (u_char)smc->sm.uniq_ticks ; in smt_set_timestamp()
1244 if (utime != smc->sm.uniq_time) { in smt_set_timestamp()
1245 smc->sm.uniq_ticks = 0 ; in smt_set_timestamp()
1247 smc->sm.uniq_ticks++ ; in smt_set_timestamp()
1248 smc->sm.uniq_time = utime ; in smt_set_timestamp()
1555 while ((tid = ++(smc->sm.smt_tid) ^ SMT_TID_MAGIC) == 0) in smt_get_tid()
1642 int smt_check_para(struct s_smc *smc, struct smt_header *sm, in smt_check_para() argument
1647 if (!sm_to_para(smc,sm,(int) *p)) { in smt_check_para()
1656 void *sm_to_para(struct s_smc *smc, struct smt_header *sm, int para) in sm_to_para() argument
1665 len = sm->smt_len ; in sm_to_para()
1666 p = (char *)(sm+1) ; /* pointer to info */ in sm_to_para()
1802 void smt_swap_para(struct smt_header *sm, int len, int direction) in smt_swap_para() argument
1815 smt_string_swap((char *)sm,SWAP_SMTHEADER,len) ; in smt_swap_para()
1820 p = (char *) (sm + 1) ; in smt_swap_para()
1894 void smt_swap_para(struct smt_header *sm, int len, int direction) in smt_swap_para() argument
1897 SK_UNUSED(sm) ; in smt_swap_para()