Skip to contentSkip to conversation

Bluetooth: Provide access to reassembled Rx packets

RFC Superseded Suraj Sumangala 2 participants 3 messages Jul 26, 2010

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC 1/1 Bluetooth: Provide access to reassembled Rx packets

Provide the HCI transport driver access to reassembled Rx packets before sending to Host.

---
 include/net/bluetooth/hci_core.h |    1 +
 net/bluetooth/hci_core.c         |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
include/net/bluetooth/hci_core.h +1 -0
index 350b3e6..769530b 100644
@@ -156,6 +156,7 @@ struct hci_dev {
 	int (*close)(struct hci_dev *hdev);
 	int (*flush)(struct hci_dev *hdev);
 	int (*send)(struct sk_buff *skb);
+	int (*recv)(struct hci_dev *hdev, struct sk_buff *skb);
 	void (*destruct)(struct hci_dev *hdev);
 	void (*notify)(struct hci_dev *hdev, unsigned int evt);
 	int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
net/bluetooth/hci_core.c +4 -0
index 995c9f9..8d74f9d 100644
@@ -1132,6 +1132,10 @@ static int hci_reassembly(struct hci_dev *hdev, int type, void *data,
 			/* Complete frame */
 
 			bt_cb(skb)->pkt_type = type;
+
+			if (hdev->recv)
+				hdev->recv(hdev, skb);
+
 			hci_recv_frame(skb);
 
 			hdev->reassembly[index] = NULL;
Signature · 1 line
1.7.0.4
maintainer
#1 lore raw

Hi Suraj,

Quoted 14 lines

Provide the HCI transport driver access to reassembled Rx packets before sending to Host.

---
 include/net/bluetooth/hci_core.h |    1 +
 net/bluetooth/hci_core.c         |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
include/net/bluetooth/hci_core.h +0 -0
index 350b3e6..769530b 100644

include/net/bluetooth/hci_core.h struct hci_dev { · line 159

Quoted 4 lines
include/net/bluetooth/hci_core.h +1 -0
@@ -156,6 +156,7 @@ struct hci_dev {
 	int (*close)(struct hci_dev *hdev);
 	int (*flush)(struct hci_dev *hdev);
 	int (*send)(struct sk_buff *skb);
+	int (*recv)(struct hci_dev *hdev, struct sk_buff *skb);

besides the fact that skb->dev == hdev, why would be doing something like this? This is highly inefficient.

Regards

Marcel

author
#2 lore raw

Hi Marcel,

Quoted 11 lines · Marcel Holtmann

Hi Suraj,

Quoted 9 lines

Provide the HCI transport driver access to reassembled Rx packets before sending to Host.

---
  include/net/bluetooth/hci_core.h |    1 +
  net/bluetooth/hci_core.c         |    4 ++++
  2 files changed, 5 insertions(+), 0 deletions(-)
Quoted 12 lines

include/net/bluetooth/hci_core.h struct hci_dev { · line 159

Quoted 9 lines
include/net/bluetooth/hci_core.h +1 -0
index 350b3e6..769530b 100644
@@ -156,6 +156,7 @@ struct hci_dev {
  	int (*close)(struct hci_dev *hdev);
  	int (*flush)(struct hci_dev *hdev);
  	int (*send)(struct sk_buff *skb);
+	int (*recv)(struct hci_dev *hdev, struct sk_buff *skb);

besides the fact that skb->dev == hdev, why would be doing something like this? This is highly inefficient.

The idea was to provide the driver access the hci_dev structure.
Yes, as long as we have "skb->dev == hdev", called should be able to extract it from the skbuff.

Quoted 5 lines

Regards

Marcel

Regards
Suraj