summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJean Tourrilhes <jt@bougret.hpl.hp.com>2004-04-16 00:45:58 -0700
committerDavid S. Miller <davem@nuts.davemloft.net>2004-04-16 00:45:58 -0700
commit461fa1023511ebf6a017036ea7f929671c7e83a9 (patch)
treeeea3c80dbfa536d0c10e7617f528e3c063bd3b30 /net
parentbc206d40dba5cbb115ad50396f04a9f9d885e8a0 (diff)
[IRDA]: Fix handling of RD:RSP to be spec compliant
From Martin Diehl.
Diffstat (limited to 'net')
-rw-r--r--net/irda/irlap_event.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c
index 005a96c9ed08..3871220e62f6 100644
--- a/net/irda/irlap_event.c
+++ b/net/irda/irlap_event.c
@@ -2236,6 +2236,14 @@ static int irlap_state_sclose(struct irlap_cb *self, IRLAP_EVENT event,
irlap_disconnect_indication(self, LAP_DISC_INDICATION);
break;
case RECV_DM_RSP:
+ /* IrLAP-1.1 p.82: in SCLOSE, S and I type RSP frames
+ * shall take us down into default NDM state, like DM_RSP
+ */
+ case RECV_RR_RSP:
+ case RECV_RNR_RSP:
+ case RECV_REJ_RSP:
+ case RECV_SREJ_RSP:
+ case RECV_I_RSP:
/* Always switch state before calling upper layers */
irlap_next_state(self, LAP_NDM);
@@ -2253,6 +2261,17 @@ static int irlap_state_sclose(struct irlap_cb *self, IRLAP_EVENT event,
irlap_disconnect_indication(self, LAP_DISC_INDICATION);
break;
default:
+ /* IrLAP-1.1 p.82: in SCLOSE, basically any received frame
+ * with pf=1 shall restart the wd-timer and resend the rd:rsp
+ */
+ if (info != NULL && info->pf) {
+ del_timer(&self->wd_timer);
+ irlap_wait_min_turn_around(self, &self->qos_tx);
+ irlap_send_rd_frame(self);
+ irlap_start_wd_timer(self, self->wd_timeout);
+ break; /* stay in SCLOSE */
+ }
+
IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __FUNCTION__,
event, irlap_event[event]);