Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync 22/6 #139

Merged
Merged

Conversation

rmandrad
Copy link
Owner

Thanks for your contribution to OpenWrt!

To help keep the codebase consistent and readable,
and to help people review your contribution,
we ask you to follow the rules you find in the wiki at this link
https://openwrt.org/submitting-patches

Please remove this message before posting the pull request.

Ansuel and others added 30 commits June 20, 2024 23:23
224d497 srec2bin: drop unused "dum" variable
6777b2d uimage_sgehdr: use "char" type for header struct strings
81db302 uimage_sgehdr: drop unused "ltmp" variable
bd7fcc7 pc1crypt: make decrypt/encrypt functions take void * as argument
6ac4497 linksys: add magic header generation tool for e8350 v1

Signed-off-by: Christian Marangi <[email protected]>
Add a missing NULL pointer check when deleting beacons

Signed-off-by: Felix Fietkau <[email protected]>
The data is modified within hostapd_add_iface

Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
8cf816d615fd socket: fix potential memory leak in connect()
8f5f231d66cd socket: optimize poll() argument handling
36f106056069 socket: remove wrong documentation fragment
525fca224012 socket: uv_to_sockaddr(): fix length calculation for AF_UNIX addresses
3938645ad9e3 socket: support IPv6 addresses in struct conversion routines
3a586dc7ddbe socket: improve uc_socket_connect() behavior
7b269f1cd3d2 socket: improve uc_socket_listen() behavior
fc6f2b89febf socket: handle further socket option value types
d6f25797dad1 socket: add IPv6 socket options
7611487b9a05 socket: implement recvmsg(), sendmsg() and cmsg support
d2e44bfa8b54 core-lib: improved documentation
e0bab40c8578 fs: add truncate() file method
5d305cfb2ab7 fs: add lock() file method
8b0318f7fabe lib: introduce zlib library

Signed-off-by: Felix Fietkau <[email protected]>
Preparation for avoiding iw calls in /lib/wifi/mac80211.sh

Signed-off-by: Felix Fietkau <[email protected]>
Rely entirely on /etc/board.json instead of screen scraping iw cli output

Signed-off-by: Felix Fietkau <[email protected]>
224d497 srec2bin: drop unused "dum" variable
6777b2d uimage_sgehdr: use "char" type for header struct strings
81db302 uimage_sgehdr: drop unused "ltmp" variable
bd7fcc7 pc1crypt: make decrypt/encrypt functions take void * as argument
6ac4497 linksys: add magic header generation tool for e8350 v1

Signed-off-by: Christian Marangi <[email protected]>
qoriq has had kernel 6.1 as testing for 2 months now, so lets default to
it and drop 5.15 support.

Link: openwrt#15767
Signed-off-by: Robert Marko <[email protected]>
With `iw` version 6.9 frequencies are now being reported as float,
which is incompatible with wpa_supplicant's config option 'frequency'
which expects an integer.

iwinfo phy0 info output:

Version: 5.19
```
Frequencies:
  * 5180 MHz [36] (30.0 dBm)
  * 5200 MHz [40] (30.0 dBm)
  * 5220 MHz [44] (30.0 dBm)
  * 5240 MHz [48] (30.0 dBm)
  * 5260 MHz [52] (24.0 dBm)
  * 5280 MHz [56] (24.0 dBm)
  * 5300 MHz [60] (24.0 dBm)
  * 5320 MHz [64] (24.0 dBm)
  * 5500 MHz [100] (24.0 dBm)
  * 5520 MHz [104] (24.0 dBm)
  * 5540 MHz [108] (24.0 dBm)
  * 5560 MHz [112] (24.0 dBm)
  * 5580 MHz [116] (24.0 dBm)
  * 5600 MHz [120] (24.0 dBm)
  * 5620 MHz [124] (24.0 dBm)
  * 5640 MHz [128] (24.0 dBm)
  * 5660 MHz [132] (24.0 dBm)
  * 5680 MHz [136] (24.0 dBm)
  * 5700 MHz [140] (24.0 dBm)
  * 5720 MHz [144] (24.0 dBm)
  * 5745 MHz [149] (30.0 dBm)
  * 5765 MHz [153] (30.0 dBm)
  * 5785 MHz [157] (30.0 dBm)
  * 5805 MHz [161] (30.0 dBm)
  * 5825 MHz [165] (30.0 dBm)
  * 5845 MHz [169] (disabled)
  * 5865 MHz [173] (disabled)
  * 5885 MHz [177] (disabled)
```

