Bluetooth : Recover BT, if hardware error event is received from the SOC

If Hardware Error event is received from the SOC, then BT SOC is in bad
state. As per spec, Hardware Error event is handled in HCI. Upper layer
gets informed by HCI to reset everything. & recover BT state machine & BT
SOC.

Change-Id: Iefdf8511ad51f88ff8a24ab9e075eb8dbc0a0a67
Signed-off-by: Nitin Shivpure <nshivpur@codeaurora.org>
This commit is contained in:
Nitin Shivpure
2013-04-28 00:14:26 +05:30
parent 82c5f6ec94
commit 4b9989a6b1
2 changed files with 25 additions and 1 deletions
+6 -1
View File
@@ -1,6 +1,6 @@
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (c) 2000-2001, 2010-2012 The Linux Foundation. All rights reserved.
Copyright (c) 2000-2001, 2010-2013 The Linux Foundation. All rights reserved.
Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
@@ -1145,6 +1145,11 @@ struct hci_ev_cmd_status {
__le16 opcode;
} __packed;
#define HCI_EV_HARDWARE_ERROR 0x10
struct hci_ev_hardware_error {
__u8 hw_err_code;
} __packed;
#define HCI_EV_ROLE_CHANGE 0x12
struct hci_ev_role_change {
__u8 status;
+19
View File
@@ -2426,6 +2426,21 @@ static inline void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb)
}
}
static inline void hci_hardware_error_evt(struct hci_dev *hdev,
struct sk_buff *skb)
{
struct hci_ev_hardware_error *ev = (void *) skb->data;
BT_ERR("hdev=%p, hw_err_code = %u", hdev, ev->hw_err_code);
if (hdev && hdev->dev_type == HCI_BREDR) {
hci_dev_lock_bh(hdev);
mgmt_powered(hdev->id, 1);
hci_dev_unlock_bh(hdev);
}
}
static inline void hci_role_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_ev_role_change *ev = (void *) skb->data;
@@ -3555,6 +3570,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
hci_cmd_status_evt(hdev, skb);
break;
case HCI_EV_HARDWARE_ERROR:
hci_hardware_error_evt(hdev, skb);
break;
case HCI_EV_ROLE_CHANGE:
hci_role_change_evt(hdev, skb);
break;