aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-03-17 07:48:49 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-03-17 13:03:08 -0400
commit88b94ce925cb103851f39bfa7e23e09823573d30 (patch)
treec73d6a6d81e9177a8353a821c4eeb8891f11879c /net/bluetooth
parenta380b6cff1a2d2139772e88219d08330f84d0381 (diff)
Bluetooth: Add hdev_init callback for HCI channels
In order to make the mgmt command handling more generic we can't have a direct call to mgmt_init_hdev() from mgmt_control(). This patch adds a new callback to struct hci_mgmt_chan. And sets it to point to the mgmt_init_hdev() function for the HCI_CHANNEL_CONTROL instance. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 915a2a1f0a71..ac897e676d5e 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6493,8 +6493,8 @@ int mgmt_control(struct hci_mgmt_chan *chan, struct sock *sk,
6493 goto done; 6493 goto done;
6494 } 6494 }
6495 6495
6496 if (hdev) 6496 if (hdev && chan->hdev_init)
6497 mgmt_init_hdev(sk, hdev); 6497 chan->hdev_init(sk, hdev);
6498 6498
6499 cp = buf + sizeof(*hdr); 6499 cp = buf + sizeof(*hdr);
6500 6500
@@ -7706,6 +7706,7 @@ static struct hci_mgmt_chan chan = {
7706 .channel = HCI_CHANNEL_CONTROL, 7706 .channel = HCI_CHANNEL_CONTROL,
7707 .handler_count = ARRAY_SIZE(mgmt_handlers), 7707 .handler_count = ARRAY_SIZE(mgmt_handlers),
7708 .handlers = mgmt_handlers, 7708 .handlers = mgmt_handlers,
7709 .hdev_init = mgmt_init_hdev,
7709}; 7710};
7710 7711
7711int mgmt_init(void) 7712int mgmt_init(void)