All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bluetooth: btusb: Add support for BCM2045 HCI with vend:prod ids set to 0000:0000
@ 2017-07-06 14:08 Hans de Goede
  2017-07-06 15:22 ` Marcel Holtmann
  2017-07-07 11:30 ` Marcel Holtmann
  0 siblings, 2 replies; 6+ messages in thread
From: Hans de Goede @ 2017-07-06 14:08 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: Hans de Goede, linux-bluetooth

The GPD Pocket is shipping with a BCM2045 USB HCI with its vend:prod
ids set to 0000:0000 and also has its interface class set to 255 (Vendor
Specific Class).

Which, well sucks. Luckily it does advertise usable manufacturer and
product strings, so this commit adds 0000:0000 to the usb_device_id
table, with a special flag of BTUSB_BCM2045_0000_0000, if this flag
is set btusb_probe will check the strings and if they don't match
return -ENODEV.

This is not pretty, but it fixes bluetooth not working under Linux.

Reported-and-tested-by: Christopher Williamson <home@chrisaw.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/btusb.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 7fa373b428f8..9c3201c0525d 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -66,6 +66,7 @@ static struct usb_driver btusb_driver;
 #define BTUSB_BCM2045		0x40000
 #define BTUSB_IFNUM_2		0x80000
 #define BTUSB_CW6622		0x100000
