mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Thalmeier <michael.thalmeier@hale.at>
To: Samuel Ortiz <sameo@linux.intel.com>,
	Lauro Ramos Venancio <lauro.venancio@openbossa.org>,
	Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: linux-kernel@vger.kernel.org, linux-nfc@ml01.01.org,
	michael@thalmeier.at
Subject: [RFC 1/4] NFC: pn533: Send ATR_REQ only if NFC_PROTO_NFC_DEP bit is set in poll_protocols
Date: Fri, 25 Mar 2016 15:46:51 +0100	[thread overview]
Message-ID: <1458917214-10693-2-git-send-email-michael.thalmeier@hale.at> (raw)
In-Reply-To: <1458917214-10693-1-git-send-email-michael.thalmeier@hale.at>

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

  reply	other threads:[~2016-03-25 14:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25 14:46 [RFC 0/4] NFC: pn533: support for pn532 via I2C Michael Thalmeier
2016-03-25 14:46 ` Michael Thalmeier [this message]
2016-03-25 14:46 ` [RFC 2/4] NFC: pn533: fix deadlock when socket is closed while processing command Michael Thalmeier
2016-03-25 14:46 ` [RFC 3/4] NFC: pn533: Separate pn533 driver in HW dependant and independant parts Michael Thalmeier
2016-03-25 14:46 ` [RFC 4/4] NFC: pn533: add I2C phy driver Michael Thalmeier
2016-04-09 21:45   ` Samuel Ortiz
2016-04-11 14:36     ` [PATCH] nfc: pn533: Add device tree documentation for i2c phy Michael Thalmeier
2016-05-01 21:36       ` Samuel Ortiz
2016-05-04 15:22   ` [RFC 4/4] NFC: pn533: add I2C phy driver Olliver Schinagl
2016-04-09 21:45 ` [RFC 0/4] NFC: pn533: support for pn532 via I2C Samuel Ortiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458917214-10693-2-git-send-email-michael.thalmeier@hale.at \
    --to=michael.thalmeier@hale.at \
    --cc=aloisio.almeida@openbossa.org \
    --cc=lauro.venancio@openbossa.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfc@ml01.01.org \
    --cc=michael@thalmeier.at \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®