aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@animalcreek.com>2014-07-02 12:01:56 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2014-07-20 18:45:03 -0400
commit4b4dbca5e49eea2567d0da777fea2c86e7b89622 (patch)
tree87d4e7027d458f889b443eab85ad98cef8b8818e /net/nfc
parent1d9e954e8b522ae37c7c0fdd791b5736321684a0 (diff)
NFC: digital: Check for NFC-DEP before checking for Type 4 tag
In digital_in_recv_sel_res(), the code that determines the tag type will interpret bits 7:6 (lsb being b1 as per the Digital Specification) of a SEL RES set to 11b as a Type 4 tag. This is okay except that the neard will interpret the same value as an NFC-DEP device (in src/tag.c:set_tag_type() in the neard source). Make the digital layer's interpretation match neard's interpretation by changing the order of the checks in digital_in_recv_sel_res() so that a value of 11b in bits 7:6 is interpreted as an NFC-DEP device instead of a Type 4 tag. Acked-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/digital_technology.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c
index c2c1c0189b7c..d1684cbfea68 100644
--- a/net/nfc/digital_technology.c
+++ b/net/nfc/digital_technology.c
@@ -318,6 +318,8 @@ static void digital_in_recv_sel_res(struct nfc_digital_dev *ddev, void *arg,
318 318
319 if (DIGITAL_SEL_RES_IS_T2T(sel_res)) { 319 if (DIGITAL_SEL_RES_IS_T2T(sel_res)) {
320 nfc_proto = NFC_PROTO_MIFARE; 320 nfc_proto = NFC_PROTO_MIFARE;
321 } else if (DIGITAL_SEL_RES_IS_NFC_DEP(sel_res)) {
322 nfc_proto = NFC_PROTO_NFC_DEP;
321 } else if (DIGITAL_SEL_RES_IS_T4T(sel_res)) { 323 } else if (DIGITAL_SEL_RES_IS_T4T(sel_res)) {
322 rc = digital_in_send_rats(ddev, target); 324 rc = digital_in_send_rats(ddev, target);
323 if (rc) 325 if (rc)
@@ -327,8 +329,6 @@ static void digital_in_recv_sel_res(struct nfc_digital_dev *ddev, void *arg,
327 * done when receiving the ATS 329 * done when receiving the ATS
328 */ 330 */
329 goto exit_free_skb; 331 goto exit_free_skb;
330 } else if (DIGITAL_SEL_RES_IS_NFC_DEP(sel_res)) {
331 nfc_proto = NFC_PROTO_NFC_DEP;
332 } else { 332 } else {
333 rc = -EOPNOTSUPP; 333 rc = -EOPNOTSUPP;
334 goto exit; 334 goto exit;