aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/bluetooth.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/bluetooth/bluetooth.h')
-rw-r--r--include/net/bluetooth/bluetooth.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 43750439c52..e727555d4ee 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -56,6 +56,7 @@
56#define BT_SECURITY 4 56#define BT_SECURITY 4
57struct bt_security { 57struct bt_security {
58 __u8 level; 58 __u8 level;
59 __u8 key_size;
59}; 60};
60#define BT_SECURITY_SDP 0 61#define BT_SECURITY_SDP 0
61#define BT_SECURITY_LOW 1 62#define BT_SECURITY_LOW 1
@@ -69,9 +70,19 @@ struct bt_security {
69#define BT_FLUSHABLE_OFF 0 70#define BT_FLUSHABLE_OFF 0
70#define BT_FLUSHABLE_ON 1 71#define BT_FLUSHABLE_ON 1
71 72
72#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg) 73#define BT_POWER 9
73#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg) 74struct bt_power {
74#define BT_DBG(fmt, arg...) pr_debug("%s: " fmt "\n" , __func__ , ## arg) 75 __u8 force_active;
76};
77#define BT_POWER_FORCE_ACTIVE_OFF 0
78#define BT_POWER_FORCE_ACTIVE_ON 1
79
80__attribute__((format (printf, 2, 3)))
81int bt_printk(const char *level, const char *fmt, ...);
82
83#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg)
84#define BT_ERR(fmt, arg...) bt_printk(KERN_ERR, pr_fmt(fmt), ##arg)
85#define BT_DBG(fmt, arg...) pr_debug(fmt "\n", ##arg)
75 86
76/* Connection and socket states */ 87/* Connection and socket states */
77enum { 88enum {
@@ -130,7 +141,8 @@ int bt_sock_register(int proto, const struct net_proto_family *ops);
130int bt_sock_unregister(int proto); 141int bt_sock_unregister(int proto);
131void bt_sock_link(struct bt_sock_list *l, struct sock *s); 142void bt_sock_link(struct bt_sock_list *l, struct sock *s);
132void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); 143void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
133int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); 144int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
145 struct msghdr *msg, size_t len, int flags);
134int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, 146int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
135 struct msghdr *msg, size_t len, int flags); 147 struct msghdr *msg, size_t len, int flags);
136uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); 148uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait);
@@ -150,6 +162,7 @@ struct bt_skb_cb {
150 __u8 retries; 162 __u8 retries;
151 __u8 sar; 163 __u8 sar;
152 unsigned short channel; 164 unsigned short channel;
165 __u8 force_active;
153}; 166};
154#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) 167#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
155 168
@@ -164,8 +177,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how)
164 return skb; 177 return skb;
165} 178}
166 179
167static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, unsigned long len, 180static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk,
168 int nb, int *err) 181 unsigned long len, int nb, int *err)
169{ 182{
170 struct sk_buff *skb; 183 struct sk_buff *skb;
171 184
@@ -195,7 +208,7 @@ out:
195 return NULL; 208 return NULL;
196} 209}
197 210
198int bt_err(__u16 code); 211int bt_to_errno(__u16 code);
199 212
200extern int hci_sock_init(void); 213extern int hci_sock_init(void);
201extern void hci_sock_cleanup(void); 214extern void hci_sock_cleanup(void);