Commit 5671e8c1 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

fddi: skfp: Use more common logging styles

Several macros use non-standard styles where format and arguments
are not verified.  Convert these to a more typical fmt, ##__VA_ARGS__
use so format and arguments match as appropriate.

Miscellanea:

o Fix format and argument mismatches
o Realign and reindent misindented block
o Strip newlines from formats and add to macro defines
o Coalesce a few consecutive logging uses to more simple single uses
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5dbc6530
...@@ -52,7 +52,6 @@ static const char ID_sccs[] = "@(#)cfm.c 2.18 98/10/06 (C) SK " ; ...@@ -52,7 +52,6 @@ static const char ID_sccs[] = "@(#)cfm.c 2.18 98/10/06 (C) SK " ;
#define ACTIONS_DONE() (smc->mib.fddiSMTCF_State &= ~AFLAG) #define ACTIONS_DONE() (smc->mib.fddiSMTCF_State &= ~AFLAG)
#define ACTIONS(x) (x|AFLAG) #define ACTIONS(x) (x|AFLAG)
#ifdef DEBUG
/* /*
* symbolic state names * symbolic state names
*/ */
...@@ -68,7 +67,6 @@ static const char * const cfm_states[] = { ...@@ -68,7 +67,6 @@ static const char * const cfm_states[] = {
static const char * const cfm_events[] = { static const char * const cfm_events[] = {
"NONE","CF_LOOP_A","CF_LOOP_B","CF_JOIN_A","CF_JOIN_B" "NONE","CF_LOOP_A","CF_LOOP_B","CF_JOIN_A","CF_JOIN_B"
} ; } ;
#endif
/* /*
* map from state to downstream port type * map from state to downstream port type
...@@ -230,10 +228,10 @@ void cfm(struct s_smc *smc, int event) ...@@ -230,10 +228,10 @@ void cfm(struct s_smc *smc, int event)
oldstate = smc->mib.fddiSMTCF_State ; oldstate = smc->mib.fddiSMTCF_State ;
do { do {
DB_CFM("CFM : state %s%s", DB_CFM("CFM : state %s%s event %s",
(smc->mib.fddiSMTCF_State & AFLAG) ? "ACTIONS " : "", smc->mib.fddiSMTCF_State & AFLAG ? "ACTIONS " : "",
cfm_states[smc->mib.fddiSMTCF_State & ~AFLAG]) ; cfm_states[smc->mib.fddiSMTCF_State & ~AFLAG],
DB_CFM(" event %s\n",cfm_events[event],0) ; cfm_events[event]);
state = smc->mib.fddiSMTCF_State ; state = smc->mib.fddiSMTCF_State ;
cfm_fsm(smc,event) ; cfm_fsm(smc,event) ;
event = 0 ; event = 0 ;
...@@ -297,7 +295,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd) ...@@ -297,7 +295,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */ queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
/* Don't do the WC-Flag changing here */ /* Don't do the WC-Flag changing here */
ACTIONS_DONE() ; ACTIONS_DONE() ;
DB_CFMN(1,"CFM : %s\n",cfm_states[smc->mib.fddiSMTCF_State],0) ; DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]);
break; break;
case SC0_ISOLATED : case SC0_ISOLATED :
/*SC07*/ /*SC07*/
...@@ -338,7 +336,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd) ...@@ -338,7 +336,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */ queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
} }
ACTIONS_DONE() ; ACTIONS_DONE() ;
DB_CFMN(1,"CFM : %s\n",cfm_states[smc->mib.fddiSMTCF_State],0) ; DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]);
break ; break ;
case SC9_C_WRAP_A : case SC9_C_WRAP_A :
/*SC10*/ /*SC10*/
...@@ -403,7 +401,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd) ...@@ -403,7 +401,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */ queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
} }
ACTIONS_DONE() ; ACTIONS_DONE() ;
DB_CFMN(1,"CFM : %s\n",cfm_states[smc->mib.fddiSMTCF_State],0) ; DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]);
break ; break ;
case SC10_C_WRAP_B : case SC10_C_WRAP_B :
/*SC20*/ /*SC20*/
...@@ -448,7 +446,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd) ...@@ -448,7 +446,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
smc->r.rm_join = TRUE ; smc->r.rm_join = TRUE ;
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */ queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
ACTIONS_DONE() ; ACTIONS_DONE() ;
DB_CFMN(1,"CFM : %s\n",cfm_states[smc->mib.fddiSMTCF_State],0) ; DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]);
break ; break ;
case SC4_THRU_A : case SC4_THRU_A :
/*SC41*/ /*SC41*/
...@@ -481,7 +479,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd) ...@@ -481,7 +479,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
smc->r.rm_join = TRUE ; smc->r.rm_join = TRUE ;
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */ queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
ACTIONS_DONE() ; ACTIONS_DONE() ;
DB_CFMN(1,"CFM : %s\n",cfm_states[smc->mib.fddiSMTCF_State],0) ; DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]);
break ; break ;
case SC5_THRU_B : case SC5_THRU_B :
/*SC51*/ /*SC51*/
...@@ -519,7 +517,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd) ...@@ -519,7 +517,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */ queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
} }
ACTIONS_DONE() ; ACTIONS_DONE() ;
DB_CFMN(1,"CFM : %s\n",cfm_states[smc->mib.fddiSMTCF_State],0) ; DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]);
break ; break ;
case SC11_C_WRAP_S : case SC11_C_WRAP_S :
/*SC70*/ /*SC70*/
......
...@@ -343,8 +343,8 @@ void init_board(struct s_smc *smc, u_char *mac_addr) ...@@ -343,8 +343,8 @@ void init_board(struct s_smc *smc, u_char *mac_addr)
*/ */
void sm_pm_bypass_req(struct s_smc *smc, int mode) void sm_pm_bypass_req(struct s_smc *smc, int mode)
{ {
DB_ECMN(1,"ECM : sm_pm_bypass_req(%s)\n",(mode == BP_INSERT) ? DB_ECMN(1, "ECM : sm_pm_bypass_req(%s)",
"BP_INSERT" : "BP_DEINSERT",0) ; mode == BP_INSERT ? "BP_INSERT" : "BP_DEINSERT");
if (smc->s.sas != SMT_DAS) if (smc->s.sas != SMT_DAS)
return ; return ;
......
...@@ -66,7 +66,6 @@ static const char ID_sccs[] = "@(#)ecm.c 2.7 99/08/05 (C) SK " ; ...@@ -66,7 +66,6 @@ static const char ID_sccs[] = "@(#)ecm.c 2.7 99/08/05 (C) SK " ;
#define EC6_CHECK 6 /* checking bypass */ #define EC6_CHECK 6 /* checking bypass */
#define EC7_DEINSERT 7 /* bypass being turnde off */ #define EC7_DEINSERT 7 /* bypass being turnde off */
#ifdef DEBUG
/* /*
* symbolic state names * symbolic state names
*/ */
...@@ -83,7 +82,6 @@ static const char * const ecm_events[] = { ...@@ -83,7 +82,6 @@ static const char * const ecm_events[] = {
"EC_TIMEOUT_TD","EC_TIMEOUT_TMAX", "EC_TIMEOUT_TD","EC_TIMEOUT_TMAX",
"EC_TIMEOUT_IMAX","EC_TIMEOUT_INMAX","EC_TEST_DONE" "EC_TIMEOUT_IMAX","EC_TIMEOUT_INMAX","EC_TEST_DONE"
} ; } ;
#endif
/* /*
* all Globals are defined in smc.h * all Globals are defined in smc.h
...@@ -126,10 +124,10 @@ void ecm(struct s_smc *smc, int event) ...@@ -126,10 +124,10 @@ void ecm(struct s_smc *smc, int event)
int state ; int state ;
do { do {
DB_ECM("ECM : state %s%s", DB_ECM("ECM : state %s%s event %s",
(smc->mib.fddiSMTECMState & AFLAG) ? "ACTIONS " : "", smc->mib.fddiSMTECMState & AFLAG ? "ACTIONS " : "",
ecm_states[smc->mib.fddiSMTECMState & ~AFLAG]) ; ecm_states[smc->mib.fddiSMTECMState & ~AFLAG],
DB_ECM(" event %s\n",ecm_events[event],0) ; ecm_events[event]);
state = smc->mib.fddiSMTECMState ; state = smc->mib.fddiSMTECMState ;
ecm_fsm(smc,event) ; ecm_fsm(smc,event) ;
event = 0 ; event = 0 ;
...@@ -379,7 +377,7 @@ static void ecm_fsm(struct s_smc *smc, int cmd) ...@@ -379,7 +377,7 @@ static void ecm_fsm(struct s_smc *smc, int cmd)
(((ls_a == PC_ILS) && (ls_b == PC_QLS)) || (((ls_a == PC_ILS) && (ls_b == PC_QLS)) ||
((ls_a == PC_QLS) && (ls_b == PC_ILS)))){ ((ls_a == PC_QLS) && (ls_b == PC_ILS)))){
smc->e.sb_flag = TRUE ; smc->e.sb_flag = TRUE ;
DB_ECMN(1,"ECM : EC6_CHECK - stuck bypass\n",0,0) ; DB_ECMN(1, "ECM : EC6_CHECK - stuck bypass");
AIX_EVENT(smc, (u_long) FDDI_RING_STATUS, (u_long) AIX_EVENT(smc, (u_long) FDDI_RING_STATUS, (u_long)
FDDI_SMT_ERROR, (u_long) FDDI_BYPASS_STUCK, FDDI_SMT_ERROR, (u_long) FDDI_BYPASS_STUCK,
smt_get_error_word(smc)); smt_get_error_word(smc));
...@@ -443,29 +441,29 @@ static void prop_actions(struct s_smc *smc) ...@@ -443,29 +441,29 @@ static void prop_actions(struct s_smc *smc)
return ; return ;
} }
DB_ECM("ECM : prop_actions - trace_prop %d\n", smc->e.trace_prop,0) ; DB_ECM("ECM : prop_actions - trace_prop %lu", smc->e.trace_prop);
DB_ECM("ECM : prop_actions - in %d out %d\n", port_in,port_out) ; DB_ECM("ECM : prop_actions - in %d out %d", port_in, port_out);
if (smc->e.trace_prop & ENTITY_BIT(ENTITY_MAC)) { if (smc->e.trace_prop & ENTITY_BIT(ENTITY_MAC)) {
/* trace initiatior */ /* trace initiatior */
DB_ECM("ECM : initiate TRACE on PHY %c\n",'A'+port_in-PA,0) ; DB_ECM("ECM : initiate TRACE on PHY %c", 'A' + port_in - PA);
queue_event(smc,EVENT_PCM+port_in,PC_TRACE) ; queue_event(smc,EVENT_PCM+port_in,PC_TRACE) ;
} }
else if ((smc->e.trace_prop & ENTITY_BIT(ENTITY_PHY(PA))) && else if ((smc->e.trace_prop & ENTITY_BIT(ENTITY_PHY(PA))) &&
port_out != PA) { port_out != PA) {
/* trace propagate upstream */ /* trace propagate upstream */
DB_ECM("ECM : propagate TRACE on PHY B\n",0,0) ; DB_ECM("ECM : propagate TRACE on PHY B");
queue_event(smc,EVENT_PCMB,PC_TRACE) ; queue_event(smc,EVENT_PCMB,PC_TRACE) ;
} }
else if ((smc->e.trace_prop & ENTITY_BIT(ENTITY_PHY(PB))) && else if ((smc->e.trace_prop & ENTITY_BIT(ENTITY_PHY(PB))) &&
port_out != PB) { port_out != PB) {
/* trace propagate upstream */ /* trace propagate upstream */
DB_ECM("ECM : propagate TRACE on PHY A\n",0,0) ; DB_ECM("ECM : propagate TRACE on PHY A");
queue_event(smc,EVENT_PCMA,PC_TRACE) ; queue_event(smc,EVENT_PCMA,PC_TRACE) ;
} }
else { else {
/* signal trace termination */ /* signal trace termination */
DB_ECM("ECM : TRACE terminated\n",0,0) ; DB_ECM("ECM : TRACE terminated");
smc->e.path_test = PT_PENDING ; smc->e.path_test = PT_PENDING ;
} }
smc->e.trace_prop = 0 ; smc->e.trace_prop = 0 ;
...@@ -482,13 +480,13 @@ static void prop_actions(struct s_smc *smc) ...@@ -482,13 +480,13 @@ static void prop_actions(struct s_smc *smc)
RS_SET(smc,RS_EVENT) ; RS_SET(smc,RS_EVENT) ;
while (smc->e.trace_prop) { while (smc->e.trace_prop) {
DB_ECM("ECM : prop_actions - trace_prop %d\n", DB_ECM("ECM : prop_actions - trace_prop %d",
smc->e.trace_prop,0) ; smc->e.trace_prop);
if (smc->e.trace_prop & ENTITY_BIT(ENTITY_MAC)) { if (smc->e.trace_prop & ENTITY_BIT(ENTITY_MAC)) {
initiator = ENTITY_MAC ; initiator = ENTITY_MAC ;
smc->e.trace_prop &= ~ENTITY_BIT(ENTITY_MAC) ; smc->e.trace_prop &= ~ENTITY_BIT(ENTITY_MAC) ;
DB_ECM("ECM: MAC initiates trace\n",0,0) ; DB_ECM("ECM: MAC initiates trace");
} }
else { else {
for (p = NUMPHYS-1 ; p >= 0 ; p--) { for (p = NUMPHYS-1 ; p >= 0 ; p--) {
...@@ -503,12 +501,12 @@ static void prop_actions(struct s_smc *smc) ...@@ -503,12 +501,12 @@ static void prop_actions(struct s_smc *smc)
if (upstream == ENTITY_MAC) { if (upstream == ENTITY_MAC) {
/* signal trace termination */ /* signal trace termination */
DB_ECM("ECM : TRACE terminated\n",0,0) ; DB_ECM("ECM : TRACE terminated");
smc->e.path_test = PT_PENDING ; smc->e.path_test = PT_PENDING ;
} }
else { else {
/* trace propagate upstream */ /* trace propagate upstream */
DB_ECM("ECM : propagate TRACE on PHY %d\n",upstream,0) ; DB_ECM("ECM : propagate TRACE on PHY %d", upstream);
queue_event(smc,EVENT_PCM+upstream,PC_TRACE) ; queue_event(smc,EVENT_PCM+upstream,PC_TRACE) ;
} }
} }
......
...@@ -134,7 +134,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -134,7 +134,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
* get the resource type * get the resource type
*/ */
if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) { if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) {
DB_ESS("ESS: RAF frame error, parameter type not found\n",0,0) ; DB_ESS("ESS: RAF frame error, parameter type not found");
return fs; return fs;
} }
msg_res_type = ((struct smt_p_0015 *)p)->res_type ; msg_res_type = ((struct smt_p_0015 *)p)->res_type ;
...@@ -146,16 +146,16 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -146,16 +146,16 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
/* /*
* error in frame: para ESS command was not found * error in frame: para ESS command was not found
*/ */
DB_ESS("ESS: RAF frame error, parameter command not found\n",0,0); DB_ESS("ESS: RAF frame error, parameter command not found");
return fs; return fs;
} }
DB_ESSN(2,"fc %x ft %x\n",sm->smt_class,sm->smt_type) ; DB_ESSN(2, "fc %x ft %x", sm->smt_class, sm->smt_type);
DB_ESSN(2,"ver %x tran %lx\n",sm->smt_version,sm->smt_tid) ; DB_ESSN(2, "ver %x tran %x", sm->smt_version, sm->smt_tid);
DB_ESSN(2,"stn_id %s\n",addr_to_string(&sm->smt_source),0) ; DB_ESSN(2, "stn_id %s", addr_to_string(&sm->smt_source));
DB_ESSN(2,"infolen %x res %x\n",sm->smt_len, msg_res_type) ; DB_ESSN(2, "infolen %x res %lx", sm->smt_len, msg_res_type);
DB_ESSN(2,"sbacmd %x\n",cmd->sba_cmd,0) ; DB_ESSN(2, "sbacmd %x", cmd->sba_cmd);
/* /*
* evaluate the ESS command * evaluate the ESS command
...@@ -189,7 +189,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -189,7 +189,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
* The ESS do not send the Frame to the network! * The ESS do not send the Frame to the network!
*/ */
smc->ess.alloc_trans_id = sm->smt_tid ; smc->ess.alloc_trans_id = sm->smt_tid ;
DB_ESS("ESS: save Alloc Req Trans ID %lx\n",sm->smt_tid,0); DB_ESS("ESS: save Alloc Req Trans ID %x", sm->smt_tid);
p = (void *) sm_to_para(smc,sm,SMT_P320F) ; p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
((struct smt_p_320f *)p)->mib_payload = ((struct smt_p_320f *)p)->mib_payload =
smc->mib.a[PATH0].fddiPATHSbaPayload ; smc->mib.a[PATH0].fddiPATHSbaPayload ;
...@@ -220,7 +220,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -220,7 +220,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
* check the parameters * check the parameters
*/ */
if (smt_check_para(smc,sm,plist_raf_alc_res)) { if (smt_check_para(smc,sm,plist_raf_alc_res)) {
DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ; DB_ESS("ESS: RAF with para problem, ignoring");
return fs; return fs;
} }
...@@ -241,7 +241,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -241,7 +241,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
!= SMT_RDF_SUCCESS) || != SMT_RDF_SUCCESS) ||
(sm->smt_tid != smc->ess.alloc_trans_id)) { (sm->smt_tid != smc->ess.alloc_trans_id)) {
DB_ESS("ESS: Allocation Response not accepted\n",0,0) ; DB_ESS("ESS: Allocation Response not accepted");
return fs; return fs;
} }
...@@ -261,7 +261,8 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -261,7 +261,8 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
} }
overhead = ((struct smt_p_3210 *)p)->mib_overhead ; overhead = ((struct smt_p_3210 *)p)->mib_overhead ;
DB_ESSN(2,"payload= %lx overhead= %lx\n",payload,overhead) ; DB_ESSN(2, "payload= %lx overhead= %lx",
payload, overhead);
/* /*
* process the bandwidth allocation * process the bandwidth allocation
...@@ -279,7 +280,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -279,7 +280,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
* except only replies * except only replies
*/ */
if (sm->smt_type != SMT_REQUEST) { if (sm->smt_type != SMT_REQUEST) {
DB_ESS("ESS: Do not process Change Responses\n",0,0) ; DB_ESS("ESS: Do not process Change Responses");
return fs; return fs;
} }
...@@ -287,7 +288,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -287,7 +288,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
* check the para for the Change Request * check the para for the Change Request
*/ */
if (smt_check_para(smc,sm,plist_raf_chg_req)) { if (smt_check_para(smc,sm,plist_raf_chg_req)) {
DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ; DB_ESS("ESS: RAF with para problem, ignoring");
return fs; return fs;
} }
...@@ -299,7 +300,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -299,7 +300,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
*/ */
if ((((struct smt_p_320b *)sm_to_para(smc,sm,SMT_P320B))->path_index if ((((struct smt_p_320b *)sm_to_para(smc,sm,SMT_P320B))->path_index
!= PRIMARY_RING) || (msg_res_type != SYNC_BW)) { != PRIMARY_RING) || (msg_res_type != SYNC_BW)) {
DB_ESS("ESS: RAF frame with para problem, ignoring\n",0,0) ; DB_ESS("ESS: RAF frame with para problem, ignoring");
return fs; return fs;
} }
...@@ -311,9 +312,10 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -311,9 +312,10 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
p = (void *) sm_to_para(smc,sm,SMT_P3210) ; p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
overhead = ((struct smt_p_3210 *)p)->mib_overhead ; overhead = ((struct smt_p_3210 *)p)->mib_overhead ;
DB_ESSN(2,"ESS: Change Request from %s\n", DB_ESSN(2, "ESS: Change Request from %s",
addr_to_string(&sm->smt_source),0) ; addr_to_string(&sm->smt_source));
DB_ESSN(2,"payload= %lx overhead= %lx\n",payload,overhead) ; DB_ESSN(2, "payload= %lx overhead= %lx",
payload, overhead);
/* /*
* process the bandwidth allocation * process the bandwidth allocation
...@@ -337,18 +339,18 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -337,18 +339,18 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
* except only requests * except only requests
*/ */
if (sm->smt_type != SMT_REQUEST) { if (sm->smt_type != SMT_REQUEST) {
DB_ESS("ESS: Do not process a Report Reply\n",0,0) ; DB_ESS("ESS: Do not process a Report Reply");
return fs; return fs;
} }
DB_ESSN(2,"ESS: Report Request from %s\n", DB_ESSN(2, "ESS: Report Request from %s",
addr_to_string(&(sm->smt_source)),0) ; addr_to_string(&sm->smt_source));
/* /*
* verify that the resource type is sync bw only * verify that the resource type is sync bw only
*/ */
if (msg_res_type != SYNC_BW) { if (msg_res_type != SYNC_BW) {
DB_ESS("ESS: ignoring RAF with para problem\n",0,0) ; DB_ESS("ESS: ignoring RAF with para problem");
return fs; return fs;
} }
...@@ -364,7 +366,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, ...@@ -364,7 +366,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
/* /*
* error in frame * error in frame
*/ */
DB_ESS("ESS: ignoring RAF with bad sba_cmd\n",0,0) ; DB_ESS("ESS: ignoring RAF with bad sba_cmd");
break ; break ;
} }
...@@ -417,17 +419,17 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe ...@@ -417,17 +419,17 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe
* set the mib attributes fddiPATHSbaOverhead, fddiPATHSbaPayload * set the mib attributes fddiPATHSbaOverhead, fddiPATHSbaPayload
*/ */
/* if (smt_set_obj(smc,SMT_P320F,payload,S_SET)) { /* if (smt_set_obj(smc,SMT_P320F,payload,S_SET)) {
DB_ESS("ESS: SMT does not accept the payload value\n",0,0) ; DB_ESS("ESS: SMT does not accept the payload value");
return FALSE; return FALSE;
} }
if (smt_set_obj(smc,SMT_P3210,overhead,S_SET)) { if (smt_set_obj(smc,SMT_P3210,overhead,S_SET)) {
DB_ESS("ESS: SMT does not accept the overhead value\n",0,0) ; DB_ESS("ESS: SMT does not accept the overhead value");
return FALSE; return FALSE;
} */ } */
/* premliminary */ /* premliminary */
if (payload > MAX_PAYLOAD || overhead > 5000) { if (payload > MAX_PAYLOAD || overhead > 5000) {
DB_ESS("ESS: payload / overhead not accepted\n",0,0) ; DB_ESS("ESS: payload / overhead not accepted");
return FALSE; return FALSE;
} }
...@@ -446,7 +448,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe ...@@ -446,7 +448,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe
* evulate the Payload * evulate the Payload
*/ */
if (payload) { if (payload) {
DB_ESSN(2,"ESS: turn SMT_ST_SYNC_SERVICE bit on\n",0,0) ; DB_ESSN(2, "ESS: turn SMT_ST_SYNC_SERVICE bit on");
smc->ess.sync_bw_available = TRUE ; smc->ess.sync_bw_available = TRUE ;
smc->ess.sync_bw = overhead - smc->ess.sync_bw = overhead -
...@@ -454,7 +456,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe ...@@ -454,7 +456,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe
payload / 1562 ; payload / 1562 ;
} }
else { else {
DB_ESSN(2,"ESS: turn SMT_ST_SYNC_SERVICE bit off\n",0,0) ; DB_ESSN(2, "ESS: turn SMT_ST_SYNC_SERVICE bit off");
smc->ess.sync_bw_available = FALSE ; smc->ess.sync_bw_available = FALSE ;
smc->ess.sync_bw = 0 ; smc->ess.sync_bw = 0 ;
overhead = 0 ; overhead = 0 ;
...@@ -464,7 +466,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe ...@@ -464,7 +466,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe
smc->mib.a[PATH0].fddiPATHSbaOverhead = overhead ; smc->mib.a[PATH0].fddiPATHSbaOverhead = overhead ;
DB_ESSN(2,"tsync = %lx\n",smc->ess.sync_bw,0) ; DB_ESSN(2, "tsync = %lx", smc->ess.sync_bw);
ess_config_fifo(smc) ; ess_config_fifo(smc) ;
set_formac_tsync(smc,smc->ess.sync_bw) ; set_formac_tsync(smc,smc->ess.sync_bw) ;
...@@ -541,7 +543,7 @@ void ess_timer_poll(struct s_smc *smc) ...@@ -541,7 +543,7 @@ void ess_timer_poll(struct s_smc *smc)
if (!smc->ess.raf_act_timer_poll) if (!smc->ess.raf_act_timer_poll)
return ; return ;
DB_ESSN(2,"ESS: timer_poll\n",0,0) ; DB_ESSN(2, "ESS: timer_poll");
smc->ess.timer_count++ ; smc->ess.timer_count++ ;
if (smc->ess.timer_count == 10) { if (smc->ess.timer_count == 10) {
...@@ -667,11 +669,11 @@ static void ess_send_frame(struct s_smc *smc, SMbuf *mb) ...@@ -667,11 +669,11 @@ static void ess_send_frame(struct s_smc *smc, SMbuf *mb)
/* /*
* Send the Change Reply to the local SBA * Send the Change Reply to the local SBA
*/ */
DB_ESS("ESS:Send to the local SBA\n",0,0) ; DB_ESS("ESS:Send to the local SBA");
if (!smc->ess.sba_reply_pend) if (!smc->ess.sba_reply_pend)
smc->ess.sba_reply_pend = mb ; smc->ess.sba_reply_pend = mb ;
else { else {
DB_ESS("Frame is lost - another frame was pending\n",0,0); DB_ESS("Frame is lost - another frame was pending");
smt_free_mbuf(smc,mb) ; smt_free_mbuf(smc,mb) ;
} }
} }
...@@ -679,7 +681,7 @@ static void ess_send_frame(struct s_smc *smc, SMbuf *mb) ...@@ -679,7 +681,7 @@ static void ess_send_frame(struct s_smc *smc, SMbuf *mb)
/* /*
* Send the SBA RAF Change Reply to the network * Send the SBA RAF Change Reply to the network
*/ */
DB_ESS("ESS:Send to the network\n",0,0) ; DB_ESS("ESS:Send to the network");
smt_send_frame(smc,mb,FC_SMT_INFO,0) ; smt_send_frame(smc,mb,FC_SMT_INFO,0) ;
} }
} }
......
...@@ -726,7 +726,7 @@ void mac2_irq(struct s_smc *smc, u_short code_s2u, u_short code_s2l) ...@@ -726,7 +726,7 @@ void mac2_irq(struct s_smc *smc, u_short code_s2u, u_short code_s2l)
if (code_s2u & FM_SMYBEC) if (code_s2u & FM_SMYBEC)
queue_event(smc,EVENT_RMT,RM_MY_BEACON) ; queue_event(smc,EVENT_RMT,RM_MY_BEACON) ;
if (change_s2u & code_s2u & FM_SLOCLM) { if (change_s2u & code_s2u & FM_SLOCLM) {
DB_RMTN(2,"RMT : lower claim received\n",0,0) ; DB_RMTN(2, "RMT : lower claim received");
} }
if ((code_s2u & FM_SMYCLM) && !(code_s2l & FM_SDUPCLM)) { if ((code_s2u & FM_SMYCLM) && !(code_s2l & FM_SDUPCLM)) {
/* /*
...@@ -746,7 +746,7 @@ void mac2_irq(struct s_smc *smc, u_short code_s2u, u_short code_s2l) ...@@ -746,7 +746,7 @@ void mac2_irq(struct s_smc *smc, u_short code_s2u, u_short code_s2l)
queue_event(smc,EVENT_RMT,RM_VALID_CLAIM) ; queue_event(smc,EVENT_RMT,RM_VALID_CLAIM) ;
} }
if (change_s2u & code_s2u & FM_SHICLM) { if (change_s2u & code_s2u & FM_SHICLM) {
DB_RMTN(2,"RMT : higher claim received\n",0,0) ; DB_RMTN(2, "RMT : higher claim received");
} }
if ( (code_s2l & FM_STRTEXP) || if ( (code_s2l & FM_STRTEXP) ||
(code_s2l & FM_STRTEXR) ) (code_s2l & FM_STRTEXR) )
...@@ -1334,7 +1334,7 @@ void rtm_irq(struct s_smc *smc) ...@@ -1334,7 +1334,7 @@ void rtm_irq(struct s_smc *smc)
outpw(ADDR(B2_RTM_CRTL),TIM_CL_IRQ) ; /* clear IRQ */ outpw(ADDR(B2_RTM_CRTL),TIM_CL_IRQ) ; /* clear IRQ */
if (inpw(ADDR(B2_RTM_CRTL)) & TIM_RES_TOK) { if (inpw(ADDR(B2_RTM_CRTL)) & TIM_RES_TOK) {
outpw(FM_A(FM_CMDREG1),FM_ICL) ; /* force claim */ outpw(FM_A(FM_CMDREG1),FM_ICL) ; /* force claim */
DB_RMT("RMT: fddiPATHT_Rmode expired\n",0,0) ; DB_RMT("RMT: fddiPATHT_Rmode expired");
AIX_EVENT(smc, (u_long) FDDI_RING_STATUS, AIX_EVENT(smc, (u_long) FDDI_RING_STATUS,
(u_long) FDDI_SMT_EVENT, (u_long) FDDI_SMT_EVENT,
(u_long) FDDI_RTT, smt_get_event_word(smc)); (u_long) FDDI_RTT, smt_get_event_word(smc));
...@@ -1353,8 +1353,8 @@ void rtm_set_timer(struct s_smc *smc) ...@@ -1353,8 +1353,8 @@ void rtm_set_timer(struct s_smc *smc)
/* /*
* MIB timer and hardware timer have the same resolution of 80nS * MIB timer and hardware timer have the same resolution of 80nS
*/ */
DB_RMT("RMT: setting new fddiPATHT_Rmode, t = %d ns\n", DB_RMT("RMT: setting new fddiPATHT_Rmode, t = %d ns",
(int) smc->mib.a[PATH0].fddiPATHT_Rmode,0) ; (int)smc->mib.a[PATH0].fddiPATHT_Rmode);
outpd(ADDR(B2_RTM_INI),smc->mib.a[PATH0].fddiPATHT_Rmode) ; outpd(ADDR(B2_RTM_INI),smc->mib.a[PATH0].fddiPATHT_Rmode) ;
} }
...@@ -1469,13 +1469,13 @@ static void smt_split_up_fifo(struct s_smc *smc) ...@@ -1469,13 +1469,13 @@ static void smt_split_up_fifo(struct s_smc *smc)
smc->hw.fp.fifo.rx2_fifo_start = smc->hw.fp.fifo.tx_a0_start + smc->hw.fp.fifo.rx2_fifo_start = smc->hw.fp.fifo.tx_a0_start +
smc->hw.fp.fifo.tx_a0_size ; smc->hw.fp.fifo.tx_a0_size ;
DB_SMT("FIFO split: mode = %x\n",smc->hw.fp.fifo.fifo_config_mode,0) ; DB_SMT("FIFO split: mode = %x", smc->hw.fp.fifo.fifo_config_mode);
DB_SMT("rbc_ram_start = %x rbc_ram_end = %x\n", DB_SMT("rbc_ram_start = %x rbc_ram_end = %x",
smc->hw.fp.fifo.rbc_ram_start, smc->hw.fp.fifo.rbc_ram_end) ; smc->hw.fp.fifo.rbc_ram_start, smc->hw.fp.fifo.rbc_ram_end);
DB_SMT("rx1_fifo_start = %x tx_s_start = %x\n", DB_SMT("rx1_fifo_start = %x tx_s_start = %x",
smc->hw.fp.fifo.rx1_fifo_start, smc->hw.fp.fifo.tx_s_start) ; smc->hw.fp.fifo.rx1_fifo_start, smc->hw.fp.fifo.tx_s_start);
DB_SMT("tx_a0_start = %x rx2_fifo_start = %x\n", DB_SMT("tx_a0_start = %x rx2_fifo_start = %x",
smc->hw.fp.fifo.tx_a0_start, smc->hw.fp.fifo.rx2_fifo_start) ; smc->hw.fp.fifo.tx_a0_start, smc->hw.fp.fifo.rx2_fifo_start);
} }
void formac_reinit_tx(struct s_smc *smc) void formac_reinit_tx(struct s_smc *smc)
......
...@@ -54,43 +54,48 @@ ...@@ -54,43 +54,48 @@
#endif #endif
#ifdef DEBUG #ifdef DEBUG
#define DB_PR(flag,a,b,c) { if (flag) printf(a,b,c) ; } #define DB_PR(flag, fmt, ...) \
do { if (flag) printf(fmt "\n", ##__VA_ARGS__); } while (0)
#else #else
#define DB_PR(flag,a,b,c) #define DB_PR(flag, fmt, ...) no_printk(fmt "\n", ##__VA_ARGS__)
#endif #endif
#ifdef DEBUG_BRD #ifdef DEBUG_BRD
#define DB_ECM(a,b,c) DB_PR((smc->debug.d_smt&1),a,b,c) #define DB_TEST (smc->debug)
#define DB_ECMN(n,a,b,c) DB_PR((smc->debug.d_ecm >=(n)),a,b,c)
#define DB_RMT(a,b,c) DB_PR((smc->debug.d_smt&2),a,b,c)
#define DB_RMTN(n,a,b,c) DB_PR((smc->debug.d_rmt >=(n)),a,b,c)
#define DB_CFM(a,b,c) DB_PR((smc->debug.d_smt&4),a,b,c)
#define DB_CFMN(n,a,b,c) DB_PR((smc->debug.d_cfm >=(n)),a,b,c)
#define DB_PCM(a,b,c) DB_PR((smc->debug.d_smt&8),a,b,c)
#define DB_PCMN(n,a,b,c) DB_PR((smc->debug.d_pcm >=(n)),a,b,c)
#define DB_SMT(a,b,c) DB_PR((smc->debug.d_smtf),a,b,c)
#define DB_SMTN(n,a,b,c) DB_PR((smc->debug.d_smtf >=(n)),a,b,c)
#define DB_SBA(a,b,c) DB_PR((smc->debug.d_sba),a,b,c)
#define DB_SBAN(n,a,b,c) DB_PR((smc->debug.d_sba >=(n)),a,b,c)
#define DB_ESS(a,b,c) DB_PR((smc->debug.d_ess),a,b,c)
#define DB_ESSN(n,a,b,c) DB_PR((smc->debug.d_ess >=(n)),a,b,c)
#else #else
#define DB_ECM(a,b,c) DB_PR((debug.d_smt&1),a,b,c) #define DB_TEST (debug)
#define DB_ECMN(n,a,b,c) DB_PR((debug.d_ecm >=(n)),a,b,c)
#define DB_RMT(a,b,c) DB_PR((debug.d_smt&2),a,b,c)
#define DB_RMTN(n,a,b,c) DB_PR((debug.d_rmt >=(n)),a,b,c)
#define DB_CFM(a,b,c) DB_PR((debug.d_smt&4),a,b,c)
#define DB_CFMN(n,a,b,c) DB_PR((debug.d_cfm >=(n)),a,b,c)
#define DB_PCM(a,b,c) DB_PR((debug.d_smt&8),a,b,c)
#define DB_PCMN(n,a,b,c) DB_PR((debug.d_pcm >=(n)),a,b,c)
#define DB_SMT(a,b,c) DB_PR((debug.d_smtf),a,b,c)
#define DB_SMTN(n,a,b,c) DB_PR((debug.d_smtf >=(n)),a,b,c)
#define DB_SBA(a,b,c) DB_PR((debug.d_sba),a,b,c)
#define DB_SBAN(n,a,b,c) DB_PR((debug.d_sba >=(n)),a,b,c)
#define DB_ESS(a,b,c) DB_PR((debug.d_ess),a,b,c)
#define DB_ESSN(n,a,b,c) DB_PR((debug.d_ess >=(n)),a,b,c)
#endif #endif
#define DB_ECM(fmt, ...) \
DB_PR((DB_TEST).d_smt & 1, fmt, ##__VA_ARGS__)
#define DB_ECMN(n, fmt, ...) \
DB_PR((DB_TEST).d_ecm >= (n), fmt, ##__VA_ARGS__)
#define DB_RMT(fmt, ...) \
DB_PR((DB_TEST).d_smt & 2, fmt, ##__VA_ARGS__)
#define DB_RMTN(n, fmt, ...) \
DB_PR((DB_TEST).d_rmt >= (n), fmt, ##__VA_ARGS__)
#define DB_CFM(fmt, ...) \
DB_PR((DB_TEST).d_smt & 4, fmt, ##__VA_ARGS__)
#define DB_CFMN(n, fmt, ...) \
DB_PR((DB_TEST).d_cfm >= (n), fmt, ##__VA_ARGS__)
#define DB_PCM(fmt, ...) \
DB_PR((DB_TEST).d_smt & 8, fmt, ##__VA_ARGS__)
#define DB_PCMN(n, fmt, ...) \
DB_PR((DB_TEST).d_pcm >= (n), fmt, ##__VA_ARGS__)
#define DB_SMT(fmt, ...) \
DB_PR((DB_TEST).d_smtf, fmt, ##__VA_ARGS__)
#define DB_SMTN(n, fmt, ...) \
DB_PR((DB_TEST).d_smtf >= (n), fmt, ##__VA_ARGS__)
#define DB_SBA(fmt, ...) \
DB_PR((DB_TEST).d_sba, fmt, ##__VA_ARGS__)
#define DB_SBAN(n, fmt, ...) \
DB_PR((DB_TEST).d_sba >= (n), fmt, ##__VA_ARGS__)
#define DB_ESS(fmt, ...) \
DB_PR((DB_TEST).d_ess, fmt, ##__VA_ARGS__)
#define DB_ESSN(n, fmt, ...) \
DB_PR((DB_TEST).d_ess >= (n), fmt, ##__VA_ARGS__)
#ifndef SS_NOT_DS #ifndef SS_NOT_DS
#define SK_LOC_DECL(type,var) type var #define SK_LOC_DECL(type,var) type var
#else #else
...@@ -640,8 +645,8 @@ void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text); ...@@ -640,8 +645,8 @@ void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text);
#define dump_smt(smc,sm,text) #define dump_smt(smc,sm,text)
#endif #endif
#ifdef DEBUG
char* addr_to_string(struct fddi_addr *addr); char* addr_to_string(struct fddi_addr *addr);
#ifdef DEBUG
void dump_hex(char *p, int len); void dump_hex(char *p, int len);
#endif #endif
......
...@@ -158,7 +158,7 @@ u_int mac_drv_check_space(void); ...@@ -158,7 +158,7 @@ u_int mac_drv_check_space(void);
SMbuf* smt_get_mbuf(struct s_smc *smc); SMbuf* smt_get_mbuf(struct s_smc *smc);
#ifdef DEBUG #ifdef DEBUG
void mac_drv_debug_lev(void); void mac_drv_debug_lev(struct s_smc *smc, int flag, int lev);
#endif #endif
/* /*
......
...@@ -91,7 +91,6 @@ int p ...@@ -91,7 +91,6 @@ int p
#define PC8_ACTIVE 8 #define PC8_ACTIVE 8
#define PC9_MAINT 9 #define PC9_MAINT 9
#ifdef DEBUG
/* /*
* symbolic state names * symbolic state names
*/ */
...@@ -113,7 +112,6 @@ static const char * const pcm_events[] = { ...@@ -113,7 +112,6 @@ static const char * const pcm_events[] = {
"PC_TIMEOUT_TL_MIN","PC_TIMEOUT_T_NEXT","PC_TIMEOUT_LCT", "PC_TIMEOUT_TL_MIN","PC_TIMEOUT_T_NEXT","PC_TIMEOUT_LCT",
"PC_NSE","PC_LEM" "PC_NSE","PC_LEM"
} ; } ;
#endif
#ifdef MOT_ELM #ifdef MOT_ELM
/* /*
...@@ -610,12 +608,11 @@ void pcm(struct s_smc *smc, const int np, int event) ...@@ -610,12 +608,11 @@ void pcm(struct s_smc *smc, const int np, int event)
mib = phy->mib ; mib = phy->mib ;
oldstate = mib->fddiPORTPCMState ; oldstate = mib->fddiPORTPCMState ;
do { do {
DB_PCM("PCM %c: state %s", DB_PCM("PCM %c: state %s%s, event %s",
phy->phy_name, phy->phy_name,
(mib->fddiPORTPCMState & AFLAG) ? "ACTIONS " : "") ; mib->fddiPORTPCMState & AFLAG ? "ACTIONS " : "",
DB_PCM("%s, event %s\n", pcm_states[mib->fddiPORTPCMState & ~AFLAG],
pcm_states[mib->fddiPORTPCMState & ~AFLAG], pcm_events[event]);
pcm_events[event]) ;
state = mib->fddiPORTPCMState ; state = mib->fddiPORTPCMState ;
pcm_fsm(smc,phy,event) ; pcm_fsm(smc,phy,event) ;
event = 0 ; event = 0 ;
...@@ -1017,7 +1014,7 @@ static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd) ...@@ -1017,7 +1014,7 @@ static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd)
ACTIONS_DONE() ; ACTIONS_DONE() ;
break ; break ;
case PC9_MAINT : case PC9_MAINT :
DB_PCMN(1,"PCM %c : MAINT\n",phy->phy_name,0) ; DB_PCMN(1, "PCM %c : MAINT", phy->phy_name);
/*PC90*/ /*PC90*/
if (cmd == PC_ENABLE) { if (cmd == PC_ENABLE) {
GO_STATE(PC0_OFF) ; GO_STATE(PC0_OFF) ;
...@@ -1126,13 +1123,12 @@ static void lem_evaluate(struct s_smc *smc, struct s_phy *phy) ...@@ -1126,13 +1123,12 @@ static void lem_evaluate(struct s_smc *smc, struct s_phy *phy)
} }
if (lem->lem_errors) { if (lem->lem_errors) {
DB_PCMN(1,"LEM %c :\n",phy->np == PB? 'B' : 'A',0) ; DB_PCMN(1, "LEM %c :", phy->np == PB ? 'B' : 'A');
DB_PCMN(1,"errors : %ld\n",lem->lem_errors,0) ; DB_PCMN(1, "errors : %ld", lem->lem_errors);
DB_PCMN(1,"sum_errors : %ld\n",mib->fddiPORTLem_Ct,0) ; DB_PCMN(1, "sum_errors : %ld", mib->fddiPORTLem_Ct);
DB_PCMN(1,"current BER : 10E-%d\n",ber/100,0) ; DB_PCMN(1, "current BER : 10E-%d", ber / 100);
DB_PCMN(1,"float BER : 10E-(%d/100)\n",lem->lem_float_ber,0) ; DB_PCMN(1, "float BER : 10E-(%d/100)", lem->lem_float_ber);
DB_PCMN(1,"avg. BER : 10E-%d\n", DB_PCMN(1, "avg. BER : 10E-%d", mib->fddiPORTLer_Estimate);
mib->fddiPORTLer_Estimate,0) ;
} }
lem->lem_errors = 0L ; lem->lem_errors = 0L ;
...@@ -1160,8 +1156,8 @@ static void lem_evaluate(struct s_smc *smc, struct s_phy *phy) ...@@ -1160,8 +1156,8 @@ static void lem_evaluate(struct s_smc *smc, struct s_phy *phy)
/*PC81b*/ /*PC81b*/
#ifdef CONCENTRATOR #ifdef CONCENTRATOR
DB_PCMN(1,"PCM: LER cutoff on port %d cutoff %d\n", DB_PCMN(1, "PCM: LER cutoff on port %d cutoff %d",
phy->np, mib->fddiPORTLer_Cutoff) ; phy->np, mib->fddiPORTLer_Cutoff);
#endif #endif
#ifdef SMT_EXT_CUTOFF #ifdef SMT_EXT_CUTOFF
smt_port_off_event(smc,phy->np); smt_port_off_event(smc,phy->np);
...@@ -1213,7 +1209,7 @@ static void lem_check_lct(struct s_smc *smc, struct s_phy *phy) ...@@ -1213,7 +1209,7 @@ static void lem_check_lct(struct s_smc *smc, struct s_phy *phy)
phy->pc_lem_fail = TRUE ; phy->pc_lem_fail = TRUE ;
break ; break ;
} }
DB_PCMN(1," >>errors : %d\n",lem->lem_errors,0) ; DB_PCMN(1, " >>errors : %lu", lem->lem_errors);
} }
if (phy->pc_lem_fail) { if (phy->pc_lem_fail) {
mib->fddiPORTLCTFail_Ct++ ; mib->fddiPORTLCTFail_Ct++ ;
...@@ -1277,7 +1273,7 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy) ...@@ -1277,7 +1273,7 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
mib = phy->mib ; mib = phy->mib ;
DB_PCMN(1,"SIG rec %x %x:\n", bit,phy->r_val[bit] ) ; DB_PCMN(1, "SIG rec %x %x:", bit, phy->r_val[bit]);
bit++ ; bit++ ;
switch(bit) { switch(bit) {
...@@ -1298,8 +1294,8 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy) ...@@ -1298,8 +1294,8 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
case 4: case 4:
if (mib->fddiPORTMy_Type == TM && if (mib->fddiPORTMy_Type == TM &&
mib->fddiPORTNeighborType == TM) { mib->fddiPORTNeighborType == TM) {
DB_PCMN(1,"PCM %c : E100 withhold M-M\n", DB_PCMN(1, "PCM %c : E100 withhold M-M",
phy->phy_name,0) ; phy->phy_name);
mib->fddiPORTPC_Withhold = PC_WH_M_M ; mib->fddiPORTPC_Withhold = PC_WH_M_M ;
RS_SET(smc,RS_EVENT) ; RS_SET(smc,RS_EVENT) ;
} }
...@@ -1321,16 +1317,16 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy) ...@@ -1321,16 +1317,16 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
else { else {
mib->fddiPORTPC_Withhold = PC_WH_OTHER ; mib->fddiPORTPC_Withhold = PC_WH_OTHER ;
RS_SET(smc,RS_EVENT) ; RS_SET(smc,RS_EVENT) ;
DB_PCMN(1,"PCM %c : E101 withhold other\n", DB_PCMN(1, "PCM %c : E101 withhold other",
phy->phy_name,0) ; phy->phy_name);
} }
phy->twisted = ((mib->fddiPORTMy_Type != TS) && phy->twisted = ((mib->fddiPORTMy_Type != TS) &&
(mib->fddiPORTMy_Type != TM) && (mib->fddiPORTMy_Type != TM) &&
(mib->fddiPORTNeighborType == (mib->fddiPORTNeighborType ==
mib->fddiPORTMy_Type)) ; mib->fddiPORTMy_Type)) ;
if (phy->twisted) { if (phy->twisted) {
DB_PCMN(1,"PCM %c : E102 !!! TWISTED !!!\n", DB_PCMN(1, "PCM %c : E102 !!! TWISTED !!!",
phy->phy_name,0) ; phy->phy_name);
} }
break ; break ;
case 5 : case 5 :
...@@ -1368,7 +1364,7 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy) ...@@ -1368,7 +1364,7 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
if (phy->t_next[7] > smc->s.pcm_lc_medium) { if (phy->t_next[7] > smc->s.pcm_lc_medium) {
start_pcm_timer0(smc,phy->t_next[7],PC_TIMEOUT_LCT,phy); start_pcm_timer0(smc,phy->t_next[7],PC_TIMEOUT_LCT,phy);
} }
DB_PCMN(1,"LCT timer = %ld us\n", phy->t_next[7], 0) ; DB_PCMN(1, "LCT timer = %ld us", phy->t_next[7]);
phy->t_next[9] = smc->s.pcm_t_next_9 ; phy->t_next[9] = smc->s.pcm_t_next_9 ;
break ; break ;
case 7: case 7:
...@@ -1379,8 +1375,9 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy) ...@@ -1379,8 +1375,9 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
break ; break ;
case 8: case 8:
if (phy->t_val[7] || phy->r_val[7]) { if (phy->t_val[7] || phy->r_val[7]) {
DB_PCMN(1,"PCM %c : E103 LCT fail %s\n", DB_PCMN(1, "PCM %c : E103 LCT fail %s",
phy->phy_name,phy->t_val[7]? "local":"remote") ; phy->phy_name,
phy->t_val[7] ? "local" : "remote");
queue_event(smc,(int)(EVENT_PCM+phy->np),PC_START) ; queue_event(smc,(int)(EVENT_PCM+phy->np),PC_START) ;
} }
break ; break ;
...@@ -1529,8 +1526,7 @@ static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy ...@@ -1529,8 +1526,7 @@ static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy
phy->cf_loop = FALSE ; phy->cf_loop = FALSE ;
lem_check_lct(smc,phy) ; lem_check_lct(smc,phy) ;
if (phy->pc_lem_fail) { if (phy->pc_lem_fail) {
DB_PCMN(1,"PCM %c : E104 LCT failed\n", DB_PCMN(1, "PCM %c : E104 LCT failed", phy->phy_name);
phy->phy_name,0) ;
phy->t_val[7] = 1 ; phy->t_val[7] = 1 ;
} }
else else
...@@ -1580,7 +1576,7 @@ static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy ...@@ -1580,7 +1576,7 @@ static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy
mib->fddiPORTMacIndicated.T_val = phy->t_val[9] ; mib->fddiPORTMacIndicated.T_val = phy->t_val[9] ;
break ; break ;
} }
DB_PCMN(1,"SIG snd %x %x:\n", bit,phy->t_val[bit] ) ; DB_PCMN(1, "SIG snd %x %x:", bit, phy->t_val[bit]);
} }
/* /*
...@@ -1783,13 +1779,14 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd) ...@@ -1783,13 +1779,14 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
} }
/*jd 05-Aug-1999 changed: Bug #10419 */ /*jd 05-Aug-1999 changed: Bug #10419 */
DB_PCMN(1,"PLC %d: MDcF = %x\n", np, smc->e.DisconnectFlag); DB_PCMN(1, "PLC %d: MDcF = %x", np, smc->e.DisconnectFlag);
if (smc->e.DisconnectFlag == FALSE) { if (smc->e.DisconnectFlag == FALSE) {
DB_PCMN(1,"PLC %d: restart (reason %x)\n", np, reason); DB_PCMN(1, "PLC %d: restart (reason %x)", np, reason);
queue_event(smc,EVENT_PCM+np,PC_START) ; queue_event(smc,EVENT_PCM+np,PC_START) ;
} }
else { else {
DB_PCMN(1,"PLC %d: NO!! restart (reason %x)\n", np, reason); DB_PCMN(1, "PLC %d: NO!! restart (reason %x)",
np, reason);
} }
return ; return ;
} }
...@@ -1810,8 +1807,8 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd) ...@@ -1810,8 +1807,8 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
if (cmd & PL_TRACE_PROP) { /* MLS while PC8_ACTIV || PC2_TRACE */ if (cmd & PL_TRACE_PROP) { /* MLS while PC8_ACTIV || PC2_TRACE */
/*PC22b*/ /*PC22b*/
if (!phy->tr_flag) { if (!phy->tr_flag) {
DB_PCMN(1,"PCM : irq TRACE_PROP %d %d\n", DB_PCMN(1, "PCM : irq TRACE_PROP %d %d",
np,smc->mib.fddiSMTECMState) ; np, smc->mib.fddiSMTECMState);
phy->tr_flag = TRUE ; phy->tr_flag = TRUE ;
smc->e.trace_prop |= ENTITY_BIT(ENTITY_PHY(np)) ; smc->e.trace_prop |= ENTITY_BIT(ENTITY_PHY(np)) ;
queue_event(smc,EVENT_ECM,EC_TRACE_PROP) ; queue_event(smc,EVENT_ECM,EC_TRACE_PROP) ;
...@@ -1824,8 +1821,9 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd) ...@@ -1824,8 +1821,9 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
if ((cmd & PL_SELF_TEST) && (phy->mib->fddiPORTPCMState == PC2_TRACE)) { if ((cmd & PL_SELF_TEST) && (phy->mib->fddiPORTPCMState == PC2_TRACE)) {
/*PC22a*/ /*PC22a*/
if (smc->e.path_test == PT_PASSED) { if (smc->e.path_test == PT_PASSED) {
DB_PCMN(1,"PCM : state = %s %d\n", get_pcmstate(smc,np), DB_PCMN(1, "PCM : state = %s %d",
phy->mib->fddiPORTPCMState) ; get_pcmstate(smc, np),
phy->mib->fddiPORTPCMState);
smc->e.path_test = PT_PENDING ; smc->e.path_test = PT_PENDING ;
queue_event(smc,EVENT_ECM,EC_PATH_TEST) ; queue_event(smc,EVENT_ECM,EC_PATH_TEST) ;
...@@ -1835,9 +1833,10 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd) ...@@ -1835,9 +1833,10 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
/* break_required (TNE > NS_Max) */ /* break_required (TNE > NS_Max) */
if (phy->mib->fddiPORTPCMState == PC8_ACTIVE) { if (phy->mib->fddiPORTPCMState == PC8_ACTIVE) {
if (!phy->tr_flag) { if (!phy->tr_flag) {
DB_PCMN(1,"PCM %c : PC81 %s\n",phy->phy_name,"NSE"); DB_PCMN(1, "PCM %c : PC81 %s",
queue_event(smc,EVENT_PCM+np,PC_START) ; phy->phy_name, "NSE");
return ; queue_event(smc, EVENT_PCM + np, PC_START);
return;
} }
} }
} }
......
...@@ -284,7 +284,7 @@ void smt_pmf_received_pack(struct s_smc *smc, SMbuf *mb, int local) ...@@ -284,7 +284,7 @@ void smt_pmf_received_pack(struct s_smc *smc, SMbuf *mb, int local)
SMbuf *reply ; SMbuf *reply ;
sm = smtod(mb,struct smt_header *) ; sm = smtod(mb,struct smt_header *) ;
DB_SMT("SMT: processing PMF frame at %p len %d\n",sm,mb->sm_len) ; DB_SMT("SMT: processing PMF frame at %p len %d", sm, mb->sm_len);
#ifdef DEBUG #ifdef DEBUG
dump_smt(smc,sm,"PMF Received") ; dump_smt(smc,sm,"PMF Received") ;
#endif #endif
...@@ -1585,7 +1585,7 @@ void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text) ...@@ -1585,7 +1585,7 @@ void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text)
dump_hex((char *) &sm->smt_source,6) ; dump_hex((char *) &sm->smt_source,6) ;
printf(" Class %x Type %x Version %x\n", printf(" Class %x Type %x Version %x\n",
sm->smt_class,sm->smt_type,sm->smt_version) ; sm->smt_class,sm->smt_type,sm->smt_version) ;
printf("TID %lx\t\tSID ",sm->smt_tid) ; printf("TID %x\t\tSID ", sm->smt_tid);
dump_hex((char *) &sm->smt_sid,8) ; dump_hex((char *) &sm->smt_sid,8) ;
printf(" LEN %x\n",sm->smt_len) ; printf(" LEN %x\n",sm->smt_len) ;
......
...@@ -70,7 +70,6 @@ static const char ID_sccs[] = "@(#)rmt.c 2.13 99/07/02 (C) SK " ; ...@@ -70,7 +70,6 @@ static const char ID_sccs[] = "@(#)rmt.c 2.13 99/07/02 (C) SK " ;
#define RM6_DIRECTED 6 /* sending directed beacons */ #define RM6_DIRECTED 6 /* sending directed beacons */
#define RM7_TRACE 7 /* trace initiated */ #define RM7_TRACE 7 /* trace initiated */
#ifdef DEBUG
/* /*
* symbolic state names * symbolic state names
*/ */
...@@ -91,7 +90,6 @@ static const char * const rmt_events[] = { ...@@ -91,7 +90,6 @@ static const char * const rmt_events[] = {
"RM_TIMEOUT_ANNOUNCE","RM_TIMEOUT_T_DIRECT", "RM_TIMEOUT_ANNOUNCE","RM_TIMEOUT_T_DIRECT",
"RM_TIMEOUT_D_MAX","RM_TIMEOUT_POLL","RM_TX_STATE_CHANGE" "RM_TIMEOUT_D_MAX","RM_TIMEOUT_POLL","RM_TX_STATE_CHANGE"
} ; } ;
#endif
/* /*
* Globals * Globals
...@@ -149,10 +147,10 @@ void rmt(struct s_smc *smc, int event) ...@@ -149,10 +147,10 @@ void rmt(struct s_smc *smc, int event)
int state ; int state ;
do { do {
DB_RMT("RMT : state %s%s", DB_RMT("RMT : state %s%s event %s",
(smc->mib.m[MAC0].fddiMACRMTState & AFLAG) ? "ACTIONS " : "", smc->mib.m[MAC0].fddiMACRMTState & AFLAG ? "ACTIONS " : "",
rmt_states[smc->mib.m[MAC0].fddiMACRMTState & ~AFLAG]) ; rmt_states[smc->mib.m[MAC0].fddiMACRMTState & ~AFLAG],
DB_RMT(" event %s\n",rmt_events[event],0) ; rmt_events[event]);
state = smc->mib.m[MAC0].fddiMACRMTState ; state = smc->mib.m[MAC0].fddiMACRMTState ;
rmt_fsm(smc,event) ; rmt_fsm(smc,event) ;
event = 0 ; event = 0 ;
...@@ -191,7 +189,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -191,7 +189,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
smc->r.loop_avail = FALSE ; smc->r.loop_avail = FALSE ;
smc->r.sm_ma_avail = FALSE ; smc->r.sm_ma_avail = FALSE ;
smc->r.no_flag = TRUE ; smc->r.no_flag = TRUE ;
DB_RMTN(1,"RMT : ISOLATED\n",0,0) ; DB_RMTN(1, "RMT : ISOLATED");
ACTIONS_DONE() ; ACTIONS_DONE() ;
break ; break ;
case RM0_ISOLATED : case RM0_ISOLATED :
...@@ -213,7 +211,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -213,7 +211,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
stop_rmt_timer1(smc) ; stop_rmt_timer1(smc) ;
stop_rmt_timer2(smc) ; stop_rmt_timer2(smc) ;
sm_ma_control(smc,MA_BEACON) ; sm_ma_control(smc,MA_BEACON) ;
DB_RMTN(1,"RMT : RING DOWN\n",0,0) ; DB_RMTN(1, "RMT : RING DOWN");
RS_SET(smc,RS_NORINGOP) ; RS_SET(smc,RS_NORINGOP) ;
smc->r.sm_ma_avail = FALSE ; smc->r.sm_ma_avail = FALSE ;
rmt_indication(smc,0) ; rmt_indication(smc,0) ;
...@@ -248,7 +246,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -248,7 +246,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
else else
smc->mib.m[MAC0].fddiMACMA_UnitdataAvailable = FALSE ; smc->mib.m[MAC0].fddiMACMA_UnitdataAvailable = FALSE ;
} }
DB_RMTN(1,"RMT : RING UP\n",0,0) ; DB_RMTN(1, "RMT : RING UP");
RS_CLEAR(smc,RS_NORINGOP) ; RS_CLEAR(smc,RS_NORINGOP) ;
RS_SET(smc,RS_RINGOPCHANGE) ; RS_SET(smc,RS_RINGOPCHANGE) ;
rmt_indication(smc,1) ; rmt_indication(smc,1) ;
...@@ -285,7 +283,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -285,7 +283,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
start_rmt_timer1(smc,smc->s.rmt_t_stuck,RM_TIMEOUT_T_STUCK) ; start_rmt_timer1(smc,smc->s.rmt_t_stuck,RM_TIMEOUT_T_STUCK) ;
start_rmt_timer2(smc,smc->s.rmt_t_poll,RM_TIMEOUT_POLL) ; start_rmt_timer2(smc,smc->s.rmt_t_poll,RM_TIMEOUT_POLL) ;
sm_mac_check_beacon_claim(smc) ; sm_mac_check_beacon_claim(smc) ;
DB_RMTN(1,"RMT : RM3_DETECT\n",0,0) ; DB_RMTN(1, "RMT : RM3_DETECT");
ACTIONS_DONE() ; ACTIONS_DONE() ;
break ; break ;
case RM3_DETECT : case RM3_DETECT :
...@@ -327,7 +325,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -327,7 +325,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
* trace ! * trace !
*/ */
if ((tx = sm_mac_get_tx_state(smc)) == 4 || tx == 5) { if ((tx = sm_mac_get_tx_state(smc)) == 4 || tx == 5) {
DB_RMTN(2,"RMT : DETECT && TRT_EXPIRED && T4/T5\n",0,0); DB_RMTN(2, "RMT : DETECT && TRT_EXPIRED && T4/T5");
smc->r.bn_flag = TRUE ; smc->r.bn_flag = TRUE ;
/* /*
* If one of the upstream stations beaconed * If one of the upstream stations beaconed
...@@ -344,9 +342,8 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -344,9 +342,8 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
* must be cleared in order to get in this condition. * must be cleared in order to get in this condition.
*/ */
DB_RMTN(2, DB_RMTN(2, "RMT : sm_mac_get_tx_state() = %d (bn_flag = %d)",
"RMT : sm_mac_get_tx_state() = %d (bn_flag = %d)\n", tx, smc->r.bn_flag);
tx,smc->r.bn_flag) ;
} }
/*RM34a*/ /*RM34a*/
else if (cmd == RM_MY_CLAIM && smc->r.timer0_exp) { else if (cmd == RM_MY_CLAIM && smc->r.timer0_exp) {
...@@ -378,7 +375,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -378,7 +375,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
start_rmt_timer1(smc,smc->s.rmt_t_stuck,RM_TIMEOUT_T_STUCK) ; start_rmt_timer1(smc,smc->s.rmt_t_stuck,RM_TIMEOUT_T_STUCK) ;
start_rmt_timer2(smc,smc->s.rmt_t_poll,RM_TIMEOUT_POLL) ; start_rmt_timer2(smc,smc->s.rmt_t_poll,RM_TIMEOUT_POLL) ;
sm_mac_check_beacon_claim(smc) ; sm_mac_check_beacon_claim(smc) ;
DB_RMTN(1,"RMT : RM4_NON_OP_DUP\n",0,0) ; DB_RMTN(1, "RMT : RM4_NON_OP_DUP");
ACTIONS_DONE() ; ACTIONS_DONE() ;
break ; break ;
case RM4_NON_OP_DUP : case RM4_NON_OP_DUP :
...@@ -406,7 +403,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -406,7 +403,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
* trace ! * trace !
*/ */
if ((tx = sm_mac_get_tx_state(smc)) == 4 || tx == 5) { if ((tx = sm_mac_get_tx_state(smc)) == 4 || tx == 5) {
DB_RMTN(2,"RMT : NOPDUP && TRT_EXPIRED && T4/T5\n",0,0); DB_RMTN(2, "RMT : NOPDUP && TRT_EXPIRED && T4/T5");
smc->r.bn_flag = TRUE ; smc->r.bn_flag = TRUE ;
/* /*
* If one of the upstream stations beaconed * If one of the upstream stations beaconed
...@@ -423,9 +420,8 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -423,9 +420,8 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
* must be cleared in order to get in this condition. * must be cleared in order to get in this condition.
*/ */
DB_RMTN(2, DB_RMTN(2, "RMT : sm_mac_get_tx_state() = %d (bn_flag = %d)",
"RMT : sm_mac_get_tx_state() = %d (bn_flag = %d)\n", tx, smc->r.bn_flag);
tx,smc->r.bn_flag) ;
} }
/*RM44c*/ /*RM44c*/
else if (cmd == RM_TIMEOUT_ANNOUNCE && !smc->r.bn_flag) { else if (cmd == RM_TIMEOUT_ANNOUNCE && !smc->r.bn_flag) {
...@@ -448,7 +444,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -448,7 +444,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
stop_rmt_timer0(smc) ; stop_rmt_timer0(smc) ;
stop_rmt_timer1(smc) ; stop_rmt_timer1(smc) ;
stop_rmt_timer2(smc) ; stop_rmt_timer2(smc) ;
DB_RMTN(1,"RMT : RM5_RING_OP_DUP\n",0,0) ; DB_RMTN(1, "RMT : RM5_RING_OP_DUP");
ACTIONS_DONE() ; ACTIONS_DONE() ;
break; break;
case RM5_RING_OP_DUP : case RM5_RING_OP_DUP :
...@@ -472,7 +468,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -472,7 +468,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
start_rmt_timer2(smc,smc->s.rmt_t_poll,RM_TIMEOUT_POLL) ; start_rmt_timer2(smc,smc->s.rmt_t_poll,RM_TIMEOUT_POLL) ;
sm_ma_control(smc,MA_DIRECTED) ; sm_ma_control(smc,MA_DIRECTED) ;
RS_SET(smc,RS_BEACON) ; RS_SET(smc,RS_BEACON) ;
DB_RMTN(1,"RMT : RM6_DIRECTED\n",0,0) ; DB_RMTN(1, "RMT : RM6_DIRECTED");
ACTIONS_DONE() ; ACTIONS_DONE() ;
break ; break ;
case RM6_DIRECTED : case RM6_DIRECTED :
...@@ -515,7 +511,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd) ...@@ -515,7 +511,7 @@ static void rmt_fsm(struct s_smc *smc, int cmd)
stop_rmt_timer2(smc) ; stop_rmt_timer2(smc) ;
smc->e.trace_prop |= ENTITY_BIT(ENTITY_MAC) ; smc->e.trace_prop |= ENTITY_BIT(ENTITY_MAC) ;
queue_event(smc,EVENT_ECM,EC_TRACE_PROP) ; queue_event(smc,EVENT_ECM,EC_TRACE_PROP) ;
DB_RMTN(1,"RMT : RM7_TRACE\n",0,0) ; DB_RMTN(1, "RMT : RM7_TRACE");
ACTIONS_DONE() ; ACTIONS_DONE() ;
break ; break ;
case RM7_TRACE : case RM7_TRACE :
......
This diff is collapsed.
...@@ -173,7 +173,6 @@ static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index) ...@@ -173,7 +173,6 @@ static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index)
#define THRESHOLD_2 (2*TICKS_PER_SECOND) #define THRESHOLD_2 (2*TICKS_PER_SECOND)
#define THRESHOLD_32 (32*TICKS_PER_SECOND) #define THRESHOLD_32 (32*TICKS_PER_SECOND)
#ifdef DEBUG
static const char * const srf_names[] = { static const char * const srf_names[] = {
"None","MACPathChangeEvent", "MACNeighborChangeEvent", "None","MACPathChangeEvent", "MACNeighborChangeEvent",
"PORTPathChangeEvent", "PORTUndesiredConnectionAttemptEvent", "PORTPathChangeEvent", "PORTUndesiredConnectionAttemptEvent",
...@@ -182,7 +181,6 @@ static const char * const srf_names[] = { ...@@ -182,7 +181,6 @@ static const char * const srf_names[] = {
"MACNotCopiedCondition", "PORTEBErrorCondition", "MACNotCopiedCondition", "PORTEBErrorCondition",
"PORTLerCondition" "PORTLerCondition"
} ; } ;
#endif
void smt_srf_event(struct s_smc *smc, int code, int index, int cond) void smt_srf_event(struct s_smc *smc, int code, int index, int cond)
{ {
...@@ -198,10 +196,10 @@ void smt_srf_event(struct s_smc *smc, int code, int index, int cond) ...@@ -198,10 +196,10 @@ void smt_srf_event(struct s_smc *smc, int code, int index, int cond)
} }
if (code) { if (code) {
DB_SMT("SRF: %s index %d\n",srf_names[code],index) ; DB_SMT("SRF: %s index %d", srf_names[code], index);
if (!(evc = smt_get_evc(smc,code,index))) { if (!(evc = smt_get_evc(smc,code,index))) {
DB_SMT("SRF : smt_get_evc() failed\n",0,0) ; DB_SMT("SRF : smt_get_evc() failed");
return ; return ;
} }
/* /*
...@@ -217,7 +215,7 @@ void smt_srf_event(struct s_smc *smc, int code, int index, int cond) ...@@ -217,7 +215,7 @@ void smt_srf_event(struct s_smc *smc, int code, int index, int cond)
*/ */
smt_set_timestamp(smc,smc->mib.fddiSMTTransitionTimeStamp) ; smt_set_timestamp(smc,smc->mib.fddiSMTTransitionTimeStamp) ;
if (SMT_IS_CONDITION(code)) { if (SMT_IS_CONDITION(code)) {
DB_SMT("SRF: condition is %s\n",cond ? "ON":"OFF",0) ; DB_SMT("SRF: condition is %s", cond ? "ON" : "OFF");
if (cond) { if (cond) {
*evc->evc_cond_state = TRUE ; *evc->evc_cond_state = TRUE ;
evc->evc_rep_required = TRUE ; evc->evc_rep_required = TRUE ;
...@@ -414,9 +412,9 @@ static void smt_send_srf(struct s_smc *smc) ...@@ -414,9 +412,9 @@ static void smt_send_srf(struct s_smc *smc)
smt->smt_len = SMT_MAX_INFO_LEN - pcon.pc_len ; smt->smt_len = SMT_MAX_INFO_LEN - pcon.pc_len ;
mb->sm_len = smt->smt_len + sizeof(struct smt_header) ; mb->sm_len = smt->smt_len + sizeof(struct smt_header) ;
DB_SMT("SRF: sending SRF at %p, len %d\n",smt,mb->sm_len) ; DB_SMT("SRF: sending SRF at %p, len %d", smt, mb->sm_len);
DB_SMT("SRF: state SR%d Threshold %d\n", DB_SMT("SRF: state SR%d Threshold %lu",
smc->srf.sr_state,smc->srf.SRThreshold/TICKS_PER_SECOND) ; smc->srf.sr_state, smc->srf.SRThreshold / TICKS_PER_SECOND);
#ifdef DEBUG #ifdef DEBUG
dump_smt(smc,smt,"SRF Send") ; dump_smt(smc,smt,"SRF Send") ;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment