Bug 60901
Summary: | [PATCH]Roper Class 1 Bluetooth Dongle / TRENDnet TBW-102UB not working with all kernel 3.x tested | ||
---|---|---|---|
Product: | Drivers | Reporter: | Christophe PEREZ (chris) |
Component: | Bluetooth | Assignee: | linux-bluetooth (linux-bluetooth) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | alan, gustavo, info, martin, opi, pupykin.s, yury.af |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.10.7 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | dont send local commnads command to silicon wave devices |
Description
Christophe PEREZ
2013-09-07 16:50:32 UTC
Could you provide the output of hcidump or btmon when you try to run: $ hciconfig hci0 down $ hciconfig hci0 up output of hcidump ou btmon ? I don't understand, I don't have this on my system. # hciconfig hci0 down # hciconfig hci0 up Can't init device hci0: Invalid request code (56) # # which hcidump which: no hcidump in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin... # which btmon which: no btmon in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin... found hcidump in another package. "hciconfig hci0 down" doesn't give anything in hcidump "hciconfig hci0 up" : < HCI Command: Reset (0x03|0x0003) plen 0 > HCI Event: Command Complete (0x0e) plen 4 Reset (0x03|0x0003) ncmd 1 status 0x00 < HCI Command: Read Local Supported Features (0x04|0x0003) plen 0 > HCI Event: Command Complete (0x0e) plen 12 Read Local Supported Features (0x04|0x0003) ncmd 1 status 0x00 Features: 0xff 0xff 0x05 0x38 0x18 0x18 0x00 0x00 < HCI Command: Read Local Version Information (0x04|0x0001) plen 0 > HCI Event: Command Complete (0x0e) plen 12 Read Local Version Information (0x04|0x0001) ncmd 1 status 0x00 HCI Version: 1.2 (0x2) HCI Revision: 0x0 LMP Version: 1.2 (0x2) LMP Subversion: 0x757 Manufacturer: Silicon Wave (11) < HCI Command: Read BD ADDR (0x04|0x0009) plen 0 > HCI Event: Command Complete (0x0e) plen 10 Read BD ADDR (0x04|0x0009) ncmd 1 status 0x00 bdaddr 00:0B:0D:06:F3:A3 < HCI Command: Read Buffer Size (0x04|0x0005) plen 0 > HCI Event: Command Complete (0x0e) plen 11 Read Buffer Size (0x04|0x0005) ncmd 1 status 0x00 ACL MTU 120:20 SCO MTU 0:0 < HCI Command: Read Class of Device (0x03|0x0023) plen 0 > HCI Event: Command Complete (0x0e) plen 7 Read Class of Device (0x03|0x0023) ncmd 1 status 0x00 class 0x000000 < HCI Command: Read Local Name (0x03|0x0014) plen 0 > HCI Event: Command Complete (0x0e) plen 252 Read Local Name (0x03|0x0014) ncmd 1 status 0x00 name '' < HCI Command: Read Voice Setting (0x03|0x0025) plen 0 > HCI Event: Command Complete (0x0e) plen 6 Read Voice Setting (0x03|0x0025) ncmd 1 status 0x00 voice setting 0x0060 < HCI Command: Set Event Filter (0x03|0x0005) plen 1 type 0 condition 0 Clear all filters > HCI Event: Command Complete (0x0e) plen 4 Set Event Filter (0x03|0x0005) ncmd 1 status 0x00 < HCI Command: Write Connection Accept Timeout (0x03|0x0016) plen 2 timeout 32000 > HCI Event: Command Complete (0x0e) plen 4 Write Connection Accept Timeout (0x03|0x0016) ncmd 1 status 0x00 < HCI Command: Read Page Scan Activity (0x03|0x001b) plen 0 > HCI Event: Command Complete (0x0e) plen 8 Read Page Scan Activity (0x03|0x001b) ncmd 1 status 0x00 interval 2048 window 18 < HCI Command: Read Page Scan Type (0x03|0x0046) plen 0 > HCI Event: Command Complete (0x0e) plen 5 Read Page Scan Type (0x03|0x0046) ncmd 1 < HCI Command: Set Event Mask (0x03|0x0001) plen 8 Mask: 0xfffffbff07180000 > HCI Event: Command Complete (0x0e) plen 4 Set Event Mask (0x03|0x0001) ncmd 1 status 0x00 < HCI Command: Read Local Supported Commands (0x04|0x0002) plen 0 > HCI Event: Command Status (0x0f) plen 4 Read Local Supported Commands (0x04|0x0002) status 0x01 ncmd 1 Error: Unknown HCI Command I hope I used hcidump correctly, just with : hcidump hci0 > hci0.txt Created attachment 108071 [details]
dont send local commnads command to silicon wave devices
Could please try this patch? It is just a workaround for now. Please send the hcidump output with this patch in.
Hi, I've got the same issue and the patch provided is not working for me because of different ID. I did executed same commands as described in comments above and got same results, however my device has ID=31, and not 11: --- hci_core.c 2013-09-03 04:46:10.000000000 +0800 +++ hci_core.c.patched 2013-10-13 16:27:15.559095546 +0800 @@ -516,7 +516,7 @@ static void hci_init2_req(struct hci_req /* AVM Berlin (31), aka "BlueFRITZ!", doesn't support the read * local supported commands HCI command. */ - if (hdev->manufacturer != 31 && hdev->hci_ver > BLUETOOTH_VER_1_1) + if (hdev->manufacturer != 31 && hdev->manufacturer != 11 && hdev->hci_ver > BLUETOOTH_VER_1_1) hci_req_add(req, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); if (lmp_ssp_capable(hdev)) { I've tested my changes and they work fine. Please include this in next kernel release if possible. Many thanks! "1310:0001 Roper Class 1 Bluetooth Dongle" also fails on "Read Local Supported Commands" And looks working after patching PS. I've used sed -i 's|.*HCI_OP_READ_LOCAL_COMMANDS.*|do{}while(0);|g' net/bluetooth/hci_core.c command instead of fair patching. My Roper Class 1 Bluetooth Dongle works now. (In reply to Gustavo Padovan from comment #4) > Could please try this patch? It is just a workaround for now. Please send > the hcidump output with this patch in. Sorry for not responding before. It works with the patch : < HCI Command: Reset (0x03|0x0003) plen 0 > HCI Event: Command Complete (0x0e) plen 4 Reset (0x03|0x0003) ncmd 1 status 0x00 < HCI Command: Read Local Supported Features (0x04|0x0003) plen 0 > HCI Event: Command Complete (0x0e) plen 12 Read Local Supported Features (0x04|0x0003) ncmd 1 status 0x00 Features: 0xff 0xff 0x05 0x38 0x18 0x18 0x00 0x00 < HCI Command: Read Local Version Information (0x04|0x0001) plen 0 > HCI Event: Command Complete (0x0e) plen 12 Read Local Version Information (0x04|0x0001) ncmd 1 status 0x00 HCI Version: 1.2 (0x2) HCI Revision: 0x0 LMP Version: 1.2 (0x2) LMP Subversion: 0x757 Manufacturer: Silicon Wave (11) < HCI Command: Read BD ADDR (0x04|0x0009) plen 0 > HCI Event: Command Complete (0x0e) plen 10 Read BD ADDR (0x04|0x0009) ncmd 1 status 0x00 bdaddr 00:0B:0D:06:F3:A3 < HCI Command: Read Buffer Size (0x04|0x0005) plen 0 > HCI Event: Command Complete (0x0e) plen 11 Read Buffer Size (0x04|0x0005) ncmd 1 status 0x00 ACL MTU 120:20 SCO MTU 0:0 < HCI Command: Read Class of Device (0x03|0x0023) plen 0 > HCI Event: Command Complete (0x0e) plen 7 Read Class of Device (0x03|0x0023) ncmd 1 status 0x00 class 0x000000 < HCI Command: Read Local Name (0x03|0x0014) plen 0 > HCI Event: Command Complete (0x0e) plen 252 Read Local Name (0x03|0x0014) ncmd 1 status 0x00 name '' < HCI Command: Read Voice Setting (0x03|0x0025) plen 0 > HCI Event: Command Complete (0x0e) plen 6 Read Voice Setting (0x03|0x0025) ncmd 1 status 0x00 voice setting 0x0060 < HCI Command: Set Event Filter (0x03|0x0005) plen 1 type 0 condition 0 Clear all filters > HCI Event: Command Complete (0x0e) plen 4 Set Event Filter (0x03|0x0005) ncmd 1 status 0x00 < HCI Command: Write Connection Accept Timeout (0x03|0x0016) plen 2 timeout 32000 > HCI Event: Command Complete (0x0e) plen 4 Write Connection Accept Timeout (0x03|0x0016) ncmd 1 status 0x00 < HCI Command: Read Page Scan Activity (0x03|0x001b) plen 0 > HCI Event: Command Complete (0x0e) plen 8 Read Page Scan Activity (0x03|0x001b) ncmd 1 status 0x00 interval 2048 window 18 < HCI Command: Read Page Scan Type (0x03|0x0046) plen 0 > HCI Event: Command Complete (0x0e) plen 5 Read Page Scan Type (0x03|0x0046) ncmd 1 < HCI Command: Set Event Mask (0x03|0x0001) plen 8 Mask: 0xfffffbff07180000 > HCI Event: Command Complete (0x0e) plen 4 Set Event Mask (0x03|0x0001) ncmd 1 status 0x00 < HCI Command: Write Scan Enable (0x03|0x001a) plen 1 enable 3 > HCI Event: Command Complete (0x0e) plen 4 Write Scan Enable (0x03|0x001a) ncmd 1 status 0x00 < HCI Command: Write Class of Device (0x03|0x0024) plen 3 class 0x620100 > HCI Event: Command Complete (0x0e) plen 4 Write Class of Device (0x03|0x0024) ncmd 1 status 0x00 < HCI Command: Write Local Name (0x03|0x0013) plen 248 name 'fuji' > HCI Event: Command Complete (0x0e) plen 4 Write Local Name (0x03|0x0013) ncmd 1 status 0x00 *** Bug 51831 has been marked as a duplicate of this bug. *** After sed -i 's|.*HCI_OP_READ_LOCAL_COMMANDS.*|do{}while(0);|g' net/bluetooth/hci_core.c my dongle "ID 1310:0001 Roper Class 1 Bluetooth Dongle" works now too. And after - if (hdev->manufacturer != 31 && hdev->hci_ver > BLUETOOTH_VER_1_1) + if (hdev->manufacturer != 31 && hdev->manufacturer != 11 && hdev->hci_ver > BLUETOOTH_VER_1_1) my dongle "ID 1310:0001 Roper Class 1 Bluetooth Dongle" works too. I've another (unnamed) device with same issue: $> cat /var/log/syslog kernel: [ 7425.384652] usb 9-2: new full-speed USB device number 6 using ohci-pci kernel: [ 7425.553469] usb 9-2: New USB device found, idVendor=0c10, idProduct=0000 kernel: [ 7425.553481] usb 9-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 kernel: [ 7425.553488] usb 9-2: Product: SiW kernel: [ 7425.553494] usb 9-2: Manufacturer: SiW kernel: [ 7425.553499] usb 9-2: SerialNumber: 48E707F61100 $> lsusb Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 009 Device 006: ID 0c10:0000 Bus 009 Device 002: ID 1130:6604 Tenx Technology, Inc. MCE IR-Receiver Bus 009 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 002: ID 192f:0916 Avago Technologies, Pte. Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub $> hcitool dev Devices: $> hcitool scan Device is not available: No such device $> hciconfig hci0 hci0: Type: BR/EDR Bus: USB BD Address: 00:11:F6:07:E7:48 ACL MTU: 120:20 SCO MTU: 0:0 DOWN RX bytes:388 acl:0 sco:0 events:16 errors:0 TX bytes:59 acl:0 sco:0 commands:16 errors:0 $> hciconfig hci0 up Can't init device hci0: Invalid request code (56) $> uname -a Linux zimmer 3.16.0-16-generic #22-Ubuntu SMP Wed Sep 17 18:47:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Kubuntu 14.10 not yet definitively corrected ? I always have to patch new kernel the same way to use my dongle (actually 3.17.7 on gentoo) linux-next.git already has more proper fix instead of this hack. See http://permalink.gmane.org/gmane.linux.bluez.kernel/57722 https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/bluetooth/btusb.c /* Roper Class 1 Bluetooth Dongle (Silicon Wave based) */ { USB_DEVICE(0x1300, 0x0001), .driver_info = BTUSB_SWAVE }, And then HCI_QUIRK_BROKEN_LOCAL_COMMANDS is set. (In reply to Sergej Pupykin from comment #14) > linux-next.git already has more proper fix instead of this hack. Thanks. I don't know what "linux-next" is. Which kernel version will I find this fix in pls ? (In reply to Christophe PEREZ from comment #15) > I don't know what "linux-next" is. Which kernel version will I find this fix > in pls ? See last line in table on https://www.kernel.org/. It should be linux-3.20. driver_info = BTUSB_SWAVE and HCI_QUIRK_BROKEN_LOCAL_COMMANDS present in 4.0-rc1 That bug fixed since 4.0-r1, but not for all device. Please, add my "1310:0001 Roper Class 1 Bluetooth Dongle" too --- drivers/bluetooth/btusb.c_ORIG 2015-05-01 12:06:59.000000000 +0300 +++ drivers/bluetooth/btusb.c 2015-05-01 12:02:00.000000000 +0300 @@ -254,6 +254,7 @@ /* Roper Class 1 Bluetooth Dongle (Silicon Wave based) */ { USB_DEVICE(0x1300, 0x0001), .driver_info = BTUSB_SWAVE }, + { USB_DEVICE(0x1310, 0x0001), .driver_info = BTUSB_SWAVE }, /* Digianswer devices */ { USB_DEVICE(0x08fd, 0x0001), .driver_info = BTUSB_DIGIANSWER }, Add a Signed-off-by: line and send the patch to linux-bluetooth@vger.kernel.org with a note saying you've tested that it fixes your Roper Class 1 dongle and it should get picked up and merged by the maintainer (See Documentation/SubmittingPatches). You don't need to be subscribed to linux-bluetooth to send a patch there. On compliance http://permalink.gmane.org/gmane.linux.bluez.kernel/61883 that 0x1300 instead of 0x1310 is a typo. Can be simply used as: --- drivers/bluetooth/btusb.c_ORIG 2015-05-01 12:06:59.000000000 +0300 +++ drivers/bluetooth/btusb.c 2015-05-01 12:02:00.000000000 +0300 @@ -254,6 +254,6 @@ /* Roper Class 1 Bluetooth Dongle (Silicon Wave based) */ - { USB_DEVICE(0x1300, 0x0001), .driver_info = BTUSB_SWAVE }, + { USB_DEVICE(0x1310, 0x0001), .driver_info = BTUSB_SWAVE }, /* Digianswer devices */ { USB_DEVICE(0x08fd, 0x0001), .driver_info = BTUSB_DIGIANSWER }, That typo fixed in commit 2eeac871697ac24a77b6d7953bd711b490e83ac7 of kernel 4.2-rc1 Since that kernel on "1310:0001 Roper Class 1 Bluetooth Dongle" applied HCI_QUIRK_BROKEN_LOCAL_COMMANDS and Dongle initialize and work. In my case all work and bug fixed. Kernel 4.0.5 doesn't workd for me. I always need to patch with : --- net/bluetooth/hci_core.c.orig 2015-08-08 18:22:36.000000000 -0400 +++ net/bluetooth/hci_core.c 2015-08-08 18:25:15.000000000 -0400 @@ -594,7 +594,7 @@ * the driver can quirk the behavior and skip reading the local * supported commands. */ - if (hdev->hci_ver > BLUETOOTH_VER_1_1 && + if (hdev->manufacturer != 11 && hdev->manufacturer != 31 && hdev->hci_ver > BLUETOOTH_VER_1_1 && !test_bit(HCI_QUIRK_BROKEN_LOCAL_COMMANDS, &hdev->quirks)) hci_req_add(req, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); to make it work :( For Christophe PEREZ: That bug FIXED in kernel AFTER 4.2-rc1 in 4.0.5 that patch adsent and patch hci_core.c steel need. Oh ! sorry ... For information:
that bug fixed in kernel:
>= 4.1.4
>= 4.2-rc1
|