diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_compat.h b/drivers/aic8800/aic8800_fdrv/rwnx_compat.h index f088f9c..5a60fd3 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_compat.h +++ b/drivers/aic8800/aic8800_fdrv/rwnx_compat.h @@ -22,11 +22,28 @@ #ifndef _RWNX_COMPAT_H_ #define _RWNX_COMPAT_H_ #include +#include #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) #error "Minimum kernel version supported is 3.10" #endif +/* Kernel 6.15: legacy del_timer{,_sync} aliases removed (renamed in 6.2). */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) +#ifndef del_timer +#define del_timer timer_delete +#endif +#ifndef del_timer_sync +#define del_timer_sync timer_delete_sync +#endif +#endif + +/* Kernel 6.16: from_timer() was renamed to timer_container_of(). */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) && !defined(from_timer) +#define from_timer(var, callback_timer, timer_fieldname) \ + timer_container_of(var, callback_timer, timer_fieldname) +#endif + /* Generic */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) #define __bf_shf(x) (__builtin_ffsll(x) - 1) diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_main.c b/drivers/aic8800/aic8800_fdrv/rwnx_main.c index 8c5eebc..66873f8 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_main.c +++ b/drivers/aic8800/aic8800_fdrv/rwnx_main.c @@ -3842,6 +3842,9 @@ cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1, #endif static int rwnx_cfg80211_set_monitor_channel(struct wiphy *wiphy, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) + struct net_device *dev, +#endif struct cfg80211_chan_def *chandef) { struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy); @@ -3952,7 +3955,12 @@ void rwnx_cfg80211_mgmt_frame_register(struct wiphy *wiphy, * 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, 13, 0) +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) +#endif { return 0; } @@ -3968,6 +3976,9 @@ static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) static int rwnx_cfg80211_set_tx_power(struct wiphy *wiphy, #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) struct wireless_dev *wdev, +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0) + int radio_idx, #endif enum nl80211_tx_power_setting type, int mbm) { @@ -4367,7 +4378,11 @@ static int rwnx_cfg80211_get_channel(struct wiphy *wiphy, if (rwnx_vif->vif_index == rwnx_hw->monitor_vif) { //retrieve channel from firmware +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) + rwnx_cfg80211_set_monitor_channel(wiphy, NULL, NULL); +#else rwnx_cfg80211_set_monitor_channel(wiphy, NULL); +#endif } //Check if channel context is valid @@ -4550,6 +4565,9 @@ int rwnx_cfg80211_start_radar_detection(struct wiphy *wiphy, struct cfg80211_chan_def *chandef #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) , u32 cac_time_ms + #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) + , int link_id #endif ) { @@ -8539,7 +8557,9 @@ static void __exit rwnx_mod_exit(void) module_init(rwnx_mod_init); module_exit(rwnx_mod_exit); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0) +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); #endif MODULE_FIRMWARE(RWNX_CONFIG_FW_NAME); diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_radar.c b/drivers/aic8800/aic8800_fdrv/rwnx_radar.c index e6dc578..0afb09a 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_radar.c +++ b/drivers/aic8800/aic8800_fdrv/rwnx_radar.c @@ -1399,7 +1399,11 @@ static void rwnx_radar_cac_work(struct work_struct *ws) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) &ctxt->chan_def, #endif - NL80211_RADAR_CAC_FINISHED, GFP_KERNEL); + NL80211_RADAR_CAC_FINISHED, GFP_KERNEL + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + , 0 + #endif + ); rwnx_send_apm_stop_cac_req(rwnx_hw, radar->cac_vif); rwnx_chanctx_unlink(radar->cac_vif); @@ -1499,7 +1503,11 @@ void rwnx_radar_cancel_cac(struct rwnx_radar *radar) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) &ctxt->chan_def, #endif - NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); + NL80211_RADAR_CAC_ABORTED, GFP_KERNEL + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + , 0 + #endif + ); rwnx_chanctx_unlink(radar->cac_vif); } diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_rx.c b/drivers/aic8800/aic8800_fdrv/rwnx_rx.c index e1b08d6..1a99242 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_rx.c +++ b/drivers/aic8800/aic8800_fdrv/rwnx_rx.c @@ -2073,7 +2073,11 @@ u8 rwnx_rxdataind_aicwf(struct rwnx_hw *rwnx_hw, void *hostid, void *rx_priv) 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, 0, 0) + cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, -1, GFP_ATOMIC); +#else cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, GFP_ATOMIC); +#endif } goto end; } @@ -2168,8 +2172,13 @@ u8 rwnx_rxdataind_aicwf(struct rwnx_hw *rwnx_hw, void *hostid, void *rx_priv) } if (hw_rxhdr->flags_is_4addr && !rwnx_vif->use_4addr) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev, + sta->mac_addr, -1, GFP_ATOMIC); +#else cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev, sta->mac_addr, GFP_ATOMIC); +#endif } } diff --git a/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c b/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c index be05052..1b337c2 100644 --- a/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c +++ b/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c @@ -69,7 +69,9 @@ static void __exit aic_bluetooth_mod_exit(void) module_init(aic_bluetooth_mod_init); module_exit(aic_bluetooth_mod_exit); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0) +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); #endif