Firmware version for commit:
W9098-17.92.1.p149.115
IW416-16.92.21.p160
W8987-16.92.21.p156.2
IW612-18.99.8.p52
IW610-18.99.8.p52
AW693-18.99.7.p230.2
Signed-off-by: AMIT CHOUDHARY <amit.kumar_13@nxp.com>
When build wifi driver based on L7.0 kernel next tree, will observe the
following build errors. These are caused by the upstream patches:
7c6084d7fa4e6 ("wifi: cfg80211: support key installation on non-netdev wdevs")
033fe322f5852 ("wifi: nl80211/cfg80211: support stations of non-netdev interfaces")
08e6183ed2568 ("wifi: move action code from per-type frame structs")
Need to change corresponding APIs here to avoid the build break.
mlinux/moal_shim.c: In function ‘moal_recv_event’:
mlinux/moal_shim.c:5041:62: error: passing argument 1 of ‘cfg80211_new_sta’ from incompatible pointer type [-Wincompatible-pointer-types]
5041 | cfg80211_new_sta(priv->netdev,
| ~~~~^~~~~~~~
| |
| struct net_device *
In file included from mlinux/moal_main.h:160,
from mlinux/moal_shim.c:28:
linux-nxp-rebase/include/net/cfg80211.h:8972:44: note: expected ‘struct wireless_dev *’ but argument is of type ‘struct net_device *’
8972 | void cfg80211_new_sta(struct wireless_dev *wdev, const u8 *mac_addr,
| ~~~~~~~~~~~~~~~~~~~~~^~~~
mlinux/moal_sta_cfg80211.c: In function ‘woal_construct_tdls_action_frame’:
mlinux/moal_sta_cfg80211.c:9329:55: error: ‘struct <anonymous>’ has no member named ‘u’
9329 | skb_put(skb, 1 + sizeof(mgmt->u.action.u.tdls_discover_resp));
| ^
mlinux/moal_sta_cfg80211.c:9331:31: error: ‘struct <anonymous>’ has no member named ‘u’
9331 | mgmt->u.action.u.tdls_discover_resp.action_code =
| ^
mlinux/moal_sta_cfg80211.c:9333:31: error: ‘struct <anonymous>’ has no member named ‘u’
9333 | mgmt->u.action.u.tdls_discover_resp.dialog_token = dialog_token;
| ^
mlinux/moal_sta_cfg80211.c:9334:31: error: ‘struct <anonymous>’ has no member named ‘u’
9334 | mgmt->u.action.u.tdls_discover_resp.capability =
| ^
mlinux/moal_sta_cfg80211.c:9338:50: error: ‘struct <anonymous>’ has no member named ‘u’
9338 | 1 + sizeof(mgmt->u.action.u.tdls_discover_resp));
| ^
mlinux/moal_sta_cfg80211.c: In function ‘woal_cfg80211_uap_add_station’:
mlinux/moal_sta_cfg80211.c:11172:42: error: passing argument 1 of ‘cfg80211_new_sta’ from incompatible pointer type [-Wincompatible-pointer-types]
11172 | cfg80211_new_sta(dev, mac, sinfo, GFP_KERNEL);
| ^~~
| |
| struct net_device *
In file included from mlinux/moal_main.h:160,
from mlinux/moal_cfg80211.h:26:
linux-nxp-rebase/include/net/cfg80211.h:8972:44: note: expected ‘struct wireless_dev *’ but argument is of type ‘struct net_device *’
8972 | void cfg80211_new_sta(struct wireless_dev *wdev, const u8 *mac_addr,
| ~~~~~~~~~~~~~~~~~~~~~^~~~
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Firmware version for commit:
W9098-17.92.1.p149.88
IW416-16.92.21.p159
W8987-16.92.21.p156.1
IW612-18.99.8.p24
IW610-18.99.8.p24
AW693-18.99.2.p145.201
Signed-off-by: AMIT CHOUDHARY <amit.kumar_13@nxp.com>
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Firmware version for commit:
W9098-17.92.1.p149.84
IW416-16.92.21.p155.1
W8987-16.92.21.p155.1
IW612-18.99.8.p3
IW610-18.99.8.p3
AW693-18.99.2.p145.172
Signed-off-by: AMIT CHOUDHARY <amit.kumar_13@nxp.com>
When build wifi driver based on L6.19 kernel next tree, will observe the
following build error. It is caused by the upstream patch:
2b5e9f9b7e414 ("net: Convert struct sockaddr to fixed-size "sa_data[14]"")
Need to change corresponding API here to avoid the build break.
Build error logs:
mlinux/moal_eth_ioctl.c: In function ‘woal_priv_get_ap’:
mlinux/moal_eth_ioctl.c:6970:55: error: ‘struct sockaddr’ has no member named ‘sa_data_min’; did you mean ‘sa_data’?
6970 | sizeof(mwr->u.ap_addr.sa_data_min));
| ^~~~~~~~~~~
| sa_data
make[4]: *** [/scripts/Makefile.build:287: mlinux/moal_eth_ioctl.o] Error 1
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Firmware version for commit::
W9098-17.92.1.p149.84
IW416-16.92.21.p155.1
W8987-16.92.21.p155.1
IW612-18.99.8.p3
IW610-18.99.8.p3
AW693-18.99.2.p145.172
Signed-off-by: AMIT CHOUDHARY <amit.kumar_13@nxp.com>
When a WiFi driver caches station_info and later copies it back
using memcpy(), the newly allocated sinfo->links[] pointers are
overwritten with stale pointers from the cache. This causes
use-after-free and double-free errors when cfg80211_sinfo_release_content()
attempts to free the already-freed cached pointers.
The issue occurs in this sequence:
1. nl80211_get_station() allocates fresh sinfo.links[] arrays
2. Driver's get_station() does memcpy(sinfo, cached_sinfo, ...)
3. This overwrites new link pointers with old freed pointers
4. cfg80211_sinfo_release_content() in nl80211_send_station() frees the stale pointers
5. It triggers KASAN use-after-free/double-free
Fix by preserving the newly allocated link pointers across the
memcpy operation.
KASAN report:
BUG: KASAN: slab-use-after-free in cfg80211_sinfo_release_content+0x90/0xc8 [cfg80211]
Call trace:
show_stack+0x18/0x28 (C)
dump_stack_lvl+0x40/0xbc
print_report+0x144/0x6f4
kasan_report+0xdc/0x13c
__asan_report_load8_noabort+0x20/0x30
cfg80211_sinfo_release_content+0x90/0xc8 [cfg80211]
nl80211_send_station+0x167c/0x1bc4 [cfg80211]
nl80211_get_station+0x530/0x660 [cfg80211]
genl_family_rcv_msg_doit+0x17c/0x258
genl_rcv_msg+0x334/0x478
netlink_rcv_skb+0x1a0/0x2f8
genl_rcv+0x34/0x50
netlink_unicast+0x4e8/0x76c
netlink_sendmsg+0x460/0x6ec
Freed by task 992:
kasan_save_track+0x40/0x7c
__kasan_save_free_info+0x54/0x70
__kasan_slab_free+0x6c/0xa0
kfree+0x104/0x48c
cfg80211_sinfo_release_content+0x50/0xc8 [cfg80211]
nl80211_send_station+0x167c/0x1bc4 [cfg80211]
nl80211_get_station+0x530/0x660 [cfg80211]
Change-Id: Ib7b715c953170b0cd31b7b3557a907debfdf1d6f
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
When building MM6X18542.p2 wifi release on ARM32 platforms, will meet
the following build warning, force the size_t type to be converted to
the unsigned long to avoid this warning.
mlinux/moal_proc.c: In function ‘woal_ssu_dump_read’:
/linux-lts-nxp/include/linux/kern_levels.h:5:25: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Firmware version for commit:
W8997-16.92.21.p153.4
W9098-17.92.1.p149.76
IW416-16.92.21.p153.4
W8987-16.92.21.p153.4
IW612-18.99.3.p26.7
IW610-18.99.5.p73
AW693-18.99.2.p145.99
Signed-off-by: AMIT CHOUDHARY <amit.kumar_13@nxp.com>
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Since the SECURE_HOST related files have been removed, the secure_host
in the README should also be cleaned up accordingly.
Also, some missing files in the mlan and mlinux folders have been
cleaned up.
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Firmware version for commit:
W8997-16.92.21.p153.4
W9098-17.92.1.p149.76
IW416-16.92.21.p153.4
W8987-16.92.21.p153.4
IW612-18.99.3.p26.7
IW610-18.99.5.p73
AW693-18.99.2.p145.99
Signed-off-by: AMIT CHOUDHARY <amit.kumar_13@nxp.com>
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
When build wifi driver based on L6.15 kernel next tree, will observe the
following build error. This is caused by the upstream patch:
8fa7292fee5c ("treewide: Switch/rename to timer_delete[_sync]()")
Need to change corresponding API here to avoid the build break.
Build error logs:
In file included from mlinux/moal_ioctl.c:28:
mlinux/moal_main.h: In function ‘woal_cancel_timer’:
mlinux/moal_main.h:572:17: error: implicit declaration of function ‘del_timer’; did you mean ‘add_timer’? [-Werror=implicit-function-declaration]
572 | del_timer(&timer->tl);
| ^~~~~~~~~
| add_timer
mlinux/moal_main.h:574:17: error: implicit declaration of function ‘del_timer_sync’; did you mean ‘dev_mc_sync’? [-Werror=implicit-function-declaration]
574 | del_timer_sync(&timer->tl);
| ^~~~~~~~~~~~~~
| dev_mc_sync
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
When build wifi driver based on L6.14 kernel next tree, will observe the
following build error. This is caused by the upstream patch:
f835bdae7167 ("net: remove init_dummy_netdev()").
Need to change corresponding API here to avoid the build break.
Build error logs:
mlinux/moal_main.c: In function 'woal_add_card':
mlinux/moal_main.c:13469:17: error: implicit declaration of function 'init_dummy_netdev' [-Wimplicit-function-declaration]
13469 | init_dummy_netdev(&handle->napi_dev);
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Remove MODULE_DEVICE_TABLE for USB wifi driver to avoid autoloading wifi
driver without any wifi load parameters.
Also keep consistency with PCIe and SDIO drivers.
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
When build wifi driver based on L6.13 kernel next tree, will observe the
following build errors. This is caused by the following three upstream
patches. Need to change corresponding API here to avoid the build break.
02f220b52670 ("wifi: ipw2x00/lib80211: move remaining lib80211 into
libipw")
7a53af85d3bb ("wifi: cfg80211: send MLO links tx power info in
GET_INTERFACE")
9c4f83092775 ("wifi: cfg80211: pass net_device to .set_monitor_channel")
In file included from mlinux/moal_main.c:29:
mlinux/moal_main.h:136:10: fatal error: net/lib80211.h: No such file or directory
136 | #include <net/lib80211.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/kernel-source/scripts/Makefile.build:194: mlinux/moal_main.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from mlinux/moal_eth_ioctl.c:29:
mlinux/moal_main.h:136:10: fatal error: net/lib80211.h: No such file or directory
136 | #include <net/lib80211.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
mlinux/moal_sta_cfg80211.c:379:25: error: initialization of ‘int (*)(struct wiphy *, struct wireless_dev *, unsigned int, int *)’ from incompatible pointer type ‘int (*)(struct wiphy *, struct wireless_dev *, int *)’ [-Werror=incompatible-pointer-types]
379 | .get_tx_power = woal_cfg80211_get_tx_power,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
mlinux/moal_sta_cfg80211.c:379:25: note: (near initialization for ‘woal_cfg80211_ops.get_tx_power’)
mlinux/moal_sta_cfg80211.c:468:32: error: initialization of ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *)’ from incompatible pointer type ‘int (*)(struct wiphy *, struct cfg80211_chan_def *)’ [-Werror=incompatible-pointer-types]
468 | .set_monitor_channel = woal_cfg80211_set_monitor_channel,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mlinux/moal_sta_cfg80211.c:468:32: note: (near initialization for ‘woal_cfg80211_ops.set_monitor_channel’)
cc1: some warnings being treated as errors
make[4]: *** [/kernel-source/scripts/Makefile.build:194: mlinux/moal_sta_cfg80211.o] Error 1
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
When build wifi driver based on L6.12 kernel next tree, will observe the
following build errors. This is caused by the upstream patches
62c16f219a73 ("wifi: cfg80211: move DFS related members to links[] in
wireless_dev") and 81f67d60ebf2 ("wifi: cfg80211: handle DFS per link").
Need to change corresponding API here to avoid the build break.
/mwifiex/mlinux/moal_sta_cfg80211.c:435:34: error: initialization of ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *, u32, int)’ {aka ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *, unsigned int, int)’} from incompatible pointer type ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *, u32)’ {aka ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *, unsigned int)’} [-Werror=incompatible-pointer-types]
435 | .start_radar_detection = woal_cfg80211_start_radar_detection,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mwifiex/mlinux/moal_sta_cfg80211.c:435:34: note: (near initialization for ‘woal_cfg80211_ops.start_radar_detection’)
/mwifiex/mlinux/moal_cfg80211.c: In function ‘woal_cancel_cac’:
/mwifiex/mlinux/moal_cfg80211.c:1096:17: error: too few arguments to function ‘cfg80211_cac_event’
1096 | cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
| ^~~~~~~~~~~~~~~~~~
In file included from /mwifiex/mlinux/moal_main.h:136,
from /mwifiex/mlinux/moal_cfg80211.h:26,
from /mwifiex/mlinux/moal_cfg80211.c:23:
./include/net/cfg80211.h:8750:6: note: declared here
8750 | void cfg80211_cac_event(struct net_device *netdev,
| ^~~~~~~~~~~~~~~~~~
/mwifiex/mlinux/moal_shim.c:3701:60: error: ‘struct wireless_dev’ has no member named ‘cac_start_time’
3701 | (priv->wdev->cac_start_time +
| ^~
/mwifiex/mlinux/moal_shim.c:3704:66: error: ‘struct wireless_dev’ has no member named ‘cac_time_ms’
3704 | ->cac_time_ms));
| ^~
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
When build on 32-bit platform, error log shows:
ERROR: modpost: "__bad_udelay" [mwifiex/moal.ko] undefined!
32-bit platform udelay has 2000us limition. Split it as workaround.
Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
Corresponding firmware version:
SDIO-UART W8987 Firmware version 16.92.21.p142
PCIE-UART W8997 Firmware version 16.92.21.p137.3
SDIO-UART W8997 Firmware version 16.92.21.p137.3
SDIO-UART IW416 Firmware version 16.92.21.p142
SDIO_UART IW610 Firmware version 18.99.5.p35
SDIO_UART IW612 Firmware version 18.99.3.p21.4
SDIO-UART W8801 Firmware version 14.92.36.p194
SDIO-UART W9098 Firmware version 17.92.1.p149.50
PCIE-UART W9098 Firmware version 17.92.1.p149.50
Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
Corresponding firmware version:
SDIO-UART W8987 Firmware version 16.92.21.p137.2
PCIE-UART W8997 Firmware version 16.92.21.p137.2
SDIO-UART W8997 Firmware version 16.92.21.p137.2
SDIO-UART IW416 Firmware version 16.92.21.p137.2
SDIO_UART IW612 Firmware version 18.99.3.p15.8
SDIO-UART W8801 Firmware version 14.92.36.p192
SDIO-UART W9098 Firmware version 17.92.1.p149.155
PCIE-UART W9098 Firmware version 17.92.1.p149.155
Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
WCSWREL-621:
woal_sdio_suspend() may be called before complete cfg80211_disconnect(),
which causes WiFi cannot connect to AP after suspend resume.
Add delay to wait kernel complete cfg80211_disconnect() as a workaround.
Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
Corresponding firmware version:
SDIO-UART W8987 Firmware version 16.92.21.p137
PCIE-UART W8997 Firmware version 16.92.21.p137.1
SDIO-UART W8997 Firmware version 16.92.21.p137.1
SDIO-UART IW416 Firmware version 16.92.21.p137
SDIO_UART IW612 Firmware version 18.99.3.p15
SDIO-UART W8801 Firmware version 14.92.36.p192
SDIO-UART W9098 Firmware version 17.92.1.p149.44
PCIE-UART W9098 Firmware version 17.92.1.p149.44
Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
When build wifi driver based on L6.9 kernel next tree, will observe the
following three different type build warnings. Need to add the code
changes here to avoid the build warnings.
/mwifiex/mlan/mlan_11h.c:1676:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
1676 | t_u8 static wlan_11h_check_dfs_channel(mlan_adapter *pmadapter)
| ^~~~
CC [M] /mwifiex/mlan/mlan_uap_cmdevent.o
/mwifiex/mlan/mlan_11h.c:1712:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
1712 | mlan_status static wlan_11h_disable_dfs(mlan_private *priv, t_void *pioctl_buf)
| ^~~~~~~~~~~
/mwifiex/mlinux/moal_eth_ioctl.c: In function ‘parse_arguments’:
/mwifiex/mlinux/moal_eth_ioctl.c:159:41: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
159 | ;
| ^
/mwifiex/mlinux/moal_eth_ioctl.c: In function ‘woal_priv_hssetpara.isra’:
/mwifiex/mlinux/moal_eth_ioctl.c:5159:17: warning: ‘snprintf’ argument 6 may overlap destination object ‘respbuf’ [-Wrestrict]
5159 | snprintf(respbuf, CMD_BUF_LEN, "%s%s%s", CMD_NXP,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5160 | PRIV_CMD_HSCFG,
| ~~~~~~~~~~~~~~~
5161 | respbuf + (strlen(CMD_NXP) +
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5162 | strlen(PRIV_CMD_HSSETPARA)));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mwifiex/mlinux/moal_eth_ioctl.c:5131:58: note: destination object referenced by ‘restrict’-qualified argument 1 was declared here
5131 | static int woal_priv_hssetpara(moal_private *priv, t_u8 *respbuf,
| ~~~~~~^~~~~~~
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
When build wifi driver based on L6.9 kernel next tree, will observe the
following build warnings. Need to add static to avoid the build
warnings.
/mwifiex/mlinux/moal_shim.c:2768:8: warning: no previous prototype for ‘woal_process_event_tx_status’ [-Wmissing-prototypes]
2768 | t_void woal_process_event_tx_status(moal_private *priv,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mwifiex/mlinux/moal_uap.c:2560:5: warning: no previous prototype for ‘woal_uap_wacp_mode’ [-Wmissing-prototypes]
2560 | int woal_uap_wacp_mode(struct net_device *dev, struct ifreq *req)
| ^~~~~~~~~~~~~~~~~~
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>