NFC: Complete NCI deactivate in deactivate_ntf
Subsystems (2)
PATCH 1/1 NFC: Complete NCI deactivate in deactivate_ntf
From: Ilan Elias <[email protected]>
If a target was active, complete the NCI deactivate request only in deactivate_ntf. Otherwise, complete it at deactivate_rsp. Deactivate_ntf represents the actual disconnection event (sent from the NCI controller).
Signed-off-by Ilan Elias <[email protected]>
--- net/nfc/nci/ntf.c | 2 ++ net/nfc/nci/rsp.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletions(-)
net/nfc/nci/ntf.c +2 -0
@@ -365,6 +365,8 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,/* complete the data exchange transaction, if exists */ if (test_bit (NCI_DATA_EXCHANGE , &ndev->flags))nci_data_exchange_complete (ndev,NULL , -EIO ); + +nci_req_complete (ndev,NCI_STATUS_OK ); }void nci_ntf_packet (struct nci_dev *ndev,struct sk_buff *skb)
net/nfc/nci/rsp.c +4 -1
@@ -151,7 +151,10 @@ static void nci_rf_deactivate_rsp_packet(struct nci_dev *ndev,clear_bit (NCI_DISCOVERY , &ndev->flags); -nci_req_complete (ndev, status); +/* If target was active, complete the request only in deactivate_ntf */ +if ((status !=NCI_STATUS_OK ) || + (!test_bit (NCI_POLL_ACTIVE , &ndev->flags))) +nci_req_complete (ndev, status); }void nci_rsp_packet (struct nci_dev *ndev,struct sk_buff *skb)
Signature · 1 line
1.7.0.4
Quoted 8 lines · On Sun, 2012-01-08 at 11:21 +0200, [email protected] wrote:
From: Ilan Elias <[email protected]>
If a target was active, complete the NCI deactivate request only in
deactivate_ntf. Otherwise, complete it atdeactivate_rsp.Deactivate_ntfrepresents the actual disconnection event (sent from the NCI controller).Signed-off-by Ilan Elias <[email protected]>
Acked-by Samuel Ortiz <[email protected]>
Cheers,
Samuel.