Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] NFC: implicitly deactivate in nci_start_poll
@ 2011-09-22  8:13 ilanelias78
  2011-09-26 21:00 ` Lauro Ramos Venancio
  0 siblings, 1 reply; 2+ messages in thread
From: ilanelias78 @ 2011-09-22  8:13 UTC (permalink / raw)
  To: aloisio.almeida, lauro.venancio, samuel, linville
  Cc: linux-wireless, Ilan Elias

From: Ilan Elias <ilane@ti.com>

When start_poll is called, and a target was implicitly activated,
we need to implicitly deactivate it.
On the other hand, when the target was activated by the user,
we should not deactivate it.

Signed-off-by: Ilan Elias <ilane@ti.com>
---
 net/nfc/nci/core.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 895e5fd..361491b 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -365,8 +365,13 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, __u32 protocols)
 		return -EBUSY;
 	}
 
+	if (ndev->target_active_prot) {
+		nfc_err("there is an active target");
+		return -EBUSY;
+	}
+
 	if (test_bit(NCI_POLL_ACTIVE, &ndev->flags)) {
-		nfc_dbg("target already active, first deactivate...");
+		nfc_dbg("target is active, implicitly deactivate...");
 
 		rc = nci_request(ndev, nci_rf_deactivate_req, 0,
 			msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT));
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-26 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-22  8:13 [PATCH] NFC: implicitly deactivate in nci_start_poll ilanelias78
2011-09-26 21:00 ` Lauro Ramos Venancio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox