Rename hci_recv_fragment to hci_recv_packet_fragment
Subsystems (2)
PATCH 1/3 Rename hci_recv_fragment to hci_recv_packet_fragment
Renaming hci_recv_fragment to hci_recv_packet_fragment as it will be used only for reassembling HCI fragments with know packet type.
--- include/net/bluetooth/hci_core.h | 3 ++- net/bluetooth/hci_core.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)
include/net/bluetooth/hci_core.h +2 -1
@@ -427,7 +427,8 @@ int hci_inquiry(void __user *arg);void hci_event_packet (struct hci_dev *hdev,struct sk_buff *skb);int hci_recv_frame (struct sk_buff *skb); -int hci_recv_fragment (struct hci_dev *hdev,int type,void *data,int count); +int hci_recv_packet_fragment (struct hci_dev *hdev,int type,void *data, +int count);int hci_register_sysfs (struct hci_dev *hdev);void hci_unregister_sysfs (struct hci_dev *hdev);
net/bluetooth/hci_core.c +3 -2
@@ -1033,7 +1033,8 @@ EXPORT_SYMBOL(hci_recv_frame);/* Receive packet type fragment */ #define __reassembly (hdev, type) ((hdev)->reassembly[(type) - 2]) -int hci_recv_fragment (struct hci_dev *hdev,int type,void *data,int count) +int hci_recv_packet_fragment (struct hci_dev *hdev,int type,void *data, +int count) {if (type <HCI_ACLDATA_PKT || type >HCI_EVENT_PKT )return -EILSEQ ;
@@ -1112,7 +1113,7 @@ int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count)return 0 ; } -EXPORT_SYMBOL (hci_recv_fragment); +EXPORT_SYMBOL (hci_recv_packet_fragment);/* ---- Interface to upper protocols ---- */
Signature · 1 line
1.7.0
PATCH 2/3 Replace hci_recv_fragment calls
Replace all usages of hci_recv_fragment calls with hci_recv_packet_fragment
--- drivers/bluetooth/btusb.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/bluetooth/btusb.c +3 -3
@@ -211,7 +211,7 @@ static void btusb_intr_complete(struct urb *urb)if (urb->status ==0 ) { hdev->stat.byte_rx += urb->actual_length; -if (hci_recv_fragment (hdev,HCI_EVENT_PKT , +if (hci_recv_packet_fragment (hdev,HCI_EVENT_PKT , urb->transfer_buffer, urb->actual_length) <0 ) {BT_ERR ("%s corrupted event packet" , hdev->name);
@@ -295,7 +295,7 @@ static void btusb_bulk_complete(struct urb *urb)if (urb->status ==0 ) { hdev->stat.byte_rx += urb->actual_length; -if (hci_recv_fragment (hdev,HCI_ACLDATA_PKT , +if (hci_recv_packet_fragment (hdev,HCI_ACLDATA_PKT , urb->transfer_buffer, urb->actual_length) <0 ) {BT_ERR ("%s corrupted ACL packet" , hdev->name);
@@ -384,7 +384,7 @@ static void btusb_isoc_complete(struct urb *urb) hdev->stat.byte_rx += length; -if (hci_recv_fragment (hdev,HCI_SCODATA_PKT , +if (hci_recv_packet_fragment (hdev,HCI_SCODATA_PKT , urb->transfer_buffer + offset, length) <0 ) {BT_ERR ("%s corrupted SCO packet" , hdev->name);
Signature · 1 line
1.7.0
PATCH 3/3 frame reassembly implementation for data from stream
Implemented hci_recv_stream_fragment to reassemble HCI packets received from a data stream with packet type not known.
--- include/net/bluetooth/hci_core.h | 1 + net/bluetooth/hci_core.c | 104 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 0 deletions(-)
include/net/bluetooth/hci_core.h +1 -0
@@ -429,6 +429,7 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);int hci_recv_frame (struct sk_buff *skb);int hci_recv_packet_fragment (struct hci_dev *hdev,int type,void *data,int count); +int hci_recv_stream_fragment (struct hci_dev *hdev,void *data,int count);int hci_register_sysfs (struct hci_dev *hdev);void hci_unregister_sysfs (struct hci_dev *hdev);
net/bluetooth/hci_core.c +104 -0
110 lines not on this page · raw message
Signature · 1 line
1.7.0
RE: [PATCH 2/3] Replace hci_recv_fragment calls
In reply to surajYou want to unify patches 1 and 2. Patches upstream should be atomic so tha= t if you apply it, it should make everything still work. Your first patch = removes hci_recv_fragment() and then this one fixes the places that call it= , you want to do both in one shot.
Luis
________________________________________
From: Suraj Sumangala
Sent: Tuesday, June 01, 2010 1:08 AM
To: [email protected]
Cc: [email protected]; Luis Rodriguez; Jothikumar Mothilal
Subject: [PATCH 2/3] Replace hci_recv_fragment calls
Replace all usages of hci_recv_fragment calls with hci_recv_packet_fragment
--- drivers/bluetooth/btusb.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/bluetooth/btusb.c +3 -3
@@ -211,7 +211,7 @@ static void btusb_intr_complete(struct urb *urb) if (urb->status =3D=3D 0) { hdev->stat.byte_rx +=3D urb->actual_length; -if (hci_recv_fragment (hdev,HCI_EVENT_PKT , +if (hci_recv_packet_fragment (hdev,HCI_EVENT_PKT , urb->transfer_buffer, urb->actual_length) <0 ) {BT_ERR ("%s corrupted event packet" , hdev->name);
@@ -295,7 +295,7 @@ static void btusb_bulk_complete(struct urb *urb) if (urb->status =3D=3D 0) { hdev->stat.byte_rx +=3D urb->actual_length; -if (hci_recv_fragment (hdev,HCI_ACLDATA_PKT , +if (hci_recv_packet_fragment (hdev,HCI_ACLDATA_PKT , urb->transfer_buffer, urb->actual_length) <0 ) {BT_ERR ("%s corrupted ACL packet" , hdev->name);
@@ -384,7 +384,7 @@ static void btusb_isoc_complete(struct urb *urb) hdev->stat.byte_rx +=3D length; - if (hci_recv_fragment(hdev, HCI_SCODATA_PKT, + if (hci_recv_packet_fragment(hdev, HCI_SCODATA_PKT, urb->transfer_buffer + offs=
et,
length) < 0=
) {
BT_ERR("%s corrupted SCO packet", hdev->nam=e);
--
1.7.0
Marcel Holtmann
maintainerRE: [PATCH 2/3] Replace hci_recv_fragment calls
Hi Luis,
Quoted 1 line
You want to unify patches 1 and 2. Patches upstream should be atomic so that if you apply it, it should make everything still work. Your first patch removes
hci_recv_fragment()and then this one fixes the places that call it, you want to do both in one shot.
actually I prefer to leave these two patches out for now. Since the renaming could be done easily later. The important part is actually the other implementation.
Regards
Marcel
Re: [PATCH 2/3] Replace hci_recv_fragment calls
Quoted 7 lines · Marcel Holtmann
Hi Luis,
Quoted 1 line
You want to unify patches 1 and 2. Patches upstream should be atomic so that if you apply it, it should make everything still work. Your first patch removes
hci_recv_fragment()and then this one fixes the places that call it, you want to do both in one shot.actually I prefer to leave these two patches out for now. Since the renaming could be done easily later. The important part is actually the other implementation.
Won't that break compilation on the first patch since all existing code users no longer have the exported symbol available?
Luis
Marcel Holtmann
maintainerRe: [PATCH 2/3] Replace hci_recv_fragment calls
Hi Luis,
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
You want to unify patches 1 and 2. Patches upstream should be atomic so that if you apply it, it should make everything still work. Your first patch removes
hci_recv_fragment()and then this one fixes the places that call it, you want to do both in one shot.actually I prefer to leave these two patches out for now. Since the renaming could be done easily later. The important part is actually the other implementation.
Won't that break compilation on the first patch since all existing code users no longer have the exported symbol available?
no. The important change here is for the H4 specific stream fragment handling. The rest is just a renaming. So 3/3 is the important patch and 1/2 and 2/2 are just cosmetic changes.
Regards
Marcel
Re: [PATCH 2/3] Replace hci_recv_fragment calls
Hi Marcel,
Quoted 11 lines · Marcel Holtmann
Hi Luis,
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
You want to unify patches 1 and 2. Patches upstream should be atomic so that if you apply it, it should make everything still work. Your first patch removes
hci_recv_fragment()and then this one fixes the places that call it, you want to do both in one shot.actually I prefer to leave these two patches out for now. Since the renaming could be done easily later. The important part is actually the other implementation.
Won't that break compilation on the first patch since all existing code users no longer have the exported symbol available?
Quoted 9 lines
no. The important change here is for the H4 specific stream fragment handling. The rest is just a renaming. So 3/3 is the important patch and 1/2 and 2/2 are just cosmetic changes.
Regards
Marcel
I will send 3/3 as a separate patch for you to verify.
Regards
Suraj