diff options
Diffstat (limited to 'include/net/bluetooth/bluetooth.h')
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 38d8a34d3589..42844d7b154a 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -122,12 +122,28 @@ struct bt_voice { | |||
122 | __printf(1, 2) | 122 | __printf(1, 2) |
123 | void bt_info(const char *fmt, ...); | 123 | void bt_info(const char *fmt, ...); |
124 | __printf(1, 2) | 124 | __printf(1, 2) |
125 | void bt_warn(const char *fmt, ...); | ||
126 | __printf(1, 2) | ||
125 | void bt_err(const char *fmt, ...); | 127 | void bt_err(const char *fmt, ...); |
128 | __printf(1, 2) | ||
129 | void bt_err_ratelimited(const char *fmt, ...); | ||
126 | 130 | ||
127 | #define BT_INFO(fmt, ...) bt_info(fmt "\n", ##__VA_ARGS__) | 131 | #define BT_INFO(fmt, ...) bt_info(fmt "\n", ##__VA_ARGS__) |
132 | #define BT_WARN(fmt, ...) bt_warn(fmt "\n", ##__VA_ARGS__) | ||
128 | #define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__) | 133 | #define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__) |
129 | #define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__) | 134 | #define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__) |
130 | 135 | ||
136 | #define BT_ERR_RATELIMITED(fmt, ...) bt_err_ratelimited(fmt "\n", ##__VA_ARGS__) | ||
137 | |||
138 | #define bt_dev_info(hdev, fmt, ...) \ | ||
139 | BT_INFO("%s: " fmt, (hdev)->name, ##__VA_ARGS__) | ||
140 | #define bt_dev_warn(hdev, fmt, ...) \ | ||
141 | BT_WARN("%s: " fmt, (hdev)->name, ##__VA_ARGS__) | ||
142 | #define bt_dev_err(hdev, fmt, ...) \ | ||
143 | BT_ERR("%s: " fmt, (hdev)->name, ##__VA_ARGS__) | ||
144 | #define bt_dev_dbg(hdev, fmt, ...) \ | ||
145 | BT_DBG("%s: " fmt, (hdev)->name, ##__VA_ARGS__) | ||
146 | |||
131 | /* Connection and socket states */ | 147 | /* Connection and socket states */ |
132 | enum { | 148 | enum { |
133 | BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */ | 149 | BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */ |
@@ -280,22 +296,22 @@ typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode); | |||
280 | typedef void (*hci_req_complete_skb_t)(struct hci_dev *hdev, u8 status, | 296 | typedef void (*hci_req_complete_skb_t)(struct hci_dev *hdev, u8 status, |
281 | u16 opcode, struct sk_buff *skb); | 297 | u16 opcode, struct sk_buff *skb); |
282 | 298 | ||
283 | struct req_ctrl { | 299 | struct hci_ctrl { |
284 | bool start; | 300 | __u16 opcode; |
285 | u8 event; | 301 | bool req_start; |
286 | hci_req_complete_t complete; | 302 | u8 req_event; |
287 | hci_req_complete_skb_t complete_skb; | 303 | hci_req_complete_t req_complete; |
304 | hci_req_complete_skb_t req_complete_skb; | ||
288 | }; | 305 | }; |
289 | 306 | ||
290 | struct bt_skb_cb { | 307 | struct bt_skb_cb { |
291 | __u8 pkt_type; | 308 | __u8 pkt_type; |
292 | __u8 force_active; | 309 | __u8 force_active; |
293 | __u16 opcode; | ||
294 | __u16 expect; | 310 | __u16 expect; |
295 | __u8 incoming:1; | 311 | __u8 incoming:1; |
296 | union { | 312 | union { |
297 | struct l2cap_ctrl l2cap; | 313 | struct l2cap_ctrl l2cap; |
298 | struct req_ctrl req; | 314 | struct hci_ctrl hci; |
299 | }; | 315 | }; |
300 | }; | 316 | }; |
301 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) | 317 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) |