aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2014-12-02 15:27:49 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2014-12-02 16:47:17 -0500
commit9295b5b569fc4d5b9cd0fa7b44d03f9f712ecec9 (patch)
tree990d8c0d7deaab6c527d7113174b683ab413fa04 /net/nfc
parent4391590c4038d506a806503f66b9b2521a771e9e (diff)
NFC: nci: Add support for different NCI_DEACTIVATE_TYPE
nci_rf_deactivate_req only support NCI_DEACTIVATE_TYPE_IDLE_MODE. In some situation, it might be necessary to be able to support other NCI_DEACTIVATE_TYPE such as NCI_DEACTIVATE_TYPE_SLEEP_MODE in order for example to reactivate the selected target. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/nci/core.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 552b13ba7b32..51feb5e63008 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -299,7 +299,7 @@ static void nci_rf_deactivate_req(struct nci_dev *ndev, unsigned long opt)
299{ 299{
300 struct nci_rf_deactivate_cmd cmd; 300 struct nci_rf_deactivate_cmd cmd;
301 301
302 cmd.type = NCI_DEACTIVATE_TYPE_IDLE_MODE; 302 cmd.type = opt;
303 303
304 nci_send_cmd(ndev, NCI_OP_RF_DEACTIVATE_CMD, 304 nci_send_cmd(ndev, NCI_OP_RF_DEACTIVATE_CMD,
305 sizeof(struct nci_rf_deactivate_cmd), &cmd); 305 sizeof(struct nci_rf_deactivate_cmd), &cmd);
@@ -527,7 +527,8 @@ static int nci_start_poll(struct nfc_dev *nfc_dev,
527 (atomic_read(&ndev->state) == NCI_POLL_ACTIVE)) { 527 (atomic_read(&ndev->state) == NCI_POLL_ACTIVE)) {
528 pr_debug("target active or w4 select, implicitly deactivate\n"); 528 pr_debug("target active or w4 select, implicitly deactivate\n");
529 529
530 rc = nci_request(ndev, nci_rf_deactivate_req, 0, 530 rc = nci_request(ndev, nci_rf_deactivate_req,
531 NCI_DEACTIVATE_TYPE_IDLE_MODE,
531 msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); 532 msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT));
532 if (rc) 533 if (rc)
533 return -EBUSY; 534 return -EBUSY;
@@ -568,7 +569,7 @@ static void nci_stop_poll(struct nfc_dev *nfc_dev)
568 return; 569 return;
569 } 570 }
570 571
571 nci_request(ndev, nci_rf_deactivate_req, 0, 572 nci_request(ndev, nci_rf_deactivate_req, NCI_DEACTIVATE_TYPE_IDLE_MODE,
572 msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); 573 msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT));
573} 574}
574 575
@@ -653,7 +654,8 @@ static void nci_deactivate_target(struct nfc_dev *nfc_dev,
653 ndev->target_active_prot = 0; 654 ndev->target_active_prot = 0;
654 655
655 if (atomic_read(&ndev->state) == NCI_POLL_ACTIVE) { 656 if (atomic_read(&ndev->state) == NCI_POLL_ACTIVE) {
656 nci_request(ndev, nci_rf_deactivate_req, 0, 657 nci_request(ndev, nci_rf_deactivate_req,
658 NCI_DEACTIVATE_TYPE_SLEEP_MODE,
657 msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); 659 msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT));
658 } 660 }
659} 661}