Version: 6.9
```
Frequencies:
  * 5180.0 MHz [36] (30.0 dBm)
  * 5200.0 MHz [40] (30.0 dBm)
  * 5220.0 MHz [44] (30.0 dBm)
  * 5240.0 MHz [48] (30.0 dBm)
  * 5260.0 MHz [52] (24.0 dBm)
  * 5280.0 MHz [56] (24.0 dBm)
  * 5300.0 MHz [60] (24.0 dBm)
  * 5320.0 MHz [64] (24.0 dBm)
  * 5500.0 MHz [100] (24.0 dBm)
  * 5520.0 MHz [104] (24.0 dBm)
  * 5540.0 MHz [108] (24.0 dBm)
  * 5560.0 MHz [112] (24.0 dBm)
  * 5580.0 MHz [116] (24.0 dBm)
  * 5600.0 MHz [120] (24.0 dBm)
  * 5620.0 MHz [124] (24.0 dBm)
  * 5640.0 MHz [128] (24.0 dBm)
  * 5660.0 MHz [132] (24.0 dBm)
  * 5680.0 MHz [136] (24.0 dBm)
  * 5700.0 MHz [140] (24.0 dBm)
  * 5720.0 MHz [144] (24.0 dBm)
  * 5745.0 MHz [149] (30.0 dBm)
  * 5765.0 MHz [153] (30.0 dBm)
  * 5785.0 MHz [157] (30.0 dBm)
  * 5805.0 MHz [161] (30.0 dBm)
  * 5825.0 MHz [165] (30.0 dBm)
  * 5845.0 MHz [169] (disabled)
  * 5865.0 MHz [173] (disabled)
  * 5885.0 MHz [177] (disabled)
```

Error reported from wpa_supplicant
```console
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Line 10: invalid number "5320.0"
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Line 10: failed to parse frequency '5320.0'.
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Line 16: failed to parse network block.
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Failed to read or parse configuration '/var/run/wpa_supplicant-phy1-mesh0.conf'.
```

This affects mesh, adhoc, and client-mode WDS.

Until hostapd/wpa_supplicant is updated (or patched) to support float
frequencies, ensure `get_freq` prints out an integer.

Signed-off-by: Sean Khan <[email protected]>
Link: openwrt#15770
Signed-off-by: Robert Marko <[email protected]>
The GW74xx's first RJ45 is eth0 which should be the WAN adapter, not
eth1 which is the CPU uplink port to the switch.

Signed-off-by: Tim Harvey <[email protected]>
Link: openwrt#15736
Signed-off-by: Robert Marko <[email protected]>
Add a set of upstream patches for the imx8m{m,n,p} based Venice
boards.

Signed-off-by: Tim Harvey <[email protected]>
Link: openwrt#15736
Signed-off-by: Robert Marko <[email protected]>
Currently, the build option to enable/disable engine support isn't
reflected in the final '/etc/ssl/openssl.cnf' config. It assumes `engines`
is always enabled, producing an error whenever running any
commands in openssl util or programs that explicitly use settings
from '/etc/ssl/openssl.cnf'.

```
➤ openssl version
FATAL: Startup failure (dev note: apps_startup()) for openssl
307D1EA97F000000:error:12800067:lib(37):dlfcn_load:reason(103):crypto/dso/dso_dlfcn.c:118:filename(libengines.so):
Error loading shared library libengines.so: No such file or directory
307D1EA97F000000:error:12800067:lib(37):DSO_load:reason(103):crypto/dso/dso_lib.c:152:
307D1EA97F000000:error:0700006E:lib(14):module_load_dso:reason(110):crypto/conf/conf_mod.c:321:module=engines, path=engines
307D1EA97F000000:error:07000071:lib(14):module_run:reason(113):crypto/conf/conf_mod.c:266:module=engines
```

Build should check for the `CONFIG_OPENSSL_ENGINE` option, and comment out `engines`
if not explicitly enabled.

Example:
```
[openssl_init]
providers = provider_sect
```

After this change, openssl util works correctly.

```
➤ openssl version
OpenSSL 3.0.14 4 Jun 2024 (Library: OpenSSL 3.0.14 4 Jun 2024)
```

Signed-off-by: Sean Khan <[email protected]>
Link: openwrt#15661
Signed-off-by: Robert Marko <[email protected]>
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.35

Removed upstreamed:
	bcm27xx/patches-6.6/950-1135-ax25-Fix-refcount-imbalance-on-inbound-connections.patch[1]

Removed no longer needed:
	generic/pending-6.6/779-net-vxlan-don-t-learn-non-unicast-L2-destinations.patch[2]

All other patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.35&id=52100fd74ad07b53a4666feafff1cd11436362d3
2. As suggested by @DragonBluep, "This patch can be removed. It will never return false. And the upstream commit should fix the same issue: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?h=v6.6.35&id=924f7bbfc5cfd029e417c56357ca01eae681fba6"

Signed-off-by: John Audia <[email protected]>
Fakeroot uses an egrep configure check to look for the string "time64"
within a preprocessed include of the sys/stat.h header
in order to decide whether or not to create declarations
and internal functions used for wrapping the native functions
stat64_time64 fstat64_time64 lstat64_time64 and fstatat64_time64.

On specific older versions of glibc these functions are not included,
but there are some references to "time64" unrelated to functions,
like aliasing the time64_t typedef to the standard time_t typedef
when the size of a word is 64 bits or defining it if not.

In this case, a grep for "stat64"
of the preprocessed sys/stat.h header matches nothing,
however, the grep for "time64" in the configure check
of the preprocessed sys/stat.h header matches a line
that has nothing to do with the functions
that will be wrapped as a result of successful matching.

  __extension__ typedef __int64_t __time64_t;

This causes the attempt to wrap the functions to occur,
which fails due to some of the corresponding macros being empty
since the native declarations they are based on do not exist,
causing a common error claiming that a part of the syntax is missing.

  error: expected '=', ',', ';', 'asm' or '__attribute__' before ...

Fix this by making the testing regular expression more complex
in order to match actual function names ending in "_time64"
with or without a set of preceding underscores, but none after.

Signed-off-by: Michael Pratt <[email protected]>
Link: openwrt#15773
Signed-off-by: Robert Marko <[email protected]>
Running the glibc-static check with GCC14 as the host compiler will fail:
Please install a static glibc package. (Missing libutil.a, librt.a or libpthread.a)

However, this error will get printed even with the required static
libraries installed when GCC14 is used.

Manually running the check exposes the real error:
<stdin>: In function ‘main’:
<stdin>:1:45: error: implicit declaration of function ‘timer_gettime’ [-Wimplicit-function-declaration]

GCC14 now errors on implicit declarations by default, so lets add the
required time.h header to fix compilation and thus the check.

Link: openwrt#15778
Signed-off-by: Robert Marko <[email protected]>
Signed-off-by: bitthief <[email protected]>
Co-Developed-by: Sean Khan <[email protected]>
Signed-off-by: bitthief <[email protected]>

package: kernel: nat46: add kernel 6.1 support

Signed-off-by: bitthief <[email protected]>
Co-Developed-by: Sean Khan <[email protected]>
Instead of 'install', 'cp', use standard build functions

Signed-off-by: Sean Khan <[email protected]>
Signed-off-by: bitthief <[email protected]>
Co-Developed-by: Sean Khan <[email protected]>
Signed-off-by: bitthief <[email protected]>

qualcommax: dts: provide label for NSS reserved-memory

Provide a label for the NSS reserved-memory node so it can be easily passed
to the NSS DRV instead of having to global match by name which is fragile.

Signed-off-by: bitthief <[email protected]>
Attempt at getting NSS WiFi Offload working on kernel 6.1 (backport 6.5)

These patches are a mix of @Ansuel branch for 5.15 (ipq807x-5.15-ecm-wifi)
Ansuel@3ecaee7

