2024-12-14 16:09:18 +08:00

160 lines
7.8 KiB
Diff

--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
@@ -776,7 +776,7 @@ static void rwnx_csa_finish(struct work_
spin_unlock_bh(&rwnx_hw->cb_lock);
#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION3)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0, 0);
-#elif (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION)
+#elif (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION) || defined(BUILD_OPENWRT)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0);
#else
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef);
@@ -3540,7 +3540,7 @@ bool key_flag = false;
* when adding a group key.
*/
static int rwnx_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
int link_id,
#endif
u8 key_index, bool pairwise, const u8 *mac_addr,
@@ -3637,7 +3637,7 @@ bool key_flag = false;
*
*/
static int rwnx_cfg80211_get_key(struct wiphy *wiphy, struct net_device *netdev,
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
int link_id,
#endif
u8 key_index, bool pairwise, const u8 *mac_addr,
@@ -3655,7 +3655,7 @@ static int rwnx_cfg80211_get_key(struct
* and @key_index, return -ENOENT if the key doesn't exist.
*/
static int rwnx_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev,
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
int link_id,
#endif
u8 key_index, bool pairwise, const u8 *mac_addr)
@@ -3694,7 +3694,7 @@ static int rwnx_cfg80211_del_key(struct
*/
static int rwnx_cfg80211_set_default_key(struct wiphy *wiphy,
struct net_device *netdev,
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
int link_id,
#endif
u8 key_index, bool unicast, bool multicast)
@@ -3709,7 +3709,7 @@ static int rwnx_cfg80211_set_default_key
*/
static int rwnx_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
struct net_device *netdev,
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
int link_id,
#endif
u8 key_index)
@@ -3796,7 +3796,7 @@ static int rwnx_cfg80211_connect(struct
key_params.seq_len = 0;
key_params.cipher = sme->crypto.cipher_group;
rwnx_cfg80211_add_key(wiphy, dev,
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
0,
#endif
sme->key_idx, false, NULL, &key_params);
@@ -4063,7 +4063,7 @@ static int rwnx_cfg80211_add_station(str
sta->vif_idx = rwnx_vif->vif_index;
sta->vlan_idx = sta->vif_idx;
sta->qos = (params->sta_flags_set & BIT(NL80211_STA_FLAG_WME)) != 0;
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
sta->ht = params->link_sta_params.ht_capa ? 1 : 0;
sta->vht = params->link_sta_params.vht_capa ? 1 : 0;
#else
@@ -4469,7 +4469,7 @@ static int rwnx_cfg80211_change_station(
sta->vif_idx = rwnx_vif->vif_index;
sta->vlan_idx = sta->vif_idx;
sta->qos = (params->sta_flags_set & BIT(NL80211_STA_FLAG_WME)) != 0;
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
sta->ht = params->link_sta_params.ht_capa ? 1 : 0;
sta->vht = params->link_sta_params.vht_capa ? 1 : 0;
#else
@@ -4716,7 +4716,7 @@ static int rwnx_cfg80211_change_beacon(s
/**
* * @stop_ap: Stop being an AP, including stopping beaconing.
*/
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION)
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION) || defined(BUILD_OPENWRT)
static int rwnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id)
#else
static int rwnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
@@ -5190,7 +5190,7 @@ static int rwnx_cfg80211_dump_survey(str
*/
static int rwnx_cfg80211_get_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
unsigned int link_id,
#endif
struct cfg80211_chan_def *chandef)
@@ -5487,7 +5487,7 @@ int rwnx_cfg80211_channel_switch (struct
INIT_WORK(&csa->work, rwnx_csa_finish);
#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION4
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false, 0);
-#elif LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2
+#elif LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2 || defined(BUILD_OPENWRT)
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
cfg80211_ch_switch_started_notify(dev, &csa->chandef, params->count, params->block_tx);
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_rx.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_rx.c
@@ -836,7 +836,7 @@ static inline int rwnx_rx_sm_connect_ind
do {
bss = cfg80211_get_bss(wdev->wiphy, NULL, rwnx_vif->sta.bssid,
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
wdev->u.client.ssid, wdev->u.client.ssid_len,
#else
wdev->ssid, wdev->ssid_len,
@@ -866,7 +866,7 @@ static inline int rwnx_rx_sm_connect_ind
#else
WLAN_CAPABILITY_ESS,
#endif
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
(int)wdev->u.client.ssid_len,
wdev->u.client.ssid,
#else
@@ -887,7 +887,7 @@ static inline int rwnx_rx_sm_connect_ind
rwnx_vif->sta.bssid[0], rwnx_vif->sta.bssid[1], rwnx_vif->sta.bssid[2],
rwnx_vif->sta.bssid[3], rwnx_vif->sta.bssid[4], rwnx_vif->sta.bssid[5]);
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
wdev->u.client.ssid_len = (int)rwnx_vif->sta.ssid_len;
memcpy(wdev->u.client.ssid, rwnx_vif->sta.ssid, wdev->u.client.ssid_len);
#else
@@ -927,7 +927,7 @@ static inline int rwnx_rx_sm_connect_ind
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
struct cfg80211_roam_info info;
memset(&info, 0, sizeof(info));
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
if (rwnx_vif->ch_index < NX_CHAN_CTXT_CNT)
info.links[0].channel = rwnx_hw->chanctx_table[rwnx_vif->ch_index].chan_def.chan;
info.links[0].bssid = (const u8 *)ind->bssid.array;
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_tx.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_tx.c
@@ -1941,7 +1941,7 @@ int rwnx_send_me_sta_add(struct rwnx_hw
{
struct me_sta_add_req *req;
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
struct link_station_parameters *link_sta_params = &params->link_sta_params;
#else
struct station_parameters *link_sta_params = params;