diff options
Diffstat (limited to 'net/bluetooth/hci_request.c')
-rw-r--r-- | net/bluetooth/hci_request.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index 0adbb59ec2f0..b1d4d5bba7c1 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c | |||
@@ -186,7 +186,7 @@ EXPORT_SYMBOL(__hci_cmd_sync); | |||
186 | /* Execute request and wait for completion. */ | 186 | /* Execute request and wait for completion. */ |
187 | int __hci_req_sync(struct hci_dev *hdev, void (*func)(struct hci_request *req, | 187 | int __hci_req_sync(struct hci_dev *hdev, void (*func)(struct hci_request *req, |
188 | unsigned long opt), | 188 | unsigned long opt), |
189 | unsigned long opt, __u32 timeout) | 189 | unsigned long opt, u32 timeout, u8 *hci_status) |
190 | { | 190 | { |
191 | struct hci_request req; | 191 | struct hci_request req; |
192 | DECLARE_WAITQUEUE(wait, current); | 192 | DECLARE_WAITQUEUE(wait, current); |
@@ -231,14 +231,20 @@ int __hci_req_sync(struct hci_dev *hdev, void (*func)(struct hci_request *req, | |||
231 | switch (hdev->req_status) { | 231 | switch (hdev->req_status) { |
232 | case HCI_REQ_DONE: | 232 | case HCI_REQ_DONE: |
233 | err = -bt_to_errno(hdev->req_result); | 233 | err = -bt_to_errno(hdev->req_result); |
234 | if (hci_status) | ||
235 | *hci_status = hdev->req_result; | ||
234 | break; | 236 | break; |
235 | 237 | ||
236 | case HCI_REQ_CANCELED: | 238 | case HCI_REQ_CANCELED: |
237 | err = -hdev->req_result; | 239 | err = -hdev->req_result; |
240 | if (hci_status) | ||
241 | *hci_status = HCI_ERROR_UNSPECIFIED; | ||
238 | break; | 242 | break; |
239 | 243 | ||
240 | default: | 244 | default: |
241 | err = -ETIMEDOUT; | 245 | err = -ETIMEDOUT; |
246 | if (hci_status) | ||
247 | *hci_status = HCI_ERROR_UNSPECIFIED; | ||
242 | break; | 248 | break; |
243 | } | 249 | } |
244 | 250 | ||
@@ -251,7 +257,7 @@ int __hci_req_sync(struct hci_dev *hdev, void (*func)(struct hci_request *req, | |||
251 | 257 | ||
252 | int hci_req_sync(struct hci_dev *hdev, void (*req)(struct hci_request *req, | 258 | int hci_req_sync(struct hci_dev *hdev, void (*req)(struct hci_request *req, |
253 | unsigned long opt), | 259 | unsigned long opt), |
254 | unsigned long opt, __u32 timeout) | 260 | unsigned long opt, u32 timeout, u8 *hci_status) |
255 | { | 261 | { |
256 | int ret; | 262 | int ret; |
257 | 263 | ||
@@ -260,7 +266,7 @@ int hci_req_sync(struct hci_dev *hdev, void (*req)(struct hci_request *req, | |||
260 | 266 | ||
261 | /* Serialize all requests */ | 267 | /* Serialize all requests */ |
262 | hci_req_sync_lock(hdev); | 268 | hci_req_sync_lock(hdev); |
263 | ret = __hci_req_sync(hdev, req, opt, timeout); | 269 | ret = __hci_req_sync(hdev, req, opt, timeout, hci_status); |
264 | hci_req_sync_unlock(hdev); | 270 | hci_req_sync_unlock(hdev); |
265 | 271 | ||
266 | return ret; | 272 | return ret; |