summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoe Rubinstein <nrubinstein@proformatique.com>2010-12-03 23:12:57 +0100
committerNoe Rubinstein <nrubinstein@proformatique.com>2010-12-03 23:12:57 +0100
commitab051a7a9cd716ef6c186705527d233fd9db8476 (patch)
treed374032b275d5445f55712550c2b5c54aedba0c7
parentf146680146bfa723548c6c828315c10ee8e72b70 (diff)
fix activate_request
-rw-r--r--xhfc/xhfc_st_state.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/xhfc/xhfc_st_state.c b/xhfc/xhfc_st_state.c
index 6a94f78..4645447 100644
--- a/xhfc/xhfc_st_state.c
+++ b/xhfc/xhfc_st_state.c
@@ -50,18 +50,42 @@ void start_state_machine(struct xhfc_span* s)
void activate_request(struct xhfc_span* s)
{
u8 a_su_wr_sta = 0;
+ int sta = GET_V_SU_STA(s->state);
+ int impossible_te = !s->nt &&
+ (sta == F2 || sta == F4 || sta == F5 || sta == F5);
+ int impossible_nt = s->nt &&
+ (sta == G2 || sta == G3);
+ int no_action_te = !s->nt &&
+ (sta == F0 || sta == F6 || sta == F8);
+
+ 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",
+ (s->nt ? 'G' : 'F'), sta, portno(s));
+ return;
+ } else if (no_action_te) {
+ if(DBG_ST && DBG_SPAN(s))
+ printk(KERN_INFO DRIVER_NAME ": "
+ "no action for activate "
+ "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
": activate on port %d\n",
s->port + 1);
+
SET_V_SU_ACT(a_su_wr_sta, V_SU_ACT_ACTIVATE);
write_xhfc(s->xhfc, R_SU_SEL, s->port);
write_xhfc(s->xhfc, A_SU_WR_STA, a_su_wr_sta);
- if(!s->nt && GET_V_SU_STA(s->state) == 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;