Fake CSR 4.0 Bluetooth Dongle with error Set Event Filter(Invalid HCI Command Parameters) after kernel patch

I've got a fake dongle BT 4.0 from china and try the procedure from this thread: Bluetooth dongle problem

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
Device: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) bcdDevice: 88.91 Kernel: 5.10.3-051003-generic
usb-devices | awk '/0a12/' RS=
T: Bus=02 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0a12 ProdID=0001 Rev=88.91
S: Product=BT DONGLE10
C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#=0x0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I: If#=0x1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb

But even after patch, I'm getting the error below via hcidump:

HCI Event: Command Complete (0x0e) plen 4 Set Event Filter (0x03|0x0005) ncmd 1 status 0x12 Error: Invalid HCI Command Parameters

Check it:

"Same device and same issue on Pi Zero. "Changing the #define lmp_bredr_capable(dev) in hci_core.h to return false did the trick."

I don't know how to do that #define lmp_bredr_capable(dev). Could someone help?

I'm fully available to test it.

3

2 Answers

i solved my problem by comment the lines 296 and 297 of hci_core.c(plus patches).

static void bredr_setup(struct hci_request *req)
{ __le16 param; __u8 flt_type; /* Read Buffer Size (ACL mtu, max pkt, etc.) */ hci_req_add(req, HCI_OP_READ_BUFFER_SIZE, 0, NULL); /* Read Class of Device */ hci_req_add(req, HCI_OP_READ_CLASS_OF_DEV, 0, NULL); /* Read Local Name */ hci_req_add(req, HCI_OP_READ_LOCAL_NAME, 0, NULL); /* Read Voice Setting */ hci_req_add(req, HCI_OP_READ_VOICE_SETTING, 0, NULL); /* Read Number of Supported IAC */ hci_req_add(req, HCI_OP_READ_NUM_SUPPORTED_IAC, 0, NULL); /* Read Current IAC LAP */ hci_req_add(req, HCI_OP_READ_CURRENT_IAC_LAP, 0, NULL); /* Clear Event Filters */ //flt_type = HCI_FLT_CLEAR_ALL; HERE!! //hci_req_add(req, HCI_OP_SET_EVENT_FLT, 1, &flt_type); /* Connection accept timeout ~20 secs */ param = cpu_to_le16(0x7d00); hci_req_add(req, HCI_OP_WRITE_CA_TIMEOUT, 2, &param);

Maybe the "#define lmp_bredr_capable(dev) 0" also work. But im not sure. I still run the bredr_setup() but bypass the clear event filter step...

obs: Its working flawless for 2 days. Only problem, i cant turn it into a HSP\HSP profile but i think its another story(even after the ofono gambiarra). Bluetooth in linux is a pain in a$..

I have found that just upgrading to Kernel 5.13.4 fixes the Fake Bluetooth CSR 0100 issue.

sudo add-apt-repository ppa:cappelikan/ppa

Then check updates and install the tool via commands:

sudo apt update
sudo apt install mainline

Search in Linux Programs Kernel Mainline updater and run the upgrade, reboot, Fake CSR Bluetooth working.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like