Questions about configuring ath10k wifi

I'm hoping to get FreeBSD installed on a Chromebook I have. The chromebook is running coreboot and I have devuan/debian on it at the moment.

The machine uses a Qualcom Atheros QCA6174 wireless adapter

LSPCI:
01:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)

I found a package for ath10k which lists this card wifi-firmware-ath10k-kmod, it supports several cards and I'm hoping one of the two 6714 options will work for mine,
  • qca6174_hw21: wifi-firmware-ath10k-kmod-qca6174_hw21
  • qca6174_hw30: wifi-firmware-ath10k-kmod-qca6174_hw30

My question is, what do I do after installing that? I tried loading both with kldload, and I actually found that there are more than two, in /boot/modules with the model of my wifi chipset.

Sorry I'm new to this, my other machines have intel wifi, so the installer takes care of the rc.conf part for me. I figured I'd ask someone who knows rather than bork the system and need to install a third time.

Thanks!
 
You don't need to reinstall the entire OS for a driver. Even if you loaded the wrong one. It would simply not attach to the card and do nothing.

That said, it would be interesting to see the pciconf(8) output of this card. It contains a vendor and device ID. Those IDs are used to find the correct driver. If we know the exact IDs of your card we can look at the IDs the driver supports and tell you which one you would need (or if it's supported at all). Firmware is important too, the card would need it to function, but the firmware on its own won't do anything if there's no driver.

 
Okay, honestly I guess I didn't realize that the driver and the firmware are two separate things. I mean, I do know this, but I didn't think of it in this context until reading your post, so thank you for the clarification! I'm assuming then that I install the above mentioned firmware package, and then perhaps load something like "ath" or "ath_pci" in rc.conf?

Here's the pciconf info, vendor 0x1022 device 0x15b5 and not sure weather or not if you need these but to save time if we do, subvendor 0x1a56 and subdevice 0x1435, class 0x028000 and rev 0x32.

Thanks so much for the quick reply!!

Also, I did read over the handbook pages for wireless and network, as well as some kernel stuff. And I scanned through the page on fresh ports aswell, and tldr I just couldnt figure this out.

Ben
 
The machine uses a Qualcom Atheros QCA6174 wireless adapter
The QCA6174 is not officially supported yet, its driver a work in progress. There is a ath10k kernel driver module in the FreeBSD source code, but it is disconnected from build. That means the driver is not build automatically for official releases, it must be build manually.

You could build the driver from source manually, but only for testing purposes, not real usage.

. https://cgit.freebsd.org/src/tree/sys/modules/ath10k

I suggest, if wifi is needed, get a cheep supported dongle. Maybe you have one laying around .
 
I've used the wifibox vm package with very good results on my desktop with an intel card. Seeing as this works find under linux, I think that'd be a good option. The double nat is annoying, but tolerable for web browsing. It becomes annoying when I can't ssh in, from another device. And I've done port forwarding to allow that but for some reason when I do that I can see in the the wifibox computer but all of the sudden can no longer ssh another machine FROM the one running the wifibox vm.

I like to tinker though, so I'll probably try building the driver. I'm still curious if there is a generic answer to my question though, about how one would go about using one of these drivers other than just installing the package. I couldn't find any documentation specific to it.
 
I'm still curious if there is a generic answer to my question though, about how one would go about using one of these drivers other than just installing the package. I couldn't find any documentation specific to it.
If you are using a GENERIC kernel (the one which gets installed with the FreeBSD installer images, not a custom configured kernel and modules), nothing has to done to load a base system kernel driver. FreeBSD, in its default configuration, has the capability to load the driver automatically by devmatch(8). It runs as a service, /etc/rc.d/devmatch, ( rc(8) ), which is enabled by default:

/etc/defaults/rc.conf
Code:
devmatch_enable="YES"   # Demand load kernel modules based on device ids.

See also manual of ath10k driver ( from source. The manual is also disconnected from build, not available online or on system).

Package installed kernel module drivers must be loaded explicitly. Those kernel driver modules display a post-install message, giving information how to proceed, for example net/intel-ixl-kmod:

from the post-install package message
Code:
Usage:
To load the updated version of the driver add this:

if_%%PORTNAME%%_updated_load="YES"

to your /boot/loader.conf and reboot the machine.
(%%PORTNAME%% would be replaced by "ixl")

In case you miss the post-install message, re-view them with pkg info -D <package_name> or from all installed packages which have a message pkg info -Da.
 
If you are using a GENERIC kernel (the one which gets installed with the FreeBSD installer images, not a custom configured kernel and modules), nothing has to done to load a base system kernel driver. FreeBSD, in its default configuration, has the capability to load the driver automatically by devmatch(8). It runs as a service, /etc/rc.d/devmatch, ( rc(8) ), which is enabled by default:

/etc/defaults/rc.conf
Code:
devmatch_enable="YES"   # Demand load kernel modules based on device ids.

See also manual of ath10k driver ( from source. The manual is also disconnected from build, not available online or on system).

Package installed kernel module drivers must be loaded explicitly. Those kernel driver modules display a post-install message, giving information how to proceed, for example net/intel-ixl-kmod:

from the post-install package message
Code:
Usage:
To load the updated version of the driver add this:

if_%%PORTNAME%%_updated_load="YES"

to your /boot/loader.conf and reboot the machine.
(%%PORTNAME%% would be replaced by "ixl")

In case you miss the post-install message, re-view them with pkg info -D <package_name> or from all installed packages which have a message pkg info -Da.
I didn't get a post install message, thank you for the links (manual etc) because that is what I was trying to find!

The driver will auto-load without any user interaction using
.Xr devmatch 8
if enabled in
.Xr rc.conf 5 .
.Pp
Only if auto-loading is explicitly disabled, place the following
lines in
.Xr rc.conf 5
to manually load the driver as a module at boot time:
.Bd -literal -offset indent
kld_list="${kld_list} if_ath10k"

So does this mean that I shouldn't need anything in my rc.conf file in order for this to work??

And if I did use it, do I use "kld_list=if_ath10k"? or do i need to use something specific like:
ben@vmtc:~ % ls /boot/modules/*6174*
/boot/modules/ath10k_QCA6174_hw2_1_board_2_bin.ko
/boot/modules/ath10k_QCA6174_hw2_1_board_bin.ko
/boot/modules/ath10k_QCA6174_hw2_1_firmware_5_bin.ko
/boot/modules/ath10k_QCA6174_hw3_0_board_2_bin.ko
/boot/modules/ath10k_QCA6174_hw3_0_board_bin.ko
/boot/modules/ath10k_QCA6174_hw3_0_firmware_4_bin.ko
/boot/modules/ath10k_QCA6174_hw3_0_firmware_6_bin.ko
Actually, as I am posting this, I have re-read your reply... So I take it you're saying it is a WIP because it's not ready to be in base? Is there a component I need to build from source? Your link in 2nd to last post is just a make file.


I'm assuming @ this point that with the wifi-firmware-ath10k-kmod pkg installed, I can then add "kld_list=if_ath10k" to my rc.conf, and maybe this'll work??
But trying /w kldload instead I get:
kldload: can't load if_ath10k: No such file or directory
So is if_ath10k the thing I need to build from source? If so, do I download that makefile and run make or something? Sorry for my lack of knowledge, I tried what I could think of reading on my own I'm still new to freebsd. pkg info didn't seem to help:
# pkg info -D wifi-firmware-ath10k-kmod
wifi-firmware-ath10k-kmod-20230310:
#
 
So I take it you're saying it is a WIP because it's not ready to be in base?
As I understood it, it's included with the source but it's not activated to build yet, that's why the kernel module doesn't exist. And yes, it's still a work in progress, so YMMV.
Is there a component I need to build from source? Your link in 2nd to last post is just a make file.
Yes. On your system you have to cd /usr/src/sys/modules/ath10k, you'll find the Makefile there. Then run make install. That should build and install the driver.
 
On your system you have to cd /usr/src/sys/modules/ath10k, you'll find the Makefile there. Then run make install. That should build and install the driver.
Apparently the ath10k kernel module requires a dependency kernel module.
In addition:
Code:
 # cd /usr/src/sys/modules/athk_common
 # make install
The above dependency module is loaded automatically when if_ath10k gets loaded.
 
Thank you so much, both you guys are awesome!

I had to do an offline bootstrap of pkg, and download the fw package in a vm to put it on a usb stick /w pkg. I built and installed both modules. ath10k, athk_common
My device now appears to be working, and I can do sysctl -n net.wlan.devices and sure enough I see it.

I made a wpa_supplicant.conf file with my ssid and password, and ran wpa_supplicant -iwlan0 -e/etc/wpa_supplicant.conf and it looks to be doing everything right but I'm getting auth errors. Going to try it on an open network without a password to troubleshoot.

Do I need to add these to my /boot/loader.conf?? As per https://freebsdfoundation.org/resource/networking-basics-wifi-and-bluetooth/
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"


EDIT: Also, do I need to specify a driver /w wpa_supplicant? I've never needed to before on intel cards, -Dbsd worked iirc, or not specifying anything at all.
 
UPDATE so I tried making a hotspot off my phone, with no password, just open network & visible ssid. To connect to this I did ifconfig wlan0 ssid wl and it connected without issue, as far as I could tell; the carrier status no longer said disconnected and instead said associated. However, it did not get an IP via dhcp (which is probably because of missing configuration on my part). However, I ran dhclient wlan0 and this didn't get it an IP, I'm not sure why. I did this without using wpa_supplicant, by the way, because as I understand it wpa_supplicant is for networks that need authentication. I also tried my home network several times, with wpa_supplicant, and as said above I get auth errors, errors about a 4 way handshake. Still thinking I may just be missing some configuration. I'm going to look at another FreeBSD install so I can see how a proper setup to my home network /w the iwl driver looks.
 
Any ideas? I've made sure to load all the relevant modules, as far as I know.

This is what I'm getting: Some things I thought may be most relevant are in bold.

media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) status: no carrier
nd6 options=29<PERFORMNUD, IFDISABLED, AUTO_LINKLOCAL>
root@chronobsd:" # wpa_supplicant -c /etc/wpa_supplicant.conf -iwlan0
Successfully initialized wpa_supplicant
ioctl(SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
ioctl(SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
wlan0: Trying to associate with my:ma:ca:dd:re:ss (SSID='MySSID_24' freq=2447 MHz)
wlan0: Associated with my:ma:ca:dd:re:ss
wlan0: CTRL-EVENT-DISCONNECTED bssid=my:ma:ca:dd:re:ss reason=0
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="MySSID_24" auth_failures=1 duration=10 reason=WRONG KEY
wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="MySSID_24"
wlan0: Trying to associate with my:ma:ca:dd:re:ss (SSID='MySSID_24' freq=2447 MHz)
ath10k0: 1kpi_iv_newstate: error 95 during state transition 2 (AUTH) -> 2 (AUTH)
wlan0: Authentication with my:ma:ca:dd:re:ss timed out.
wlan0: CTRL-EVENT-DISCONNECTED bssid=my:ma:ca:dd:re:ss reason=3 locally_generated=1
BSSID my:ma:ca:dd:re:ss ignore list count incremented to 2, ignoring for 10 seconds
wlan0: CTRL-EVENT-DSCP-POLICY clear_all
wlan0: Trying to associate with my:ma:ca:dd:re:ss (SSID='MySSID_24' freq=2447 MHz)
wlan0: Associated with my:ma:ca:dd:re:ss
wlan0: CTRL-EVENT-DISCONNECTED bssid=my:ma:ca:dd:re:ss reason=0
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="MySSID_24" auth_failures=2 duration=38 reason=WRONG_KEY
EDIT: Replaced small grainy phone picture with text above

Also, just to confirm I am definitely using the correct wpa key, in plain text in my wpa_supplicant.conf. I have no issues connecting to this network with my other two FreeBSD machines which use wifi.
 
As mentioned before, the ath10k is not fully supported, a work in progress.

I see two options:
  • get in touch with the developer of the ath10k driver Bjoern A. Zeeb on freebsd-wireless@freebsd.org (subscribe here), but there is no guarantee of a solution
  • or try net/wifibox (package name wifibox-ath10k), it might work for your system
Code:
Wifibox deploys a Linux guest to drive a wireless networking card on
the FreeBSD host system with the help of PCI pass-through. [...]

One of the prerequisites is
A CPU that is supported by bhyve PCI pass-through (I/O MMU) with~256 MB physical memory or less
depending on the guest, and some disk space available for the guest virtual disk image.
If your systems CPU supports I/O MMU it should get the device working.
 
I'll get in touch with him, hopefully I can be of some use to the devel of the driver in some way. Thank you.

As for wifibox, I initially thought that'd be the 'easy way', but trying it now I'm realizing it doesn't 'just work' like it has for me on other boxes.

The laptop has an AMD A4-9120, which supports amd-v. I don't see the CPU on wifibox's compat list https://github.com/pgj/freebsd-wifibox but the list is quite small.

I downloaded wifibox-ath10k with the dependencies on another fbsd box and put it on a flash drive, installed it on the chromebook, configured it as best I could.

For my devmatch blacklist I did ath10k_pci and if_ath10k. I don't know if that's right.

To /boot/loader.conf I've added hw.vmm.amdvi.enable=1


When I start it up with wifibox now, I get a loop of:
launchng guest with bhyve
destroying guest wifibox
destroying ppt device pci 1:0:0
ppt device could not be destroyed
guest crashed

It seems like either the PCI passthru simply isn't working, or that perhaps I've missed something. Maybe also that for some reason the VM doesn't have the right driver for the card? My card is listed as working though, on the wifibox github page linked above. (and I used the ath10k wifibox package to install from)

Thanks for all the help so far!
 
Part of the log, tried to get a nice chunk of it without posting duplicated lines
2024-06-30T12:45:18-0400 INFO VM manager launched
2024-06-30T12:45:18-0400 INFO Gathering necessary configuration files for launching the guest
2024-06-30T12:45:18-0400 INFO Pulling bhyve options from configuration file
2024-06-30T12:45:18-0400 INFO Guest console is configured to use
2024-06-30T12:45:18-0400 INFO Passthru devices configured: [1/0/0]
2024-06-30T12:45:18-0400 INFO PPT driver is configured for pci1:0:0 device
2024-06-30T12:45:18-0400 INFO tap interface is configured: tap0
2024-06-30T12:45:18-0400 INFO Launching guest wifibox from /usr/local/share/wifibox with grub-bhyve
2024-06-30T12:45:18-0400 INFO Application config is found at /usr/local/etc/wifibox/wpa_supplicant
2024-06-30T12:45:18-0400 INFO Application config will be mounted writeable
2024-06-30T12:45:19-0400 INFO Launching guest wifibox from /usr/local/share/wifibox with bhyve
2024-06-30T12:45:19-0400 INFO Destroying guest wifibox
2024-06-30T12:45:20-0400 INFO Destroying bhyve PPT device: pci1:0:0
2024-06-30T12:45:20-0400 WARN PPT device pci1:0:0 could not be destroyed
2024-06-30T12:45:20-0400 INFO VM manager: guest crashed, signaling restart after 5 seconds
2024-06-30T12:45:26-0400 INFO Detached from the guest
2024-06-30T12:45:26-0400 INFO End: wifibox console

and here is kldstat, if that is helpful
Id Refs Address Size Name
1 124 0xffffffff80200000 1f370e8 kernel
2 1 0xffffffff82c30000 5f90 ig4.ko
3 1 0xffffffff82c36000 3220 intpm.ko
4 1 0xffffffff82c3a000 2178 smbus.ko
5 1 0xffffffff82c3d000 7798 if_bridge.ko
6 1 0xffffffff82c45000 60e0 bridgestp.ko
7 1 0xffffffff82e00000 33e438 vmm.ko
8 1 0xffffffff82c4c000 21dc nmdm.ko
9 1 0xffffffff82c4f000 33a0 if_urndis.ko
10 1 0xffffffff82c53000 3190 uether.ko
11 1 0xffffffff82c57000 4d20 ng_ubt.ko
12 6 0xffffffff82c5c000 abb8 netgraph.ko
13 2 0xffffffff82c67000 a250 ng_hci.ko
14 4 0xffffffff82c72000 2670 ng_bluetooth.ko
15 1 0xffffffff82c75000 3218 iichid.ko
16 4 0xffffffff82c79000 3380 hidbus.ko
17 1 0xffffffff82c7d000 e268 ng_l2cap.ko
18 1 0xffffffff82c8c000 1bf68 ng_btsocket.ko
19 1 0xffffffff82ca8000 38f8 ng_socket.ko
20 1 0xffffffff82cac000 21e8 hms.ko
21 1 0xffffffff82caf000 30a8 hidmap.ko
22 1 0xffffffff82cb3000 21b8 ietp.ko
23 1 0xffffffff83200000 502958 amdgpu.ko
24 2 0xffffffff82cb6000 7c050 drm.ko
25 1 0xffffffff82d33000 22b8 iic.ko
26 3 0xffffffff82d36000 3080 linuxkpi_hdmi.ko
27 3 0xffffffff82d3a000 6350 dmabuf.ko
28 3 0xffffffff82d41000 3378 lindebugfs.ko
29 1 0xffffffff82d45000 b360 ttm.ko
30 1 0xffffffff82d51000 6360 amdgpu_stoney_pfp_bin.ko
31 1 0xffffffff82d58000 6360 amdgpu_stoney_me_bin.ko
32 1 0xffffffff82d5f000 4360 amdgpu_stoney_ce_bin.ko
33 1 0xffffffff82d64000 6438 amdgpu_stoney_rlc_bin.ko
34 1 0xffffffff82d6b000 42360 amdgpu_stoney_mec_bin.ko
35 1 0xffffffff82dae000 4a60 amdgpu_stoney_sdma_bin.ko
36 1 0xffffffff82db3000 45bc0 amdgpu_stoney_uvd_bin.ko
37 1 0xffffffff8313f000 2ac80 amdgpu_stoney_vce_bin.ko

 
So, tonight I finally got around to taking this chromebook apart, and sticking in a good 'ol intel wifi card. But, didn't work. Absolutely nothing in pciconf -lv on the BSD side, nor anything in Linux with lspci. I tried dmesg|grep intel on both OSs, and saw nothing of interest. I vaguely remember something about intel wifi / bt chipsets needing to be used on an Intel platform in order to work, haven't looked that up yet but obviously something isn't jiving here. I do not think it is a BIOS/EFI white/black list, because I have (what I assume to be) vanilla coreboot on this thing. Kind of a bummer.

Will report back when I get the Ath card working, or get closer.
 
Back
Top