Lines Matching defs:smc
19 #include "h/smc.h"
31 static int smt_authorize(struct s_smc *smc, struct smt_header *sm);
32 static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm);
34 static int smt_mib_phys(struct s_smc *smc);
35 static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
37 void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
39 static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
41 static int port_to_mib(struct s_smc *smc, int p);
277 void smt_pmf_received_pack(struct s_smc *smc, SMbuf *mb, int local)
285 dump_smt(smc,sm,"PMF Received") ;
291 smt_start_watchdog(smc) ;
295 reply = smt_build_pmf_response(smc,sm,
300 dump_smt(smc,sm,"PMF Reply") ;
302 smt_send_frame(smc,reply,FC_SMT_INFO,local) ;
307 static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
326 if (!(mb = smt_get_mbuf(smc)))
351 if (!local && smt_authorize(smc,req))
353 else if (smt_check_set_count(smc,req))
360 smt_add_para(smc,&pcon,(u_short) SMT_P_REASON,0,0) ;
361 smt_add_para(smc,&pcon,(u_short) SMT_P1033,0,0) ;
364 smt_add_para(smc,&pcon,(u_short) SMT_P1035,0,0) ;
365 smt_add_para(smc,&pcon,(u_short) SMT_P1036,0,0) ;
404 if (smc->s.sas == SMT_SAS)
432 smt_add_para(smc,&pcon,pt->p_num,
446 smt_add_para(smc,&pcon,pa->p_type,
450 st = smt_set_para(smc,pa,index,local,1);
454 smt_add_para(smc,&pcon,pa->p_type,
463 smt_add_para(smc,&pcon,pa->p_type,
486 smc->mib.fddiSMTSetCount.count++ ;
487 smt_set_timestamp(smc,smc->mib.fddiSMTSetCount.timestamp) ;
488 smc->mib.fddiSMTLastSetStationId = req->smt_sid ;
489 smt_add_para(smc,&set_pcon,(u_short) SMT_P1035,0,0) ;
490 smt_add_para(smc,&set_pcon,(u_short) SMT_P1036,0,0) ;
495 static int smt_authorize(struct s_smc *smc, struct smt_header *sm)
504 p = (char *) &smc->mib.fddiPRPMFStation ;
509 (char *) &smc->mib.fddiPRPMFStation,8))
515 p = (char *) smc->mib.fddiPRPMFPasswd ;
519 pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P_AUTHOR) ;
524 if (memcmp((char *)(pa+1),(char *)smc->mib.fddiPRPMFPasswd,8))
530 static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm)
535 pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P1035) ;
538 if ((smc->mib.fddiSMTSetCount.count != sc->count) ||
539 memcmp((char *) smc->mib.fddiSMTSetCount.timestamp,
546 void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
608 mib_addr = (char *) (&smc->mib) ;
615 mib_addr = (char *) (&smc->mib.m[mac]) ;
623 mib_addr = (char *) (&smc->mib.a[path]) ;
626 if (port < 0 || port >= smt_mib_phys(smc)) {
630 mib_addr = (char *) (&smc->mib.p[port_to_mib(smc,port)]) ;
665 mac_update_counter(smc) ;
669 sm_pm_get_ls(smc,port_to_mib(smc,port))) ;
676 smt_set_timestamp(smc,smc->mib.fddiSMTTimeStamp) ;
684 if (smc->s.sas == SMT_SAS)
699 sp_len = cem_build_path(smc,to,path) ;
706 sp->p1048_flag = smc->mib.fddiSMTPeerWrapFlag ;
707 sp->p1048_cf_state = smc->mib.fddiSMTCF_State ;
716 smc->mib.m[MAC0].fddiMACDuplicateAddressCond ;
1029 SMT_PANIC(smc,SMT_E0119, SMT_E0119_MSG) ;
1071 static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1100 mib = &smc->mib ;
1110 mib_m = &smc->mib.m[mac] ;
1119 mib_a = &smc->mib.a[path] ;
1125 if (port < 0 || port >= smt_mib_phys(smc)) {
1128 mib_p = &smc->mib.p[port_to_mib(smc,port)] ;
1288 SMT_PANIC(smc,SMT_E0120, SMT_E0120_MSG) ;
1329 if (set && smc->mib.fddiESSPayload != long_val) {
1330 smc->ess.raf_act_timer_poll = TRUE ;
1331 smc->mib.fddiESSPayload = long_val ;
1337 if (set && smc->mib.fddiESSPayload &&
1338 smc->mib.fddiESSOverhead != long_val) {
1339 smc->ess.raf_act_timer_poll = TRUE ;
1340 smc->mib.fddiESSOverhead = long_val ;
1395 queue_event(smc,EVENT_RMT,RM_ENABLE_FLAG) ;
1407 ess_para_change(smc) ;
1420 ess_para_change(smc) ;
1429 rtm_set_timer(smc) ;
1451 if (set && smt_set_mac_opvalues(smc)) {
1452 RS_SET(smc,RS_EVENT) ;
1453 smc->sm.please_reconnect = 1 ;
1454 queue_event(smc,EVENT_ECM,EC_DISCONNECT) ;
1487 if (smt_action(smc,SMT_STATION_ACTION, (int) word_val, 0))
1491 if (smt_action(smc,SMT_PORT_ACTION, (int) word_val,
1492 port_to_mib(smc,port)))
1527 static int smt_mib_phys(struct s_smc *smc)
1530 SK_UNUSED(smc) ;
1534 if (smc->s.sas == SMT_SAS)
1540 static int port_to_mib(struct s_smc *smc, int p)
1543 SK_UNUSED(smc) ;
1547 if (smc->s.sas == SMT_SAS)
1556 void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text)
1567 SK_UNUSED(smc) ;
1570 if (smc->debug.d_smtf < 2)