Commit de054799 authored by Ilan Elias's avatar Ilan Elias Committed by John W. Linville

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: default avatarIlan Elias <ilane@ti.com>
Acked-by: default avatarLauro Ramos Venancio <lauro.venancio@openbossa.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2eb1dc10
...@@ -361,8 +361,13 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, __u32 protocols) ...@@ -361,8 +361,13 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, __u32 protocols)
return -EBUSY; return -EBUSY;
} }
if (ndev->target_active_prot) {
nfc_err("there is an active target");
return -EBUSY;
}
if (test_bit(NCI_POLL_ACTIVE, &ndev->flags)) { 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, rc = nci_request(ndev, nci_rf_deactivate_req, 0,
msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment