aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-03-14 19:28:00 -0700
committerJohan Hedberg <johan.hedberg@intel.com>2015-03-15 09:57:31 +0200
commitc85be545ea23a4fe590c89683242a9be823394e0 (patch)
tree3807191476a15efd18b7d6b4468fc0eed770ab47 /net/bluetooth
parentBluetooth: Consolidate socket channel sending function back into one (diff)
downloadlinux-dev-c85be545ea23a4fe590c89683242a9be823394e0.tar.xz
linux-dev-c85be545ea23a4fe590c89683242a9be823394e0.zip
Bluetooth: Add hci_sock_test_flag helper function
The management interface will need access to the socket flags and so provide a helper function for checking them. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_sock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index e7f463f6fd69..df23c184c897 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -60,6 +60,11 @@ void hci_sock_clear_flag(struct sock *sk, int nr)
clear_bit(nr, &hci_pi(sk)->flags);
}
+int hci_sock_test_flag(struct sock *sk, int nr)
+{
+ return test_bit(nr, &hci_pi(sk)->flags);
+}
+
static inline int hci_test_bit(int nr, const void *addr)
{
return *((const __u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31));
@@ -211,7 +216,7 @@ void hci_send_to_channel(unsigned short channel, struct sk_buff *skb,
struct sk_buff *nskb;
/* Ignore socket without the flag set */
- if (!test_bit(flag, &hci_pi(sk)->flags))
+ if (!hci_sock_test_flag(sk, flag))
continue;
/* Skip the original socket */