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>
This commit is contained in:

committed by
Marcel Holtmann

parent
a4368ff3ed
commit
db6e3e8d01
@@ -278,16 +278,22 @@ struct hci_dev;
|
||||
|
||||
typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode);
|
||||
|
||||
struct req_ctrl {
|
||||
bool start;
|
||||
u8 event;
|
||||
hci_req_complete_t complete;
|
||||
};
|
||||
|
||||
struct bt_skb_cb {
|
||||
__u8 pkt_type;
|
||||
__u8 force_active;
|
||||
__u16 opcode;
|
||||
__u16 expect;
|
||||
__u8 incoming:1;
|
||||
__u8 req_start:1;
|
||||
u8 req_event;
|
||||
hci_req_complete_t req_complete;
|
||||
struct l2cap_ctrl l2cap;
|
||||
union {
|
||||
struct l2cap_ctrl l2cap;
|
||||
struct req_ctrl req;
|
||||
};
|
||||
};
|
||||
#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
|
||||
|
||||
|
Reference in New Issue
Block a user