summaryrefslogtreecommitdiff
path: root/drivers/nfc
diff options
context:
space:
mode:
authorMichael Thalmeier <michael.thalmeier@hale.at>2016-03-25 17:46:51 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2016-04-10 00:53:05 +0300
commite997ebbe46fe46bd4e8d476adca1f9b76779f270 (patch)
treec5c7388e3416badd26e3c646a50cae0692f3cb44 /drivers/nfc
parent03c5b534185f9844c1b5fcfdbae2adc32821ec42 (diff)
downloadlinux-e997ebbe46fe46bd4e8d476adca1f9b76779f270.tar.xz
NFC: pn533: Send ATR_REQ only if NFC_PROTO_NFC_DEP bit is set
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>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/pn533.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index bb3d5ea9869c..a85830fcafd0 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -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);
}