fix: support OpenWrt cfg80211 backport versions

Allow CFG80211_VERSION to select wireless API signatures independently of the target kernel. Keep native kernel builds on their existing version checks.

Also guard the WEXT-only label and replace overlapping firmware path formatting with bounded appends so OpenWrt builds pass with Werror.

Validated all three modules against OpenWrt Linux 6.12.94 with backports 6.18.26, plus native 6.11, 6.17 and 7.2 headers. Refs #94.
This commit is contained in:
Shen Mintao
2026-09-17 13:55:56 +08:00
parent 9594c5c99a
commit 27af5add83
13 changed files with 71 additions and 49 deletions
+10
View File
@@ -2,6 +2,16 @@ EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
EXTRA_CFLAGS += -Wno-implicit-fallthrough EXTRA_CFLAGS += -Wno-implicit-fallthrough
#EXTRA_CFLAGS += -Wno-unused-variable #EXTRA_CFLAGS += -Wno-unused-variable
# OpenWrt may build a newer cfg80211 backport on an older kernel.
# Set this to the wireless stack's version, e.g. CFG80211_VERSION=6.18.26.
ifneq ($(strip $(CFG80211_VERSION)),)
aicwf_cfg80211_version := $(subst ., ,$(CFG80211_VERSION))
ifneq ($(words $(aicwf_cfg80211_version)),3)
$(error CFG80211_VERSION must have the form major.minor.patch)
endif
ccflags-y += '-DAICWF_CFG80211_VERSION_CODE=KERNEL_VERSION($(word 1,$(aicwf_cfg80211_version)),$(word 2,$(aicwf_cfg80211_version)),$(word 3,$(aicwf_cfg80211_version)))'
endif
RWNX_VERS_NUM := 6.4.3.0 RWNX_VERS_NUM := 6.4.3.0
CONFIG_AIC8800_WLAN_SUPPORT = m CONFIG_AIC8800_WLAN_SUPPORT = m
+4 -4
View File
@@ -1832,7 +1832,7 @@ void set_vendor_extension_ie(char *command){
} }
#endif//CONFIG_SET_VENDOR_EXTENSION_IE #endif//CONFIG_SET_VENDOR_EXTENSION_IE
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy, struct net_device *dev, int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_chan_def *chandef); struct cfg80211_chan_def *chandef);
#else #else
@@ -1840,7 +1840,7 @@ int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef); struct cfg80211_chan_def *chandef);
#endif #endif
int rwnx_atoi2(char *value, int c_len); int rwnx_atoi2(char *value, int c_len);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
void set_mon_chan(struct rwnx_vif *vif, struct net_device *dev, char *parameter) void set_mon_chan(struct rwnx_vif *vif, struct net_device *dev, char *parameter)
#else #else
void set_mon_chan(struct rwnx_vif *vif, char *parameter) void set_mon_chan(struct rwnx_vif *vif, char *parameter)
@@ -1867,7 +1867,7 @@ void set_mon_chan(struct rwnx_vif *vif, char *parameter)
chandef->center_freq1 = chandef->chan->center_freq; chandef->center_freq1 = chandef->chan->center_freq;
chandef->center_freq2 = 0; chandef->center_freq2 = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
rwnx_cfg80211_set_monitor_channel_(vif->rwnx_hw->wiphy, dev, chandef); rwnx_cfg80211_set_monitor_channel_(vif->rwnx_hw->wiphy, dev, chandef);
#else #else
rwnx_cfg80211_set_monitor_channel_(vif->rwnx_hw->wiphy, chandef); rwnx_cfg80211_set_monitor_channel_(vif->rwnx_hw->wiphy, chandef);
@@ -2136,7 +2136,7 @@ int android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
char *set_parameter; char *set_parameter;
skip = strlen(CMD_SET_MON_FREQ) + 1; skip = strlen(CMD_SET_MON_FREQ) + 1;
set_parameter = command + skip; set_parameter = command + skip;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
set_mon_chan(vif, net, set_parameter); set_mon_chan(vif, net, set_parameter);
#else #else
set_mon_chan(vif, set_parameter); set_mon_chan(vif, set_parameter);
+1 -1
View File
@@ -62,7 +62,7 @@ int get_cs_info(struct rwnx_vif *vif, u8 *mac_addr, u8 *val);
unsigned int command_strtoul(const char *cp, char **endp, unsigned int base); unsigned int command_strtoul(const char *cp, char **endp, unsigned int base);
int str_starts(const char *str, const char *start); int str_starts(const char *str, const char *start);
int handle_private_cmd(struct net_device *net, char *command, u32 cmd_len); int handle_private_cmd(struct net_device *net, char *command, u32 cmd_len);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
void set_mon_chan(struct rwnx_vif *vif, struct net_device *dev, char *parameter); void set_mon_chan(struct rwnx_vif *vif, struct net_device *dev, char *parameter);
#else #else
void set_mon_chan(struct rwnx_vif *vif, char *parameter); void set_mon_chan(struct rwnx_vif *vif, char *parameter);
@@ -40,7 +40,8 @@ int rwnx_plat_userconfig_load_8800d80(struct rwnx_hw *rwnx_hw){
char *filename = FW_USERCONFIG_NAME_8800D80; char *filename = FW_USERCONFIG_NAME_8800D80;
#ifndef ANDROID_PLATFORM #ifndef ANDROID_PLATFORM
sprintf(aic_fw_path, "%s/%s", aic_fw_path, "aic8800D80"); if (strlcat(aic_fw_path, "/aic8800D80", sizeof(aic_fw_path)) >= sizeof(aic_fw_path))
return -ENAMETOOLONG;
#endif #endif
AICWFDBG(LOGINFO, "userconfig file path:%s \r\n", filename); AICWFDBG(LOGINFO, "userconfig file path:%s \r\n", filename);
@@ -41,7 +41,8 @@ int rwnx_plat_userconfig_load_8800d80x2(struct rwnx_hw *rwnx_hw){
char *filename = FW_USERCONFIG_NAME_8800D80X2; char *filename = FW_USERCONFIG_NAME_8800D80X2;
#ifndef ANDROID_PLATFORM #ifndef ANDROID_PLATFORM
sprintf(aic_fw_path, "%s/%s", aic_fw_path, "aic8800D80X2"); if (strlcat(aic_fw_path, "/aic8800D80X2", sizeof(aic_fw_path)) >= sizeof(aic_fw_path))
return -ENAMETOOLONG;
#endif #endif
AICWFDBG(LOGINFO, "userconfig file path:%s \r\n", filename); AICWFDBG(LOGINFO, "userconfig file path:%s \r\n", filename);
@@ -23,6 +23,11 @@
#define _RWNX_COMPAT_H_ #define _RWNX_COMPAT_H_
#include <linux/version.h> #include <linux/version.h>
/* Keep wireless API checks separate from timer, USB and other kernel APIs. */
#ifndef AICWF_CFG80211_VERSION_CODE
#define AICWF_CFG80211_VERSION_CODE LINUX_VERSION_CODE
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
#error "Minimum kernel version supported is 3.10" #error "Minimum kernel version supported is 3.10"
#endif #endif
+33 -33
View File
@@ -2942,7 +2942,7 @@ bool key_flag = false;
* when adding a group key. * when adding a group key.
*/ */
static int rwnx_cfg80211_add_key(struct wiphy *wiphy, static int rwnx_cfg80211_add_key(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *netdev, struct net_device *netdev,
@@ -2954,7 +2954,7 @@ static int rwnx_cfg80211_add_key(struct wiphy *wiphy,
struct key_params *params) struct key_params *params)
{ {
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy); struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct rwnx_vif *vif = netdev_priv(wdev->netdev); struct rwnx_vif *vif = netdev_priv(wdev->netdev);
#else #else
struct rwnx_vif *vif = netdev_priv(netdev); struct rwnx_vif *vif = netdev_priv(netdev);
@@ -3066,7 +3066,7 @@ static int rwnx_cfg80211_add_key(struct wiphy *wiphy,
* *
*/ */
static int rwnx_cfg80211_get_key(struct wiphy *wiphy, static int rwnx_cfg80211_get_key(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *netdev, struct net_device *netdev,
@@ -3090,7 +3090,7 @@ static int rwnx_cfg80211_get_key(struct wiphy *wiphy,
* and @key_index, return -ENOENT if the key doesn't exist. * and @key_index, return -ENOENT if the key doesn't exist.
*/ */
static int rwnx_cfg80211_del_key(struct wiphy *wiphy, static int rwnx_cfg80211_del_key(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *netdev, struct net_device *netdev,
@@ -3102,7 +3102,7 @@ static int rwnx_cfg80211_del_key(struct wiphy *wiphy,
u8 key_index, bool pairwise, const u8 *mac_addr) u8 key_index, bool pairwise, const u8 *mac_addr)
{ {
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy); struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct rwnx_vif *vif = netdev_priv(wdev->netdev); struct rwnx_vif *vif = netdev_priv(wdev->netdev);
#else #else
struct rwnx_vif *vif = netdev_priv(netdev); struct rwnx_vif *vif = netdev_priv(netdev);
@@ -3154,7 +3154,7 @@ static int rwnx_cfg80211_set_default_key(struct wiphy *wiphy,
* @set_default_mgmt_key: set the default management frame key on an interface * @set_default_mgmt_key: set the default management frame key on an interface
*/ */
static int rwnx_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, static int rwnx_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *netdev, struct net_device *netdev,
@@ -3249,7 +3249,7 @@ static int rwnx_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
key_params.seq_len = 0; key_params.seq_len = 0;
key_params.cipher = sme->crypto.cipher_group; key_params.cipher = sme->crypto.cipher_group;
rwnx_cfg80211_add_key(wiphy, rwnx_cfg80211_add_key(wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
&rwnx_vif->wdev, &rwnx_vif->wdev,
#else #else
dev, dev,
@@ -3480,7 +3480,7 @@ static int rwnx_cfg80211_external_auth(struct wiphy *wiphy, struct net_device *d
* @add_station: Add a new station. * @add_station: Add a new station.
*/ */
static int rwnx_cfg80211_add_station(struct wiphy *wiphy, static int rwnx_cfg80211_add_station(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *dev, struct net_device *dev,
@@ -3493,7 +3493,7 @@ static int rwnx_cfg80211_add_station(struct wiphy *wiphy,
struct station_parameters *params) struct station_parameters *params)
{ {
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy); struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct rwnx_vif *rwnx_vif = netdev_priv(wdev->netdev); struct rwnx_vif *rwnx_vif = netdev_priv(wdev->netdev);
#else #else
struct rwnx_vif *rwnx_vif = netdev_priv(dev); struct rwnx_vif *rwnx_vif = netdev_priv(dev);
@@ -3589,7 +3589,7 @@ static int rwnx_cfg80211_add_station(struct wiphy *wiphy,
sinfo.filled |= STATION_INFO_ASSOC_REQ_IES; sinfo.filled |= STATION_INFO_ASSOC_REQ_IES;
#endif #endif
cfg80211_new_sta( cfg80211_new_sta(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
&rwnx_vif->wdev, &rwnx_vif->wdev,
#else #else
rwnx_vif->ndev, rwnx_vif->ndev,
@@ -3620,7 +3620,7 @@ static int rwnx_cfg80211_add_station(struct wiphy *wiphy,
(params->sta_flags_set & BIT(NL80211_STA_FLAG_##f) ? "["#f"]" : "") (params->sta_flags_set & BIT(NL80211_STA_FLAG_##f) ? "["#f"]" : "")
netdev_info( netdev_info(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
wdev->netdev, wdev->netdev,
#else #else
dev, dev,
@@ -3651,7 +3651,7 @@ static int rwnx_cfg80211_add_station(struct wiphy *wiphy,
* @del_station: Remove a station * @del_station: Remove a station
*/ */
static int rwnx_cfg80211_del_station_compat(struct wiphy *wiphy, static int rwnx_cfg80211_del_station_compat(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *dev, struct net_device *dev,
@@ -3666,7 +3666,7 @@ static int rwnx_cfg80211_del_station_compat(struct wiphy *wiphy,
) )
{ {
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy); struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct rwnx_vif *rwnx_vif = netdev_priv(wdev->netdev); struct rwnx_vif *rwnx_vif = netdev_priv(wdev->netdev);
#else #else
struct rwnx_vif *rwnx_vif = netdev_priv(dev); struct rwnx_vif *rwnx_vif = netdev_priv(dev);
@@ -3711,7 +3711,7 @@ static int rwnx_cfg80211_del_station_compat(struct wiphy *wiphy,
if(found) { if(found) {
netdev_info( netdev_info(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
wdev->netdev, wdev->netdev,
#else #else
dev, dev,
@@ -3731,7 +3731,7 @@ static int rwnx_cfg80211_del_station_compat(struct wiphy *wiphy,
} }
if (rwnx_vif->wdev.iftype == NL80211_IFTYPE_AP || rwnx_vif->wdev.iftype == NL80211_IFTYPE_P2P_GO) { if (rwnx_vif->wdev.iftype == NL80211_IFTYPE_AP || rwnx_vif->wdev.iftype == NL80211_IFTYPE_P2P_GO) {
cfg80211_del_sta( cfg80211_del_sta(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
&rwnx_vif->wdev, &rwnx_vif->wdev,
#else #else
rwnx_vif->ndev, rwnx_vif->ndev,
@@ -3962,7 +3962,7 @@ void apm_probe_sta_work_process(struct work_struct *work)
* cfg80211_check_station_change() to validate the information. * cfg80211_check_station_change() to validate the information.
*/ */
static int rwnx_cfg80211_change_station(struct wiphy *wiphy, static int rwnx_cfg80211_change_station(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *dev, struct net_device *dev,
@@ -3975,7 +3975,7 @@ static int rwnx_cfg80211_change_station(struct wiphy *wiphy,
struct station_parameters *params) struct station_parameters *params)
{ {
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy); struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct rwnx_vif *vif = netdev_priv(wdev->netdev); struct rwnx_vif *vif = netdev_priv(wdev->netdev);
#else #else
struct rwnx_vif *vif = netdev_priv(dev); struct rwnx_vif *vif = netdev_priv(dev);
@@ -3988,7 +3988,7 @@ static int rwnx_cfg80211_change_station(struct wiphy *wiphy,
/* Add the TDLS station */ /* Add the TDLS station */
if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct rwnx_vif *rwnx_vif = netdev_priv(wdev->netdev); struct rwnx_vif *rwnx_vif = netdev_priv(wdev->netdev);
#else #else
struct rwnx_vif *rwnx_vif = netdev_priv(dev); struct rwnx_vif *rwnx_vif = netdev_priv(dev);
@@ -4064,7 +4064,7 @@ static int rwnx_cfg80211_change_station(struct wiphy *wiphy,
(params->sta_flags_set & BIT(NL80211_STA_FLAG_##f) ? "["#f"]" : "") (params->sta_flags_set & BIT(NL80211_STA_FLAG_##f) ? "["#f"]" : "")
netdev_info( netdev_info(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
wdev->netdev, wdev->netdev,
#else #else
dev, dev,
@@ -4353,7 +4353,7 @@ static int rwnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
/* delete any remaining STA*/ /* delete any remaining STA*/
while (!list_empty(&rwnx_vif->ap.sta_list)) { while (!list_empty(&rwnx_vif->ap.sta_list)) {
rwnx_cfg80211_del_station_compat(wiphy, rwnx_cfg80211_del_station_compat(wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
&rwnx_vif->wdev, &rwnx_vif->wdev,
#else #else
dev, dev,
@@ -4420,7 +4420,7 @@ cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1,
} }
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
static int rwnx_cfg80211_set_monitor_channel(struct wiphy *wiphy, struct net_device *dev, static int rwnx_cfg80211_set_monitor_channel(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_chan_def *chandef) struct cfg80211_chan_def *chandef)
#else #else
@@ -4480,7 +4480,7 @@ static int rwnx_cfg80211_set_monitor_channel(struct wiphy *wiphy,
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy, int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy,
struct net_device *dev, struct net_device *dev,
struct cfg80211_chan_def *chandef) struct cfg80211_chan_def *chandef)
@@ -4553,7 +4553,7 @@ void rwnx_cfg80211_mgmt_frame_register(struct wiphy *wiphy,
* have changed. The actual parameter values are available in * have changed. The actual parameter values are available in
* struct wiphy. If returning an error, no value should be changed. * struct wiphy. If returning an error, no value should be changed.
*/ */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed) static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed)
#else #else
static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
@@ -4574,7 +4574,7 @@ static int rwnx_cfg80211_set_tx_power(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
int radio_idx, int radio_idx,
#endif #endif
enum nl80211_tx_power_setting type, int mbm) enum nl80211_tx_power_setting type, int mbm)
@@ -4611,10 +4611,10 @@ static int rwnx_cfg80211_get_tx_power(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
int radio_idx, int radio_idx,
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)
unsigned int link_id, unsigned int link_id,
#endif #endif
int *mbm) int *mbm)
@@ -4858,7 +4858,7 @@ rwnx_cfg80211_remain_on_channel(struct wiphy *wiphy,
enum nl80211_channel_type channel_type, enum nl80211_channel_type channel_type,
#endif #endif
unsigned int duration, u64 *cookie unsigned int duration, u64 *cookie
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 2, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 2, 0)
/* /*
* 7.2 added an optional receive address filter for the off-channel * 7.2 added an optional receive address filter for the off-channel
* period. cfg80211 refuses a non-NULL one unless the driver sets * period. cfg80211 refuses a non-NULL one unless the driver sets
@@ -5009,7 +5009,7 @@ static int rwnx_cfg80211_get_channel(struct wiphy *wiphy,
if (rwnx_vif->vif_index == rwnx_hw->monitor_vif) if (rwnx_vif->vif_index == rwnx_hw->monitor_vif)
{ {
//retrieve channel from firmware //retrieve channel from firmware
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
rwnx_cfg80211_set_monitor_channel(wiphy, wdev->netdev, NULL); rwnx_cfg80211_set_monitor_channel(wiphy, wdev->netdev, NULL);
#else #else
rwnx_cfg80211_set_monitor_channel(wiphy, NULL); rwnx_cfg80211_set_monitor_channel(wiphy, NULL);
@@ -5207,7 +5207,7 @@ int rwnx_cfg80211_start_radar_detection(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
, u32 cac_time_ms , u32 cac_time_ms
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
, int link_id , int link_id
#endif #endif
) )
@@ -5991,7 +5991,7 @@ int rwnx_fill_station_info(struct rwnx_sta *sta, struct rwnx_vif *vif,
* @get_station: get station information for the station identified by @mac * @get_station: get station information for the station identified by @mac
*/ */
static int rwnx_cfg80211_get_station(struct wiphy *wiphy, static int rwnx_cfg80211_get_station(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *dev, struct net_device *dev,
@@ -6003,7 +6003,7 @@ static int rwnx_cfg80211_get_station(struct wiphy *wiphy,
#endif #endif
struct station_info *sinfo) struct station_info *sinfo)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct rwnx_vif *vif = netdev_priv(wdev->netdev); struct rwnx_vif *vif = netdev_priv(wdev->netdev);
#else #else
struct rwnx_vif *vif = netdev_priv(dev); struct rwnx_vif *vif = netdev_priv(dev);
@@ -6041,14 +6041,14 @@ static int rwnx_cfg80211_get_station(struct wiphy *wiphy,
* @dump_station: dump station callback -- resume dump at index @idx * @dump_station: dump station callback -- resume dump at index @idx
*/ */
static int rwnx_cfg80211_dump_station(struct wiphy *wiphy, static int rwnx_cfg80211_dump_station(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct wireless_dev *wdev, struct wireless_dev *wdev,
#else #else
struct net_device *dev, struct net_device *dev,
#endif #endif
int idx, u8 *mac, struct station_info *sinfo) int idx, u8 *mac, struct station_info *sinfo)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
struct rwnx_vif *rwnx_vif = netdev_priv(wdev->netdev); struct rwnx_vif *rwnx_vif = netdev_priv(wdev->netdev);
#else #else
struct rwnx_vif *rwnx_vif = netdev_priv(dev); struct rwnx_vif *rwnx_vif = netdev_priv(dev);
+1 -1
View File
@@ -91,7 +91,7 @@ void aicwf_p2p_alive_timeout(struct timer_list *t);
int rwnx_send_check_p2p(struct cfg80211_scan_request *param); int rwnx_send_check_p2p(struct cfg80211_scan_request *param);
void apm_staloss_work_process(struct work_struct *work); void apm_staloss_work_process(struct work_struct *work);
void apm_probe_sta_work_process(struct work_struct *work); void apm_probe_sta_work_process(struct work_struct *work);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) #if (AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy, int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy,
struct net_device *dev, struct net_device *dev,
struct cfg80211_chan_def *chandef); struct cfg80211_chan_def *chandef);
@@ -825,7 +825,9 @@ static inline int rwnx_rx_scanu_result_ind(struct rwnx_hw *rwnx_hw,
#endif #endif
} }
#ifdef CONFIG_USE_WIRELESS_EXT
putbss: putbss:
#endif
if (bss != NULL) if (bss != NULL)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
cfg80211_put_bss(bss); cfg80211_put_bss(bss);
+6 -3
View File
@@ -1669,7 +1669,8 @@ static int rwnx_plat_patch_load(struct rwnx_hw *rwnx_hw)
if(rwnx_hw->usbdev->chipid == PRODUCT_ID_AIC8800DC || if(rwnx_hw->usbdev->chipid == PRODUCT_ID_AIC8800DC ||
rwnx_hw->usbdev->chipid == PRODUCT_ID_AIC8800DW){ rwnx_hw->usbdev->chipid == PRODUCT_ID_AIC8800DW){
#ifndef ANDROID_PLATFORM #ifndef ANDROID_PLATFORM
sprintf(aic_fw_path, "%s/%s", aic_fw_path, "aic8800DC"); if (strlcat(aic_fw_path, "/aic8800DC", sizeof(aic_fw_path)) >= sizeof(aic_fw_path))
return -ENAMETOOLONG;
#endif #endif
AICWFDBG(LOGINFO, "testmode=%d\n", testmode); AICWFDBG(LOGINFO, "testmode=%d\n", testmode);
if (chip_sub_id == 0) { if (chip_sub_id == 0) {
@@ -1808,7 +1809,8 @@ static int rwnx_plat_patch_load(struct rwnx_hw *rwnx_hw)
} }
} else if(rwnx_hw->usbdev->chipid == PRODUCT_ID_AIC8800D80N) { } else if(rwnx_hw->usbdev->chipid == PRODUCT_ID_AIC8800D80N) {
#ifndef ANDROID_PLATFORM #ifndef ANDROID_PLATFORM
sprintf(aic_fw_path, "%s/%s", aic_fw_path, "aic8800D80N"); if (strlcat(aic_fw_path, "/aic8800D80N", sizeof(aic_fw_path)) >= sizeof(aic_fw_path))
return -ENAMETOOLONG;
#endif #endif
if (testmode == FW_NORMAL_MODE) { if (testmode == FW_NORMAL_MODE) {
ret = aicwf_plat_patch_load_8800d80n(rwnx_hw); ret = aicwf_plat_patch_load_8800d80n(rwnx_hw);
@@ -1838,7 +1840,8 @@ static int rwnx_plat_patch_load(struct rwnx_hw *rwnx_hw)
} }
else if(rwnx_hw->usbdev->chipid == PRODUCT_ID_AIC8800DLN) { else if(rwnx_hw->usbdev->chipid == PRODUCT_ID_AIC8800DLN) {
#ifndef ANDROID_PLATFORM #ifndef ANDROID_PLATFORM
sprintf(aic_fw_path, "%s/%s", aic_fw_path, "aic8800DLN"); if (strlcat(aic_fw_path, "/aic8800DLN", sizeof(aic_fw_path)) >= sizeof(aic_fw_path))
return -ENAMETOOLONG;
#endif #endif
if (testmode == FW_NORMAL_MODE) { if (testmode == FW_NORMAL_MODE) {
aicwf_patch_config_8800dln(rwnx_hw); aicwf_patch_config_8800dln(rwnx_hw);
+2 -2
View File
@@ -1475,7 +1475,7 @@ static void rwnx_radar_cac_work(struct work_struct *ws)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
&ctxt->chan_def, &ctxt->chan_def,
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0); NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0);
#else #else
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL); NL80211_RADAR_CAC_FINISHED, GFP_KERNEL);
@@ -1617,7 +1617,7 @@ void rwnx_radar_cancel_cac(struct rwnx_radar *radar)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
&ctxt->chan_def, &ctxt->chan_def,
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0); NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0);
#else #else
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
+2 -2
View File
@@ -2410,7 +2410,7 @@ check_len_update:
hdr = (struct ieee80211_hdr *)(skb->data + msdu_offset); hdr = (struct ieee80211_hdr *)(skb->data + msdu_offset);
rwnx_vif = rwnx_rx_get_vif(rwnx_hw, hw_rxhdr->flags_vif_idx); rwnx_vif = rwnx_rx_get_vif(rwnx_hw, hw_rxhdr->flags_vif_idx);
if (rwnx_vif) { if (rwnx_vif) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, -1, GFP_ATOMIC); cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, -1, GFP_ATOMIC);
#else #else
cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, GFP_ATOMIC); cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, GFP_ATOMIC);
@@ -2757,7 +2757,7 @@ check_len_update:
if (hw_rxhdr->flags_is_4addr && !rwnx_vif->use_4addr) { if (hw_rxhdr->flags_is_4addr && !rwnx_vif->use_4addr) {
printk("aicwf: 4addr flag error\n"); printk("aicwf: 4addr flag error\n");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev, cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev,
sta->mac_addr, -1, GFP_ATOMIC); sta->mac_addr, -1, GFP_ATOMIC);
#else #else
+1 -1
View File
@@ -115,7 +115,7 @@ rwnx_prep_tdls_direct(struct rwnx_hw *rwnx_hw, struct rwnx_vif *rwnx_vif,
switch (action_code) { switch (action_code) {
case WLAN_PUB_ACTION_TDLS_DISCOVER_RES: case WLAN_PUB_ACTION_TDLS_DISCOVER_RES:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0) #if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
skb_put(skb, 2 + sizeof(mgmt->u.action.tdls_discover_resp)); skb_put(skb, 2 + sizeof(mgmt->u.action.tdls_discover_resp));
mgmt->u.action.category = WLAN_CATEGORY_PUBLIC; mgmt->u.action.category = WLAN_CATEGORY_PUBLIC;
mgmt->u.action.action_code = WLAN_PUB_ACTION_TDLS_DISCOVER_RES; mgmt->u.action.action_code = WLAN_PUB_ACTION_TDLS_DISCOVER_RES;