Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: hci: Add stop_poll HCI operand.

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>

authored by

Christophe Ricard and committed by
Samuel Ortiz
95f7687b 0531107e

+6 -2
+1
include/net/nfc/hci.h
··· 37 37 int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); 38 38 int (*start_poll) (struct nfc_hci_dev *hdev, 39 39 u32 im_protocols, u32 tm_protocols); 40 + void (*stop_poll) (struct nfc_hci_dev *hdev); 40 41 int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target, 41 42 u8 comm_mode, u8 *gb, size_t gb_len); 42 43 int (*dep_link_down)(struct nfc_hci_dev *hdev);
+5 -2
net/nfc/hci/core.c
··· 553 553 { 554 554 struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); 555 555 556 - nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, 557 - NFC_HCI_EVT_END_OPERATION, NULL, 0); 556 + if (hdev->ops->stop_poll) 557 + hdev->ops->stop_poll(hdev); 558 + else 559 + nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, 560 + NFC_HCI_EVT_END_OPERATION, NULL, 0); 558 561 } 559 562 560 563 static int hci_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,