And QUIC's upstream NSS patches on [NHSS.QSDK.12.4.5.r3](https://git.codelinaro.org/clo/qsdk/oss/system/feeds/wlan-open.git)
For the actual package setup (Makfiles,ath.mk) Qualcomm's branch is under 'wlan-open/NHSS.QSDK.12.4.5.r3'

Looks like they've swtiched to using backports 6.5-rc3, and figured to
use a mix of their patches on 'NHSS.QSDK.12.4.5.r3' (nss)
'wlan-open/NHSS.QSDK.12.4.5.r3' (syncing with openwrt main).

Booting with "nss_offload=1 frame_mode=2"

Logs show:
[   16.606282] WARNING: CPU: 2 PID: 3524 at ath11k_nss_tx+0x1d4/0x1e0 [ath11k]
[   16.611060] Modules linked in: ecm pppoe ppp_async nft_fib_inet nf_flow_table_inet ath11k_ahb ath11k pptp pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_fullcone nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_compat nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack_netlink nf_conntrack mac80211 iptable_mangle iptable_filter ipt_REJECT ipt_ECN ip_tables cfg80211 xt_time xt_tcpudp xt_tcpmss xt_statistic xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_ecn xt_dscp xt_comment xt_TCPMSS xt_LOG xt_HL xt_DSCP xt_CLASSIFY x_tables wireguard slhc sch_cake qrtr_smd qrtr qmi_helpers nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv4 mhi libcrc32c libchacha20poly1305 compat sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32 cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred act_gact qca_nss_cfi_cryptoapi
[   16.611215]  qca_nss_crypto qca_nss_qdisc qca_nss_wifi_meshmgr qca_nss_gre ledtrig_usbport qca_mcs bonding ip6_gre ip_gre gre ifb nat46 nf_defrag_ipv6 sit qca_nss_drv ip6_tunnel tunnel6 tunnel4 nls_utf8 nls_iso8859_1 nls_cp437 vxlan seqiv michael_mic uas usb_storage leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom qca_nss_dp qca_ssdk ramoops reed_solomon pstore gpio_button_hotplug ext4 mbcache jbd2 aquantia hwmon crc_ccitt crc32c_generic
[   16.721723] CPU: 2 PID: 3524 Comm: hostapd Not tainted 6.1.68 #0
[   16.743958] Hardware name: Dynalink DL-WRX36 (DT)
[   16.750032] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   16.754635] pc : ath11k_nss_tx+0x1d4/0x1e0 [ath11k]
[   16.761403] lr : ath11k_nss_tx+0x1bc/0x1e0 [ath11k]
[   16.766264] sp : ffffffc00b1db790
[   16.771122] x29: ffffffc00b1db790 x28: 0000000000000038 x27: 0000000000000000
[   16.774602] x26: ffffff8006dd7430 x25: ffffff8007ea9dc8 x24: 0000000060000012
[   16.781719] x23: ffffff8005c6a060 x22: ffffff8005c6a060 x21: ffffff80072f12d8
[   16.788837] x20: ffffff8007ea9dc8 x19: ffffff8006082800 x18: 0000000000000005
[   16.795957] x17: 6976312065707974 x16: 207061636e652062 x15: 6b73207874207373
[   16.803075] x14: ffffffc00a0dd518 x13: 000000000000018b x12: 000000000000018b
[   16.810192] x11: 00000000ffffffea x10: ffffffc00a135518 x9 : 0000000000000001
[   16.817310] x8 : 0000000000000001 x7 : 0000000000017fe8 x6 : c0000000ffffefff
[   16.824429] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
[   16.831547] x2 : ffffff80072f1370 x1 : 0000000000000000 x0 : 0000000000000001
[   16.838665] Call trace:
[   16.845774]  ath11k_nss_tx+0x1d4/0x1e0 [ath11k]
[   16.848035]  ath11k_mac_tx_mgmt_pending_free+0x3034/0x9600 [ath11k]
[   16.852551]  ieee80211_handle_wake_tx_queue+0x68/0xb10 [mac80211]
[   16.858801]  ieee80211_probereq_get+0xca4/0x11f0 [mac80211]
[   16.865049]  ieee80211_tx_prepare_skb+0x1dc/0x240 [mac80211]
[   16.870432]  ieee80211_xmit+0xcc/0x120 [mac80211]
[   16.876333]  __ieee80211_subif_start_xmit+0x2b8/0x380 [mac80211]
[   16.880937]  ieee80211_subif_start_xmit+0x40/0x3b0 [mac80211]
[   16.887013]  ieee80211_subif_start_xmit_8023+0xb8/0x430 [mac80211]
[   16.892656]  dev_hard_start_xmit+0x8c/0x110
[   16.898728]  __dev_queue_xmit+0x1f0/0xbc0
[   16.902808]  dev_queue_xmit+0x14/0x20
[   16.906975]  packet_sendmsg+0x768/0x1260
[   16.910620]  __sys_sendto+0xdc/0x140
[   16.914613]  __arm64_sys_sendto+0x28/0x40
[   16.918174]  invoke_syscall.constprop.0+0x5c/0x110
[   16.922081]  do_el0_svc+0x58/0x170
[   16.926765]  el0_svc+0x18/0x60
[   16.930149]  el0t_64_sync_handler+0x114/0x120
[   16.933190]  el0t_64_sync+0x174/0x178
[   16.933197] ---[ end trace 0000000000000000 ]---
[   16.933230] ath11k c000000.wifi: failed to transmit frame -22
[   17.041495] ath11k c000000.wifi: encap mismatch in nss tx skb encap type 1vif encap type 2
[   17.041578] ath11k c000000.wifi: failed to transmit frame -22

