aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/nfc
diff options
context:
space:
mode:
authorEric Lapuyade <eric.lapuyade@intel.com>2012-05-03 05:49:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-09 16:42:11 -0400
commit36516268fd372294f5f4f26e0538ee70a1b5b9e7 (patch)
tree0e589dd20c94f5600097f559123483a52b91b626 /Documentation/nfc
parent9eb334ac1709e8f135af341ce1dd0e6b4449c6d3 (diff)
NFC: Error management documentation
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'Documentation/nfc')
-rw-r--r--Documentation/nfc/nfc-hci.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/Documentation/nfc/nfc-hci.txt b/Documentation/nfc/nfc-hci.txt
index 320f9336c781..89a339c9b079 100644
--- a/Documentation/nfc/nfc-hci.txt
+++ b/Documentation/nfc/nfc-hci.txt
@@ -178,3 +178,36 @@ ANY_GET_PARAMETER to the reader A gate to get information on the target
178that was discovered). 178that was discovered).
179 179
180Typically, such an event will be propagated to NFC Core from MSGRXWQ context. 180Typically, such an event will be propagated to NFC Core from MSGRXWQ context.
181
182Error management
183----------------
184
185Errors that occur synchronously with the execution of an NFC Core request are
186simply returned as the execution result of the request. These are easy.
187
188Errors that occur asynchronously (e.g. in a background protocol handling thread)
189must be reported such that upper layers don't stay ignorant that something
190went wrong below and know that expected events will probably never happen.
191Handling of these errors is done as follows:
192
193- driver (pn544) fails to deliver an incoming frame: it stores the error such
194that any subsequent call to the driver will result in this error. Then it calls
195the standard nfc_shdlc_recv_frame() with a NULL argument to report the problem
196above. shdlc stores a EREMOTEIO sticky status, which will trigger SMW to
197report above in turn.
198
199- SMW is basically a background thread to handle incoming and outgoing shdlc
200frames. This thread will also check the shdlc sticky status and report to HCI
201when it discovers it is not able to run anymore because of an unrecoverable
202error that happened within shdlc or below. If the problem occurs during shdlc
203connection, the error is reported through the connect completion.
204
205- HCI: if an internal HCI error happens (frame is lost), or HCI is reported an
206error from a lower layer, HCI will either complete the currently executing
207command with that error, or notify NFC Core directly if no command is executing.
208
209- NFC Core: when NFC Core is notified of an error from below and polling is
210active, it will send a tag discovered event with an empty tag list to the user
211space to let it know that the poll operation will never be able to detect a tag.
212If polling is not active and the error was sticky, lower levels will return it
213at next invocation.