NFC: pn533: Send ATR_REQ only if NFC_PROTO_NFC_DEP bit is set
authorMichael Thalmeier <michael.thalmeier@hale.at>
Fri, 25 Mar 2016 14:46:51 +0000 (15:46 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Sat, 9 Apr 2016 21:53:05 +0000 (23:53 +0200)
Currently it is not possible to only poll for passive targets
with the pn533 driver. To change this ATR_REQ is only sent when
NFC_PROTO_NFC_DEP is explicitly requested in poll_protocols.
As most implementations (e.g. neard) poll for all protocols
that are reported to be supported by the adapter, this should
not have much of an effect on current implementations.

Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/pn533.c

index bb3d5ea9869c63e061761edd1d460dc41a36a01f..a85830fcafd02ad272de7f58e5428567c792d9ee 100644 (file)
@@ -1540,7 +1540,8 @@ static int pn533_start_poll_complete(struct pn533 *dev, struct sk_buff *resp)
        int rc, tgdata_len;
 
        /* Toggle the DEP polling */
-       dev->poll_dep = 1;
+       if (dev->poll_protocols & NFC_PROTO_NFC_DEP_MASK)
+               dev->poll_dep = 1;
 
        nbtg = resp->data[0];
        tg = resp->data[1];
@@ -2054,7 +2055,7 @@ static int pn533_send_poll_frame(struct pn533 *dev)
        dev_dbg(&dev->interface->dev, "%s mod len %d\n",
                __func__, mod->len);
 
-       if (dev->poll_dep)  {
+       if ((dev->poll_protocols & NFC_PROTO_NFC_DEP_MASK) && dev->poll_dep)  {
                dev->poll_dep = 0;
                return pn533_poll_dep(dev->nfc_dev);
        }
This page took 0.038036 seconds and 5 git commands to generate.