summaryrefslogtreecommitdiffstats
path: root/include/hci_lib.h
diff options
context:
space:
mode:
authorMax Krasnyansky <maxk@qualcomm.com>2002-04-22 20:12:15 +0000
committerMax Krasnyansky <maxk@qualcomm.com>2002-04-22 20:12:15 +0000
commit16591cb20976879e8189d46d24ed1b41b0941a27 (patch)
tree2af04370ded0c033f0696d2b05663fe6cd777303 /include/hci_lib.h
parent6402046f11be1122658c1388c9d0614ad117c0f8 (diff)
Additional hci_filter_ functions
Diffstat (limited to 'include/hci_lib.h')
-rw-r--r--include/hci_lib.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/hci_lib.h b/include/hci_lib.h
index 5a49fd35..ecf180be 100644
--- a/include/hci_lib.h
+++ b/include/hci_lib.h
@@ -90,6 +90,11 @@ static inline void hci_set_bit(int nr, void *addr)
*((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31));
}
+static inline void hci_clear_bit(int nr, void *addr)
+{
+ *((uint32_t *) addr + (nr >> 5)) &= ~(1 << (nr & 31));
+}
+
static inline int hci_test_bit(int nr, void *addr)
{
return *((uint32_t *) addr + (nr >> 5)) & (1 << (nr & 31));
@@ -104,6 +109,14 @@ static inline void hci_filter_set_ptype(int t, struct hci_filter *f)
{
hci_set_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask);
}
+static inline void hci_filter_clear_ptype(int t, struct hci_filter *f)
+{
+ hci_clear_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask);
+}
+static inline int hci_filter_test_ptype(int t, struct hci_filter *f)
+{
+ return hci_test_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask);
+}
static inline void hci_filter_all_ptypes(struct hci_filter *f)
{
memset((void *)&f->type_mask, 0xff, sizeof(f->type_mask));
@@ -112,6 +125,14 @@ static inline void hci_filter_set_event(int e, struct hci_filter *f)
{
hci_set_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask);
}
+static inline void hci_filter_clear_event(int e, struct hci_filter *f)
+{
+ hci_clear_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask);
+}
+static inline int hci_filter_test_event(int e, struct hci_filter *f)
+{
+ return hci_test_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask);
+}
static inline void hci_filter_all_events(struct hci_filter *f)
{
memset((void *)f->event_mask, 0xff, sizeof(f->event_mask));
@@ -120,6 +141,14 @@ static inline void hci_filter_set_opcode(int opcode, struct hci_filter *f)
{
f->opcode = opcode;
}
+static inline void hci_filter_clear_opcode(int opcode, struct hci_filter *f)
+{
+ f->opcode = 0;
+}
+static inline int hci_filter_test_opcode(int opcode, struct hci_filter *f)
+{
+ return (f->opcode == opcode);
+}
#ifdef __cplusplus
}