aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-03-17 13:48:46 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-03-17 18:03:07 +0100
commitd0f172b14afa7e0d8a19db5baa07e20b3ec8dcc8 (patch)
tree3c793723557a6e5b9d33ce65e7ac5f51064a4746 /net/bluetooth
parentBluetooth: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY for BTUSB_CSR (diff)
downloadlinux-dev-d0f172b14afa7e0d8a19db5baa07e20b3ec8dcc8.tar.xz
linux-dev-d0f172b14afa7e0d8a19db5baa07e20b3ec8dcc8.zip
Bluetooth: Add helper to get HCI channel of a socket
We'll need to have access to which HCI channel a socket is bound to, in order to manage pending mgmt commands in clean way. This patch adds a helper for the purpose. 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/hci_sock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 7c719602dbca..9ba1a2667eaa 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -65,6 +65,11 @@ int hci_sock_test_flag(struct sock *sk, int nr)
return test_bit(nr, &hci_pi(sk)->flags);
}
+unsigned short hci_sock_get_channel(struct sock *sk)
+{
+ return hci_pi(sk)->channel;
+}
+
static inline int hci_test_bit(int nr, const void *addr)
{
return *((const __u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31));