Skip to content

Commit

Permalink
NFC: Handle SHDLC RSET frames from an SHDLC connected chip
Browse files Browse the repository at this point in the history
shdlc reset may leave HCI in an inconsistent state by loosing parts of
HCI frames. Handle this case by reporting an unrecoverable error to HCI.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Eric Lapuyade authored and John W. Linville committed Jul 9, 2012
1 parent d3b4044 commit 5018e49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/nfc/hci/shdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@ static void nfc_shdlc_rcv_u_frame(struct nfc_shdlc *shdlc,
r = nfc_shdlc_connect_send_ua(shdlc);
nfc_shdlc_connect_complete(shdlc, r);
}
} else if (shdlc->state > SHDLC_NEGOCIATING) {
} else if (shdlc->state == SHDLC_CONNECTED) {
/*
* TODO: Chip wants to reset link
* send ua, empty skb lists, reset counters
* propagate info to HCI layer
* Chip wants to reset link. This is unexpected and
* unsupported.
*/
shdlc->hard_fault = -ECONNRESET;
}
break;
case U_FRAME_UA:
Expand Down

0 comments on commit 5018e49

Please sign in to comment.