Using 5/10 Mhz channels with IPQ-4019 with ath10k

Hi,

I have a device with IPQ-4019 running latest OpenWRT, it uses the ath10k driver and firmware from OpenWRT.

With ath9k I can run the module with 5/10 Mhz channels using the included patch in openwrt and chanbw file.

I am trying to understand if 5/10 Mhz works nowdays in OpenWRT and if it is supported out of the box or requires patches.

According to this comment:

And this files:
https://svn.dd-wrt.com/browser/src/router/mac80211/ath10k-firmware-38eeda3ae6f90fde5546bdd48ee4ff3090f238c0/ath10k/QCA4019/hw1.0

It is supported in DD-WRT with @brainslayer custom firmware, I am just not sure it runs on the IPQ-4019 (QCA4019?) and if nowdays the OpenWRT firmware supports it?

1 Like

do you add only this? if so add the 701 patch.

I haven't tried it yet, have you managed to get it working?

From the patch in aredn which is on top of openwrt it seems it just works with the ath10k-ct firmware. I will try and update

no, i do this on my ath9k devices only.

Tried this with the following patches:

  1. https://github.com/aredn/aredn/blob/main/patches/742-5-and-10mhz-ath10k-ct-support.patch
  2. https://github.com/aredn/aredn/blob/main/patches/701-extended-spectrum.patch
  3. https://github.com/aredn/aredn/blob/main/patches/744-dd-wrt-firmware.patch

Then i tried the following firmware packages:
ath10k-firmware-ct
ath10k-firmware-ct-full-htt

And lastly the latest from dd-wrt:
https://svn.dd-wrt.com/browser/src/router/mac80211/ath10k-firmware-38eeda3ae6f90fde5546bdd48ee4ff3090f238c0/ath10k/QCA4019/hw1.0/firmware-5.bin

All of them looks the same, chanbw is available but setting it to 10 doesn't do anything, it still works as a 20mhz (or 80mhz if it is set in the UI).

I am using:
8Devices Habanero with IPQ4019
OpenWRT 23.0.5.2 with kernel 5.15

@BrainSlayer can you please help here? In the previous post:

It was mentioned that IPQ4019 works

it works only with the dd-wrt firmwares since they contain some patches in it to get it to work on all chipsets. for the rest its pretty simple.
set the desired mode 5 or 10 mhz with procfs chanbw and then setup the device using standard 20 mhz operation modes.

@BrainSlayer thank you for the resposne, I tried your firmware:

https://svn.dd-wrt.com/browser/src/router/mac80211/ath10k-firmware-38eeda3ae6f90fde5546bdd48ee4ff3090f238c0/ath10k/QCA4019/hw1.0/firmware-5.bin

With the ath10k-ct kernel with the patches from aredn and it didnt work...it stays at 20mhz even after setting the chanbw.

Any pointers? Does dd-wrt kernel with ath10k driver contains the necessary changes?

Do I need to also change the reg.db? Any instructions?

the patches are not enough. please read what i wrote how to setup it and clarify what you did to initialize the interface. the patches do not contain any configuration handling from what i have seen and consider that the gui will indeed report only 20 mhz,but that doesnt mean that i does not operate on 10 mhz or 5 mhz. this is invisible unless you do some more patches in mac80211 (which i did in dd-wrt)

I patched it, put your firmware and manually set chanbw in the sysfs node.

I am not saying it doesn't work since the UI isnt correct.

I am saying it doesnt work since:

  1. I can still see the network on my phone and computer
  2. I can't see it on my device with ath9k with 10 mhz setting that works with a mikrotik device that has 10mhz capability.

I read all your posts several times, really trying to find the issue.

After I get all of this working I am going to post a guide with all clarifications since there isn't one

can you send me your firmware image you are using? (i guess you know how to find my email correct?) and if possible also a kernel log. i can just imaging that the cause is that the chipset isnt correctly detected by the firmwares .there are 2 chipset variants. one has 5 and 10 mhz working by its default. the other variant needs a hack handled by the firmware. usually the chipset isnt detected correct. just a guess. the chipid can be normally seen if firmware debugging is enabled (ath10k debug must be enabled for that).
the printout from the firmwares looks like that (and thats what i'm looking for)

[ 12.408200] ath10k_ahb a000000.wifi: ChipType 1100 ChipTypeID 30 BoardID 14 P 80/80 V 16 K 160 PH 272 T 282 msdu-desc: 2500 sw-crypt: 0
[ 13.574066] ath10k_ahb a800000.wifi: ChipType 1100 ChipTypeID 30 BoardID 15 P 80/80 V 16 K 160 PH 272 T 282 msdu-desc: 2500 sw-crypt: 0

in worst case i just will do a test firmware which does enable the hack required for that chip without any chipid check. but this firmware may not work on devices which do not require this hack.

Thank you! Currently I am away from my equipment so I will be able to send this to you tomorrow, found your email too :slight_smile:

Just to make sure I get you everything needed, you want a kernel log and the ath10k firmware I used or the whole openwrt image?

Regarding firmware debug enabled, is that the ATH10K_DEBUG flag? I belive that one is set as if not I wouldn't have chanbw either, no?

And one last question, there is a variant with ipq4029 - should be the industrial version of the 4019 - you mean that one is auto detected by your firmware and doesn't require the pll clock change?

yes its a standard debug flag. but must be set at driver load time, since we need the firmware debug infos. so ath10k_debug is one thing. but there is a module parameter which enables it at the end

Gotcha just for the poor folks that might go this rabbit hole this is what you mean?

https://wireless.wiki.kernel.org/en/users/drivers/ath10k/debug

modprobe ath10k_core.ko debug_mask=0xffffffff

i have to look into the code later. but its a good start to get all the shitload. but i just need these 2 lines

i just see that there is also a sysfs named fw_dbglog which enables the firmware logging. the only problem point here is that the firmware bootmessage comes earlier than you can set this flag

my solution in dd-wrt (in dd-wrt its always on since the fw does only print a bootup message and nothing else which creates noise. i simply replaced the trace_ath10k_wmi_dbglog function with ath10k_info

int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
{
ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event debug mesg len %d\n",
skb->len);
char s[128];
memset(s, 0, sizeof(s));
memcpy(s, skb->data,
skb->len > sizeof(s) - 1 ? sizeof(s) - 1 : skb->len);
if (strlen(s))
ath10k_info(ar, s);
// trace_ath10k_wmi_dbglog(ar, skb->data, skb->len);

    return 0;

}

Thanks to @BrainSlayer help I managed to get this working and have assembled all the information as a guide here: