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.h40
1 files changed, 34 insertions, 6 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 4a82ca0bb0b2..262ebd1747d4 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -109,12 +109,14 @@ struct bt_power {
109 */ 109 */
110#define BT_CHANNEL_POLICY_AMP_PREFERRED 2 110#define BT_CHANNEL_POLICY_AMP_PREFERRED 2
111 111
112__printf(2, 3) 112__printf(1, 2)
113int bt_printk(const char *level, const char *fmt, ...); 113int bt_info(const char *fmt, ...);
114__printf(1, 2)
115int bt_err(const char *fmt, ...);
114 116
115#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg) 117#define BT_INFO(fmt, ...) bt_info(fmt "\n", ##__VA_ARGS__)
116#define BT_ERR(fmt, arg...) bt_printk(KERN_ERR, pr_fmt(fmt), ##arg) 118#define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__)
117#define BT_DBG(fmt, arg...) pr_debug(fmt "\n", ##arg) 119#define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__)
118 120
119/* Connection and socket states */ 121/* Connection and socket states */
120enum { 122enum {
@@ -129,6 +131,33 @@ enum {
129 BT_CLOSED 131 BT_CLOSED
130}; 132};
131 133
134/* If unused will be removed by compiler */
135static inline const char *state_to_string(int state)
136{
137 switch (state) {
138 case BT_CONNECTED:
139 return "BT_CONNECTED";
140 case BT_OPEN:
141 return "BT_OPEN";
142 case BT_BOUND:
143 return "BT_BOUND";
144 case BT_LISTEN:
145 return "BT_LISTEN";
146 case BT_CONNECT:
147 return "BT_CONNECT";
148 case BT_CONNECT2:
149 return "BT_CONNECT2";
150 case BT_CONFIG:
151 return "BT_CONFIG";
152 case BT_DISCONN:
153 return "BT_DISCONN";
154 case BT_CLOSED:
155 return "BT_CLOSED";
156 }
157
158 return "invalid state";
159}
160
132/* BD Address */ 161/* BD Address */
133typedef struct { 162typedef struct {
134 __u8 b[6]; 163 __u8 b[6];
@@ -193,7 +222,6 @@ struct bt_skb_cb {
193 __u16 tx_seq; 222 __u16 tx_seq;
194 __u8 retries; 223 __u8 retries;
195 __u8 sar; 224 __u8 sar;
196 unsigned short channel;
197 __u8 force_active; 225 __u8 force_active;
198}; 226};
199#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) 227#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))