Patchwork [Precise,1/2] UBUNTU: SAUCE: Bluetooth: Getting ID from descriptor instead of matched rule

login
register
mail settings
Submitter Jesse Sung
Date Oct. 23, 2012, 9:05 a.m.
Message ID <1350983101-11956-1-git-send-email-jesse.sung@canonical.com>
Download mbox | patch
Permalink /patch/193398/
State New
Headers show

Comments

Jesse Sung - Oct. 23, 2012, 9:05 a.m.
From: Wen-chien Jesse Sung <jesse.sung@canonical.com>

BugLink: https://launchpad.net/bugs/1065400

Since the matched rule could be specified by
USB_VENDOR_AND_INTERFACE_INFO() instead of USB_DEVICE(),
use the ID in descriptor to make sure we can really get
the correct one.

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
 drivers/bluetooth/btusb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Brad Figg - Oct. 23, 2012, 3:18 p.m.
On 10/23/2012 02:05 AM, Jesse Sung wrote:
> From: Wen-chien Jesse Sung <jesse.sung@canonical.com>
>
> BugLink: https://launchpad.net/bugs/1065400
>
> Since the matched rule could be specified by
> USB_VENDOR_AND_INTERFACE_INFO() instead of USB_DEVICE(),
> use the ID in descriptor to make sure we can really get
> the correct one.
>
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
> ---
>   drivers/bluetooth/btusb.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 96baae6..ba88eb4 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -944,7 +944,8 @@ static void btusb_load_firmware(struct hci_dev *hdev)
>   		return;
>
>   	snprintf(filename, PATCHRAM_NAME_LEN, "fw-%04x_%04x.hcd",
> -			id->idVendor, id->idProduct);
> +			le16_to_cpu(udev->descriptor.idVendor),
> +			le16_to_cpu(udev->descriptor.idProduct));
>   	if (request_firmware(&fw, (const char *) filename, &udev->dev) < 0) {
>   		BT_INFO("can't load firmware, may not work correctly");
>   		return;
>

Have these patches been sent upstream?
Tim Gardner - Oct. 23, 2012, 4:03 p.m.

Jesse Sung - Oct. 24, 2012, 9:39 a.m.
2012/10/23 Brad Figg <brad.figg@canonical.com>:
> On 10/23/2012 02:05 AM, Jesse Sung wrote:
>>
>> From: Wen-chien Jesse Sung <jesse.sung@canonical.com>
>>
>> BugLink: https://launchpad.net/bugs/1065400
>>
>> Since the matched rule could be specified by
>> USB_VENDOR_AND_INTERFACE_INFO() instead of USB_DEVICE(),
>> use the ID in descriptor to make sure we can really get
>> the correct one.
>>
>> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
>> ---
>>   drivers/bluetooth/btusb.c |    3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>> index 96baae6..ba88eb4 100644
>> --- a/drivers/bluetooth/btusb.c
>> +++ b/drivers/bluetooth/btusb.c
>> @@ -944,7 +944,8 @@ static void btusb_load_firmware(struct hci_dev *hdev)
>>                 return;
>>
>>         snprintf(filename, PATCHRAM_NAME_LEN, "fw-%04x_%04x.hcd",
>> -                       id->idVendor, id->idProduct);
>> +                       le16_to_cpu(udev->descriptor.idVendor),
>> +                       le16_to_cpu(udev->descriptor.idProduct));
>>         if (request_firmware(&fw, (const char *) filename, &udev->dev) <
>> 0) {
>>                 BT_INFO("can't load firmware, may not work correctly");
>>                 return;
>>
>
> Have these patches been sent upstream?

These are against previous broadcom patchram patches, which are rejected
by upstream [1]. So they will not be sent upstream.

[1] http://marc.info/?t=134933604300005&r=1&w=2

Patch

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 96baae6..ba88eb4 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -944,7 +944,8 @@  static void btusb_load_firmware(struct hci_dev *hdev)
 		return;
 
 	snprintf(filename, PATCHRAM_NAME_LEN, "fw-%04x_%04x.hcd",
-			id->idVendor, id->idProduct);
+			le16_to_cpu(udev->descriptor.idVendor),
+			le16_to_cpu(udev->descriptor.idProduct));
 	if (request_firmware(&fw, (const char *) filename, &udev->dev) < 0) {
 		BT_INFO("can't load firmware, may not work correctly");
 		return;