|
@@ -40,6 +40,7 @@
|
|
|
#include "hci_request.h"
|
|
#include "hci_request.h"
|
|
|
#include "hci_debugfs.h"
|
|
#include "hci_debugfs.h"
|
|
|
#include "smp.h"
|
|
#include "smp.h"
|
|
|
|
|
+#include "leds.h"
|
|
|
|
|
|
|
|
static void hci_rx_work(struct work_struct *work);
|
|
static void hci_rx_work(struct work_struct *work);
|
|
|
static void hci_cmd_work(struct work_struct *work);
|
|
static void hci_cmd_work(struct work_struct *work);
|
|
@@ -1395,6 +1396,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
|
|
|
hci_dev_set_flag(hdev, HCI_RPA_EXPIRED);
|
|
hci_dev_set_flag(hdev, HCI_RPA_EXPIRED);
|
|
|
set_bit(HCI_UP, &hdev->flags);
|
|
set_bit(HCI_UP, &hdev->flags);
|
|
|
hci_sock_dev_event(hdev, HCI_DEV_UP);
|
|
hci_sock_dev_event(hdev, HCI_DEV_UP);
|
|
|
|
|
+ hci_leds_update_powered(hdev, true);
|
|
|
if (!hci_dev_test_flag(hdev, HCI_SETUP) &&
|
|
if (!hci_dev_test_flag(hdev, HCI_SETUP) &&
|
|
|
!hci_dev_test_flag(hdev, HCI_CONFIG) &&
|
|
!hci_dev_test_flag(hdev, HCI_CONFIG) &&
|
|
|
!hci_dev_test_flag(hdev, HCI_UNCONFIGURED) &&
|
|
!hci_dev_test_flag(hdev, HCI_UNCONFIGURED) &&
|
|
@@ -1532,6 +1534,8 @@ int hci_dev_do_close(struct hci_dev *hdev)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ hci_leds_update_powered(hdev, false);
|
|
|
|
|
+
|
|
|
/* Flush RX and TX works */
|
|
/* Flush RX and TX works */
|
|
|
flush_work(&hdev->tx_work);
|
|
flush_work(&hdev->tx_work);
|
|
|
flush_work(&hdev->rx_work);
|
|
flush_work(&hdev->rx_work);
|
|
@@ -3067,6 +3071,8 @@ int hci_register_dev(struct hci_dev *hdev)
|
|
|
if (error < 0)
|
|
if (error < 0)
|
|
|
goto err_wqueue;
|
|
goto err_wqueue;
|
|
|
|
|
|
|
|
|
|
+ hci_leds_init(hdev);
|
|
|
|
|
+
|
|
|
hdev->rfkill = rfkill_alloc(hdev->name, &hdev->dev,
|
|
hdev->rfkill = rfkill_alloc(hdev->name, &hdev->dev,
|
|
|
RFKILL_TYPE_BLUETOOTH, &hci_rfkill_ops,
|
|
RFKILL_TYPE_BLUETOOTH, &hci_rfkill_ops,
|
|
|
hdev);
|
|
hdev);
|
|
@@ -3128,6 +3134,8 @@ void hci_unregister_dev(struct hci_dev *hdev)
|
|
|
|
|
|
|
|
id = hdev->id;
|
|
id = hdev->id;
|
|
|
|
|
|
|
|
|
|
+ hci_leds_exit(hdev);
|
|
|
|
|
+
|
|
|
write_lock(&hci_dev_list_lock);
|
|
write_lock(&hci_dev_list_lock);
|
|
|
list_del(&hdev->list);
|
|
list_del(&hdev->list);
|
|
|
write_unlock(&hci_dev_list_lock);
|
|
write_unlock(&hci_dev_list_lock);
|