diff options
author | Ilan Elias <ilane@ti.com> | 2011-09-22 04:13:01 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-27 14:34:04 -0400 |
commit | de054799b7ffee8ce1e3971a8dcd7816ccf04977 (patch) | |
tree | 897861c1135c73629c2bbb317583bef487c2bc74 /net/nfc | |
parent | 2eb1dc101e6ed62fda64a426ffd864c03e550bc2 (diff) |
NFC: implicitly deactivate in nci_start_poll
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>
Acked-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | 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 c3dfd4e13bd5..9f17e8ec0ab9 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
@@ -361,8 +361,13 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, __u32 protocols) | |||
361 | return -EBUSY; | 361 | return -EBUSY; |
362 | } | 362 | } |
363 | 363 | ||
364 | if (ndev->target_active_prot) { | ||
365 | nfc_err("there is an active target"); | ||
366 | return -EBUSY; | ||
367 | } | ||
368 | |||
364 | if (test_bit(NCI_POLL_ACTIVE, &ndev->flags)) { | 369 | if (test_bit(NCI_POLL_ACTIVE, &ndev->flags)) { |
365 | nfc_dbg("target already active, first deactivate..."); | 370 | nfc_dbg("target is active, implicitly deactivate..."); |
366 | 371 | ||
367 | rc = nci_request(ndev, nci_rf_deactivate_req, 0, | 372 | rc = nci_request(ndev, nci_rf_deactivate_req, 0, |
368 | msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); | 373 | msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); |