+#define BTUSB_BCM2045_0000_0000	0x200000
 
 static const struct usb_device_id btusb_table[] = {
 	/* Generic Bluetooth USB device */
@@ -124,6 +125,10 @@ static const struct usb_device_id btusb_table[] = {
 	/* Canyon CN-BTU1 with HID interfaces */
 	{ USB_DEVICE(0x0c10, 0x0000) },
 
+	/* Broadcom BCM2045 with the prod:vend ids not filled GRRR */
+	{ USB_DEVICE(0x0000, 0x0000),
+	  .driver_info = BTUSB_BCM2045 | BTUSB_BCM2045_0000_0000 },
+
 	/* Broadcom BCM20702A0 */
 	{ USB_DEVICE(0x413c, 0x8197) },
 
@@ -2887,6 +2892,16 @@ static int btusb_probe(struct usb_interface *intf,
 	if (id->driver_info == BTUSB_IGNORE)
 		return -ENODEV;
 
+	if (id->driver_info & BTUSB_BCM2045_0000_0000) {
+		struct usb_device *udev = interface_to_usbdev(intf);
+
+		/* Device with prod:vend id set to 0000:0000, check strings */
+		if (!udev->manufacturer || !udev->product ||
+		    strcmp(udev->manufacturer, "Broadcom Corp") != 0 ||
+		    strcmp(udev->product, "BCM2045A0") != 0)
+			return -ENODEV;
+	}
+
 	if (id->driver_info & BTUSB_ATH3012) {
 		struct usb_device *udev = interface_to_usbdev(intf);
 
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] bluetooth: btusb: Add support for BCM2045 HCI with vend:prod ids set to 0000:0000
  2017-07-06 14:08 [PATCH] bluetooth: btusb: Add support for BCM2045 HCI with vend:prod ids set to 0000:0000 Hans de Goede
@ 2017-07-06 15:22 ` Marcel Holtmann
  2017-07-06 16:43   ` Hans de Goede
  2017-07-07 11:30 ` Marcel Holtmann
  1 sibling, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2017-07-06 15:22 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth

Hi Hans,

> The GPD Pocket is shipping with a BCM2045 USB HCI with its vend:prod
> ids set to 0000:0000 and also has its interface class set to 255 (Vendor
> Specific Class).
> 
> Which, well sucks. Luckily it does advertise usable manufacturer and
> product strings, so this commit adds 0000:0000 to the usb_device_id
> table, with a special flag of BTUSB_BCM2045_0000_0000, if this flag
> is set btusb_probe will check the strings and if they don't match
> return -ENODEV.
> 
> This is not pretty, but it fixes bluetooth not working under Linux.

can you send around /sys/kernel/debug/usb/devices for this device.

Regards

Marcel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bluetooth: btusb: Add support for BCM2045 HCI with vend:prod ids set to 0000:0000
  2017-07-06 15:22 ` Marcel Holtmann
@ 2017-07-06 16:43   ` Hans de Goede
  2017-07-07  9:55     ` Christopher Williamson
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2017-07-06 16:43 UTC (permalink / raw)
  To: Christopher Williamson
  Cc: Marcel Holtmann, Gustavo F. Padovan, Johan Hedberg, linux-bluetooth

Hi all,

Christopher, can you do: "sudo cat /sys/kernel/debug/usb/devices"
and copy and paste the contents in a reply to this mail
(using reply-to-all) ?

On 06-07-17 17:22, Marcel Holtmann wrote:
> Hi Hans,
> 
>> The GPD Pocket is shipping with a BCM2045 USB HCI with its vend:prod
>> ids set to 0000:0000 and also has its interface class set to 255 (Vendor
>> Specific Class).
>>
>> Which, well sucks. Luckily it does advertise usable manufacturer and
>> product strings, so this commit adds 0000:0000 to the usb_device_id
>> table, with a special flag of BTUSB_BCM2045_0000_0000, if this flag
>> is set btusb_probe will check the strings and if they don't match
>> return -ENODEV.
>>
>> This is not pretty, but it fixes bluetooth not working under Linux.
> 
> can you send around /sys/kernel/debug/usb/devices for this device.

As you can see I've just asked the reported to provide this :)

I already have lsusb -v output for the btusb device:

Bus 001 Device 003: ID 0000:0000
Device Descriptor:
   bLength                18
   bDescriptorType         1
   bcdUSB               2.00
   bDeviceClass          255 Vendor Specific Class
   bDeviceSubClass         1
   bDeviceProtocol         1
   bMaxPacketSize0        64
   idVendor           0x0000
   idProduct          0x0000
   bcdDevice            1.12
   iManufacturer           1 Broadcom Corp
   iProduct                2 BCM2045A0
   iSerial                 3 AC83F30677CB
   bNumConfigurations      1
   Configuration Descriptor:
     bLength                 9
     bDescriptorType         2
     wTotalLength          218
     bNumInterfaces          4
     bConfigurationValue     1
     iConfiguration          0
     bmAttributes         0x80
       (Bus Powered)
     MaxPower              100mA
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        0
       bAlternateSetting       0
       bNumEndpoints           3
       bInterfaceClass       255 Vendor Specific Class
       bInterfaceSubClass      1
       bInterfaceProtocol      1
       iInterface              0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x81  EP 1 IN
         bmAttributes            3
           Transfer Type            Interrupt
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0010  1x 16 bytes
         bInterval               1
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x82  EP 2 IN
         bmAttributes            2
           Transfer Type            Bulk
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0040  1x 64 bytes
         bInterval               1
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x02  EP 2 OUT
         bmAttributes            2
           Transfer Type            Bulk
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0040  1x 64 bytes
         bInterval               1
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        1
       bAlternateSetting       0
       bNumEndpoints           2
       bInterfaceClass       255 Vendor Specific Class
       bInterfaceSubClass      1
       bInterfaceProtocol      1
       iInterface              0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x83  EP 3 IN
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0000  1x 0 bytes
         bInterval               1
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x03  EP 3 OUT
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0000  1x 0 bytes
         bInterval               1
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        1
       bAlternateSetting       1
       bNumEndpoints           2
       bInterfaceClass       255 Vendor Specific Class
       bInterfaceSubClass      1
       bInterfaceProtocol      1
       iInterface              0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x83  EP 3 IN
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0009  1x 9 bytes
         bInterval               1
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x03  EP 3 OUT
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0009  1x 9 bytes
         bInterval               1
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        1
       bAlternateSetting       2
       bNumEndpoints           2
       bInterfaceClass       255 Vendor Specific Class
       bInterfaceSubClass      1
       bInterfaceProtocol      1
       iInterface              0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x83  EP 3 IN
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0011  1x 17 bytes
         bInterval               1
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x03  EP 3 OUT
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0011  1x 17 bytes
         bInterval               1
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        1
       bAlternateSetting       3
       bNumEndpoints           2
       bInterfaceClass       255 Vendor Specific Class
       bInterfaceSubClass      1
       bInterfaceProtocol      1
       iInterface              0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x83  EP 3 IN
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0019  1x 25 bytes
         bInterval               1
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x03  EP 3 OUT
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0019  1x 25 bytes
         bInterval               1
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        1
       bAlternateSetting       4
       bNumEndpoints           2
       bInterfaceClass       255 Vendor Specific Class
       bInterfaceSubClass      1
       bInterfaceProtocol      1
       iInterface              0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x83  EP 3 IN
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0021  1x 33 bytes
         bInterval               1
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x03  EP 3 OUT
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0021  1x 33 bytes
         bInterval               1
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        1
       bAlternateSetting       5
       bNumEndpoints           2
       bInterfaceClass       255 Vendor Specific Class
       bInterfaceSubClass      1
       bInterfaceProtocol      1
       iInterface              0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x83  EP 3 IN
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0031  1x 49 bytes
         bInterval               1
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x03  EP 3 OUT
         bmAttributes            1
           Transfer Type            Isochronous
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0031  1x 49 bytes
         bInterval               1
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        2
       bAlternateSetting       0
       bNumEndpoints           2
       bInterfaceClass       255 Vendor Specific Class
       bInterfaceSubClass    255 Vendor Specific Subclass
       bInterfaceProtocol    255 Vendor Specific Protocol
       iInterface              0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x84  EP 4 IN
         bmAttributes            2
           Transfer Type            Bulk
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0020  1x 32 bytes
         bInterval               1
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x04  EP 4 OUT
         bmAttributes            2
           Transfer Type            Bulk
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0020  1x 32 bytes
         bInterval               1
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        3
       bAlternateSetting       0
       bNumEndpoints           0
       bInterfaceClass       254 Application Specific Interface
       bInterfaceSubClass      1 Device Firmware Update
       bInterfaceProtocol      1
       iInterface              0
       Device Firmware Upgrade Interface Descriptor:
         bLength                             9
         bDescriptorType                    33
         bmAttributes                        5
           Will Not Detach
           Manifestation Tolerant
           Upload Unsupported
           Download Supported
         wDetachTimeout                   5000 milliseconds
         wTransferSize                      64 bytes
         bcdDFUVersion                   1.10
Device Status:     0x0000
   (Bus Powered)

Regards,

Hans

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bluetooth: btusb: Add support for BCM2045 HCI with vend:prod ids set to 0000:0000
  2017-07-06 16:43   ` Hans de Goede
@ 2017-07-07  9:55     ` Christopher Williamson
  0 siblings, 0 replies; 6+ messages in thread
From: Christopher Williamson @ 2017-07-07  9:55 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Marcel Holtmann, Gustavo F. Padovan, Johan Hedberg, linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 15614 bytes --]

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 7
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 4.12
S:  Manufacturer=Linux 4.12.0-custom xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=258a ProdID=0111 Rev= 1.00
S:  Manufacturer=SINO WEALTH
S:  Product=Gaming Keyboard
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=8ms
I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=8ms

T:  Bus=01 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#=  3 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 1.12
S:  Manufacturer=Broadcom Corp
S:  Product=BCM2045A0
S:  SerialNumber=AC83F30677CB
C:* #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 6
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 4.12
S:  Manufacturer=Linux 4.12.0-custom xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

On Thu, Jul 6, 2017 at 12:43 PM, Hans de Goede <hdegoede@redhat.com> wrote:

> Hi all,
>
> Christopher, can you do: "sudo cat /sys/kernel/debug/usb/devices"
> and copy and paste the contents in a reply to this mail
> (using reply-to-all) ?
>
> On 06-07-17 17:22, Marcel Holtmann wrote:
>
>> Hi Hans,
>>
>> The GPD Pocket is shipping with a BCM2045 USB HCI with its vend:prod
>>> ids set to 0000:0000 and also has its interface class set to 255 (Vendor
>>> Specific Class).
>>>
>>> Which, well sucks. Luckily it does advertise usable manufacturer and
>>> product strings, so this commit adds 0000:0000 to the usb_device_id
>>> table, with a special flag of BTUSB_BCM2045_0000_0000, if this flag
>>> is set btusb_probe will check the strings and if they don't match
>>> return -ENODEV.
>>>
>>> This is not pretty, but it fixes bluetooth not working under Linux.
>>>
>>
>> can you send around /sys/kernel/debug/usb/devices for this device.
>>
>
> As you can see I've just asked the reported to provide this :)
>
> I already have lsusb -v output for the btusb device:
>
> Bus 001 Device 003: ID 0000:0000
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass          255 Vendor Specific Class
>   bDeviceSubClass         1
>   bDeviceProtocol         1
>   bMaxPacketSize0        64
>   idVendor           0x0000
>   idProduct          0x0000
>   bcdDevice            1.12
>   iManufacturer           1 Broadcom Corp
>   iProduct                2 BCM2045A0
>   iSerial                 3 AC83F30677CB
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength          218
>     bNumInterfaces          4
>     bConfigurationValue     1
>     iConfiguration          0
>     bmAttributes         0x80
>       (Bus Powered)
>     MaxPower              100mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           3
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      1
>       bInterfaceProtocol      1
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            3
>           Transfer Type            Interrupt
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0010  1x 16 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x82  EP 2 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x02  EP 2 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               1
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      1
>       bInterfaceProtocol      1
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x83  EP 3 IN
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0000  1x 0 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x03  EP 3 OUT
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0000  1x 0 bytes
>         bInterval               1
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       1
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      1
>       bInterfaceProtocol      1
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x83  EP 3 IN
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0009  1x 9 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x03  EP 3 OUT
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0009  1x 9 bytes
>         bInterval               1
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       2
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      1
>       bInterfaceProtocol      1
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x83  EP 3 IN
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0011  1x 17 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x03  EP 3 OUT
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0011  1x 17 bytes
>         bInterval               1
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       3
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      1
>       bInterfaceProtocol      1
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x83  EP 3 IN
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0019  1x 25 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x03  EP 3 OUT
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0019  1x 25 bytes
>         bInterval               1
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       4
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      1
>       bInterfaceProtocol      1
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x83  EP 3 IN
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0021  1x 33 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x03  EP 3 OUT
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0021  1x 33 bytes
>         bInterval               1
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       5
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass      1
>       bInterfaceProtocol      1
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x83  EP 3 IN
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0031  1x 49 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x03  EP 3 OUT
>         bmAttributes            1
>           Transfer Type            Isochronous
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0031  1x 49 bytes
>         bInterval               1
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        2
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass    255 Vendor Specific Subclass
>       bInterfaceProtocol    255 Vendor Specific Protocol
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x84  EP 4 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0020  1x 32 bytes
>         bInterval               1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x04  EP 4 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0020  1x 32 bytes
>         bInterval               1
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        3
>       bAlternateSetting       0
>       bNumEndpoints           0
>       bInterfaceClass       254 Application Specific Interface
>       bInterfaceSubClass      1 Device Firmware Update
>       bInterfaceProtocol      1
>       iInterface              0
>       Device Firmware Upgrade Interface Descriptor:
>         bLength                             9
>         bDescriptorType                    33
>         bmAttributes                        5
>           Will Not Detach
>           Manifestation Tolerant
>           Upload Unsupported
>           Download Supported
>         wDetachTimeout                   5000 milliseconds
>         wTransferSize                      64 bytes
>         bcdDFUVersion                   1.10
> Device Status:     0x0000
>   (Bus Powered)
>
> Regards,
>
> Hans
>

[-- Attachment #2: Type: text/html, Size: 20085 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bluetooth: btusb: Add support for BCM2045 HCI with vend:prod ids set to 0000:0000
  2017-07-06 14:08 [PATCH] bluetooth: btusb: Add support for BCM2045 HCI with vend:prod ids set to 0000:0000 Hans de Goede
  2017-07-06 15:22 ` Marcel Holtmann
@ 2017-07-07 11:30 ` Marcel Holtmann
  2017-07-07 11:36   ` Hans de Goede
  1 sibling, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2017-07-07 11:30 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth

Hi Hans,

> The GPD Pocket is shipping with a BCM2045 USB HCI with its vend:prod
> ids set to 0000:0000 and also has its interface class set to 255 (Vendor
> Specific Class).
> 
> Which, well sucks. Luckily it does advertise usable manufacturer and
> product strings, so this commit adds 0000:0000 to the usb_device_id
> table, with a special flag of BTUSB_BCM2045_0000_0000, if this flag
> is set btusb_probe will check the strings and if they don't match
> return -ENODEV.
> 
> This is not pretty, but it fixes bluetooth not working under Linux.
> 
> Reported-and-tested-by: Christopher Williamson <home@chrisaw.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/bluetooth/btusb.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 7fa373b428f8..9c3201c0525d 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -66,6 +66,7 @@ static struct usb_driver btusb_driver;
> #define BTUSB_BCM2045		0x40000
> #define BTUSB_IFNUM_2		0x80000
> #define BTUSB_CW6622		0x100000
> +#define BTUSB_BCM2045_0000_0000	0x200000
> 
> static const struct usb_device_id btusb_table[] = {
> 	/* Generic Bluetooth USB device */
> @@ -124,6 +125,10 @@ static const struct usb_device_id btusb_table[] = {
> 	/* Canyon CN-BTU1 with HID interfaces */
> 	{ USB_DEVICE(0x0c10, 0x0000) },
> 
> +	/* Broadcom BCM2045 with the prod:vend ids not filled GRRR */
> +	{ USB_DEVICE(0x0000, 0x0000),
> +	  .driver_info = BTUSB_BCM2045 | BTUSB_BCM2045_0000_0000 },
> +
> 	/* Broadcom BCM20702A0 */
> 	{ USB_DEVICE(0x413c, 0x8197) },
> 
> @@ -2887,6 +2892,16 @@ static int btusb_probe(struct usb_interface *intf,
> 	if (id->driver_info == BTUSB_IGNORE)
> 		return -ENODEV;
> 
> +	if (id->driver_info & BTUSB_BCM2045_0000_0000) {
> +		struct usb_device *udev = interface_to_usbdev(intf);
> +
> +		/* Device with prod:vend id set to 0000:0000, check strings */
> +		if (!udev->manufacturer || !udev->product ||
> +		    strcmp(udev->manufacturer, "Broadcom Corp") != 0 ||
> +		    strcmp(udev->product, "BCM2045A0") != 0)
> +			return -ENODEV;
> +	}
> +

so I reworked this to make it less ugly and be more restrictive in checking the matching details.

What I need is actually a “btmon -w trace.log” from the initialization of this device so that I can make sure that the patchram support does work here.

Regards

Marcel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] bluetooth: btusb: Add support for BCM2045 HCI with vend:prod ids set to 0000:0000
  2017-07-07 11:30 ` Marcel Holtmann
@ 2017-07-07 11:36   ` Hans de Goede
  0 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2017-07-07 11:36 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth,
	Christopher Williamson

Hi,

On 07-07-17 13:30, Marcel Holtmann wrote:
> Hi Hans,
> 
>> The GPD Pocket is shipping with a BCM2045 USB HCI with its vend:prod
>> ids set to 0000:0000 and also has its interface class set to 255 (Vendor
>> Specific Class).
>>
>> Which, well sucks. Luckily it does advertise usable manufacturer and
>> product strings, so this commit adds 0000:0000 to the usb_device_id
>> table, with a special flag of BTUSB_BCM2045_0000_0000, if this flag
>> is set btusb_probe will check the strings and if they don't match
>> return -ENODEV.
>>
>> This is not pretty, but it fixes bluetooth not working under Linux.
>>
>> Reported-and-tested-by: Christopher Williamson <home@chrisaw.com>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>> drivers/bluetooth/btusb.c | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>> index 7fa373b428f8..9c3201c0525d 100644
>> --- a/drivers/bluetooth/btusb.c
>> +++ b/drivers/bluetooth/btusb.c
>> @@ -66,6 +66,7 @@ static struct usb_driver btusb_driver;
>> #define BTUSB_BCM2045		0x40000
>> #define BTUSB_IFNUM_2		0x80000
>> #define BTUSB_CW6622		0x100000
>> +#define BTUSB_BCM2045_0000_0000	0x200000
>>
>> static const struct usb_device_id btusb_table[] = {
>> 	/* Generic Bluetooth USB device */
>> @@ -124,6 +125,10 @@ static const struct usb_device_id btusb_table[] = {
>> 	/* Canyon CN-BTU1 with HID interfaces */
>> 	{ USB_DEVICE(0x0c10, 0x0000) },
>>
>> +	/* Broadcom BCM2045 with the prod:vend ids not filled GRRR */
>> +	{ USB_DEVICE(0x0000, 0x0000),
>> +	  .driver_info = BTUSB_BCM2045 | BTUSB_BCM2045_0000_0000 },
>> +
>> 	/* Broadcom BCM20702A0 */
>> 	{ USB_DEVICE(0x413c, 0x8197) },
>>
>> @@ -2887,6 +2892,16 @@ static int btusb_probe(struct usb_interface *intf,
>> 	if (id->driver_info == BTUSB_IGNORE)
>> 		return -ENODEV;
>>
>> +	if (id->driver_info & BTUSB_BCM2045_0000_0000) {
>> +		struct usb_device *udev = interface_to_usbdev(intf);
>> +
>> +		/* Device with prod:vend id set to 0000:0000, check strings */
>> +		if (!udev->manufacturer || !udev->product ||
>> +		    strcmp(udev->manufacturer, "Broadcom Corp") != 0 ||
>> +		    strcmp(udev->product, "BCM2045A0") != 0)
>> +			return -ENODEV;
>> +	}
>> +
> 
> so I reworked this to make it less ugly and be more restrictive in checking the matching details.

Ok, thank you.

> What I need is actually a “btmon -w trace.log” from the initialization of this device so that I can make sure that the patchram support does work here.

Ok, note I do not own a device with this HCI, I've added
Christopher (the reporter who does have a device) to the Cc
again.

Christopher, can you collect btmon -w trace.log for this
device. I guess you need to do rmmod + modprobe btusb
while btmon is running to get the initialization trace.

Regards,

Hans

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-07 11:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-06 14:08 [PATCH] bluetooth: btusb: Add support for BCM2045 HCI with vend:prod ids set to 0000:0000 Hans de Goede
2017-07-06 15:22 ` Marcel Holtmann
2017-07-06 16:43   ` Hans de Goede
2017-07-07  9:55     ` Christopher Williamson
2017-07-07 11:30 ` Marcel Holtmann
2017-07-07 11:36   ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.