Open Emrion opened 5 years ago
I found where lie the compiled files (and it was actually obvious). Nevertheless, I still get stuck on trying to compile this code on a 12 kernel version.
Sorry we havn't gotten back to you, I will review your issue later today and see what I can come up with.
For your information, on a 13-CURRENT, I get a kernel page fault when I load if_athp. It also complains that it cannot load some firmwares; it's very close to what bradleythughes got. I tried master, NEW_ATHP_ARVIF_LOCK (same as master?) and tx_power_change branches. Same results each time.
I have a QCA6174, so I copy only the .ko and .bin from the corresponding folders. Is this ok so? I saw that it tried to load the 3.0 firmwares.
pciconf -lv: none3@pci0:1:0:0: class=0x028000 card=0x86cd1043 chip=0x003e168c rev=0x32 hdr=0x00 vendor = 'Qualcomm Atheros' device = 'QCA6174 802.11ac Wireless Network Adapter' class = network
Is this a Surface Go? I can solve these issues, you need a specific board.bin, board-2.bin and firmware-6.bin.
Try these files: https://drive.google.com/file/d/107PePJLBYtp8AhbbDAKTpDERePvMO5x5/view?usp=sharing Also remove the hw2.0 folder.
Is this a Surface Go? I can solve these issues, you need a specific board.bin, board-2.bin and firmware-6.bin.
No. It's a PC based on Asus H170I-PRO / i3 7100T. My goal is to make use the QCA6174 device by pfSense (build on a 12 FreeBSD version) as host access point. But to be clear, up to now, I only tried to compile athp under pure FreeBSD.
There is only one file in your link (board.bin), shall I place it in /boot/module? Do I have to rename it?
Reading the error generated when it loads if_athp under 13-CURRENT, I see:
Then, it crashes soon after with a page fault.
But I would like to compile athp under a 12-RELEASE. This is my main concern at the moment.
Can you get me a full log please.
Did you replace the board file in the athp_QCA6174_hw3.0_board folder when you compiled, or after you compiled? You need to replace the file before you compile so that it compiles the .ko for that board file.
So, I wiped out all my precedent trials to be sure to take the master branch. I copied the file you provided board.bin in athp/otus/freebsd/src/sys/modules/athpfw/athp_QCA6174_hw3.0_board. Then, I compiled athp. After that, I copied in /boot/modules and /boot/kernel the .ko and .bin files from athp/otus/freebsd/src/sys/modules/athpfw/athp_QCA6174_hw3.0_board and athp/otus/freebsd/src/sys/modules/athpfw/athp_QCA6174_hw3.0_firmware-4. Finally, I typed: kldload if_athp. The kernel crashes as well but the error isn't the same as before. Now, it's a general protection fault. I can't take all the output in a single picture (sorry for the poor quality, can't do better with my phone). Tell me if something important is missing.
hm, looks like it's crashing inside rx_ring_fill_n; i wonder why. can you get a kernel coredump and use gdb on it to figure out the line number?
kgdb /boot/kernel/kernel /var/crash/core.X
then when it loads, do "bt"
-a
That stuff below is more important if you can get me an image of the rx ring calls at the bottom I would like that.
I reloaded if_athp but the error changed and returned to "page fault". I have no file in /var/crash (I set dumpdev="AUTO" in rc.conf) except minfree. I attach two pictures, hoping they will have the informations you need.
Do me a favour, Try my branch out. https://github.com/Geramy/athp/tree/NEW_ATHP_ARVIF_LOCK it looks like wmi is using the conf lock. I have removed the conf lock from wmi it will be in master once we confirm it's working 100% I tested it last night and it was working. Let me know if this fixes the issue.
I already tried this branch. But this time, I used your board.bin. Here is what I get:
As of last night I did new commits, as of when did you try this branch, and have you tried the parent master branch, please make sure your on the latest revision.
I cloned your code just before with: git clone --branch NEW_ATHP_ARVIF_LOCK https://github.com/Geramy/athp
Should I try without adding board.bin?
You could give that a shot but I have a feeling that the card isnt finishing one of the startup procedures and we either arnt sleeping on something we need to or something like that. This is a lock issue. I'll have to purchase that card to verify. Can you provide me the cards model and manufacturer? When I get home in 20 minutes I'll try to patch my branch with a fix also I might be able to find it in a few trys with what you sent me.
I tried NEW_ATHP_ARVIF_LOCK without adding build.bin but it crashed with the same error as above. The wifi module is embedded in the motherboard (Asus H170I-PRO). I believe it is this hardware: https://www.qualcomm.com/products/qca6174a-dual-band-wi-fi
Many thanks for all you do to get it works.
Hey were you able to compile this for freebsd 12? I was able to get it to compile with some changes. But there are no iw tools for pfsense.
Alas, no. Always these symbols undefined (they should for they come from sys/mutex.h, IIRC). Do you have a branch compilable under freebsd 12? If not, can you tell me the changes you made? I would like to test it just to be sure that the crash doesn't come from an instable feature in freebsd CURRENT.
Also, I tried to enable the bluetooth module (I disabled it at the base), but no dice again under freebsd 13.
I don't know precisely concerning iw tools but one can set a host AP with pfSense (I thought it used iw). I just lack a suitable interface up to now. :-)
I'm doing something that can interrest you: a debian 9.8 install. It have the driver but it doesn't work because some firmware files are missing. Could it be just that?
Seems, concerning debian, I have to install a package that provide them: firmware-atheros.
I have submitted the changes to get it to compile for freebsd 12.0 https://github.com/Geramy/athp/tree/NEW_ATHP_ARVIF_LOCK
@Emrion have you compiled pfsense before? if_athp also requires alq.so module just so you know. I am working on compiling pfsense from source i'm not sure how exactly but i'll get through it.
Concerning FreeBSD 12: the good new is it compiles now like a charm; the bad one is I get the same crash when I load if_athp. Anyway, it generated a core file and here is the result of kgdb / bt:
#0 __curthread () at ./machine/pcpu.h:230
#1 doadump (textdump=<optimized out>) at /usr/src/sys/kern/kern_shutdown.c:366
#2 0xffffffff80b9b14b in kern_reboot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:446
#3 0xffffffff80b9b5c3 in vpanic (fmt=<optimized out>, ap=0xfffffe004e8ea310) at /usr/src/sys/kern/kern_shutdown.c:872
#4 0xffffffff80b9b3b3 in panic (fmt=<unavailable>) at /usr/src/sys/kern/kern_shutdown.c:799
#5 0xffffffff8107496f in trap_fatal (frame=0xfffffe004e8ea500, eva=0) at /usr/src/sys/amd64/amd64/trap.c:929
#6 0xffffffff810749c9 in trap_pfault (frame=0xfffffe004e8ea500, usermode=0) at /usr/src/sys/amd64/amd64/trap.c:765
#7 0xffffffff81073fee in trap (frame=0xfffffe004e8ea500) at /usr/src/sys/amd64/amd64/trap.c:441
#8 <signal handler called>
#9 0xffffffff83376189 in __ath10k_htt_rx_ring_fill_n () from /boot/kernel/if_athp.ko
#10 0xffffffff8337373b in ath10k_htt_rx_ring_fill_n () from /boot/kernel/if_athp.ko
#11 0xffffffff833736c5 in ath10k_htt_rx_ring_refill () from /boot/kernel/if_athp.ko
#12 0xffffffff8333e16c in ath10k_core_start () from /boot/kernel/if_athp.ko
#13 0xffffffff8333f837 in ath10k_core_probe_fw () from /boot/kernel/if_athp.ko
#14 0xffffffff83342c88 in attempt_ath10k_core_probe_fw () from /boot/kernel/if_athp.ko
#15 0xffffffff83340c97 in ath10k_core_register_work () from /boot/kernel/if_athp.ko
#16 0xffffffff80bf9cb4 in taskqueue_run_locked (queue=0xfffff800049bc700) at /usr/src/sys/kern/subr_taskqueue.c:465
#17 0xffffffff80bfae18 in taskqueue_thread_loop (arg=<optimized out>) at /usr/src/sys/kern/subr_taskqueue.c:757
#18 0xffffffff80b5bf33 in fork_exit (callout=0xffffffff80bfad80 <taskqueue_thread_loop>, arg=0xfffffe00003b40f0,
frame=0xfffffe004e8ea9c0) at /usr/src/sys/kern/kern_fork.c:1057
I don't know if it'll be of some use.
About pfSense: I never compiled it. I think it isn't easy. However, my first trial would be to load the driver compiled under pure FreeBSD 12 into pfSense (the development version which is based on a 12 FreeBSD).
It's the same issue I'll have to think about this more.
I think the firmware probe is still failing, I did a checkup on the failure and it looks like it could be because the firmware fails to load. Maybe try another board, can you get the firmware files from the original driver or operating system?
Try one of these qca6174 bin files one is a board-1 the smaller one and one is board-2 the bigger file. https://drive.google.com/folderview?id=1jSiXYUCR6TtTdveW4dD7NzF1rwh4jdEo
Thanks but I can't dl them. It asks me a google account... Can you make them public? Where should I place the file I'm testing? I have to recompile athp?
PS: I somewhat solved my problem by a bhyve VM with debian as guest. It receives the device QCA6174 as passthru and connects it on virtual bridges. But I would prefer a driver that can work under pfSense (upcoming version based on 12.0 FreeBSD).
Tnx for your hard work, it's working on my freebsd 12 after following all your directions here, now i need to find a way to port this on pfsense somehow, it's not working if i move the modules on my pfsense box, missing alq and firmware say "image firmware table full", @Geramy were you able to compile the kernel for pfsense?
Here is a tutorial on how to build pfsense, https://github.com/PiBa-NL/PiBa-NL-WIKI/wiki/How-to-building-a-pfSense-.iso-from-sources
I actually myself have not been able to build pfsense, its the worst to try to build, trust me. I think the best solution is to actually find the exact freebsd kernel the latest pfsense iso you can get and rebuild the freebsd kernel from source and all the modules, then build the ath10k based on those sources, the new ones. your going to be missing tons of modules as pfsense doesnt include them all so what you should be doing is most likely just overwrite all the files from the kernel source you built. That will also get you some of the required modules you are missing.
now i'm trying to rebuild only the kernel, i have downloaded from here https://github.com/pfsense/pfsense, i see there is a script that let you build only the kernel. but i need time to understand how to properly do it
When I get home tonight ill look in to this again and see if anything can be done.
i was able to build a working kernel ./build.sh --setup copy build.conf.sample in build.conf ./build.sh --build-kernels at the end kernel was inside pfsense/tmp/pfSense_master_amd64-core/.real_20190514-1256/All/pfSense-kernel-pfsense-2.5.0.a.20190514.1256.txz i have copied it inside a vm pfsense and it boot. now i need to understand where to put options to add alq found it tested with virtual machine only https://drive.google.com/open?id=1BT2DGkCvJC9U7gUBR6gdKFDX-yGezXv-
There should be a config for the kernel and way to go. Good work on this!
ok, it work under a real pfsense machine but there is no options in the GUI to configure the access point, i can only assign interface
i must configure it manually from the console somehow
I believe you have to manually configure it from the console because there is no vap support for this driver yet, "virtual access point", please provide me the link to the iso and i'll give it a shot at home tonight and try to get the log information out to create a small patch that lets us hack around the no vap support.
i don't have any iso, i compiled only the kernel and it's in my google drive, i have installed from original iso that you can download from netgate website and with scp i copied inside my kernel
Are you able to send me the logs to pfsense? syslog and the like?
all the logs are here -> https://drive.google.com/open?id=1fM-Jlmf8BY21kIEGueSxFWmrISZqcDj3 take in mind that i have 2 wifi card ath0 and athp0 with ath0 (AR9485) i can see the interface in the gui to configure the wifi but not with ath0p (QCA988X)
in the meantime i have created a script /root/hostapd_athp0_wlan0.conf
interface=athp0_wlan0 driver=bsd logger_syslog=-1 logger_syslog_level=0 dump_file=/tmp/hostapd_athp0_wlan0.dump ctrl_interface=/var/run/hostapd_wlan0 ctrl_interface_group=wheel ssid=pfSense-5G debug= wpa=2 wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP wpa_group_rekey=3600 wpa_strict_rekey= wpa_passphrase=yourpasswordhere
after this i created a script inside /usr/local/etc/rc.d/hostapd-5g.sh
/usr/local/sbin/hostapd -B -P /var/run/hostapd_athp0_wlan0.pid /root/hostapd_athp0_wlan0.conf
wifi go up and running at startup
i'm going on with my test, i have 144Mbps at 2,4Ghz channel 11 ht40- but if i change mode to 11a channel 161 i have only 54Mbps ifconfig athp0_wlan0 channel 161:ht40- does not work, no error message and no 40Mhz only 20Mhz width i have tried other channel inside 5g range but same results
Have you tried channel 40? I operate my stuff at channel 40 and I believe n worked great. Oh it has to be in n mode only too. Also what is the normal statistics of that card?
i found out that it was set as 11a instead of 11na but as soon as i start hostapd it go to 11a again even on channel 40
lemme go see if I have some uncommitted regdomain.xml changes to enable it for at least the US. Sorry!
i found that setting channel=48 inside hostapd and start it , it change mode to 11a if i use ifconfig and remove the channel= from hostapd it work in short
/usr/local/etc/rc.d/hostapd-5g.sh
ifconfig athp0_wlan0 mode 11na ifconfig athp0_wlan0 channel 48:ht/40- /usr/local/sbin/hostapd -B -P /var/run/hostapd_athp0_wlan0.pid /root/hostapd_athp0_wlan0.conf
and inside /root/hostapd_athp_wlan0.conf
interface=athp0_wlan0 logger_syslog=-1 logger_syslog_level=0 dump_file=/tmp/hostapd_athp0_wlan0.dump ctrl_interface=/var/run/hostapd_wlan0 ctrl_interface_group=wheel ssid=pfSense-5G beacon_int=100 dtim_period=2 max_num_sta=255 rts_threshold=2347 fragm_threshold=2346 auth_algs=3 wmm_enabled=1 wme_enabled=1 wpa=2 wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP rsn_pairwise=CCMP wpa_group_rekey=3600 wpa_passphrase=somepassword
the problem was that i had channel=48:ht/40- before inside hostapd conf and starting it resulted in mode changed to 11a without 40 width
now i have a 300Mpbs connection on my phone
[2.5.0-DEVELOPMENT][root@pfSense.localdomain]/root: ifconfig -v athp0_wlan0
athp0_wlan0: flags=8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 00:0e:8e:5a:c6:f6
inet6 fe80::20e:8eff:fe5a:c6f6%athp0_wlan0 prefixlen 64 tentative scopeid 0xa
groups: wlan
ssid pfSense-5G channel 48 (5240 MHz 11a) bssid 00:00:00:00:00:00
regdomain FCC country US anywhere -ecm authmode WPA2/802.11i -wps
-tsn privacy MIXED deftxkey 2
AES-CCM 2:128-bit powersavemode OFF powersavesleep 100 txpower 17
txpowmax 50.0 -dotd rtsthreshold 2346 fragthreshold 2346 bmiss 7
11a ucast NONE mgmt 6 Mb/s mcast 6 Mb/s maxretry 6
11b ucast NONE mgmt 1 Mb/s mcast 1 Mb/s maxretry 6
11g ucast NONE mgmt 1 Mb/s mcast 1 Mb/s maxretry 6
turboA ucast NONE mgmt 6 Mb/s mcast 6 Mb/s maxretry 6
turboG ucast NONE mgmt 1 Mb/s mcast 1 Mb/s maxretry 6
sturbo ucast NONE mgmt 6 Mb/s mcast 6 Mb/s maxretry 6
11na ucast NONE mgmt 12 MCS mcast 12 MCS maxretry 6
11ng ucast NONE mgmt 2 MCS mcast 2 MCS maxretry 6
half ucast NONE mgmt 3 Mb/s mcast 3 Mb/s maxretry 6
quarter ucast NONE mgmt 1 Mb/s mcast 1 Mb/s maxretry 6
11acg ucast NONE mgmt 1 Mb/s mcast 1 Mb/s maxretry 6
11ac ucast NONE mgmt 6 Mb/s mcast 6 Mb/s maxretry 6
scanvalid 60 -bgscan bgscanintvl 300 bgscanidle 250
roam:11a rssi 7dBm rate 12 Mb/s
roam:11b rssi 7dBm rate 1 Mb/s
roam:11g rssi 7dBm rate 5 Mb/s
roam:turboA rssi 7dBm rate 12 Mb/s
roam:turboG rssi 7dBm rate 12 Mb/s
roam:sturbo rssi 7dBm rate 12 Mb/s
roam:11na rssi 7dBm MCS 1
roam:11ng rssi 7dBm MCS 1
roam:half rssi 7dBm rate 6 Mb/s
roam:quarter rssi 7dBm rate 3 Mb/s
roam:11acg rssi 7dBm rate 64 Mb/s
roam:11ac rssi 7dBm rate 64 Mb/s
-pureg protmode CTS ht htcompat ampdu ampdulimit 64k ampdudensity 8
amsdu shortgi htprotmode RTSCTS -puren -smps -rifs stbc -ldpctx ldpcrx
vht vht40 vht80 -vht80p80 -vht160 wme -burst -dwds -hidessid apbridge
dtimperiod 1 doth -dfs inact bintval 100
AC_BE cwmin 4 cwmax 6 aifs 3 txopLimit 0 -acm ack
cwmin 4 cwmax 10 aifs 3 txopLimit 0 -acm
AC_BK cwmin 4 cwmax 10 aifs 7 txopLimit 0 -acm ack
cwmin 4 cwmax 10 aifs 7 txopLimit 0 -acm
AC_VI cwmin 3 cwmax 4 aifs 1 txopLimit 94 -acm ack
cwmin 3 cwmax 4 aifs 2 txopLimit 94 -acm
AC_VO cwmin 2 cwmax 3 aifs 1 txopLimit 47 -acm ack
cwmin 2 cwmax 3 aifs 2 txopLimit 47 -acm
media: IEEE 802.11 Wireless Ethernet autoselect mode 11a
[2.5.0-DEVELOPMENT][root@pfSense.localdomain]/root: ifconfig athp0_wlan0 list regdomain :regdomain FCC country US anywhere -ecm Channel 1 : 2412 MHz 11b Channel 9 : 2452 MHz 11g Channel 1 : 2412 MHz 11g Channel 9 : 2452 MHz 11g ht/20 Channel 1 : 2412 MHz 11g ht/20 Channel 9 : 2452 MHz 11g ht/40- Channel 1 : 2412 MHz 11g ht/40+ Channel 10 : 2457 MHz 11b Channel 2 : 2417 MHz 11b Channel 10 : 2457 MHz 11g Channel 2 : 2417 MHz 11g Channel 10 : 2457 MHz 11g ht/20 Channel 2 : 2417 MHz 11g ht/20 Channel 10 : 2457 MHz 11g ht/40- Channel 2 : 2417 MHz 11g ht/40+ Channel 11 : 2462 MHz 11b Channel 3 : 2422 MHz 11b Channel 11 : 2462 MHz 11g Channel 3 : 2422 MHz 11g Channel 11 : 2462 MHz 11g ht/20 Channel 3 : 2422 MHz 11g ht/20 Channel 11 : 2462 MHz 11g ht/40- Channel 3 : 2422 MHz 11g ht/40+ Channel 36 : 5180 MHz 11a Channel 4 : 2427 MHz 11b Channel 36 : 5180 MHz 11a ht/20 Channel 4 : 2427 MHz 11g Channel 36 : 5180 MHz 11a ht/40+ Channel 4 : 2427 MHz 11g ht/20 Channel 40 : 5200 MHz 11a Channel 4 : 2427 MHz 11g ht/40+ Channel 40 : 5200 MHz 11a ht/20 Channel 5 : 2432 MHz 11b Channel 40 : 5200 MHz 11a ht/40- Channel 5 : 2432 MHz 11g Channel 44 : 5220 MHz 11a Channel 5 : 2432 MHz 11g ht/20 Channel 44 : 5220 MHz 11a ht/20 Channel 5 : 2432 MHz 11g ht/40+ Channel 44 : 5220 MHz 11a ht/40+ Channel 5 : 2432 MHz 11g ht/40- Channel 48 : 5240 MHz 11a Channel 6 : 2437 MHz 11b Channel 48 : 5240 MHz 11a ht/20 Channel 6 : 2437 MHz 11g Channel 48 : 5240 MHz 11a ht/40- Channel 6 : 2437 MHz 11g ht/20 Channel 149 : 5745 MHz 11a Channel 6 : 2437 MHz 11g ht/40+ Channel 149 : 5745 MHz 11a ht/20 Channel 6 : 2437 MHz 11g ht/40- Channel 149 : 5745 MHz 11a ht/40+ Channel 7 : 2442 MHz 11b Channel 153 : 5765 MHz 11a Channel 7 : 2442 MHz 11g Channel 153 : 5765 MHz 11a ht/20 Channel 7 : 2442 MHz 11g ht/20 Channel 153 : 5765 MHz 11a ht/40- Channel 7 : 2442 MHz 11g ht/40+ Channel 157 : 5785 MHz 11a Channel 7 : 2442 MHz 11g ht/40- Channel 157 : 5785 MHz 11a ht/20 Channel 8 : 2447 MHz 11b Channel 157 : 5785 MHz 11a ht/40+ Channel 8 : 2447 MHz 11g Channel 161 : 5805 MHz 11a Channel 8 : 2447 MHz 11g ht/20 Channel 161 : 5805 MHz 11a ht/20 Channel 8 : 2447 MHz 11g ht/40- Channel 161 : 5805 MHz 11a ht/40- Channel 9 : 2452 MHz 11b Channel 165 : 5825* MHz 11a
Have you tried selecting a channel that is actually ac?
I'm also testing this. What channel do you suggest? I don't see anything listed that is specifically .11ac. What should be possible in FreeBSD 12? Works great in .11n mode though.
i have tried all the channel available from 1 to 165, fcc / etsi of every country .... i have compiled also hostapd for freebsd with 802.11ac support and i put this on the config when following an howto that i found for linux,
channel=36 ieee80211n=1 ieee80211ac=1 vht_oper_chwidth=1 vht_oper_centr_freq_seg0_idx=42
no error from hostapd but as before it work only as 802.11n
Thank you all for your hard work, I will take a look into this and make any change necessary to get ac working, I will make an implementation and test ticket and please if you could follow up with that ticket in the coming up weeks. I'll submit an update on the ticket once I have it working or once I believe its working.
Hello everyone! I had the same issue as @Emrion so I followed your work and I built the bin/ko files for the kernel and modules.
Unfortunately, I had the same crashes than @Emrion, so I tried to download the bin files from your Google Drive @Geramy and... I really don't understand what I am supposed to do with those files :-/
Do I need to rename all of them to match the ko files? Do I need to remove the previous bin files I built and moved to /boot/modules? Are all of those files important or only the board ones?
Sorry but I am completely lost here :-(
Thanks in avance for your response!
I think they are obvious problems but... I can't make it to work.
The script build_modules seems to need a 13 kernel version not a 12 (it complains about undefined symbols: MA_NOTOWNED and MA_OWNED)... Is it possible to use it with a 12 version?
With a 13 kernel, I follow the instructions (no errors): running ./build_modules, building the kernel and installing it... But I can't find any file .ko or .bin in athp/otus/freebsd/src/sys/modules/athpfw/.
What I did wrong?