Lines Matching refs:sm

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