Skip to content

Commit

Permalink
NFC: implicitly deactivate in nci_start_poll
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ilan Elias authored and John W. Linville committed Sep 27, 2011
1 parent 2eb1dc1 commit de05479
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/nfc/nci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,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));
Expand Down

0 comments on commit de05479

Please sign in to comment.