diff options
author | Ilan Elias <ilane@ti.com> | 2012-01-08 04:21:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-24 14:08:38 -0500 |
commit | bd7e01bc7e7a90b33470173618f6f6805143cd42 (patch) | |
tree | 6ded85d2d1559bec5e0dbdbda81acd7ebb1acb0b /net/nfc | |
parent | ca742cd9766ff519b0e927a9296e29541ee13c7b (diff) |
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: Ilan Elias <ilane@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/nci/ntf.c | 2 | ||||
-rw-r--r-- | net/nfc/nci/rsp.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c index b16a8dc2afbe..10682bf7029d 100644 --- a/net/nfc/nci/ntf.c +++ b/net/nfc/nci/ntf.c | |||
@@ -280,6 +280,8 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev, | |||
280 | /* complete the data exchange transaction, if exists */ | 280 | /* complete the data exchange transaction, if exists */ |
281 | if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags)) | 281 | if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags)) |
282 | nci_data_exchange_complete(ndev, NULL, -EIO); | 282 | nci_data_exchange_complete(ndev, NULL, -EIO); |
283 | |||
284 | nci_req_complete(ndev, NCI_STATUS_OK); | ||
283 | } | 285 | } |
284 | 286 | ||
285 | void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb) | 287 | void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb) |
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c index 2840ae2f3615..3c73e92eb625 100644 --- a/net/nfc/nci/rsp.c +++ b/net/nfc/nci/rsp.c | |||
@@ -151,7 +151,10 @@ static void nci_rf_deactivate_rsp_packet(struct nci_dev *ndev, | |||
151 | 151 | ||
152 | clear_bit(NCI_DISCOVERY, &ndev->flags); | 152 | clear_bit(NCI_DISCOVERY, &ndev->flags); |
153 | 153 | ||
154 | nci_req_complete(ndev, status); | 154 | /* If target was active, complete the request only in deactivate_ntf */ |
155 | if ((status != NCI_STATUS_OK) || | ||
156 | (!test_bit(NCI_POLL_ACTIVE, &ndev->flags))) | ||
157 | nci_req_complete(ndev, status); | ||
155 | } | 158 | } |
156 | 159 | ||
157 | void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) | 160 | void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) |