提交 4391590c 编写于 作者: C Christophe Ricard 提交者: Samuel Ortiz

NFC: nci: Add management for NCI state for machine rf_deactivate_ntf

A notification for rf deaction can be IDLE_MODE, SLEEP_MODE,
SLEEP_AF_MODE and DISCOVERY. According to each type and the NCI
state machine is different (see figure 10 RF Communication State
Machine in NCI specification)
Signed-off-by: NChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 98ff416f
...@@ -680,11 +680,21 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev, ...@@ -680,11 +680,21 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags)) if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
nci_data_exchange_complete(ndev, NULL, -EIO); nci_data_exchange_complete(ndev, NULL, -EIO);
nci_clear_target_list(ndev); switch (ntf->type) {
if (ntf->type == NCI_DEACTIVATE_TYPE_DISCOVERY) case NCI_DEACTIVATE_TYPE_IDLE_MODE:
atomic_set(&ndev->state, NCI_DISCOVERY); nci_clear_target_list(ndev);
else
atomic_set(&ndev->state, NCI_IDLE); atomic_set(&ndev->state, NCI_IDLE);
break;
case NCI_DEACTIVATE_TYPE_SLEEP_MODE:
case NCI_DEACTIVATE_TYPE_SLEEP_AF_MODE:
atomic_set(&ndev->state, NCI_W4_HOST_SELECT);
break;
case NCI_DEACTIVATE_TYPE_DISCOVERY:
nci_clear_target_list(ndev);
atomic_set(&ndev->state, NCI_DISCOVERY);
break;
}
nci_req_complete(ndev, NCI_STATUS_OK); nci_req_complete(ndev, NCI_STATUS_OK);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册