Commit d1230b63 authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by Linus Torvalds

irda update 6/6:

        o [CORRECT] Start timer before sending event to fix race condition
        o [FEATURE] Improve the IrLMP event debugging messages.
parent 38fea30d
...@@ -514,10 +514,10 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -514,10 +514,10 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event,
irlmp_next_lsap_state(self, LSAP_SETUP_PEND); irlmp_next_lsap_state(self, LSAP_SETUP_PEND);
irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, NULL);
/* Start watchdog timer (5 secs for now) */ /* Start watchdog timer (5 secs for now) */
irlmp_start_watchdog_timer(self, 5*HZ); irlmp_start_watchdog_timer(self, 5*HZ);
irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, NULL);
break; break;
case LM_CONNECT_INDICATION: case LM_CONNECT_INDICATION:
if (self->conn_skb) { if (self->conn_skb) {
...@@ -529,8 +529,6 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -529,8 +529,6 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event,
irlmp_next_lsap_state(self, LSAP_CONNECT_PEND); irlmp_next_lsap_state(self, LSAP_CONNECT_PEND);
irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, NULL);
/* Start watchdog timer /* Start watchdog timer
* This is not mentionned in the spec, but there is a rare * This is not mentionned in the spec, but there is a rare
* race condition that can get the socket stuck. * race condition that can get the socket stuck.
...@@ -543,10 +541,12 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -543,10 +541,12 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event,
* a backup plan. 1 second is plenty (should be immediate). * a backup plan. 1 second is plenty (should be immediate).
* Jean II */ * Jean II */
irlmp_start_watchdog_timer(self, 1*HZ); irlmp_start_watchdog_timer(self, 1*HZ);
irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, NULL);
break; break;
default: default:
IRDA_DEBUG(2, "%s(), Unknown event %s\n", IRDA_DEBUG(1, "%s(), Unknown event %s on LSAP %#02x\n",
__FUNCTION__, irlmp_event[event]); __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb) if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
break; break;
...@@ -604,8 +604,8 @@ static int irlmp_state_connect(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -604,8 +604,8 @@ static int irlmp_state_connect(struct lsap_cb *self, IRLMP_EVENT event,
irlmp_next_lsap_state(self, LSAP_DISCONNECTED); irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
break; break;
default: default:
IRDA_DEBUG(0, "%s(), Unknown event %s\n", IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
__FUNCTION__, irlmp_event[event]); __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb) if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
break; break;
...@@ -666,8 +666,8 @@ static int irlmp_state_connect_pend(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -666,8 +666,8 @@ static int irlmp_state_connect_pend(struct lsap_cb *self, IRLMP_EVENT event,
irlmp_next_lsap_state(self, LSAP_DISCONNECTED); irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
break; break;
default: default:
IRDA_DEBUG(0, "%s(), Unknown event %s\n", IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
__FUNCTION__, irlmp_event[event]); __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb) if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
break; break;
...@@ -757,8 +757,8 @@ static int irlmp_state_dtr(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -757,8 +757,8 @@ static int irlmp_state_dtr(struct lsap_cb *self, IRLMP_EVENT event,
irlmp_disconnect_indication(self, reason, skb); irlmp_disconnect_indication(self, reason, skb);
break; break;
default: default:
IRDA_DEBUG(0, "%s(), Unknown event %s\n", IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
__FUNCTION__, irlmp_event[event]); __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb) if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
break; break;
...@@ -830,8 +830,8 @@ static int irlmp_state_setup(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -830,8 +830,8 @@ static int irlmp_state_setup(struct lsap_cb *self, IRLMP_EVENT event,
irlmp_disconnect_indication(self, LM_CONNECT_FAILURE, NULL); irlmp_disconnect_indication(self, LM_CONNECT_FAILURE, NULL);
break; break;
default: default:
IRDA_DEBUG(0, "%s(), Unknown event %s\n", IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
__FUNCTION__, irlmp_event[event]); __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb) if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
break; break;
...@@ -889,8 +889,8 @@ static int irlmp_state_setup_pend(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -889,8 +889,8 @@ static int irlmp_state_setup_pend(struct lsap_cb *self, IRLMP_EVENT event,
irlmp_disconnect_indication(self, reason, NULL); irlmp_disconnect_indication(self, reason, NULL);
break; break;
default: default:
IRDA_DEBUG(0, "%s(), Unknown event %s\n", IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
__FUNCTION__, irlmp_event[event]); __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb) if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
break; break;
......
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