Re: [bluetooth] linux-3.x regression (bisected)

From: Rene Herman
Date: Wed Jan 04 2012 - 10:12:22 EST


On 04-01-12 15:16, Andre Guedes wrote:

Any word on a final fix for this?

Yes,this couple of patches fixes this issue:
http://article.gmane.org/gmane.linux.bluez.kernel/19950/
http://article.gmane.org/gmane.linux.bluez.kernel/19951/

They were already pushed to bluetooth-next tree.

Thank you. Just in case anyone cares, versions against 3.1.7 re-attached (and confirmed, of course).

Regards,
Rene

[PATCH 1/2] Bluetooth: Rename extfeatures

From: Andre Guedes <aguedespe@xxxxxxxxx>

This patch renames hdev->extfeatures to hdev->host_features since it
holds the extended features Page 1 (aka host features).

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 8f441b8..61deef8 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -130,7 +130,7 @@ struct hci_dev {
__u8 major_class;
__u8 minor_class;
__u8 features[8];
- __u8 extfeatures[8];
+ __u8 host_features[8];
__u8 commands[64];
__u8 ssp_mode;
__u8 hci_ver;
@@ -601,7 +601,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)

/* ----- Extended LMP capabilities ----- */
-#define lmp_host_le_capable(dev) ((dev)->extfeatures[0] & LMP_HOST_LE)
+#define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE)

/* ----- HCI protocols ----- */
struct hci_proto {
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 7ef4eb4..6a09143 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -695,7 +695,7 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
if (rp->status)
return;

- memcpy(hdev->extfeatures, rp->features, 8);
+ memcpy(hdev->host_features, rp->features, 8);

hci_req_complete(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES, rp->status);
}
[PATCH 2/2] Bluetooh: Fix hci_cc_read_local_ext_features()

From: Andre Guedes <aguedespe@xxxxxxxxx>

Copy the Features value according to the Page number.

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 6a09143..9ef6012 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -695,7 +695,14 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
if (rp->status)
return;

- memcpy(hdev->host_features, rp->features, 8);
+ switch (rp->page) {
+ case 0:
+ memcpy(hdev->features, rp->features, 8);
+ break;
+ case 1:
+ memcpy(hdev->host_features, rp->features, 8);
+ break;
+ }

hci_req_complete(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES, rp->status);
}