diff options
| author | Julien Lefrique <lefrique@marvell.com> | 2014-10-21 10:52:53 -0400 |
|---|---|---|
| committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-11-28 08:07:51 -0500 |
| commit | d7979e130ebb02bafdbfc084312656eec1387911 (patch) | |
| tree | adda6991431ea814c865f44294ad5468349a3594 | |
| parent | 6ff5462b678db88fa35fda9016d53c32f18eed5f (diff) | |
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>
| -rw-r--r-- | net/nfc/nci/core.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 5e3971e88ea5..a354d1985d50 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
| @@ -681,9 +681,24 @@ static int nci_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target, | |||
| 681 | 681 | ||
| 682 | static int nci_dep_link_down(struct nfc_dev *nfc_dev) | 682 | static int nci_dep_link_down(struct nfc_dev *nfc_dev) |
| 683 | { | 683 | { |
| 684 | struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); | ||
| 685 | int rc; | ||
| 686 | |||
| 684 | pr_debug("entry\n"); | 687 | pr_debug("entry\n"); |
| 685 | 688 | ||
| 686 | nci_deactivate_target(nfc_dev, NULL); | 689 | if (nfc_dev->rf_mode == NFC_RF_INITIATOR) { |
| 690 | nci_deactivate_target(nfc_dev, NULL); | ||
| 691 | } else { | ||
| 692 | if (atomic_read(&ndev->state) == NCI_LISTEN_ACTIVE || | ||
| 693 | atomic_read(&ndev->state) == NCI_DISCOVERY) { | ||
| 694 | nci_request(ndev, nci_rf_deactivate_req, 0, | ||
| 695 | msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); | ||
| 696 | } | ||
| 697 | |||
| 698 | rc = nfc_tm_deactivated(nfc_dev); | ||
| 699 | if (rc) | ||
| 700 | pr_err("error when signaling tm deactivation\n"); | ||
| 701 | } | ||
| 687 | 702 | ||
| 688 | return 0; | 703 | return 0; |
| 689 | } | 704 | } |
