Skip to contentSkip to conversation

Bluetooth: Make bt_cb()->pkt_type and bt_cb()->except HCI specific

PATCH In review Marcel Holtmann 1 participant 2 messages Nov 5, 2015 – Nov 6, 2015

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Make bt_cb()->pkt_type and bt_cb()->except HCI specific

The two fields for pkt_type and expect inside the bt_cb() structure are highly HCI specific and only used by HCI drivers. So instead of keeping them global, move them into the union entry for HCI.

---
 include/net/bluetooth/bluetooth.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/net/bluetooth/bluetooth.h +4 -4
index 8d38f411009c..8afa7534248e 100644
@@ -300,6 +300,8 @@ typedef void (*hci_req_complete_skb_t)(struct hci_dev *hdev, u8 status,
 #define HCI_REQ_SKB	BIT(1)
 
 struct hci_ctrl {
+	__u8 pkt_type;
+	__u16 expect;
 	__u16 opcode;
 	u8 req_flags;
 	u8 req_event;
@@ -310,9 +312,7 @@ struct hci_ctrl {
 };
 
 struct bt_skb_cb {
-	__u8 pkt_type;
 	__u8 force_active;
-	__u16 expect;
 	__u8 incoming:1;
 	union {
 		struct l2cap_ctrl l2cap;
@@ -321,8 +321,8 @@ struct bt_skb_cb {
 };
 #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
 
-#define hci_skb_pkt_type(skb) bt_cb((skb))->pkt_type
-#define hci_skb_expect(skb) bt_cb((skb))->expect
+#define hci_skb_pkt_type(skb) bt_cb((skb))->hci.pkt_type
+#define hci_skb_expect(skb) bt_cb((skb))->hci.expect
 #define hci_skb_opcode(skb) bt_cb((skb))->hci.opcode
 
 static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how)
Signature · 1 line
2.5.0
author maintainer
#1 lore raw

Hi Johan,

Quoted 8 lines

The two fields for pkt_type and expect inside the bt_cb() structure are highly HCI specific and only used by HCI drivers. So instead of keeping them global, move them into the union entry for HCI.

---
include/net/bluetooth/bluetooth.h | 8 ++++----

1 file changed, 4 insertions(+), 4 deletions(-)

actually there might be some side affects with this patch. I have not tracked down if it is this one or some of my experimental patches. However I do not think it is safe to apply this one at the moment.

Regards

Marcel