#[SOLVED] Recompiling Bluetooth driver for Qualcomm WiFi 7 - Bluetooth combo card (QCNCM865)

161 messages · Page 1 of 1 (latest)

fluid gulch
#
/* Qualcomm WCN785x PID 1107 */
    { USB_DEVICE_AND_INTERFACE_INFO(0x17cb, 0x1107, USB_CLASS_WIRELESS, 0xff, 0xff) },
#

This is the entry I'd like to add to btusb.c

#

Which I have I just can't get it to compile

true cargo
#

Does it compile without your changes?

#

Did you try that first

fluid gulch
#

I did not, just deleted everything to start with a clean slate, gonna redownload the kernel and try compiling it as is

true cargo
#

Also that patch was submitted against the mainline kernel, not zen

fluid gulch
#

Isn't Zen a fork of the mainline kernel?

true cargo
#

Well yes

#

But it's a fork

fluid gulch
#

I think I get what you're saying

true cargo
#

So I applied the patch to the latest kernel and it seems like it's working

#

But I will write when it's done

fluid gulch
#

I just don't know what I'm doing lol so this is what I just did

#

Cd into kernel source files
cat /proc/config.gz > .config
make menuconfig - Did not touch a thing just saved
make -j$(nproc)
make modules

#

That was it, it compiled just fine as far as I can tell, no errors

#

btusb.c doesn't seem to have compiled

true cargo
#

Realistically you want to put the patch in a packagebuild

#

So I just finished the compile

#

The patch seems fine

fluid gulch
true cargo
fluid gulch
#

Okay tracking so far

true cargo
#

And so are all the kernels arch linux ships

#

This is for the vanilla kernel

#

You can take this

#

Add your patch

#

Change the name

#

And install it like a package

true cargo
#

The PKGBUILD is basically a big bash script that builds the package

#

So not directly

#

You add a patch

fluid gulch
#

I'm sorry I still don't understand

true cargo
#

Give me a sec

#

Ah nice

#

Ofc there is an arch wiki entry for this

#

Every day issue I want to patch my kernel

fluid gulch
#

I read this when Copilot used it as a source but it completely flew over my head I don't get how this adds my cards PID to btusb.c

true cargo
#

Do you have a source

fluid gulch
#

I copied one of the entries in btusb.c and modified it to reflect my card

true cargo
#

So there is no official patch with that in it?

fluid gulch
#

No, there are patches with other peoples PID's but unfortunately I landed a card with a unique one

#

These are some examples I've found

#

This person added his own, although I don't understand how

#

And someone else was nice enough to collect a few and email a Qualcomm maintainer about it

#

But I don't know what this is, I managed to download a .patch file from that link but idk what to do with it, but even if I did my PID is not in that list

true cargo
fluid gulch
#

I don't think it is, I'll send you more of the file for context

true cargo
#

Ah you want it in static const struct usb_device_id btusb_table[]

fluid gulch
true cargo
#

Right?

fluid gulch
#

Yes, would that make my system recognize the card as BT compatible?

true cargo
#

Thats way too low level for what I touch from day to day

fluid gulch
#

That's what I'm saying lol I been using Linux since 2020 and I've never once had to compile a kernel I've simply been lucky enough to have hardware that is plug and play

true cargo
#

However the format looks off too

#

Where did you pull the USB_CLASS_WIRELESS from?

fluid gulch
#

I'm not sure, this entry was made by Gemini (ai)

true cargo
fluid gulch
#

Gave it examples and it spat that out

true cargo
#

That is 100% wrong

fluid gulch
#

Just changed the id values and added what it needed to after giving it info on my card

#

Damn

true cargo
#

Like

fluid gulch
#

Tried to use AI cus I really don't like socializing lol

true cargo
#

USB_DEVICE_AND_INTERFACE_INFO does not exist in that file

#

Ok it does exist in the kernel

#

A few levels up

fluid gulch
#

So it's proper format?

true cargo
#

No

#

Not for that table

fluid gulch
#

Damn

#

How can I fix it?

true cargo
#

Also whats your underlying issue?

#

Because everyone else in that thread is using usb based interfaces

#

What does your lsusb output?

fluid gulch
#

Okay taking a step back, I have a WiFi and Bluetooth combo card, the WiFi works just fine but NOTHING picks up any reference for a bluetooth device

#

23:00.0 Network controller [0280]: Qualcomm Technologies, Inc WCN785x Wi-Fi 7(802.11be) 320MHz 2x2 [FastConnect 7800] [17cb:1107] (rev 01)

#

That's the card

true cargo
#

Thats not what lsusb outputs

fluid gulch
#

It's a PCI card, but has a wire that is plugged into the USB headers on my MOBO

true cargo
#

Post lsusb here

fluid gulch
#
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 054c:0ce6 Sony Corp. DualSense wireless controller (PS5)
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 004: ID 1462:7d14 Micro Star International MYSTIC LIGHT 
Bus 001 Device 007: ID 1532:0511 Razer USA, Ltd RZ19-0229 Gaming Microphone
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 1532:028d Razer USA, Ltd Razer BlackWidow V4 Pro
Bus 003 Device 003: ID 046d:c08b Logitech, Inc. G502 SE HERO Gaming Mouse
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
#

Kinda made sense to me after seeing this because there is no mention of my PID in his patch so I figured I had a unique one as well

fluid gulch
#

It's gonna take a minute

#

Brb

true cargo
#

Alright

#

I will have to check out now tho

#

It's 7.24 in the morning and I need some sleep

#

You can maybe use dmsg and grep for usb and check if it picked up the device in there

fluid gulch
#

Gonna take a min to pull my PC out and get a pic

true cargo
#

Alright

fluid gulch
#

There is a wire that goes from the card and goes into JUSB1

fluid gulch
slim gazelleBOT
#

tobi_7264 received a thank you cookie!

fluid gulch
#

The card (before I attached the wire)

true cargo
#

How many pins does the wire from the card to the usb header have?

fluid gulch
#

9

true cargo
#

Do you have like a product sheet of the card?

fluid gulch
#

Like a manual?

#

This is the card

#

Basically just an adapter board rocking a Qualcomm QCNCM865

#

One of these

#

Which is Bluetooth and WiFi 7 capable

true cargo
#

I see

fluid gulch
true cargo
#

Yeah it's a pcie m2 adapter

fluid gulch
#

Those headers are attached to JUSB1 on my board

true cargo
#

Ok can you maybe check dmsg | grep usb

#

And see if anything related to the card shows up there?

fluid gulch
#

Sure thing

#

I'm not seeing anything, would you like me to drop the output in here?

true cargo
#

Sure

fluid gulch
true cargo
#
[    3.828288] usb 1-3.3: new full-speed USB device number 8 using xhci_hcd
[    3.856131] usb 1-3.3: Device not responding to setup address.
[    4.088091] usb 1-3.3: Device not responding to setup address.
[    4.292288] usb 1-3.3: device not accepting address 8, error -71
[    4.294420] usb 1-3.3: WARN: invalid context state for evaluate context command.
[    4.367329] usb 1-3.3: new full-speed USB device number 9 using xhci_hcd
[    4.394826] usb 1-3.3: Device not responding to setup address.
[    4.631826] usb 1-3.3: Device not responding to setup address.
[    4.836288] usb 1-3.3: device not accepting address 9, error -71
[    4.838414] usb 1-3.3: WARN: invalid context state for evaluate context command.
[    4.841287] usb 1-3-port3: unable to enumerate USB device
#

This might be the bluetooth card

fluid gulch
#

Any way we can grab a PID for that device or confirm it some other way?

true cargo
#

Hm maybe udev allows that?

fluid gulch
#

I'm gonna Google it, never used udev before

true cargo
#

Ahw ait

fluid gulch
#
lsusb -t
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/9p, 480M
    |__ Port 001: Dev 002, If 0, Class=Audio, Driver=snd-usb-audio, 480M
    |__ Port 001: Dev 002, If 1, Class=Audio, Driver=snd-usb-audio, 480M
    |__ Port 001: Dev 002, If 2, Class=Audio, Driver=snd-usb-audio, 480M
    |__ Port 001: Dev 002, If 3, Class=Human Interface Device, Driver=usbhid, 480M
    |__ Port 003: Dev 003, If 0, Class=Hub, Driver=hub/4p, 480M
    |__ Port 006: Dev 004, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 007: Dev 007, If 0, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 007: Dev 007, If 1, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 007: Dev 007, If 2, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 007: Dev 007, If 3, Class=Human Interface Device, Driver=usbhid, 12M
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/3p, 10000M
/:  Bus 003.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 001: Dev 002, If 0, Class=Human Interface Device, Driver=usbhid, 480M
    |__ Port 001: Dev 002, If 1, Class=Human Interface Device, Driver=usbhid, 480M
    |__ Port 001: Dev 002, If 2, Class=Human Interface Device, Driver=usbhid, 480M
    |__ Port 001: Dev 002, If 3, Class=Human Interface Device, Driver=usbhid, 480M
    |__ Port 001: Dev 002, If 4, Class=Human Interface Device, Driver=usbhid, 480M
    |__ Port 002: Dev 003, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 002: Dev 003, If 1, Class=Human Interface Device, Driver=usbhid, 12M
/:  Bus 004.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 10000M
#

|__ Port 003: Dev 003, If 0, Class=Hub, Driver=hub/4p, 480M - Probably this?

true cargo
#

Do sudo mount -t debugfs none /sys/kernel/debug and sudo cat /sys/kernel/debug/usb/devices

fluid gulch
#

Okay

#

Done

true cargo
#

Can you unplug the usb wire on the card and do it again?

#

Then you should hopefully see one less entry

fluid gulch
#

Okay one sec

#

Do I need to restart?

true cargo
#

No should be fine

#

Did you unplug your ps4 controller?

fluid gulch
#

Yeah I had to, did that throw everything off?

true cargo
#

No but thats the only thing that changed between the two

fluid gulch
#

Damn

#

Idk if it helps at all but I know nothing is physically broken cus it works in Windows

true cargo
#

Ok I'm sorry but someone else will need to look into this deeper because at this point I have no Idea how to debug on kernel level anymore

#

Also I despreatly need sleep

#

Good luck to you

fluid gulch
#

I very much understand, have a nice one

fluid gulch
#

So update, idk wtf happened but I can't get the card to work in Windows11 either I'm going to bed this is a god damn headache

fluid gulch
#

Update, card got RMA'd new card had PCID found within the patch everything works now.