Which is confusing since the parameter is definitley set to '2'.
➤ cat /sys/module/ath11k/parameters/frame_mode
2

Booting with either "nss_offload=1 frame_mode=3" (RAW), or "nss_offload=1 frame_mode=1" (Native Wifi)
Results in:

[   15.644742] ath11k c000000.wifi: peer not found for nss peer delete
[   15.744742] ath11k c000000.wifi: peer not found for nss peer delete
[   15.745742] ath11k c000000.wifi: peer not found for nss peer delete
[   15.746682] ath11k c000000.wifi: peer not found for nss peer delete

Clients connect and then are immediately kicked off, stuck in a loop.

ath11k-nss: Wifi offloading working (unstable)

Wifi offloading seems to be working, however it is not stable. Logs will
initially show a lot of flooding.

```
[Sun Dec 17 02:43:25 2023] ath11k c000000.wifi: peer not found for nss peer delete
[Sun Dec 17 02:43:28 2023] ath11k c000000.wifi: peer not found for nss peer delete
[Sun Dec 17 02:43:30 2023] ath11k c000000.wifi: peer not found for nss peer delete
[Sun Dec 17 02:43:32 2023] ath11k c000000.wifi: peer not found for nss peer delete
[Sun Dec 17 02:43:34 2023] ath11k c000000.wifi: peer not found for nss peer delete
[Sun Dec 17 02:43:40 2023] ath11k c000000.wifi: peer not found for nss peer delete
[Sun Dec 17 02:43:41 2023] ath11k c000000.wifi: peer not found for nss peer delete
[Sun Dec 17 02:43:46 2023] ath11k c000000.wifi: peer not found for nss peer delete
```

But eventually ends up subsiding. Needs heavy testing...

ath11k_nss: Add mac address to debug `nss peer delete` warnings

also delete ath10k patch, and refresh.

ath11k_nss: FIX `nss peer delete` + encap errors

This should hopefullly fix the following errors:

```
[Sun Dec 24 22:03:21 2023] ath11k c000000.wifi: encap mismatch in nss tx skb encap type 1vif encap type 2
[Sun Dec 24 22:03:21 2023] ath11k c000000.wifi: failed to transmit frame -22
[Sun Dec 24 22:08:25 2023] ath11k c000000.wifi: encap mismatch in nss tx skb encap type 1vif encap type 2
[Sun Dec 24 22:08:25 2023] ath11k c000000.wifi: failed to transmit frame -22
```

Clients should also be able to switch between 2Ghz and 5Ghz AP, as well
as join using password (no longer required to boot with NSS off first,
connect the client to acquire PSK, and reboot back with nss wifi offload
enabled).

Uptime has been 5 hours and so far no issues.

