linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] NFC: Handle RSET in SHDLC_CONNECTING state
@ 2012-09-12  8:13 Waldemar Rymarkiewicz
  2012-09-12  8:15 ` Rymarkiewicz Waldemar
  0 siblings, 1 reply; 3+ messages in thread
From: Waldemar Rymarkiewicz @ 2012-09-12  8:13 UTC (permalink / raw)
  To: linux-wireless, linux-nfc; +Cc: sameo, eric.lapuyade, Waldemar Rymarkiewicz

As queue_work() does not guarantee ordered execution of sm_work it
can happen in crossover RSET usecase that connect timer will constantly
change the shdlc state from NEGOTIATING to CONNECTING before shdlc have
chance to handle incoming frame.

As a result the incoming RSET frame will remain not handled before putting
shdlc into DISCONNECTED state which is too late.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
---
 net/nfc/hci/shdlc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/nfc/hci/shdlc.c b/net/nfc/hci/shdlc.c
index fd75cec..fe66cbc 100644
--- a/net/nfc/hci/shdlc.c
+++ b/net/nfc/hci/shdlc.c
@@ -365,7 +365,8 @@ static void nfc_shdlc_rcv_u_frame(struct nfc_shdlc *shdlc,
 
 	switch (u_frame_modifier) {
 	case U_FRAME_RSET:
-		if (shdlc->state == SHDLC_NEGOCIATING) {
+		if ( (shdlc->state == SHDLC_NEGOCIATING) ||
+					(shdlc->state == SHDLC_CONNECTING) ) {
 			/* we sent RSET, but chip wants to negociate */
 			if (skb->len > 0)
 				w = skb->data[0];
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH 1/3] NFC: Handle RSET in SHDLC_CONNECTING state
@ 2012-09-12  8:15 Waldemar Rymarkiewicz
  0 siblings, 0 replies; 3+ messages in thread
From: Waldemar Rymarkiewicz @ 2012-09-12  8:15 UTC (permalink / raw)
  To: linux-wireless, linux-nfc; +Cc: sameo, eric.lapuyade, Waldemar Rymarkiewicz

As queue_work() does not guarantee ordered execution of sm_work it
can happen in crossover RSET usecase that connect timer will constantly
change the shdlc state from NEGOTIATING to CONNECTING before shdlc have
chance to handle incoming frame.

As a result the incoming RSET frame will remain not handled before putting
shdlc into DISCONNECTED state which is too late.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
---
 net/nfc/hci/shdlc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/nfc/hci/shdlc.c b/net/nfc/hci/shdlc.c
index fd75cec..fe66cbc 100644
--- a/net/nfc/hci/shdlc.c
+++ b/net/nfc/hci/shdlc.c
@@ -365,7 +365,8 @@ static void nfc_shdlc_rcv_u_frame(struct nfc_shdlc *shdlc,
 
 	switch (u_frame_modifier) {
 	case U_FRAME_RSET:
-		if (shdlc->state == SHDLC_NEGOCIATING) {
+		if ( (shdlc->state == SHDLC_NEGOCIATING) ||
+					(shdlc->state == SHDLC_CONNECTING) ) {
 			/* we sent RSET, but chip wants to negociate */
 			if (skb->len > 0)
 				w = skb->data[0];
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-12  8:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-12  8:13 [PATCH 1/3] NFC: Handle RSET in SHDLC_CONNECTING state Waldemar Rymarkiewicz
2012-09-12  8:15 ` Rymarkiewicz Waldemar
  -- strict thread matches above, loose matches on Subject: below --
2012-09-12  8:15 Waldemar Rymarkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).