diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2014-05-20 22:21:58 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-07-23 01:04:31 +0200 |
commit | d57d74eb7626a2aeefad47a8d4246e9daf2199f5 (patch) | |
tree | 5add8166cd09ff61e5de6d48b8ca08b9ea6b50b6 /drivers/nfc/st21nfca | |
parent | 95f7687b209954a8ec94b4974d14fdff005ebaac (diff) | |
download | talos-obmc-linux-d57d74eb7626a2aeefad47a8d4246e9daf2199f5.tar.gz talos-obmc-linux-d57d74eb7626a2aeefad47a8d4246e9daf2199f5.zip |
NFC: st21nfca: Implement stop_poll HCI hook
Send DM_DISCONNECT command to disconnect Terminal Host from the HCI network.
- The persistent states of the terminal host pipes, including registry values,
are not modifies. Therefore, there is no NVRAM update to disconnect the
terminal host.
- The terminal host RF card gates are disabled which means that there will be no event
related to card RF gates until communication has been restored.
- The terminal host RF reader request is reset so the RF reader polling for terminal
host is disabled.
To restore the communication, the terminal host can send any HCI command or event.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/st21nfca')
-rw-r--r-- | drivers/nfc/st21nfca/st21nfca.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/nfc/st21nfca/st21nfca.c b/drivers/nfc/st21nfca/st21nfca.c index 51e0f00b3a4f..7ff1dcdd16ba 100644 --- a/drivers/nfc/st21nfca/st21nfca.c +++ b/drivers/nfc/st21nfca/st21nfca.c @@ -53,6 +53,7 @@ #define ST21NFCA_DM_PIPE_CREATED 0x02 #define ST21NFCA_DM_PIPE_OPEN 0x04 #define ST21NFCA_DM_RF_ACTIVE 0x80 +#define ST21NFCA_DM_DISCONNECT 0x30 #define ST21NFCA_DM_IS_PIPE_OPEN(p) \ ((p & 0x0f) == (ST21NFCA_DM_PIPE_CREATED | ST21NFCA_DM_PIPE_OPEN)) @@ -356,6 +357,12 @@ static int st21nfca_hci_start_poll(struct nfc_hci_dev *hdev, return r; } +static void st21nfca_hci_stop_poll(struct nfc_hci_dev *hdev) +{ + nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE, + ST21NFCA_DM_DISCONNECT, NULL, 0, NULL); +} + static int st21nfca_get_iso14443_3_atqa(struct nfc_hci_dev *hdev, u16 *atqa) { int r; @@ -601,6 +608,7 @@ static struct nfc_hci_ops st21nfca_hci_ops = { .hci_ready = st21nfca_hci_ready, .xmit = st21nfca_hci_xmit, .start_poll = st21nfca_hci_start_poll, + .stop_poll = st21nfca_hci_stop_poll, .target_from_gate = st21nfca_hci_target_from_gate, .im_transceive = st21nfca_hci_im_transceive, .check_presence = st21nfca_hci_check_presence, |