aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-03-30 16:21:02 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-03-30 17:20:53 -0400
commitdb6e3e8d016823c6b0f773c70a69ce65807d8a44 (patch)
tree89201941c7f39ed13d843de4c65ce8ab230e702e /include/net/bluetooth
parenta4368ff3ed3b57e4b5e36d83b75604f68bbcdaad (diff)
Bluetooth: Refactor HCI request variables into own struct
In order to shrink the size of bt_skb_cb, this patch moves the HCI request related variables into their own req_ctrl struct. Additionall the L2CAP and HCI request structs are placed inside the same union since they will never be used at the same time for the same skb. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/bluetooth.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index d8367cc7c76e..eeaff4b5cb62 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -278,16 +278,22 @@ struct hci_dev;
278 278
279typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode); 279typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode);
280 280
281struct req_ctrl {
282 bool start;
283 u8 event;
284 hci_req_complete_t complete;
285};
286
281struct bt_skb_cb { 287struct bt_skb_cb {
282 __u8 pkt_type; 288 __u8 pkt_type;
283 __u8 force_active; 289 __u8 force_active;
284 __u16 opcode; 290 __u16 opcode;
285 __u16 expect; 291 __u16 expect;
286 __u8 incoming:1; 292 __u8 incoming:1;
287 __u8 req_start:1; 293 union {
288 u8 req_event; 294 struct l2cap_ctrl l2cap;
289 hci_req_complete_t req_complete; 295 struct req_ctrl req;
290 struct l2cap_ctrl l2cap; 296 };
291}; 297};
292#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) 298#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
293 299