ath11k_nss: Remove unecessary clang-tidy formatting

ath11k_nss: add 'debug_mode' flag quiet warnings

Will properly handle:
```
[Mon Dec 25 16:51:34 2023] ath11k c000000.wifi: encap mismatch in nss tx skb encap type 1 vif encap type 2
```

should take the path for native wifi encap

ath11k_nss: Rework depends, make `nss_redirect` optional

1.) Added a reworked `qca-nss-pbuf` init script from QSDK that will set sysctl
    NSS `n2hcfg` wifi options based on board type and available
    RAM.

2.) ath11k is fully capable of offloading wifi, it does not need
    mac80211 to create any NSS vifs. This lowers overhead and has actually
    shown considerable speed improvements for CPU programs on the router
    side (i.e. SMB). I believe ax3600's IoT (ath10k) would require it
    for offloading.

    I've added 2 new makemenu options, `MAC80211_NSS_SUPPORT` which enables
    NSS related features, and `MAC80211_NSS_REDIRECT` which provides the option to
    autoload the module on boot with `nss_redirect=1`.

3.) Reverted the option that deafulted `ATH11K_MEM_PROFILE_512M` to
    true. This was not required for platforms with 1GB or more memory
    (which is most of them). The default is 1GB. Select for platforms
    like Xiaomi AX3600.

ath11k_nss: remove requirement for '/sys/kernel/debug/ath11k'

ath11k_nss: set default values lower to avoid eating up memory

ath11k_nss: Add NSS VLAN support + improvements

1) tweaked qca-nss-pbuf script to better handle different board configs
2) added some QSDK NSS patches for dynamic vlan, WDS.
3) added QSDK fixes for beacon, and bt-coex

For devices that keep getting disconnected (mostly on 2G). It is
recommended to use the following settings for wifi. Change for your
country.

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'platform/soc/c000000.wifi'
	option band '5g'
	option txpower '24'
	option country 'PA'
	option channel '100'
	option htmode 'HE160'
	option cell_density '0'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option encryption 'psk2'
	option key 'SOME_PASSWORD'
	option ssid 'EXAMPLE_5G'
	option dtim_period '3'
	option max_inactivity '86400'
	option disassoc_low_ack '0'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'platform/soc/c000000.wifi+1'
	option band '2g'
	option htmode 'HT20'
	option channel '1'
	option txpower '36'
	option country 'PA'
	option cell_density '0'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'EXAMPLE_2G'
	option encryption 'psk2'
	option key 'SOME_PASSWORD'
	option max_inactivity '86400'
	option dtim_period '3'
	option disassoc_low_ack '0'

WPA3 should be disabled, and left as WPA2. Experimenting with max_inactivity, dtim_period, and disassoc_low_ack to hopefully resolve the deauth disconnects.
`dev.nss.n2hcfg.n2h_wifi_pool_buf` must be set BEFORE setting
`dev.nss.n2hcfg.n2h_high_water_core0`, otherwise it resets the value.
qosmio added 19 commits June 22, 2024 16:23
In ath11k_dp_rx_msdu_coalesce(), rxcb is fetched from skb and bool
is_continuation is part of rxcb.

Currently, after freeing the skb, the rxcb->is_continuation accessed
again which is wrong since the memory is already freed.

Hence fix the issue by locally defining bool is_continuation from rxcb,
so that after freeing skb also we can use is_continuation.

Signed-off-by: Sean Khan <[email protected]>
NSS offload feature should be available for all IPQ807x/IPQ817x targets.

* Arcadyan AW1000
* CMCC RM2-6
* Linksys MX4200 V1/V2
* Linksys MX5300
* Sagemcom Fast 5285 Spectrum SAXV1V1S
* Yuncore AX880
* ZBT Z800AX
* ZTE MF269

Signed-off-by: Sean Khan <[email protected]>
Causes issues with rate stats on IPQ9074

Signed-off-by: Sean Khan <[email protected]>
On platforms using ath10k with mac80211 'nss_redirect' enabled,
a warning `ieee80211_sta_update_pending_airtime` is observered
whenever traffic load is high (iperf3).

Don't offload if pending queue > 1000

