diff options
author | Eric Lapuyade <eric.lapuyade@intel.com> | 2012-05-03 05:49:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-09 16:42:11 -0400 |
commit | 36516268fd372294f5f4f26e0538ee70a1b5b9e7 (patch) | |
tree | 0e589dd20c94f5600097f559123483a52b91b626 /Documentation/nfc | |
parent | 9eb334ac1709e8f135af341ce1dd0e6b4449c6d3 (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.txt | 33 |
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 | |||
178 | that was discovered). | 178 | that was discovered). |
179 | 179 | ||
180 | Typically, such an event will be propagated to NFC Core from MSGRXWQ context. | 180 | Typically, such an event will be propagated to NFC Core from MSGRXWQ context. |
181 | |||
182 | Error management | ||
183 | ---------------- | ||
184 | |||
185 | Errors that occur synchronously with the execution of an NFC Core request are | ||
186 | simply returned as the execution result of the request. These are easy. | ||
187 | |||
188 | Errors that occur asynchronously (e.g. in a background protocol handling thread) | ||
189 | must be reported such that upper layers don't stay ignorant that something | ||
190 | went wrong below and know that expected events will probably never happen. | ||
191 | Handling of these errors is done as follows: | ||
192 | |||
193 | - driver (pn544) fails to deliver an incoming frame: it stores the error such | ||
194 | that any subsequent call to the driver will result in this error. Then it calls | ||
195 | the standard nfc_shdlc_recv_frame() with a NULL argument to report the problem | ||
196 | above. shdlc stores a EREMOTEIO sticky status, which will trigger SMW to | ||
197 | report above in turn. | ||
198 | |||
199 | - SMW is basically a background thread to handle incoming and outgoing shdlc | ||
200 | frames. This thread will also check the shdlc sticky status and report to HCI | ||
201 | when it discovers it is not able to run anymore because of an unrecoverable | ||
202 | error that happened within shdlc or below. If the problem occurs during shdlc | ||
203 | connection, 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 | ||
206 | error from a lower layer, HCI will either complete the currently executing | ||
207 | command 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 | ||
210 | active, it will send a tag discovered event with an empty tag list to the user | ||
211 | space to let it know that the poll operation will never be able to detect a tag. | ||
212 | If polling is not active and the error was sticky, lower levels will return it | ||
213 | at next invocation. | ||