Skip to content

Commit 95f7687

Browse files
cricard13Samuel Ortiz
authored andcommitted
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>
1 parent 0531107 commit 95f7687

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎include/net/nfc/hci.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ struct nfc_hci_ops {
3737
int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb);
3838
int (*start_poll) (struct nfc_hci_dev *hdev,
3939
u32 im_protocols, u32 tm_protocols);
40+
void (*stop_poll) (struct nfc_hci_dev *hdev);
4041
int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target,
4142
u8 comm_mode, u8 *gb, size_t gb_len);
4243
int (*dep_link_down)(struct nfc_hci_dev *hdev);

‎net/nfc/hci/core.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,11 @@ static void hci_stop_poll(struct nfc_dev *nfc_dev)
553553
{
554554
struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev);
555555

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);
558561
}
559562

560563
static int hci_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,

0 commit comments

Comments
 (0)