Lines Matching defs:smc

19 #include "h/smc.h"
27 static int smt_authorize(struct s_smc *smc, struct smt_header *sm);
28 static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm);
30 static int smt_mib_phys(struct s_smc *smc);
31 static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
33 void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
35 static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
37 static int port_to_mib(struct s_smc *smc, int p);
273 void smt_pmf_received_pack(struct s_smc *smc, SMbuf *mb, int local)
281 dump_smt(smc,sm,"PMF Received") ;
287 smt_start_watchdog(smc) ;
291 reply = smt_build_pmf_response(smc,sm,
296 dump_smt(smc,sm,"PMF Reply") ;
298 smt_send_frame(smc,reply,FC_SMT_INFO,local) ;
303 static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
322 if (!(mb = smt_get_mbuf(smc)))
347 if (!local && smt_authorize(smc,req))
349 else if (smt_check_set_count(smc,req))
356 smt_add_para(smc,&pcon,(u_short) SMT_P_REASON,0,0) ;
357 smt_add_para(smc,&pcon,(u_short) SMT_P1033,0,0) ;
360 smt_add_para(smc,&pcon,(u_short) SMT_P1035,0,0) ;
361 smt_add_para(smc,&pcon,(u_short) SMT_P1036,0,0) ;
400 if (smc->s.sas == SMT_SAS)
428 smt_add_para(smc,&pcon,pt->p_num,
442 smt_add_para(smc,&pcon,pa->p_type,
446 st = smt_set_para(smc,pa,index,local,1);
450 smt_add_para(smc,&pcon,pa->p_type,
459 smt_add_para(smc,&pcon,pa->p_type,
482 smc->mib.fddiSMTSetCount.count++ ;
483 smt_set_timestamp(smc,smc->mib.fddiSMTSetCount.timestamp) ;
484 smc->mib.fddiSMTLastSetStationId = req->smt_sid ;
485 smt_add_para(smc,&set_pcon,(u_short) SMT_P1035,0,0) ;
486 smt_add_para(smc,&set_pcon,(u_short) SMT_P1036,0,0) ;
491 static int smt_authorize(struct s_smc *smc, struct smt_header *sm)
500 p = (char *) &smc->mib.fddiPRPMFStation ;
505 (char *) &smc->mib.fddiPRPMFStation,8))
511 p = (char *) smc->mib.fddiPRPMFPasswd ;
515 pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P_AUTHOR) ;
520 if (memcmp((char *)(pa+1),(char *)smc->mib.fddiPRPMFPasswd,8))
526 static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm)
531 pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P1035) ;
534 if ((smc->mib.fddiSMTSetCount.count != sc->count) ||
535 memcmp((char *) smc->mib.fddiSMTSetCount.timestamp,
542 void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
604 mib_addr = (char *) (&smc->mib) ;
611 mib_addr = (char *) (&smc->mib.m[mac]) ;
619 mib_addr = (char *) (&smc->mib.a[path]) ;
622 if (port < 0 || port >= smt_mib_phys(smc)) {
626 mib_addr = (char *) (&smc->mib.p[port_to_mib(smc,port)]) ;
661 mac_update_counter(smc) ;
665 sm_pm_get_ls(smc,port_to_mib(smc,port))) ;
672 smt_set_timestamp(smc,smc->mib.fddiSMTTimeStamp) ;
680 if (smc->s.sas == SMT_SAS)
695 sp_len = cem_build_path(smc,to,path) ;
702 sp->p1048_flag = smc->mib.fddiSMTPeerWrapFlag ;
703 sp->p1048_cf_state = smc->mib.fddiSMTCF_State ;
712 smc->mib.m[MAC0].fddiMACDuplicateAddressCond ;
1025 SMT_PANIC(smc,SMT_E0119, SMT_E0119_MSG) ;
1067 static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1096 mib = &smc->mib ;
1106 mib_m = &smc->mib.m[mac] ;
1115 mib_a = &smc->mib.a[path] ;
1121 if (port < 0 || port >= smt_mib_phys(smc)) {
1124 mib_p = &smc->mib.p[port_to_mib(smc,port)] ;
1284 SMT_PANIC(smc,SMT_E0120, SMT_E0120_MSG) ;
1325 if (set && smc->mib.fddiESSPayload != long_val) {
1326 smc->ess.raf_act_timer_poll = TRUE ;
1327 smc->mib.fddiESSPayload = long_val ;
1333 if (set && smc->mib.fddiESSPayload &&
1334 smc->mib.fddiESSOverhead != long_val) {
1335 smc->ess.raf_act_timer_poll = TRUE ;
1336 smc->mib.fddiESSOverhead = long_val ;
1391 queue_event(smc,EVENT_RMT,RM_ENABLE_FLAG) ;
1403 ess_para_change(smc) ;
1416 ess_para_change(smc) ;
1425 rtm_set_timer(smc) ;
1447 if (set && smt_set_mac_opvalues(smc)) {
1448 RS_SET(smc,RS_EVENT) ;
1449 smc->sm.please_reconnect = 1 ;
1450 queue_event(smc,EVENT_ECM,EC_DISCONNECT) ;
1483 if (smt_action(smc,SMT_STATION_ACTION, (int) word_val, 0))
1487 if (smt_action(smc,SMT_PORT_ACTION, (int) word_val,
1488 port_to_mib(smc,port)))
1523 static int smt_mib_phys(struct s_smc *smc)
1526 SK_UNUSED(smc) ;
1530 if (smc->s.sas == SMT_SAS)
1536 static int port_to_mib(struct s_smc *smc, int p)
1539 SK_UNUSED(smc) ;
1543 if (smc->s.sas == SMT_SAS)
1552 void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text)
1563 SK_UNUSED(smc) ;
1566 if (smc->debug.d_smtf < 2)