mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
NFC: NCI: Signal deactivation in Target mode
Before signaling the deactivation, send a deactivation request if in RFST_DISCOVERY state because neard assumes polling is stopped and will try to restart it. Signed-off-by: Julien Lefrique <lefrique@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
6ff5462b67
commit
d7979e130e
1 changed files with 16 additions and 1 deletions
|
@ -681,9 +681,24 @@ static int nci_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
|
||||||
|
|
||||||
static int nci_dep_link_down(struct nfc_dev *nfc_dev)
|
static int nci_dep_link_down(struct nfc_dev *nfc_dev)
|
||||||
{
|
{
|
||||||
|
struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
|
||||||
|
int rc;
|
||||||
|
|
||||||
pr_debug("entry\n");
|
pr_debug("entry\n");
|
||||||
|
|
||||||
nci_deactivate_target(nfc_dev, NULL);
|
if (nfc_dev->rf_mode == NFC_RF_INITIATOR) {
|
||||||
|
nci_deactivate_target(nfc_dev, NULL);
|
||||||
|
} else {
|
||||||
|
if (atomic_read(&ndev->state) == NCI_LISTEN_ACTIVE ||
|
||||||
|
atomic_read(&ndev->state) == NCI_DISCOVERY) {
|
||||||
|
nci_request(ndev, nci_rf_deactivate_req, 0,
|
||||||
|
msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT));
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = nfc_tm_deactivated(nfc_dev);
|
||||||
|
if (rc)
|
||||||
|
pr_err("error when signaling tm deactivation\n");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue