summaryrefslogtreecommitdiff
path: root/xhfc/xhfc_st_state.c
diff options
context:
space:
mode:
authorNoe Rubinstein <nrubinstein@proformatique.com>2010-12-09 18:30:27 +0100
committerNoe Rubinstein <nrubinstein@proformatique.com>2010-12-09 18:30:27 +0100
commit61cddfd6cae9ebbd4ef40cc8ea45ac5fc68fc162 (patch)
treed3258b9bf97ccb8439fe6af211c60cce68563973 /xhfc/xhfc_st_state.c
parentab051a7a9cd716ef6c186705527d233fd9db8476 (diff)
clean up traces
Diffstat (limited to 'xhfc/xhfc_st_state.c')
-rw-r--r--xhfc/xhfc_st_state.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/xhfc/xhfc_st_state.c b/xhfc/xhfc_st_state.c
index 4645447..dfa9897 100644
--- a/xhfc/xhfc_st_state.c
+++ b/xhfc/xhfc_st_state.c
@@ -62,7 +62,7 @@ void activate_request(struct xhfc_span* s)
if (impossible_te || impossible_nt) {
printk(KERN_INFO DRIVER_NAME ": "
"activate impossible by definition of layer 1"
- "in state %c%d on port %d\n",
+ " in state %c%d on port %d\n",
(s->nt ? 'G' : 'F'), sta, portno(s));
return;
} else if (no_action_te) {
@@ -74,10 +74,10 @@ void activate_request(struct xhfc_span* s)
return;
}
- if(DBG_ST && DBG_SPAN(s))
+ if (DBG_ST && DBG_SPAN(s))
printk(KERN_DEBUG DRIVER_NAME
": activate on port %d\n",
- s->port + 1);
+ portno(s));
SET_V_SU_ACT(a_su_wr_sta, V_SU_ACT_ACTIVATE);
@@ -85,22 +85,30 @@ void activate_request(struct xhfc_span* s)
write_xhfc(s->xhfc, R_SU_SEL, s->port);
write_xhfc(s->xhfc, A_SU_WR_STA, a_su_wr_sta);
- if(!s->nt && sta == F3 && GET_V_SU_INFO0(s->state))
+ if (!s->nt && sta == F3 && GET_V_SU_INFO0(s->state))
s->activation_timer = s->xhfc->ticks + T3_MS; /* xref5 */
else
s->activation_timer = NOT_RUNNING;
/* timer for NT activated by state change handler (xref3) */
}
-void deactivate_request(struct xhfc_span* s) /* XXX not called */
+void deactivate_request(struct xhfc_span* s)
{
u8 a_su_wr_sta = 0;
int sta = GET_V_SU_STA(s->state);
+ if (!s->nt || (s->nt && (sta == G1 || sta == G4))) {
+ printk(KERN_INFO DRIVER_NAME ": "
+ "deactivate impossible by definition of layer 1"
+ " in state %c%d on port %d\n",
+ (s->nt ? 'G' : 'F'), sta, portno(s));
+ return;
+ }
+
if(DBG_ST && DBG_SPAN(s))
printk(KERN_DEBUG DRIVER_NAME
": deactivate on port %d\n",
- s->port + 1);
+ portno(s));
SET_V_SU_ACT(a_su_wr_sta, V_SU_ACT_DEACTIVATE);
@@ -113,7 +121,7 @@ void deactivate_request(struct xhfc_span* s) /* XXX not called */
/* This function is meant to be ran each time an interface changes state;
* however, the state change is polled (during the timer interrupt; see
- * enable_interrupts and xhfc_interrupt). Therefore case, it is possible that
+ * enable_interrupts and xhfc_interrupt). Therefore, it is possible that
* two or more state changes happen on the same interface between two
* interruptions and that this functions gets only called once.
* Additionally, even when using the ST state change interrupt, an interruption
@@ -155,7 +163,7 @@ void handle_state_change(struct xhfc_span* s)
if(unlikely(s->prev_state == s->state)) {
printk(KERN_WARNING DRIVER_NAME ": a state change has been "
"reported on port %d but it looks like the "
- "state has not changed?\n", s->port + 1);
+ "state has not changed?\n", portno(s));
return;
}
@@ -242,7 +250,7 @@ static void signal_f7_transition(struct xhfc_span* s)
{
if(DBG_ST && DBG_SPAN(s))
printk(KERN_DEBUG DRIVER_NAME ": signalling transition to F7 "
- "on port %d\n", s->port + 1);
+ "on port %d\n", portno(s));
s->span.alarms = DAHDI_ALARM_NONE;
s->f6_f7_transition = NOT_RUNNING;
@@ -262,7 +270,7 @@ static void activation_timer_expiry(struct xhfc_span* s)
t1_expiry || t3_expiry ? "" : "no action for ",
s->nt ? "NT" : "TE",
s->nt ? 'G' : 'F',
- sta, s->port + 1);
+ sta, portno(s));
s->activation_timer = NOT_RUNNING;
@@ -308,7 +316,7 @@ static void print_state(struct xhfc_span* s)
{
int sta = GET_V_SU_STA(s->state);
printk(KERN_DEBUG DRIVER_NAME ": port %d: %s state %c%d (%s)\n",
- s->port + 1,
+ portno(s),
(s->nt ? "NT" : "TE"),
(s->nt ? 'G' : 'F'),
sta,