summaryrefslogtreecommitdiffstats
path: root/drivers/net/fddi/skfp/pcmplc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/fddi/skfp/pcmplc.c')
-rw-r--r--drivers/net/fddi/skfp/pcmplc.c83
1 files changed, 41 insertions, 42 deletions
diff --git a/drivers/net/fddi/skfp/pcmplc.c b/drivers/net/fddi/skfp/pcmplc.c
index 88d02d0a42c4..a9ecf923f63d 100644
--- a/drivers/net/fddi/skfp/pcmplc.c
+++ b/drivers/net/fddi/skfp/pcmplc.c
@@ -91,7 +91,6 @@ int p
#define PC8_ACTIVE 8
#define PC9_MAINT 9
-#ifdef DEBUG
/*
* symbolic state names
*/
@@ -113,7 +112,6 @@ static const char * const pcm_events[] = {
"PC_TIMEOUT_TL_MIN","PC_TIMEOUT_T_NEXT","PC_TIMEOUT_LCT",
"PC_NSE","PC_LEM"
} ;
-#endif
#ifdef MOT_ELM
/*
@@ -610,12 +608,11 @@ void pcm(struct s_smc *smc, const int np, int event)
mib = phy->mib ;
oldstate = mib->fddiPORTPCMState ;
do {
- DB_PCM("PCM %c: state %s",
- phy->phy_name,
- (mib->fddiPORTPCMState & AFLAG) ? "ACTIONS " : "") ;
- DB_PCM("%s, event %s\n",
- pcm_states[mib->fddiPORTPCMState & ~AFLAG],
- pcm_events[event]) ;
+ DB_PCM("PCM %c: state %s%s, event %s",
+ phy->phy_name,
+ mib->fddiPORTPCMState & AFLAG ? "ACTIONS " : "",
+ pcm_states[mib->fddiPORTPCMState & ~AFLAG],
+ pcm_events[event]);
state = mib->fddiPORTPCMState ;
pcm_fsm(smc,phy,event) ;
event = 0 ;
@@ -1017,7 +1014,7 @@ static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd)
ACTIONS_DONE() ;
break ;
case PC9_MAINT :
- DB_PCMN(1,"PCM %c : MAINT\n",phy->phy_name,0) ;
+ DB_PCMN(1, "PCM %c : MAINT", phy->phy_name);
/*PC90*/
if (cmd == PC_ENABLE) {
GO_STATE(PC0_OFF) ;
@@ -1126,13 +1123,12 @@ static void lem_evaluate(struct s_smc *smc, struct s_phy *phy)
}
if (lem->lem_errors) {
- DB_PCMN(1,"LEM %c :\n",phy->np == PB? 'B' : 'A',0) ;
- DB_PCMN(1,"errors : %ld\n",lem->lem_errors,0) ;
- DB_PCMN(1,"sum_errors : %ld\n",mib->fddiPORTLem_Ct,0) ;
- DB_PCMN(1,"current BER : 10E-%d\n",ber/100,0) ;
- DB_PCMN(1,"float BER : 10E-(%d/100)\n",lem->lem_float_ber,0) ;
- DB_PCMN(1,"avg. BER : 10E-%d\n",
- mib->fddiPORTLer_Estimate,0) ;
+ DB_PCMN(1, "LEM %c :", phy->np == PB ? 'B' : 'A');
+ DB_PCMN(1, "errors : %ld", lem->lem_errors);
+ DB_PCMN(1, "sum_errors : %ld", mib->fddiPORTLem_Ct);
+ DB_PCMN(1, "current BER : 10E-%d", ber / 100);
+ DB_PCMN(1, "float BER : 10E-(%d/100)", lem->lem_float_ber);
+ DB_PCMN(1, "avg. BER : 10E-%d", mib->fddiPORTLer_Estimate);
}
lem->lem_errors = 0L ;
@@ -1160,8 +1156,8 @@ static void lem_evaluate(struct s_smc *smc, struct s_phy *phy)
/*PC81b*/
#ifdef CONCENTRATOR
- DB_PCMN(1,"PCM: LER cutoff on port %d cutoff %d\n",
- phy->np, mib->fddiPORTLer_Cutoff) ;
+ DB_PCMN(1, "PCM: LER cutoff on port %d cutoff %d",
+ phy->np, mib->fddiPORTLer_Cutoff);
#endif
#ifdef SMT_EXT_CUTOFF
smt_port_off_event(smc,phy->np);
@@ -1213,7 +1209,7 @@ static void lem_check_lct(struct s_smc *smc, struct s_phy *phy)
phy->pc_lem_fail = TRUE ;
break ;
}
- DB_PCMN(1," >>errors : %d\n",lem->lem_errors,0) ;
+ DB_PCMN(1, " >>errors : %lu", lem->lem_errors);
}
if (phy->pc_lem_fail) {
mib->fddiPORTLCTFail_Ct++ ;
@@ -1277,7 +1273,7 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
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++ ;
switch(bit) {
@@ -1298,8 +1294,8 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
case 4:
if (mib->fddiPORTMy_Type == TM &&
mib->fddiPORTNeighborType == TM) {
- DB_PCMN(1,"PCM %c : E100 withhold M-M\n",
- phy->phy_name,0) ;
+ DB_PCMN(1, "PCM %c : E100 withhold M-M",
+ phy->phy_name);
mib->fddiPORTPC_Withhold = PC_WH_M_M ;
RS_SET(smc,RS_EVENT) ;
}
@@ -1321,16 +1317,16 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
else {
mib->fddiPORTPC_Withhold = PC_WH_OTHER ;
RS_SET(smc,RS_EVENT) ;
- DB_PCMN(1,"PCM %c : E101 withhold other\n",
- phy->phy_name,0) ;
+ DB_PCMN(1, "PCM %c : E101 withhold other",
+ phy->phy_name);
}
phy->twisted = ((mib->fddiPORTMy_Type != TS) &&
(mib->fddiPORTMy_Type != TM) &&
(mib->fddiPORTNeighborType ==
mib->fddiPORTMy_Type)) ;
if (phy->twisted) {
- DB_PCMN(1,"PCM %c : E102 !!! TWISTED !!!\n",
- phy->phy_name,0) ;
+ DB_PCMN(1, "PCM %c : E102 !!! TWISTED !!!",
+ phy->phy_name);
}
break ;
case 5 :
@@ -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) {
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 ;
break ;
case 7:
@@ -1379,8 +1375,9 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
break ;
case 8:
if (phy->t_val[7] || phy->r_val[7]) {
- DB_PCMN(1,"PCM %c : E103 LCT fail %s\n",
- phy->phy_name,phy->t_val[7]? "local":"remote") ;
+ DB_PCMN(1, "PCM %c : E103 LCT fail %s",
+ phy->phy_name,
+ phy->t_val[7] ? "local" : "remote");
queue_event(smc,(int)(EVENT_PCM+phy->np),PC_START) ;
}
break ;
@@ -1529,8 +1526,7 @@ static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy
phy->cf_loop = FALSE ;
lem_check_lct(smc,phy) ;
if (phy->pc_lem_fail) {
- DB_PCMN(1,"PCM %c : E104 LCT failed\n",
- phy->phy_name,0) ;
+ DB_PCMN(1, "PCM %c : E104 LCT failed", phy->phy_name);
phy->t_val[7] = 1 ;
}
else
@@ -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] ;
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)
}
/*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) {
- 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) ;
}
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 ;
}
@@ -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 */
/*PC22b*/
if (!phy->tr_flag) {
- DB_PCMN(1,"PCM : irq TRACE_PROP %d %d\n",
- np,smc->mib.fddiSMTECMState) ;
+ DB_PCMN(1, "PCM : irq TRACE_PROP %d %d",
+ np, smc->mib.fddiSMTECMState);
phy->tr_flag = TRUE ;
smc->e.trace_prop |= ENTITY_BIT(ENTITY_PHY(np)) ;
queue_event(smc,EVENT_ECM,EC_TRACE_PROP) ;
@@ -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)) {
/*PC22a*/
if (smc->e.path_test == PT_PASSED) {
- DB_PCMN(1,"PCM : state = %s %d\n", get_pcmstate(smc,np),
- phy->mib->fddiPORTPCMState) ;
+ DB_PCMN(1, "PCM : state = %s %d",
+ get_pcmstate(smc, np),
+ phy->mib->fddiPORTPCMState);
smc->e.path_test = PT_PENDING ;
queue_event(smc,EVENT_ECM,EC_PATH_TEST) ;
@@ -1835,9 +1833,10 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
/* break_required (TNE > NS_Max) */
if (phy->mib->fddiPORTPCMState == PC8_ACTIVE) {
if (!phy->tr_flag) {
- DB_PCMN(1,"PCM %c : PC81 %s\n",phy->phy_name,"NSE");
- queue_event(smc,EVENT_PCM+np,PC_START) ;
- return ;
+ DB_PCMN(1, "PCM %c : PC81 %s",
+ phy->phy_name, "NSE");
+ queue_event(smc, EVENT_PCM + np, PC_START);
+ return;
}
}
}