diff options
author | John W. Linville <linville@tuxdriver.com> | 2013-07-31 15:11:50 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-07-31 15:11:50 -0400 |
commit | 704278ccb5c9fcbe09d1be3657950c17fad18ba8 (patch) | |
tree | 1e15c5196541b928f076ae8d50e56a4cf9fbe7b8 /net/bluetooth | |
parent | d6158a55738863b3fe2d48bbb3bf33005ef834b8 (diff) | |
parent | 53e21fbc288218a423959f878c86471a0e323a9a (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Conflicts:
net/bluetooth/hci_core.c
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_core.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index e3a349977595..cc27297da5a9 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -513,7 +513,10 @@ static void hci_init2_req(struct hci_request *req, unsigned long opt) | |||
513 | 513 | ||
514 | hci_setup_event_mask(req); | 514 | hci_setup_event_mask(req); |
515 | 515 | ||
516 | if (hdev->hci_ver > BLUETOOTH_VER_1_1) | 516 | /* AVM Berlin (31), aka "BlueFRITZ!", doesn't support the read |
517 | * local supported commands HCI command. | ||
518 | */ | ||
519 | if (hdev->manufacturer != 31 && hdev->hci_ver > BLUETOOTH_VER_1_1) | ||
517 | hci_req_add(req, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); | 520 | hci_req_add(req, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); |
518 | 521 | ||
519 | if (lmp_ssp_capable(hdev)) { | 522 | if (lmp_ssp_capable(hdev)) { |
@@ -2165,10 +2168,6 @@ int hci_register_dev(struct hci_dev *hdev) | |||
2165 | 2168 | ||
2166 | BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); | 2169 | BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); |
2167 | 2170 | ||
2168 | write_lock(&hci_dev_list_lock); | ||
2169 | list_add(&hdev->list, &hci_dev_list); | ||
2170 | write_unlock(&hci_dev_list_lock); | ||
2171 | |||
2172 | hdev->workqueue = alloc_workqueue("%s", WQ_HIGHPRI | WQ_UNBOUND | | 2171 | hdev->workqueue = alloc_workqueue("%s", WQ_HIGHPRI | WQ_UNBOUND | |
2173 | WQ_MEM_RECLAIM, 1, hdev->name); | 2172 | WQ_MEM_RECLAIM, 1, hdev->name); |
2174 | if (!hdev->workqueue) { | 2173 | if (!hdev->workqueue) { |
@@ -2203,6 +2202,10 @@ int hci_register_dev(struct hci_dev *hdev) | |||
2203 | if (hdev->dev_type != HCI_AMP) | 2202 | if (hdev->dev_type != HCI_AMP) |
2204 | set_bit(HCI_AUTO_OFF, &hdev->dev_flags); | 2203 | set_bit(HCI_AUTO_OFF, &hdev->dev_flags); |
2205 | 2204 | ||
2205 | write_lock(&hci_dev_list_lock); | ||
2206 | list_add(&hdev->list, &hci_dev_list); | ||
2207 | write_unlock(&hci_dev_list_lock); | ||
2208 | |||
2206 | hci_notify(hdev, HCI_DEV_REG); | 2209 | hci_notify(hdev, HCI_DEV_REG); |
2207 | hci_dev_hold(hdev); | 2210 | hci_dev_hold(hdev); |
2208 | 2211 | ||
@@ -2215,9 +2218,6 @@ err_wqueue: | |||
2215 | destroy_workqueue(hdev->req_workqueue); | 2218 | destroy_workqueue(hdev->req_workqueue); |
2216 | err: | 2219 | err: |
2217 | ida_simple_remove(&hci_index_ida, hdev->id); | 2220 | ida_simple_remove(&hci_index_ida, hdev->id); |
2218 | write_lock(&hci_dev_list_lock); | ||
2219 | list_del(&hdev->list); | ||
2220 | write_unlock(&hci_dev_list_lock); | ||
2221 | 2221 | ||
2222 | return error; | 2222 | return error; |
2223 | } | 2223 | } |
@@ -3399,8 +3399,16 @@ void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status) | |||
3399 | */ | 3399 | */ |
3400 | if (hdev->sent_cmd) { | 3400 | if (hdev->sent_cmd) { |
3401 | req_complete = bt_cb(hdev->sent_cmd)->req.complete; | 3401 | req_complete = bt_cb(hdev->sent_cmd)->req.complete; |
3402 | if (req_complete) | 3402 | |
3403 | if (req_complete) { | ||
3404 | /* We must set the complete callback to NULL to | ||
3405 | * avoid calling the callback more than once if | ||
3406 | * this function gets called again. | ||
3407 | */ | ||
3408 | bt_cb(hdev->sent_cmd)->req.complete = NULL; | ||
3409 | |||
3403 | goto call_complete; | 3410 | goto call_complete; |
3411 | } | ||
3404 | } | 3412 | } |
3405 | 3413 | ||
3406 | /* Remove all pending commands belonging to this request */ | 3414 | /* Remove all pending commands belonging to this request */ |