aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-10-20 17:25:42 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2015-10-21 00:30:53 -0400
commit98a63aaf245e2522b0ddd86f38fb83883344bcaf (patch)
tree1d84c744eb306d7918cfb6043962a4803020cefc
parentaee61f7aa89bbfa48b91628291d8685aa61c970f (diff)
Bluetooth: Introduce driver specific post init callback
Some drivers might have to restore certain settings after the init procedure has been completed. This driver callback allows them to hook into that stage. This callback is run just before the controller is declared as powered up. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--include/net/bluetooth/hci_core.h1
-rw-r--r--net/bluetooth/hci_core.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 989c72aabc45..44fb95685611 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -398,6 +398,7 @@ struct hci_dev {
398 int (*send)(struct hci_dev *hdev, struct sk_buff *skb); 398 int (*send)(struct hci_dev *hdev, struct sk_buff *skb);
399 void (*notify)(struct hci_dev *hdev, unsigned int evt); 399 void (*notify)(struct hci_dev *hdev, unsigned int evt);
400 void (*hw_error)(struct hci_dev *hdev, u8 code); 400 void (*hw_error)(struct hci_dev *hdev, u8 code);
401 int (*post_init)(struct hci_dev *hdev);
401 int (*set_diag)(struct hci_dev *hdev, bool enable); 402 int (*set_diag)(struct hci_dev *hdev, bool enable);
402 int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr); 403 int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr);
403}; 404};
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index ac5cb251f9fb..964fba4c96bf 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1503,8 +1503,11 @@ static int hci_dev_do_open(struct hci_dev *hdev)
1503 1503
1504 if (!ret) { 1504 if (!ret) {
1505 if (!hci_dev_test_flag(hdev, HCI_UNCONFIGURED) && 1505 if (!hci_dev_test_flag(hdev, HCI_UNCONFIGURED) &&
1506 !hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) 1506 !hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) {
1507 ret = __hci_init(hdev); 1507 ret = __hci_init(hdev);
1508 if (!ret && hdev->post_init)
1509 ret = hdev->post_init(hdev);
1510 }
1508 } 1511 }
1509 1512
1510 /* If the HCI Reset command is clearing all diagnostic settings, 1513 /* If the HCI Reset command is clearing all diagnostic settings,