Signed-off-by: Sean Khan <[email protected]>
This warning can trigger if there is a mismatch between frames that were
sent with the sta pointer set vs tx status frames reported for the sta address.

This can happen due to race conditions on re-creating stations, or even
in the case of .sta_add/remove being used instead of .sta_state, which can cause
frames to be sent to a station that has not been uploaded yet.

If there is an actual underflow issue, it should show up in the device airtime
warning below, so it is better to remove this one.

Signed-off-by: Felix Fietkau <nbd@xxxxxxxx>

Signed-off-by: Sean Khan <[email protected]>
This is mostly a cosmetic change for users running NSS firmware 11.4
with mesh setups. Rather than fill up kernel logs with warnings, move log
warnings to debug.

The stats are still captured in '/sys/kernel/debug/qca-nss-drv/stats/*'

Signed-off-by: Sean Khan <[email protected]>
Should be 'rx'

Signed-off-by: Sean Khan <[email protected]>
While freeing skb in tx completion path for status reinject, inspect
or vdevid mismatch, dev_kfree_skb_any() is used but when a function
is using functions from mac80211 to free an skb then it should do
it consistently and not switch to the generic dev_kfree_skb_any.
Otherwise, mac80211 will not be aware of the freed skb and thus
not clean up related information in its internal data structures.

Hence fix the issue by properly using ieee80211_free_txskb().

Signed-off-by: Sarika Sharma <[email protected]>
Signed-off-by: Sean Khan <[email protected]>
Lock is missed while accessing idr_pool of tx_ring which
causes Use after free crash in dp_free path when unloading
the module.

Fix this by adding tx_idr_lock when accessing idr_pool
of tx_ring.

Signed-off-by: Aishwarya R <[email protected]>
Signed-off-by: Sean Khan <[email protected]>
…rrays

Fixes compile issues on GCC 13.3+

Signed-off-by: Sean Khan <[email protected]>
Adding NSS support for:

Linksys MX8500
Netgear SXR80/SXS80 (SXK80 - router and satellite)

Signed-off-by: Sean Khan <[email protected]>
1. Fix function to check for bridge master status while checking
for Bridge VLAN filter feature is enabled on bridge slave ports.
2. Disable default PVID for bridges during device registration in
the system.

Change-Id: Ibea6559c1b0700a2300b60e20d57b7818e23a8a8
Signed-off-by: Vishnu Vardhan Bantanahal <[email protected]>

bridge: Fix Bridge VLAN stats update
This patch fixes Bridge VLAN stats update for both bridge master
and bridge slave.
Change-Id: Ia26f4c71e83e27dd83336815cda5c05c8c3f24ff
Signed-off-by: Vishnu Vardhan Bantanahal <[email protected]>

bridge: Add bridge VLAN filter APIs for offload for 6.1 Kernel

Change-Id: I54e44c26664f86ae024f54605a032713a9a3eee5
Signed-off-by: Vishnu Vardhan Bantanahal <[email protected]>

Signed-off-by: Sean Khan <[email protected]>
This patch was mostly cosmetic for ipq8074 to supress warnings about
invalid memory region. In this case the M3 dump region. This isn't
necessary for operation or offloading, and is used for firmware
debugging.

However due to the memory layout of ipq6018 it was causing issues of NSS
offloading properly loading. 'idx' shouldn't be incremented, and instead
should just break.

Signed-off-by: Sean Khan <[email protected]>
This patch adds support for allocating 1MB of reserved memory
for ramoops on IPQ807x and IPQ6018 platforms.

This is required to get PSTORE option working.

Tested with the following options:

```
CONFIG_PACKAGE_kmod-pstore=y
CONFIG_PACKAGE_kmod-ramoops=y
CONFIG_PACKAGE_kmod-reed-solomon=y
```

dmesg output
```
➤ dmesg | grep -Ei "psto|ramo"

[Sun Jun  9 23:22:01 2024] OF: reserved mem: 0x0000000051200000..0x00000000512fffff (1024 KiB) map non-reusable ramoops@51200000
[Sun Jun  9 23:22:05 2024] pstore: Using crash dump compression: deflate
[Sun Jun  9 23:22:05 2024] pstore: Registered ramoops as persistent store backend
[Sun Jun  9 23:22:05 2024] ramoops: using 0x100000@0x51200000, ecc: 0
```

