Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1364713
| From | Michael Thalmeier <michael.thalmeier@hale.at> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC 1/4] NFC: pn533: Send ATR_REQ only if NFC_PROTO_NFC_DEP bit is set in poll_protocols |
| Date | 2016-03-25 16:00 +0100 |
| Message-ID | <rgBns-36A-15@gated-at.bofh.it> (permalink) |
| References | <rgBns-36A-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 for
current implementations.
Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
---
drivers/nfc/pn533.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index bb3d5ea..a85830f 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);
}
--
2.5.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC 0/4] NFC: pn533: support for pn532 via I2C Michael Thalmeier <michael.thalmeier@hale.at> - 2016-03-25 16:00 +0100 [RFC 1/4] NFC: pn533: Send ATR_REQ only if NFC_PROTO_NFC_DEP bit is set in poll_protocols Michael Thalmeier <michael.thalmeier@hale.at> - 2016-03-25 16:00 +0100 [RFC 4/4] NFC: pn533: add I2C phy driver Michael Thalmeier <michael.thalmeier@hale.at> - 2016-03-25 16:00 +0100 [RFC 2/4] NFC: pn533: fix deadlock when socket is closed while processing command Michael Thalmeier <michael.thalmeier@hale.at> - 2016-03-25 16:00 +0100
csiph-web