Commit bd7e01bc authored by Ilan Elias's avatar Ilan Elias Committed by John W. Linville

NFC: Complete NCI deactivate in deactivate_ntf

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: default avatarIlan Elias <ilane@ti.com>
Acked-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ca742cd9
...@@ -280,6 +280,8 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev, ...@@ -280,6 +280,8 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
/* complete the data exchange transaction, if exists */ /* complete the data exchange transaction, if exists */
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_req_complete(ndev, NCI_STATUS_OK);
} }
void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb) void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
......
...@@ -151,6 +151,9 @@ static void nci_rf_deactivate_rsp_packet(struct nci_dev *ndev, ...@@ -151,6 +151,9 @@ static void nci_rf_deactivate_rsp_packet(struct nci_dev *ndev,
clear_bit(NCI_DISCOVERY, &ndev->flags); clear_bit(NCI_DISCOVERY, &ndev->flags);
/* 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); nci_req_complete(ndev, status);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment