Files
eternalwrt-mt798x/package/kernel/aic8800/patches/020-wireless-6.16.patch
T
2026-03-18 09:56:04 +08:00

1503 lines
62 KiB
Diff

--- a/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/aicwf_pcie.c
+++ b/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/aicwf_pcie.c
@@ -482,7 +482,7 @@ static int aicwf_disconnect_inform(struc
struct net_device *dev;
#ifdef AICWF_RX_REORDER
struct reord_ctrl_info *reord_info, *tmp;
- u8 *macaddr;
+ const unsigned char *macaddr;
struct aicwf_rx_priv *rx_priv;
#endif
--- a/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/aicwf_tcp_ack.c
+++ b/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/aicwf_tcp_ack.c
@@ -115,7 +115,11 @@ void tcp_ack_deinit(struct rwnx_hw *priv
drop_msg = NULL;
write_seqlock_bh(&ack_m->ack_info[i].seqlock);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete(&ack_m->ack_info[i].timer);
+#else
del_timer(&ack_m->ack_info[i].timer);
+#endif
drop_msg = ack_m->ack_info[i].msgbuf;
ack_m->ack_info[i].msgbuf = NULL;
write_sequnlock_bh(&ack_m->ack_info[i].seqlock);
@@ -388,7 +392,11 @@ int tcp_ack_handle(struct msg_buf *new_m
//printk("%lx \n",ack_info->msgbuf);
drop_msg = ack_info->msgbuf;
ack_info->msgbuf = NULL;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete(&ack_info->timer);
+#else
del_timer(&ack_info->timer);
+#endif
}else{
//printk("msgbuf is NULL \n");
}
@@ -422,7 +430,11 @@ int tcp_ack_handle(struct msg_buf *new_m
atomic_read(&ack_m->max_drop_cnt)))) {
ack_info->drop_cnt = 0;
ack_info->in_send_msg = new_msgbuf;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete(&ack_info->timer);
+#else
del_timer(&ack_info->timer);
+#endif
} else {
ret = 1;
ack_info->msgbuf = new_msgbuf;
@@ -486,7 +498,11 @@ int tcp_ack_handle_new(struct msg_buf *n
ack_info->drop_cnt = 0;
//send_msg = new_msgbuf;
ack_info->in_send_msg = new_msgbuf;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete(&ack_info->timer);
+#else
del_timer(&ack_info->timer);
+#endif
if(drop_msg) {
write_seqlock_bh(&rwnx_hw->txdata_reserved_seqlock);
rwnx_hw->txdata_reserved--;
--- a/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_gki.c
+++ b/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_gki.c
@@ -12,7 +12,11 @@
static struct genl_family rwnx_nl80211_fam;
static bool __rwnx_cfg80211_unexpected_frame(struct net_device *dev, u8 cmd,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
const u8 *addr, gfp_t gfp)
+#else
+ const u8 *addr, int link_id, gfp_t gfp)
+#endif
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
@@ -48,7 +52,11 @@ static bool __rwnx_cfg80211_unexpected_f
}
bool rwnx_cfg80211_rx_spurious_frame(struct net_device *dev,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
const u8 *addr, gfp_t gfp)
+#else
+ const u8 *addr, int link_id, gfp_t gfp)
+#endif
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
bool ret;
@@ -63,7 +71,11 @@ bool rwnx_cfg80211_rx_spurious_frame(str
}
bool rwnx_cfg80211_rx_unexpected_4addr_frame(struct net_device *dev,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
const u8 *addr, gfp_t gfp)
+#else
+ const u8 *addr, int link_id, gfp_t gfp)
+#endif
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
bool ret;
--- a/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
@@ -815,7 +815,7 @@ static void rwnx_csa_finish(struct work_
} else
rwnx_txq_vif_stop(vif, RWNX_TXQ_STOP_CHAN, rwnx_hw);
spin_unlock_bh(&rwnx_hw->cb_lock);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)) || defined(BUILD_OPENWRT)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0);
#elif (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION3)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0, 0);
@@ -1693,7 +1693,11 @@ static struct rwnx_vif *rwnx_interface_a
}
if (type == NL80211_IFTYPE_AP_VLAN) {
+#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 17, 0)
+ eth_hw_addr_set(ndev, params->macaddr);
+#else
memcpy(ndev->dev_addr, params->macaddr, ETH_ALEN);
+#endif
memcpy(vif->wdev.address, params->macaddr, ETH_ALEN);
} else {
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 17, 0)
@@ -1759,7 +1763,11 @@ void aicwf_p2p_alive_timeout(struct time
rwnx_vif = (struct rwnx_vif *)data;
rwnx_hw = rwnx_vif->rwnx_hw;
#else
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
+ rwnx_hw = timer_container_of(rwnx_hw, t, p2p_alive_timer);
+ #else
rwnx_hw = from_timer(rwnx_hw, t, p2p_alive_timer);
+ #endif
rwnx_vif = rwnx_hw->p2p_dev_vif;
#endif
@@ -2364,7 +2372,11 @@ static void rwnx_cfgp2p_stop_p2p_device(
if (rwnx_vif == rwnx_hw->p2p_dev_vif) {
rwnx_hw->is_p2p_alive = 0;
if (timer_pending(&rwnx_hw->p2p_alive_timer)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete_sync(&rwnx_hw->p2p_alive_timer);
+#else
del_timer_sync(&rwnx_hw->p2p_alive_timer);
+#endif
}
if (rwnx_vif->up) {
@@ -3569,7 +3581,7 @@ end:
* @change_beacon: Change the beacon parameters for an access point mode
* interface. This should reject the call when AP mode wasn't started.
*/
-#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)) || defined(BUILD_OPENWRT)
static int rwnx_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,struct cfg80211_ap_update *info)
#else
static int rwnx_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
@@ -3587,7 +3599,7 @@ static int rwnx_cfg80211_change_beacon(s
RWNX_DBG(RWNX_FN_ENTRY_STR);
// Build the beacon
-#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)) || defined(BUILD_OPENWRT)
bcn_buf = rwnx_build_bcn(bcn, &info->beacon);
#else
bcn_buf = rwnx_build_bcn(bcn, info);
@@ -3671,6 +3683,9 @@ static int rwnx_cfg80211_stop_ap(struct
* configured at firmware level.
*/
static int rwnx_cfg80211_set_monitor_channel(struct wiphy *wiphy,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
+ struct net_device *,
+#endif
struct cfg80211_chan_def *chandef)
{
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
@@ -3725,7 +3740,11 @@ static int rwnx_cfg80211_set_monitor_cha
int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef){
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
+ return rwnx_cfg80211_set_monitor_channel(wiphy, NULL, chandef);
+#else
return rwnx_cfg80211_set_monitor_channel(wiphy, chandef);
+#endif
}
/**
@@ -3781,7 +3800,11 @@ void rwnx_cfg80211_mgmt_frame_register(s
* have changed. The actual parameter values are available in
* struct wiphy. If returning an error, no value should be changed.
*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
+#else
+static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed)
+#endif
{
return 0;
}
@@ -3795,7 +3818,11 @@ static int rwnx_cfg80211_set_wiphy_param
* (as advertised by the nl80211 feature flag.)
*/
static int rwnx_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
enum nl80211_tx_power_setting type, int mbm)
+#else
+ int radio_idx, enum nl80211_tx_power_setting type, int mbm)
+#endif
{
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
struct rwnx_vif *vif;
@@ -3826,6 +3853,12 @@ static int rwnx_cfg80211_get_tx_power(st
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION (6, 17, 0)) || defined(BUILD_OPENWRT)
+ int radio_idx,
+#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)) || defined(BUILD_OPENWRT)
+ unsigned int link_id,
+#endif
int *mbm)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
@@ -4136,7 +4169,11 @@ static int rwnx_cfg80211_get_channel(str
if (rwnx_vif->vif_index == rwnx_hw->monitor_vif) {
//retrieve channel from firmware
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
+ rwnx_cfg80211_set_monitor_channel(wiphy, NULL, chandef);
+#else
rwnx_cfg80211_set_monitor_channel(wiphy, NULL);
+#endif
}
//Check if channel context is valid
@@ -4282,7 +4319,7 @@ int rwnx_cfg80211_start_radar_detection(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
, u32 cac_time_ms
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
, int link_id
#endif
)
@@ -4428,7 +4465,7 @@ int rwnx_cfg80211_channel_switch(struct
} else {
INIT_WORK(&csa->work, rwnx_csa_finish);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)) || defined(BUILD_OPENWRT)
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false);
#elif LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION4
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false, 0);
@@ -4464,6 +4501,9 @@ rwnx_cfg80211_tdls_mgmt(struct wiphy *wi
#else
u8 *peer,
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)) || defined(BUILD_OPENWRT)
+ int link_id,
+#endif
u8 action_code,
u8 dialog_token,
u16 status_code,
@@ -6197,7 +6237,11 @@ void rwnx_cfg80211_deinit(struct rwnx_hw
list_for_each_entry(defrag_ctrl, &rwnx_hw->defrag_list, list) {
list_del_init(&defrag_ctrl->list);
if (timer_pending(&defrag_ctrl->defrag_timer))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete_sync(&defrag_ctrl->defrag_timer);
+#else
del_timer_sync(&defrag_ctrl->defrag_timer);
+#endif
dev_kfree_skb(defrag_ctrl->skb);
kfree(defrag_ctrl);
}
--- a/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_rx.c
+++ b/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_rx.c
@@ -927,7 +927,7 @@ static inline int rwnx_rx_sm_disconnect_
struct net_device *dev;
#ifdef AICWF_RX_REORDER
struct reord_ctrl_info *reord_info, *tmp;
- u8 *macaddr;
+ const unsigned char *macaddr;
struct aicwf_rx_priv *rx_priv;
#endif
--- a/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_radar.c
+++ b/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_radar.c
@@ -1502,7 +1502,7 @@ static void rwnx_radar_cac_work(struct w
&ctxt->chan_def,
#endif
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
, 0
#endif
);
@@ -1643,7 +1643,7 @@ void rwnx_radar_cancel_cac(struct rwnx_r
&ctxt->chan_def,
#endif
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
, 0
#endif
);
--- a/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_rx.c
+++ b/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_rx.c
@@ -1667,7 +1667,11 @@ check_len_update:
hdr = (struct ieee80211_hdr *)(skb->data + msdu_offset);
rwnx_vif = rwnx_rx_get_vif(rwnx_hw, hw_rxhdr->flags_vif_idx);
if (rwnx_vif) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, GFP_ATOMIC);
+#else
+ cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, -1, GFP_ATOMIC);
+#endif
}
rwnx_ipc_buf_e2a_sync_back(rwnx_hw, ipc_buf, sync_len);
rwnx_ipc_rxbuf_repush(rwnx_hw, ipc_buf);
@@ -1715,7 +1719,11 @@ check_len_update:
if (hw_rxhdr->flags_is_4addr && !rwnx_vif->use_4addr) {
cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
sta->mac_addr, GFP_ATOMIC);
+#else
+ sta->mac_addr, -1, GFP_ATOMIC);
+#endif
}
}
@@ -1906,7 +1914,11 @@ int reord_flush_tid(struct aicwf_rx_priv
preorder_ctrl->enable = false;
spin_unlock_irqrestore(&preorder_ctrl->reord_list_lock, flags);
if (timer_pending(&preorder_ctrl->reord_timer))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ ret = timer_delete_sync(&preorder_ctrl->reord_timer);
+#else
ret = del_timer_sync(&preorder_ctrl->reord_timer);
+#endif
cancel_work_sync(&preorder_ctrl->reord_timer_work);
return 0;
@@ -1937,7 +1949,11 @@ void reord_deinit_sta(struct aicwf_rx_pr
}
spin_unlock_irqrestore(&preorder_ctrl->reord_list_lock, flags);
if (timer_pending(&preorder_ctrl->reord_timer)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ ret = timer_delete_sync(&preorder_ctrl->reord_timer);
+#else
ret = del_timer_sync(&preorder_ctrl->reord_timer);
+#endif
}
cancel_work_sync(&preorder_ctrl->reord_timer_work);
}
@@ -2122,8 +2138,12 @@ void reord_timeout_handler (struct timer
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
struct reord_ctrl *preorder_ctrl = (struct reord_ctrl *)data;
#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
+ struct reord_ctrl *preorder_ctrl = timer_container_of(preorder_ctrl, t, reord_timer);
+#else
struct reord_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t, reord_timer);
#endif
+#endif
#if 0
struct aicwf_rx_priv *rx_priv = preorder_ctrl->rx_priv;
@@ -2269,7 +2289,11 @@ int reord_process_unit(struct aicwf_rx_p
}
} else {
if (timer_pending(&preorder_ctrl->reord_timer)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ ret = timer_delete(&preorder_ctrl->reord_timer);
+#else
ret = del_timer(&preorder_ctrl->reord_timer);
+#endif
}
}
@@ -2371,8 +2395,12 @@ void defrag_timeout_cb(struct timer_list
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
defrag_ctrl = (struct defrag_ctrl_info *)data;
#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
+ defrag_ctrl = timer_container_of(defrag_ctrl, t, defrag_timer);
+#else
defrag_ctrl = from_timer(defrag_ctrl, t, defrag_timer);
#endif
+#endif
printk("%s:%p\r\n", __func__, defrag_ctrl);
spin_lock_bh(&defrag_ctrl->rwnx_hw->defrag_lock);
@@ -2543,7 +2571,11 @@ check_len_update:
hdr = (struct ieee80211_hdr *)(skb->data + msdu_offset);
rwnx_vif = rwnx_rx_get_vif(rwnx_hw, hw_rxhdr->flags_vif_idx);
if (rwnx_vif) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
rwnx_cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, GFP_ATOMIC);
+#else
+ rwnx_cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, -1, GFP_ATOMIC);
+#endif
}
goto end;
}
@@ -2848,7 +2880,11 @@ check_len_update:
skb_tmp = defrag_info->skb;
list_del_init(&defrag_info->list);
if (timer_pending(&defrag_info->defrag_timer)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ ret = timer_delete(&defrag_info->defrag_timer);
+#else
ret = del_timer(&defrag_info->defrag_timer);
+#endif
}
kfree(defrag_info);
spin_unlock_bh(&rwnx_hw->defrag_lock);
@@ -2901,7 +2937,11 @@ check_len_update:
if (hw_rxhdr->flags_is_4addr && !rwnx_vif->use_4addr) {
printk("aicwf: 4addr flag error\n");
rwnx_cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
sta->mac_addr, GFP_ATOMIC);
+#else
+ sta->mac_addr, -1, GFP_ATOMIC);
+#endif
}
}
--- a/src/PCIE/driver_fw/driver/aic8800d80x2/aic8800_fdrv/rwnx_main.c
+++ b/src/PCIE/driver_fw/driver/aic8800d80x2/aic8800_fdrv/rwnx_main.c
@@ -865,7 +865,7 @@ static void rwnx_csa_finish(struct work_
} else
rwnx_txq_vif_stop(vif, RWNX_TXQ_STOP_CHAN, rwnx_hw);
spin_unlock_bh(&rwnx_hw->cb_lock);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)) || defined(BUILD_OPENWRT)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0);
#elif (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION3)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0, 0);
@@ -3690,7 +3690,7 @@ end:
* @change_beacon: Change the beacon parameters for an access point mode
* interface. This should reject the call when AP mode wasn't started.
*/
-#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)) || defined(BUILD_OPENWRT)
static int rwnx_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_update *info)
#else
@@ -3709,7 +3709,7 @@ static int rwnx_cfg80211_change_beacon(s
RWNX_DBG(RWNX_FN_ENTRY_STR);
// Build the beacon
-#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)) || defined(BUILD_OPENWRT)
bcn_buf = rwnx_build_bcn(bcn, &info->beacon);
#else
bcn_buf = rwnx_build_bcn(bcn, info);
@@ -3792,7 +3792,7 @@ static int rwnx_cfg80211_stop_ap(struct
* Also called internaly with chandef set to NULL simply to retrieve the channel
* configured at firmware level.
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
static int rwnx_cfg80211_set_monitor_channel(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_chan_def *chandef)
#else
@@ -3853,7 +3853,7 @@ static int rwnx_cfg80211_set_monitor_cha
int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_chan_def *chandef)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
return rwnx_cfg80211_set_monitor_channel(wiphy, dev, chandef);
#else
return rwnx_cfg80211_set_monitor_channel(wiphy, chandef);
@@ -3958,7 +3958,7 @@ static int rwnx_cfg80211_get_tx_power(st
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
unsigned int link_id,
#endif
@@ -4311,7 +4311,7 @@ static int rwnx_cfg80211_get_channel(str
if (rwnx_vif->vif_index == rwnx_hw->monitor_vif) {
//retrieve channel from firmware
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
rwnx_cfg80211_set_monitor_channel(wiphy, rwnx_vif->ndev, NULL);
#else
rwnx_cfg80211_set_monitor_channel(wiphy, NULL);
@@ -4460,7 +4460,7 @@ int rwnx_cfg80211_start_radar_detection(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
, u32 cac_time_ms
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
, int link_id
#endif
)
@@ -4606,7 +4606,7 @@ int rwnx_cfg80211_channel_switch(struct
} else {
INIT_WORK(&csa->work, rwnx_csa_finish);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)) || defined(BUILD_OPENWRT)
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false);
#elif LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION4
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false, 0);
--- a/src/PCIE/driver_fw/driver/aic8800d80x2/aic8800_fdrv/rwnx_platform.c
+++ b/src/PCIE/driver_fw/driver/aic8800d80x2/aic8800_fdrv/rwnx_platform.c
@@ -730,7 +730,7 @@ static int rwnx_plat_bin_fw_upload(struc
}
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
MODULE_IMPORT_NS("VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver");
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
#endif
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aic8800d80n_compat.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aic8800d80n_compat.c
@@ -1,3 +1,5 @@
+#include <linux/vmalloc.h>
+
#include "aic8800d80n_compat.h"
#include "aic_bsp_export.h"
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aic_bsp_driver.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aic_bsp_driver.c
@@ -476,8 +476,12 @@ void rwnx_rx_handle_msg(struct aic_sdio_
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
+MODULE_IMPORT_NS("VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver");
+#else
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
#endif
+#endif
#define MD5(x) x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15]
#define MD5PINRT "file md5:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\r\n"
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aicsdio.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aicsdio.c
@@ -1461,7 +1461,11 @@ int aicwf_sdio_busrx_thread(void *data)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
static void aicwf_sdio_bus_pwrctl(struct timer_list *t)
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
+ struct aic_sdio_dev *sdiodev = timer_container_of(sdiodev, t, timer);
+#else
struct aic_sdio_dev *sdiodev = from_timer(sdiodev, t, timer);
+#endif
#else
static void aicwf_sdio_bus_pwrctl(ulong data)
{
@@ -1666,7 +1670,11 @@ void aicwf_sdio_pwrctl_timer(struct aic_
spin_lock_bh(&sdiodev->pwrctl_lock);
if (!duration) {
if (timer_pending(&sdiodev->timer))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete_sync(&sdiodev->timer);
+#else
del_timer_sync(&sdiodev->timer);
+#endif
} else {
sdiodev->active_duration = duration;
timeout = msecs_to_jiffies(sdiodev->active_duration);
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/aic_btsdio.h
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/aic_btsdio.h
@@ -21,7 +21,7 @@
#ifdef CONFIG_PLATFORM_UBUNTU
#define CONFIG_BLUEDROID 0 /* bleuz 0, bluedroid 1, lbh 2 */
#else
-#define CONFIG_BLUEDROID 1 /* bleuz 0, bluedroid 1, lbh 2 */
+#define CONFIG_BLUEDROID 0 /* bleuz 0, bluedroid 1, lbh 2 */
#endif
/* #define HCI_VERSION_CODE KERNEL_VERSION(3, 14, 41) */
#define HCI_VERSION_CODE LINUX_VERSION_CODE
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/aicwf_sdio.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/aicwf_sdio.c
@@ -2804,8 +2804,12 @@ static void aicwf_sdio_bus_pwrctl(struct
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
struct aic_sdio_dev *sdiodev = (struct aic_sdio_dev *) data;
#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
+ struct aic_sdio_dev *sdiodev = timer_container_of(sdiodev, t, timer);
+#else
struct aic_sdio_dev *sdiodev = from_timer(sdiodev, t, timer);
#endif
+#endif
if (sdiodev->bus_if->state == BUS_DOWN_ST) {
sdio_err("bus down\n");
@@ -3001,7 +3005,11 @@ void aicwf_sdio_pwrctl_timer(struct aic_
spin_lock_bh(&sdiodev->pwrctl_lock);
if (!duration) {
if (timer_pending(&sdiodev->timer))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete_sync(&sdiodev->timer);
+#else
del_timer_sync(&sdiodev->timer);
+#endif
} else {
sdiodev->active_duration = duration;
timeout = msecs_to_jiffies(sdiodev->active_duration);
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/aicwf_tcp_ack.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/aicwf_tcp_ack.c
@@ -106,7 +106,11 @@ void tcp_ack_deinit(struct rwnx_hw *priv
drop_msg = NULL;
write_seqlock_bh(&ack_m->ack_info[i].seqlock);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete(&ack_m->ack_info[i].timer);
+#else
del_timer(&ack_m->ack_info[i].timer);
+#endif
drop_msg = ack_m->ack_info[i].msgbuf;
ack_m->ack_info[i].msgbuf = NULL;
write_sequnlock_bh(&ack_m->ack_info[i].seqlock);
@@ -375,7 +379,11 @@ int tcp_ack_handle(struct msg_buf *new_m
//printk("%lx \n",ack_info->msgbuf);
drop_msg = ack_info->msgbuf;
ack_info->msgbuf = NULL;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete(&ack_info->timer);
+#else
del_timer(&ack_info->timer);
+#endif
}else{
//printk("msgbuf is NULL \n");
}
@@ -409,7 +417,11 @@ int tcp_ack_handle(struct msg_buf *new_m
atomic_read(&ack_m->max_drop_cnt)))) {
ack_info->drop_cnt = 0;
ack_info->in_send_msg = new_msgbuf;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete(&ack_info->timer);
+#else
del_timer(&ack_info->timer);
+#endif
} else {
ret = 1;
ack_info->msgbuf = new_msgbuf;
@@ -472,7 +484,11 @@ int tcp_ack_handle_new(struct msg_buf *n
ack_info->drop_cnt = 0;
//send_msg = new_msgbuf;
ack_info->in_send_msg = new_msgbuf;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete(&ack_info->timer);
+#else
del_timer(&ack_info->timer);
+#endif
}else{
ret = 1;
ack_info->msgbuf = new_msgbuf;
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/btsdio.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/btsdio.c
@@ -254,7 +254,9 @@ int btsdio_init(void)
hdev->bus = HCI_SDIO;
hci_set_drvdata(hdev, data);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
hdev->dev_type = HCI_PRIMARY;
+#endif
data->hdev = hdev;
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
@@ -819,7 +819,7 @@ static void rwnx_csa_finish(struct work_
} else
rwnx_txq_vif_stop(vif, RWNX_TXQ_STOP_CHAN, rwnx_hw);
spin_unlock_bh(&rwnx_hw->cb_lock);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)) || defined(BUILD_OPENWRT)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0);
#elif (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION3)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0, 0);
@@ -1766,7 +1766,11 @@ void aicwf_p2p_alive_timeout(struct time
rwnx_vif = (struct rwnx_vif *)data;
rwnx_hw = rwnx_vif->rwnx_hw;
#else
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
+ rwnx_hw = timer_container_of(rwnx_hw, t, p2p_alive_timer);
+ #else
rwnx_hw = from_timer(rwnx_hw, t, p2p_alive_timer);
+ #endif
rwnx_vif = rwnx_hw->p2p_dev_vif;
#endif
@@ -2203,7 +2207,11 @@ static void rwnx_cfgp2p_stop_p2p_device(
if (rwnx_vif == rwnx_hw->p2p_dev_vif) {
rwnx_hw->is_p2p_alive = 0;
if (timer_pending(&rwnx_hw->p2p_alive_timer)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete_sync(&rwnx_hw->p2p_alive_timer);
+#else
del_timer_sync(&rwnx_hw->p2p_alive_timer);
+#endif
}
if (rwnx_vif->up) {
@@ -3495,7 +3503,7 @@ end:
* @change_beacon: Change the beacon parameters for an access point mode
* interface. This should reject the call when AP mode wasn't started.
*/
-#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)) || defined(BUILD_OPENWRT)
static int rwnx_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_update *info)
#else
@@ -3514,7 +3522,7 @@ static int rwnx_cfg80211_change_beacon(s
RWNX_DBG(RWNX_FN_ENTRY_STR);
// Build the beacon
-#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)) || defined(BUILD_OPENWRT)
buf = rwnx_build_bcn(bcn, &info->beacon);
#else
buf = rwnx_build_bcn(bcn, info);
@@ -3599,6 +3607,9 @@ static int rwnx_cfg80211_stop_ap(struct
* configured at firmware level.
*/
static int rwnx_cfg80211_set_monitor_channel(struct wiphy *wiphy,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
+ struct net_device *,
+#endif
struct cfg80211_chan_def *chandef)
{
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
@@ -3653,7 +3664,11 @@ static int rwnx_cfg80211_set_monitor_cha
int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef){
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
+ return rwnx_cfg80211_set_monitor_channel(wiphy, NULL, chandef);
+#else
return rwnx_cfg80211_set_monitor_channel(wiphy, chandef);
+#endif
}
@@ -3710,7 +3725,11 @@ void rwnx_cfg80211_mgmt_frame_register(s
* have changed. The actual parameter values are available in
* struct wiphy. If returning an error, no value should be changed.
*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
+#else
+static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed)
+#endif
{
return 0;
}
@@ -3724,7 +3743,11 @@ static int rwnx_cfg80211_set_wiphy_param
* (as advertised by the nl80211 feature flag.)
*/
static int rwnx_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
enum nl80211_tx_power_setting type, int mbm)
+#else
+ int radio_idx, enum nl80211_tx_power_setting type, int mbm)
+#endif
{
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
struct rwnx_vif *vif;
@@ -3755,6 +3778,12 @@ static int rwnx_cfg80211_get_tx_power(st
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 17, 0)) || defined(BUILD_OPENWRT)
+ int radio_idx,
+#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)) || defined(BUILD_OPENWRT)
+ unsigned int link_id,
+#endif
int *mbm)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
@@ -4072,7 +4101,11 @@ static int rwnx_cfg80211_get_channel(str
if (rwnx_vif->vif_index == rwnx_hw->monitor_vif) {
//retrieve channel from firmware
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
+ rwnx_cfg80211_set_monitor_channel(wiphy, NULL, chandef);
+#else
rwnx_cfg80211_set_monitor_channel(wiphy, NULL);
+#endif
}
//Check if channel context is valid
@@ -4219,7 +4252,7 @@ int rwnx_cfg80211_start_radar_detection(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
, u32 cac_time_ms
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
, int link_id
#endif
)
@@ -4362,7 +4395,7 @@ int rwnx_cfg80211_channel_switch (struct
goto end;
} else {
INIT_WORK(&csa->work, rwnx_csa_finish);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)) || defined(BUILD_OPENWRT)
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false);
#elif LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION4
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false, 0);
@@ -6326,7 +6359,11 @@ void rwnx_cfg80211_deinit(struct rwnx_hw
list_for_each_entry(defrag_ctrl, &rwnx_hw->defrag_list, list) {
list_del_init(&defrag_ctrl->list);
if (timer_pending(&defrag_ctrl->defrag_timer))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete_sync(&defrag_ctrl->defrag_timer);
+#else
del_timer_sync(&defrag_ctrl->defrag_timer);
+#endif
dev_kfree_skb(defrag_ctrl->skb);
kfree(defrag_ctrl);
}
@@ -6458,8 +6495,12 @@ static void __exit rwnx_mod_exit(void)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
+MODULE_IMPORT_NS("VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver");
+#else
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
#endif
+#endif
module_init(rwnx_mod_init);
module_exit(rwnx_mod_exit);
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_mod_params.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_mod_params.c
@@ -1594,7 +1594,9 @@ if (rwnx_hw->mod_params->custregd) {
"\n\n%s: CAUTION: USING PERMISSIVE CUSTOM REGULATORY RULES\n\n",
__func__);
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0))
wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif
wiphy_apply_custom_regulatory(wiphy, regdomain);
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
memcpy(country_code, default_ccode, sizeof(default_ccode));
@@ -1628,7 +1630,9 @@ if (rwnx_hw->mod_params->custregd) {
"\n\n%s: CAUTION: USING PERMISSIVE CUSTOM REGULATORY RULES\n\n",
__func__);
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0))
wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif
wiphy_apply_custom_regulatory(wiphy, &rwnx_regdom);
#endif
// Check if custom channel set shall be enabled. In such case only monitor mode is
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_platform.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_platform.c
@@ -548,8 +548,12 @@ static int rwnx_plat_tl4_fw_upload(struc
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
+MODULE_IMPORT_NS("VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver");
+#else
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
#endif
+#endif
#if 0
/**
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_radar.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_radar.c
@@ -1506,7 +1506,7 @@ static void rwnx_radar_cac_work(struct w
&ctxt->chan_def,
#endif
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
, 0
#endif
);
@@ -1647,7 +1647,7 @@ void rwnx_radar_cancel_cac(struct rwnx_r
&ctxt->chan_def,
#endif
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
, 0
#endif
);
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_rx.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_rx.c
@@ -1659,7 +1659,11 @@ int reord_flush_tid(struct aicwf_rx_priv
preorder_ctrl->enable = false;
spin_unlock_irqrestore(&preorder_ctrl->reord_list_lock, flags);
if (timer_pending(&preorder_ctrl->reord_timer))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ ret = timer_delete_sync(&preorder_ctrl->reord_timer);
+#else
ret = del_timer_sync(&preorder_ctrl->reord_timer);
+#endif
cancel_work_sync(&preorder_ctrl->reord_timer_work);
return 0;
@@ -1684,7 +1688,11 @@ void reord_deinit_sta(struct aicwf_rx_pr
if(preorder_ctrl->enable){
preorder_ctrl->enable = false;
if (timer_pending(&preorder_ctrl->reord_timer)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ ret = timer_delete_sync(&preorder_ctrl->reord_timer);
+#else
ret = del_timer_sync(&preorder_ctrl->reord_timer);
+#endif
}
cancel_work_sync(&preorder_ctrl->reord_timer_work);
}
@@ -1895,8 +1903,12 @@ void reord_timeout_handler (struct timer
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
struct reord_ctrl *preorder_ctrl = (struct reord_ctrl *)data;
#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
+ struct reord_ctrl *preorder_ctrl = timer_container_of(preorder_ctrl, t, reord_timer);
+#else
struct reord_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t, reord_timer);
#endif
+#endif
#if 0 //AIDEN
struct aicwf_rx_priv *rx_priv = preorder_ctrl->rx_priv;
@@ -2044,7 +2056,11 @@ int reord_process_unit(struct aicwf_rx_p
}
} else {
if (timer_pending(&preorder_ctrl->reord_timer)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ ret = timer_delete(&preorder_ctrl->reord_timer);
+#else
ret = del_timer(&preorder_ctrl->reord_timer);
+#endif
}
}
@@ -2146,8 +2162,12 @@ void defrag_timeout_cb(struct timer_list
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
defrag_ctrl = (struct defrag_ctrl_info *)data;
#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
+ defrag_ctrl = timer_container_of(defrag_ctrl, t, defrag_timer);
+#else
defrag_ctrl = from_timer(defrag_ctrl, t, defrag_timer);
#endif
+#endif
printk("%s:%p\r\n", __func__, defrag_ctrl);
spin_lock_bh(&defrag_ctrl->rwnx_hw->defrag_lock);
@@ -2376,7 +2396,11 @@ check_len_update:
#ifdef CONFIG_GKI
rwnx_cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, GFP_ATOMIC);
#else
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, GFP_ATOMIC);
+#else
+ cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, -1, GFP_ATOMIC);
+#endif
#endif
}
goto end;
@@ -2695,7 +2719,11 @@ check_len_update:
skb_tmp = defrag_info->skb;
list_del_init(&defrag_info->list);
if (timer_pending(&defrag_info->defrag_timer)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ ret = timer_delete(&defrag_info->defrag_timer);
+#else
ret = del_timer(&defrag_info->defrag_timer);
+#endif
}
kfree(defrag_info);
spin_unlock_bh(&rwnx_hw->defrag_lock);
@@ -2752,7 +2780,11 @@ check_len_update:
sta->mac_addr, GFP_ATOMIC);
#else
cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)) && !defined(BUILD_OPENWRT)
sta->mac_addr, GFP_ATOMIC);
+#else
+ sta->mac_addr, -1, GFP_ATOMIC);
+#endif
#endif
}
}
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_wakelock.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_wakelock.c
@@ -11,18 +11,24 @@
struct wakeup_source *rwnx_wakeup_init(const char *name)
{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)) && !defined(BUILD_OPENWRT)
struct wakeup_source *ws;
ws = wakeup_source_create(name);
wakeup_source_add(ws);
return ws;
+#else
+ return NULL;
+#endif
}
void rwnx_wakeup_deinit(struct wakeup_source *ws)
{
if (ws && ws->active)
__pm_relax(ws);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)) && !defined(BUILD_OPENWRT)
wakeup_source_remove(ws);
wakeup_source_destroy(ws);
+#endif
}
struct wakeup_source *rwnx_wakeup_register(struct device *dev, const char *name)
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/aic_priv_cmd.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/aic_priv_cmd.c
@@ -1832,7 +1832,7 @@ void set_vendor_extension_ie(char *comma
}
#endif//CONFIG_SET_VENDOR_EXTENSION_IE
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_chan_def *chandef);
#else
@@ -1840,7 +1840,7 @@ int rwnx_cfg80211_set_monitor_channel_(s
struct cfg80211_chan_def *chandef);
#endif
int rwnx_atoi2(char *value, int c_len);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
void set_mon_chan(struct rwnx_vif *vif, struct net_device *dev, char *parameter)
#else
void set_mon_chan(struct rwnx_vif *vif, char *parameter)
@@ -1867,7 +1867,7 @@ void set_mon_chan(struct rwnx_vif *vif,
chandef->center_freq1 = chandef->chan->center_freq;
chandef->center_freq2 = 0;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
rwnx_cfg80211_set_monitor_channel_(vif->rwnx_hw->wiphy, dev, chandef);
#else
rwnx_cfg80211_set_monitor_channel_(vif->rwnx_hw->wiphy, chandef);
@@ -2136,7 +2136,7 @@ int android_priv_cmd(struct net_device *
char *set_parameter;
skip = strlen(CMD_SET_MON_FREQ) + 1;
set_parameter = command + skip;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
set_mon_chan(vif, net, set_parameter);
#else
set_mon_chan(vif, set_parameter);
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/aic_priv_cmd.h
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/aic_priv_cmd.h
@@ -62,7 +62,7 @@ int get_cs_info(struct rwnx_vif *vif, u8
unsigned int command_strtoul(const char *cp, char **endp, unsigned int base);
int str_starts(const char *str, const char *start);
int handle_private_cmd(struct net_device *net, char *command, u32 cmd_len);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
void set_mon_chan(struct rwnx_vif *vif, struct net_device *dev, char *parameter);
#else
void set_mon_chan(struct rwnx_vif *vif, char *parameter);
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c
@@ -106,7 +106,7 @@ void tcp_ack_deinit(struct rwnx_hw *priv
drop_msg = NULL;
write_seqlock_bh(&ack_m->ack_info[i].seqlock);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
timer_delete(&ack_m->ack_info[i].timer);
#else
del_timer(&ack_m->ack_info[i].timer);
@@ -379,7 +379,7 @@ int tcp_ack_handle(struct msg_buf *new_m
//printk("%lx \n",ack_info->msgbuf);
drop_msg = ack_info->msgbuf;
ack_info->msgbuf = NULL;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
timer_delete(&ack_info->timer);
#else
del_timer(&ack_info->timer);
@@ -417,7 +417,7 @@ int tcp_ack_handle(struct msg_buf *new_m
atomic_read(&ack_m->max_drop_cnt)))) {
ack_info->drop_cnt = 0;
ack_info->in_send_msg = new_msgbuf;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
timer_delete(&ack_info->timer);
#else
del_timer(&ack_info->timer);
@@ -484,7 +484,7 @@ int tcp_ack_handle_new(struct msg_buf *n
ack_info->drop_cnt = 0;
//send_msg = new_msgbuf;
ack_info->in_send_msg = new_msgbuf;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
timer_delete(&ack_info->timer);
#else
del_timer(&ack_info->timer);
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_main.c
@@ -1110,7 +1110,7 @@ static void rwnx_csa_finish(struct work_
} else
rwnx_txq_vif_stop(vif, RWNX_TXQ_STOP_CHAN, rwnx_hw);
spin_unlock_bh(&rwnx_hw->cb_lock);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)) || defined(BUILD_OPENWRT)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0);
#elif (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION3)
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0, 0);
@@ -2067,7 +2067,7 @@ void aicwf_p2p_alive_timeout(struct time
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
rwnx_vif = (struct rwnx_vif *)data;
rwnx_hw = rwnx_vif->rwnx_hw;
- #elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)
+ #elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)) && !defined(BUILD_OPENWRT)
rwnx_hw = from_timer(rwnx_hw, t, p2p_alive_timer);
rwnx_vif = rwnx_hw->p2p_dev_vif;
#else
@@ -2310,7 +2310,7 @@ static void aicwf_pwrloss_timer(struct t
struct rwnx_vif *rwnx_vif;
rwnx_vif = (struct rwnx_vif *)data;
rwnx_hw = rwnx_vif->rwnx_hw;
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)) && !defined(BUILD_OPENWRT)
rwnx_hw = from_timer(rwnx_hw, t, pwrloss_timer);
#else
rwnx_hw = timer_container_of(rwnx_hw, t, pwrloss_timer);
@@ -2379,7 +2379,7 @@ static void aicwf_tcloss_timer(struct ti
struct rwnx_vif *rwnx_vif;
rwnx_vif = (struct rwnx_vif *)data;
rwnx_hw = rwnx_vif->rwnx_hw;
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)) && !defined(BUILD_OPENWRT)
rwnx_hw = from_timer(rwnx_hw, t, tc_timer);
#else
rwnx_hw = timer_container_of(rwnx_hw, t, tc_timer);
@@ -2587,7 +2587,11 @@ static int rwnx_cfg80211_del_iface(struc
#if 0
if (rwnx_vif == rwnx_hw->p2p_dev_vif) {
if (timer_pending(&rwnx_hw->p2p_alive_timer)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
+ timer_delete_sync(&rwnx_hw->p2p_alive_timer);
+#else
del_timer_sync(&rwnx_hw->p2p_alive_timer);
+#endif
}
}
#endif
@@ -2830,7 +2834,7 @@ static void rwnx_cfgp2p_stop_p2p_device(
if (rwnx_vif == rwnx_hw->p2p_dev_vif) {
rwnx_hw->is_p2p_alive = 0;
if (timer_pending(&rwnx_hw->p2p_alive_timer)) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
timer_delete_sync(&rwnx_hw->p2p_alive_timer);
#else
del_timer_sync(&rwnx_hw->p2p_alive_timer);
@@ -4191,7 +4195,7 @@ static int rwnx_cfg80211_start_ap(struct
* @change_beacon: Change the beacon parameters for an access point mode
* interface. This should reject the call when AP mode wasn't started.
*/
-#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)) || defined(BUILD_OPENWRT)
static int rwnx_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_update *info)
#else
@@ -4211,7 +4215,7 @@ static int rwnx_cfg80211_change_beacon(s
elem.dma_addr = 0;
// Build the beacon
-#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(6, 7, 0)) || defined(BUILD_OPENWRT)
buf = rwnx_build_bcn(bcn, &info->beacon);
#else
buf = rwnx_build_bcn(bcn, info);
@@ -4268,7 +4272,7 @@ static int rwnx_cfg80211_stop_ap(struct
rwnx_vif->ap.start = false;
aicwf_nl_hook_deinit(rwnx_vif->ap.band, rwnx_vif->rwnx_hw->iface_idx);
if (timer_pending(&rwnx_vif->steer_timer)) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
timer_delete_sync(&rwnx_vif->steer_timer);
#else
del_timer_sync(&rwnx_vif->steer_timer);
@@ -4323,7 +4327,7 @@ cfg80211_chandef_identical(const struct
}
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
static int rwnx_cfg80211_set_monitor_channel(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_chan_def *chandef)
#else
@@ -4383,7 +4387,7 @@ static int rwnx_cfg80211_set_monitor_cha
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_chan_def *chandef)
@@ -4456,7 +4460,7 @@ void rwnx_cfg80211_mgmt_frame_register(s
* have changed. The actual parameter values are available in
* struct wiphy. If returning an error, no value should be changed.
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) || defined(BUILD_OPENWRT)
static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed)
#else
static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
@@ -4477,7 +4481,7 @@ static int rwnx_cfg80211_set_tx_power(st
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) || defined(BUILD_OPENWRT)
int radio_idx,
#endif
enum nl80211_tx_power_setting type, int mbm)
@@ -4514,6 +4518,12 @@ static int rwnx_cfg80211_get_tx_power(st
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) || defined(BUILD_OPENWRT)
+ int radio_idx,
+#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)) || defined(BUILD_OPENWRT)
+ unsigned int link_id,
+#endif
int *mbm)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
@@ -4896,7 +4906,7 @@ static int rwnx_cfg80211_get_channel(str
if (rwnx_vif->vif_index == rwnx_hw->monitor_vif)
{
//retrieve channel from firmware
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
rwnx_cfg80211_set_monitor_channel(wiphy, wdev->netdev, NULL);
#else
rwnx_cfg80211_set_monitor_channel(wiphy, NULL);
@@ -5095,7 +5105,7 @@ int rwnx_cfg80211_start_radar_detection(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
, u32 cac_time_ms
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
, int link_id
#endif
)
@@ -5249,7 +5259,7 @@ int rwnx_cfg80211_channel_switch(struct
goto end;
} else {
INIT_WORK(&csa->work, rwnx_csa_finish);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)) || defined(BUILD_OPENWRT)
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false);
#elif LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION4
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false, 0);
@@ -9332,7 +9342,7 @@ void rwnx_cfg80211_deinit(struct rwnx_hw
#ifdef CONFIG_DYNAMIC_PWR
if(timer_pending(&rwnx_hw->pwrloss_timer)){
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
timer_delete_sync(&rwnx_hw->pwrloss_timer);
#else
del_timer_sync(&rwnx_hw->pwrloss_timer);
@@ -9342,7 +9352,7 @@ void rwnx_cfg80211_deinit(struct rwnx_hw
#endif
#ifdef CONFIG_TEMP_CONTROL
if(timer_pending(&rwnx_hw->tc_timer)){
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
timer_delete_sync(&rwnx_hw->tc_timer);
#else
del_timer_sync(&rwnx_hw->tc_timer);
@@ -9357,7 +9367,7 @@ void rwnx_cfg80211_deinit(struct rwnx_hw
list_for_each_entry(defrag_ctrl, &rwnx_hw->defrag_list, list) {
list_del_init(&defrag_ctrl->list);
if (timer_pending(&defrag_ctrl->defrag_timer)) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
timer_delete_sync(&defrag_ctrl->defrag_timer);
#else
del_timer_sync(&defrag_ctrl->defrag_timer);
@@ -9478,7 +9488,7 @@ module_param(wifi_mac_addr,charp, 0);
MODULE_PARM_DESC(wifi_mac_addr, "Configures mac addr.");
module_init(rwnx_mod_init);
module_exit(rwnx_mod_exit);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0) || defined(BUILD_OPENWRT)
MODULE_IMPORT_NS("VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver");
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_main.h
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_main.h
@@ -91,7 +91,7 @@ void aicwf_p2p_alive_timeout(struct time
int rwnx_send_check_p2p(struct cfg80211_scan_request *param);
void apm_staloss_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 (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
int rwnx_cfg80211_set_monitor_channel_(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_chan_def *chandef);
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_mod_params.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_mod_params.c
@@ -1663,7 +1663,9 @@ static void rwnx_set_wiphy_params(struct
"\n\n%s: CAUTION: USING PERMISSIVE CUSTOM REGULATORY RULES\n\n",
__func__);
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0))
wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif
wiphy_apply_custom_regulatory(wiphy, regdomain);
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
memcpy(country_code, default_ccode, sizeof(default_ccode));
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_radar.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_radar.c
@@ -1475,7 +1475,7 @@ static void rwnx_radar_cac_work(struct w
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
&ctxt->chan_def,
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0);
#else
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL);
@@ -1617,7 +1617,7 @@ void rwnx_radar_cancel_cac(struct rwnx_r
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
&ctxt->chan_def,
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)) || defined(BUILD_OPENWRT)
NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0);
#else
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_rx.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_rx.c
@@ -482,8 +482,13 @@ static bool rwnx_rx_data_skb(struct rwnx
#else
int count;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
+ ieee80211_amsdu_to_8023s(skb, &list, rwnx_vif->ndev->dev_addr,
+ RWNX_VIF_TYPE(rwnx_vif), 0, NULL, NULL, 0);
+#else
ieee80211_amsdu_to_8023s(skb, &list, rwnx_vif->ndev->dev_addr,
RWNX_VIF_TYPE(rwnx_vif), 0, NULL, NULL, false);
+#endif
#else
ieee80211_amsdu_to_8023s(skb, &list, rwnx_vif->ndev->dev_addr,
RWNX_VIF_TYPE(rwnx_vif), 0, NULL, NULL);
@@ -1589,7 +1594,7 @@ int reord_flush_tid(struct aicwf_rx_priv
preorder_ctrl->enable = false;
spin_unlock_irqrestore(&preorder_ctrl->reord_list_lock, flags);
if (timer_pending(&preorder_ctrl->reord_timer)) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
ret = timer_delete_sync(&preorder_ctrl->reord_timer);
#else
ret = del_timer_sync(&preorder_ctrl->reord_timer);
@@ -1620,7 +1625,7 @@ void reord_deinit_sta(struct aicwf_rx_pr
if(preorder_ctrl->enable){
preorder_ctrl->enable = false;
if (timer_pending(&preorder_ctrl->reord_timer)) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
ret = timer_delete_sync(&preorder_ctrl->reord_timer);
#else
ret = del_timer_sync(&preorder_ctrl->reord_timer);
@@ -1872,7 +1877,7 @@ void reord_timeout_handler (struct timer
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
struct reord_ctrl *preorder_ctrl = (struct reord_ctrl *)data;
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0)
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0)) && !defined(BUILD_OPENWRT)
struct reord_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t, reord_timer);
#else
struct reord_ctrl *preorder_ctrl = timer_container_of(preorder_ctrl, t, reord_timer);
@@ -2033,7 +2038,7 @@ int reord_process_unit(struct recv_msdu
}
} else {
if(timer_pending(&preorder_ctrl->reord_timer)) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
ret = timer_delete(&preorder_ctrl->reord_timer);
#else
ret = del_timer(&preorder_ctrl->reord_timer);
@@ -2204,7 +2209,7 @@ void defrag_timeout_cb(struct timer_list
struct defrag_ctrl_info *defrag_ctrl = NULL;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
defrag_ctrl = (struct defrag_ctrl_info *)data;
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0)
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0)) && !defined(BUILD_OPENWRT)
defrag_ctrl = from_timer(defrag_ctrl, t, defrag_timer);
#else
defrag_ctrl = timer_container_of(defrag_ctrl, t, defrag_timer);
@@ -2380,7 +2385,7 @@ check_len_update:
hdr = (struct ieee80211_hdr *)(skb->data + msdu_offset);
rwnx_vif = rwnx_rx_get_vif(rwnx_hw, hw_rxhdr->flags_vif_idx);
if (rwnx_vif) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) || defined(BUILD_OPENWRT)
cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, -1, GFP_ATOMIC);
#else
cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, GFP_ATOMIC);
@@ -2671,7 +2676,7 @@ check_len_update:
skb_tmp = defrag_info->skb;
list_del_init(&defrag_info->list);
if (timer_pending(&defrag_info->defrag_timer)) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) || defined(BUILD_OPENWRT)
ret = timer_delete(&defrag_info->defrag_timer);
#else
ret = del_timer(&defrag_info->defrag_timer);
@@ -2727,7 +2732,7 @@ check_len_update:
if (hw_rxhdr->flags_is_4addr && !rwnx_vif->use_4addr) {
printk("aicwf: 4addr flag error\n");
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) || defined(BUILD_OPENWRT)
cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev,
sta->mac_addr, -1, GFP_ATOMIC);
#else
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_wakelock.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_wakelock.c
@@ -9,7 +9,7 @@
#include "rwnx_defs.h"
#include "rwnx_wakelock.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0)) && !defined(BUILD_OPENWRT)
struct wakeup_source *rwnx_wakeup_init(const char *name)
{
struct wakeup_source *ws;
@@ -73,7 +73,7 @@ void rwnx_wakeup_lock_timeout(struct wak
void aicwf_wakeup_lock_init(struct rwnx_hw *rwnx_hw)
{
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
struct aic_usb_dev *usbdev = rwnx_hw->usbdev;
rwnx_hw->ws_tx = rwnx_wakeup_register(usbdev->dev, "rwnx_tx_wakelock");
rwnx_hw->ws_rx = rwnx_wakeup_register(usbdev->dev,"rwnx_rx_wakelock");
@@ -89,7 +89,7 @@ void aicwf_wakeup_lock_init(struct rwnx_
void aicwf_wakeup_lock_deinit(struct rwnx_hw *rwnx_hw)
{
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) || defined(BUILD_OPENWRT)
rwnx_wakeup_unregister(rwnx_hw->ws_tx);
rwnx_wakeup_unregister(rwnx_hw->ws_rx);
rwnx_wakeup_unregister(rwnx_hw->ws_irqrx);
--- a/src/USB/driver_fw/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c
@@ -69,7 +69,7 @@ static void __exit aic_bluetooth_mod_exi
module_init(aic_bluetooth_mod_init);
module_exit(aic_bluetooth_mod_exit);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
MODULE_IMPORT_NS("VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver");
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
--- a/src/USB/driver_fw/drivers/aic_btusb/aic_btusb.c
+++ b/src/USB/driver_fw/drivers/aic_btusb/aic_btusb.c
@@ -5509,7 +5509,7 @@ module_exit(btusb_exit);
module_param(mp_drv_mode, int, 0644);
MODULE_PARM_DESC(mp_drv_mode, "0: NORMAL; 1: MP MODE");
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) || defined(BUILD_OPENWRT)
MODULE_IMPORT_NS("VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver");
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
--- a/src/USB/driver_fw/drivers/aic_btusb/aic_btusb.h
+++ b/src/USB/driver_fw/drivers/aic_btusb/aic_btusb.h
@@ -39,7 +39,7 @@
#ifdef CONFIG_PLATFORM_UBUNTU
#define CONFIG_BLUEDROID 1 /* bleuz 0, bluedroid 1, lbh 2 */
#else
-#define CONFIG_BLUEDROID 1 /* bleuz 0, bluedroid 1, lbh 2 */
+#define CONFIG_BLUEDROID 0 /* bleuz 0, bluedroid 1, lbh 2 */
#endif
#if CONFIG_BLUEDROID == 1