NFC: hci: Add stop_poll HCI operand.
authorChristophe Ricard <christophe.ricard@gmail.com>
Tue, 20 May 2014 20:21:57 +0000 (22:21 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 22 Jul 2014 23:04:31 +0000 (01:04 +0200)
stop_poll allows to stop CLF reader polling. Some other operations might be
necessary for some CLF to stop polling. For example in card mode.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
include/net/nfc/hci.h
net/nfc/hci/core.c

index 61286db54388b9d03b6a49b494d1492e7cfd8e5c..7ee8f4cc610bebecb119ce28566604e1cd6c3f3c 100644 (file)
@@ -37,6 +37,7 @@ struct nfc_hci_ops {
        int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb);
        int (*start_poll) (struct nfc_hci_dev *hdev,
                           u32 im_protocols, u32 tm_protocols);
+       void (*stop_poll) (struct nfc_hci_dev *hdev);
        int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target,
                           u8 comm_mode, u8 *gb, size_t gb_len);
        int (*dep_link_down)(struct nfc_hci_dev *hdev);
index 47403705197e85930d9f3e480d2e2d5dbd2012fa..117708263ced38dfa690e1d49a6c19d661751289 100644 (file)
@@ -553,8 +553,11 @@ static void hci_stop_poll(struct nfc_dev *nfc_dev)
 {
        struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev);
 
-       nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE,
-                          NFC_HCI_EVT_END_OPERATION, NULL, 0);
+       if (hdev->ops->stop_poll)
+               hdev->ops->stop_poll(hdev);
+       else
+               nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE,
+                                  NFC_HCI_EVT_END_OPERATION, NULL, 0);
 }
 
 static int hci_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,