diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-06-11 04:13:08 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-06-11 23:07:45 -0400 |
commit | bda4f23a5c20deabb07545591be872145528b4ed (patch) | |
tree | 2e2c43e8b527920ad5d3aa0941d098a4929cbfb4 | |
parent | 5f246e890502fed387e0f959e2224ea680c03423 (diff) |
Bluetooth: Add opcode to error message
Sometimes HCI command sending timeouts and gives error message without
specifying which command causes error. Patch makes sure that opcode
is printed to help debugging.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
-rw-r--r-- | net/bluetooth/hci_core.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index e91bf7e15666..88858963ec21 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -1366,11 +1366,19 @@ int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr) | |||
1366 | } | 1366 | } |
1367 | 1367 | ||
1368 | /* HCI command timer function */ | 1368 | /* HCI command timer function */ |
1369 | static void hci_cmd_timer(unsigned long arg) | 1369 | static void hci_cmd_timeout(unsigned long arg) |
1370 | { | 1370 | { |
1371 | struct hci_dev *hdev = (void *) arg; | 1371 | struct hci_dev *hdev = (void *) arg; |
1372 | 1372 | ||
1373 | BT_ERR("%s command tx timeout", hdev->name); | 1373 | if (hdev->sent_cmd) { |
1374 | struct hci_command_hdr *sent = (void *) hdev->sent_cmd->data; | ||
1375 | u16 opcode = __le16_to_cpu(sent->opcode); | ||
1376 | |||
1377 | BT_ERR("%s command 0x%4.4x tx timeout", hdev->name, opcode); | ||
1378 | } else { | ||
1379 | BT_ERR("%s command tx timeout", hdev->name); | ||
1380 | } | ||
1381 | |||
1374 | atomic_set(&hdev->cmd_cnt, 1); | 1382 | atomic_set(&hdev->cmd_cnt, 1); |
1375 | queue_work(hdev->workqueue, &hdev->cmd_work); | 1383 | queue_work(hdev->workqueue, &hdev->cmd_work); |
1376 | } | 1384 | } |
@@ -1668,7 +1676,7 @@ struct hci_dev *hci_alloc_dev(void) | |||
1668 | 1676 | ||
1669 | init_waitqueue_head(&hdev->req_wait_q); | 1677 | init_waitqueue_head(&hdev->req_wait_q); |
1670 | 1678 | ||
1671 | setup_timer(&hdev->cmd_timer, hci_cmd_timer, (unsigned long) hdev); | 1679 | setup_timer(&hdev->cmd_timer, hci_cmd_timeout, (unsigned long) hdev); |
1672 | 1680 | ||
1673 | hci_init_sysfs(hdev); | 1681 | hci_init_sysfs(hdev); |
1674 | discovery_init(hdev); | 1682 | discovery_init(hdev); |