Commit 882809fb authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: Switch HCI H5 driver to use hci_reset_dev() function

Instead of having the driver generate the HCI Hardware Error event
manually, just call hci_reset_dev() to trigger the upper stack reset.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 75e0569f
...@@ -171,8 +171,6 @@ static void h5_timed_event(unsigned long arg) ...@@ -171,8 +171,6 @@ static void h5_timed_event(unsigned long arg)
static void h5_peer_reset(struct hci_uart *hu) static void h5_peer_reset(struct hci_uart *hu)
{ {
struct h5 *h5 = hu->priv; struct h5 *h5 = hu->priv;
struct sk_buff *skb;
const u8 hw_err[] = { HCI_EV_HARDWARE_ERROR, 0x01, 0x00 };
BT_ERR("Peer device has reset"); BT_ERR("Peer device has reset");
...@@ -187,15 +185,8 @@ static void h5_peer_reset(struct hci_uart *hu) ...@@ -187,15 +185,8 @@ static void h5_peer_reset(struct hci_uart *hu)
h5->tx_seq = 0; h5->tx_seq = 0;
h5->tx_ack = 0; h5->tx_ack = 0;
skb = bt_skb_alloc(3, GFP_ATOMIC); /* Send reset request to upper stack */
if (!skb) hci_reset_dev(hu->hdev);
return;
bt_cb(skb)->pkt_type = HCI_EVENT_PKT;
memcpy(skb_put(skb, 3), hw_err, 3);
/* Send Hardware Error to upper stack */
hci_recv_frame(hu->hdev, skb);
} }
static int h5_open(struct hci_uart *hu) static int h5_open(struct hci_uart *hu)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment