aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2010-05-18 07:20:32 -0400
committerMarcel Holtmann <marcel@holtmann.org>2010-07-21 13:39:05 -0400
commitf03585689fdff4ae256edd45a35bc2dd83d3684a (patch)
treebe1516aa354aa742f2d5b69a91de0561febaffc4 /include/net
parent95ffa97827371ede501615d9bd048eb5b49e8fe1 (diff)
Bluetooth: Add blacklist support for incoming connections
In some circumstances it could be desirable to reject incoming connections on the baseband level. This patch adds this feature through two new ioctl's: HCIBLOCKADDR and HCIUNBLOCKADDR. Both take a simple Bluetooth address as a parameter. BDADDR_ANY can be used with HCIUNBLOCKADDR to remove all devices from the blacklist. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/hci.h3
-rw-r--r--include/net/bluetooth/hci_core.h9
2 files changed, 12 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index fc0c502d9fd1..ca2518e0574e 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -100,6 +100,9 @@ enum {
100#define HCISETACLMTU _IOW('H', 227, int) 100#define HCISETACLMTU _IOW('H', 227, int)
101#define HCISETSCOMTU _IOW('H', 228, int) 101#define HCISETSCOMTU _IOW('H', 228, int)
102 102
103#define HCIBLOCKADDR _IOW('H', 230, int)
104#define HCIUNBLOCKADDR _IOW('H', 231, int)
105
103#define HCIINQUIRY _IOR('H', 240, int) 106#define HCIINQUIRY _IOR('H', 240, int)
104 107
105/* HCI timeouts */ 108/* HCI timeouts */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index e42f6ed5421c..ffc637748b87 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -62,6 +62,11 @@ struct hci_conn_hash {
62 unsigned int sco_num; 62 unsigned int sco_num;
63}; 63};
64 64
65struct bdaddr_list {
66 struct list_head list;
67 bdaddr_t bdaddr;
68};
69
65struct hci_dev { 70struct hci_dev {
66 struct list_head list; 71 struct list_head list;
67 spinlock_t lock; 72 spinlock_t lock;
@@ -127,6 +132,7 @@ struct hci_dev {
127 132
128 struct inquiry_cache inq_cache; 133 struct inquiry_cache inq_cache;
129 struct hci_conn_hash conn_hash; 134 struct hci_conn_hash conn_hash;
135 struct bdaddr_list blacklist;
130 136
131 struct hci_dev_stats stat; 137 struct hci_dev_stats stat;
132 138
@@ -424,6 +430,9 @@ int hci_get_conn_info(struct hci_dev *hdev, void __user *arg);
424int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); 430int hci_get_auth_info(struct hci_dev *hdev, void __user *arg);
425int hci_inquiry(void __user *arg); 431int hci_inquiry(void __user *arg);
426 432
433struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
434int hci_blacklist_clear(struct hci_dev *hdev);
435
427void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 436void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
428 437
429int hci_recv_frame(struct sk_buff *skb); 438int hci_recv_frame(struct sk_buff *skb);