After days of debugging I found that the problem is probably my dongle :
Code: Select all
# lsusb
Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
The Sony driver seems to work only with HID mode,
so I tried the following command to put it on HID mode :
Code: Select all
/lib/udev/hid2hci --mode=hid --method=csr --devpath=/devices/pci0000\:00/0000\:00\:14.0/usb1/1-13/1-13\:1.0
Control transfer failed: Broken pipe (32)
error: switching device '/sys//devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13:1.0' failed.
But unfortunately it didn't work. I found that udev has a rule (/lib/udev/rules.d/97-hid2hci.rules) that switch automatically some devices to HCI mode,
but my device does not match the rules. So my dongle is in HCI mode by default and seems to not handle HID mode, or maybe my hid2hci command is wrong ?
By enabling kernel debug messages I think I understand why my controller disconnect shortly after connecting.
After the bluetooth connection is established I have :
Code: Select all
[ 73.488561] [1019] debugfs: debugfs: creating file '71'
[ 73.488572] [1019] bluetooth: conn 0000000084254315
[ 73.488579] [1019] core: device: 'hci0:71': device_add
[ 73.488584] [1019] kobject: kobject: 'hci0:71' (00000000f70ce9e3): kobject_add_internal: parent: 'hci0', set: 'devices'
[ 73.488626] [1019] main: PM: Adding info for No Bus:hci0:71
[ 73.488630] [1019] [1019] kobject_uevent: kobject: 'hci0:71' (00000000f70ce9e3): kobject_uevent_env
[ 73.488637] [1019] kobject: kobject: 'hci0:71' (00000000f70ce9e3): fill_kobj_path: path = '/devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13:1.0/bluetooth/hci0/hci0:71'
A hci0:71 interface is created but after that no other driver handle this new interface (probably because sony driver expect a HID interface).
Then the controller close the connection (connection reset by peer 104)
Code: Select all
[ 74.409470] <intr> xhci_hcd: xhci_hcd 0000:00:14.0: ep 0x81 - asked for 16 bytes, 10 bytes untransferred
[ 74.409478] <intr> btusb: hci0 urb 000000003793cba0 status 0 count 6
[ 74.409536] [1691] bluetooth: hci0
[ 74.409540] [1691] bluetooth: hci0 Event packet
[ 74.409543] [1691] bluetooth: hci0 status 0x00
[ 74.409549] [1691] bluetooth: channel 3 len 14
[ 74.409560] [1691] bluetooth: channel 2 len 20
[ 74.409569] [1691] bluetooth: hcon 0000000084254315 reason 19
[ 74.409572] [1691] bluetooth: hcon 0000000084254315 conn 000000004f8bd33b, err 104
I suppose it's because the controller expect some information from the sony driver and did not get them so it reset the connection.
In conclusion, to make this work, I have to put my dongle in HID mode, but all attempt failed (with hid2hci and testing kernel options).
Maybe I do it wrong because I tried with an other bluetooth card from a laptop and I have the same problem (HCI mode by default, can't switch mode).
Or switching mode is really impossible and the only option is to rewrite the sony driver to make it work with HCI mode.
I never write a linux driver before but I'd like to, and before I try to do such a big task maybe someone can confirm my suppositions to be sure there is no other solutions.