Triggering kernel panic

```
sh -c 'echo 10 > /proc/sys/kernel/panic; echo c > /proc/sysrq-trigger'
```

After rebooting

```
mkdir -p /tmp/ramoops
mount -t pstore pstore /tmp/ramoops
```

```
➤ l /tmp/ramoops
drwxr-x---    2 root     root           0 Jun  9 23:02 .
drwxr-xr-x    8 root     root        4.0K Jun  9 23:23 ..
-r--r--r--    1 root     root        6.6K Jun  9 23:21 dmesg-ramoops-0
```

Truncated output
```
Panic#1 Part1
<6>[   21.656119] remoteproc remoteproc0: remote processor cd00000.q6v5_wcss is now up
<14>[   21.657910] kmodloader: done loading kernel modules from /etc/modules.d/*
<6>[   21.710545] ath11k c000000.wifi: chip_id 0x0 chip_family 0x0 board_id 0xff soc_id 0xffffffff
<6>[   21.710594] ath11k c000000.wifi: fw_version 0x270204a5 fw_build_timestamp 2022-08-04 13:05 fw_build_id WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
<6>[   91.416867] br-lan: topology change detected, sending tcn bpdu
<6>[ 1256.023874] sysrq: Trigger a crash
<0>[ 1256.023911] Kernel panic - not syncing: sysrq triggered crash
<4>[ 1256.026176] CPU: 2 PID: 2842 Comm: sh Tainted: G           O       6.6.32 #0
<4>[ 1256.031993] Hardware name: Linksys MX5300 (DT)
<4>[ 1256.039106] Call trace:
<4>[ 1256.043354]  dump_backtrace+0xb0/0x10c
<4>[ 1256.045701]  show_stack+0x18/0x24
<4>[ 1256.049519]  dump_stack_lvl+0x48/0x60
<4>[ 1256.052906]  dump_stack+0x18/0x24
<4>[ 1256.056550]  panic+0x2d0/0x31c
<4>[ 1256.059848]  sysrq_handle_moom+0x0/0x30
<4>[ 1256.062800]  __handle_sysrq+0xe4/0x1e0
<4>[ 1256.066534]  write_sysrq_trigger+0xbc/0xfc
<4>[ 1256.070354]  proc_reg_write+0xb0/0xf8
<4>[ 1256.074434]  vfs_write+0xa4/0x298
<4>[ 1256.078165]  ksys_write+0x5c/0xe0
<4>[ 1256.081464]  __arm64_sys_write+0x1c/0x28
<4>[ 1256.084763]  invoke_syscall.constprop.0+0x5c/0x100
<4>[ 1256.088758]  do_el0_svc+0x40/0xc8
<4>[ 1256.093355]  el0_svc+0x30/0xb8
<4>[ 1256.096740]  el0t_64_sync_handler+0x120/0x12c
<4>[ 1256.099694]  el0t_64_sync+0x178/0x17c
<2>[ 1256.104122] SMP: stopping secondary CPUs
<0>[ 1256.107773] Kernel Offset: disabled
<0>[ 1256.111759] CPU features: 0x0,00000000,00000000,0000400b
<0>[ 1256.114975] Memory Limit: none
```

Signed-off-by: Sean Khan <[email protected]>
This patch is to revert patch introduced in '0134270319b4fa130f35eb012a736ec1d94b3f16'
("mac80211: backport RX timestamp flags patch")

As it breaks compilation with NSS patch `Remove-unused-RX_FLAGS-from-mac80211_rx_flag`.
The `unused rx flags` is needed since it fixes iwinfo rx/tx rate flags.

This commit might be reverted until compatibility is worked out. For
now, it's not needed on NSS builds, so revert it with a patch.

Signed-off-by: Sean Khan <[email protected]>
A variation of this patch 'wifi: mac80211: Use flexible array in struct ieee80211_tim_ie'
was upstreamed in commit 'e6e4d90b69027d74ba7e9a0a586b95a5714e10c0'.
Remove it to avoid compilation issues.

Signed-off-by: Sean Khan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants