From c0cfe7faa12f189ef1024fce5a710791d0062355 Mon Sep 17 00:00:00 2001 From: "G. Liakhovetski" Date: Fri, 8 Jun 2007 19:15:17 -0700 Subject: [IrDA]: Fix Rx/Tx path race. From: G. Liakhovetski We need to switch to NRM _before_ sending the final packet otherwise we might hit a race condition where we get the first packet from the peer while we're still in LAP_XMIT_P. Signed-off-by: Samuel Ortiz Signed-off-by: David S. Miller --- include/net/irda/irlap.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/net/irda') diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h index f0248fb8e196..a3d370efb903 100644 --- a/include/net/irda/irlap.h +++ b/include/net/irda/irlap.h @@ -289,4 +289,21 @@ static inline void irlap_clear_disconnect(struct irlap_cb *self) self->disconnect_pending = FALSE; } +/* + * Function irlap_next_state (self, state) + * + * Switches state and provides debug information + * + */ +static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state) +{ + /* + if (!self || self->magic != LAP_MAGIC) + return; + + IRDA_DEBUG(4, "next LAP state = %s\n", irlap_state[state]); + */ + self->state = state; +} + #endif -- cgit v1.2.3-59-g8ed1b