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>
This commit is contained in:
committed by
Marcel Holtmann
parent
49c989a0d6
commit
d0f172b14a
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user