Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,11 @@ ifneq ($(USER_MODULE_NAME),)
MODULE_NAME := $(USER_MODULE_NAME)
endif

# Newer kernels (e.g. Arch 6.18+) no longer honor EXTRA_CFLAGS for external
# modules. Mirror the fully-expanded EXTRA_CFLAGS into Kbuild's ccflags so
# subdir objects (core/, hal/, ...) can find headers like include/drv_types.h.
subdir-ccflags-y += $(EXTRA_CFLAGS)

ifneq ($(KERNELRELEASE),)

########### this part for *.mk ############################
Expand Down
20 changes: 20 additions & 0 deletions include/osdep_service_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include <linux/rtnetlink.h>
#include <linux/delay.h>
#include <linux/interrupt.h> /* for struct tasklet_struct */
#include <linux/timer.h>
#include <linux/ip.h>
#include <linux/kthread.h>
#include <linux/list.h>
Expand Down Expand Up @@ -356,7 +357,18 @@ static inline void timer_hdl(unsigned long cntx)
#endif
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
/*
* Kernel timer helpers have changed names over time:
* - older kernels provide from_timer()
* - newer kernels provide timer_container_of()
*/
#if defined(timer_container_of)
_timer *ptimer = timer_container_of(ptimer, in_timer, timer);
#elif defined(from_timer)
_timer *ptimer = from_timer(ptimer, in_timer, timer);
#else
_timer *ptimer = container_of(in_timer, _timer, timer);
#endif
#else
_timer *ptimer = (_timer *)cntx;
#endif
Expand Down Expand Up @@ -385,7 +397,15 @@ __inline static void _set_timer(_timer *ptimer, u32 delay_time)

__inline static void _cancel_timer(_timer *ptimer, u8 *bcancelled)
{
/*
* Timer deletion helpers were renamed in newer kernels.
* del_timer_sync() -> timer_delete_sync()
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0))
*bcancelled = timer_delete_sync(&ptimer->timer) ? 1 : 0;
#else
*bcancelled = del_timer_sync(&ptimer->timer) == 1 ? 1 : 0;
#endif
}

static inline void _init_workitem(_workitem *pwork, void *pfunc, void *cntx)
Expand Down
26 changes: 25 additions & 1 deletion os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3391,7 +3391,11 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
return ret;
}

static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed)
static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0))
int radio_idx,
#endif
u32 changed)
{
#if 0
struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
Expand Down Expand Up @@ -3423,6 +3427,9 @@ static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed)
}
#endif
RTW_INFO("%s\n", __func__);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0))
(void)radio_idx;
#endif
return 0;
}

Expand Down Expand Up @@ -4293,6 +4300,9 @@ static int cfg80211_rtw_set_txpower(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
struct wireless_dev *wdev,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0))
int radio_idx,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) || defined(COMPAT_KERNEL_RELEASE)
enum nl80211_tx_power_setting type, int mbm)
#else
Expand All @@ -4306,6 +4316,10 @@ static int cfg80211_rtw_set_txpower(struct wiphy *wiphy,
int ret = 0;
int openhd_override_tx_power_mbm = 0;
bool update_tx_power = false;

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0))
(void)radio_idx;
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) || defined(COMPAT_KERNEL_RELEASE)
value = mbm/100;
#else
Expand Down Expand Up @@ -4390,6 +4404,9 @@ static int cfg80211_rtw_get_txpower(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
struct wireless_dev *wdev,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0))
int radio_idx,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0))
unsigned int link_id,
#endif
Expand All @@ -4401,6 +4418,13 @@ static int cfg80211_rtw_get_txpower(struct wiphy *wiphy,

RTW_INFO("%s\n", __func__);

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0))
(void)radio_idx;
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0))
(void)link_id;
#endif

if (openhd_override_tx_power_mbm > 0) {
*dbm = openhd_override_tx_power_mbm / 100;
} else if(padapter->registrypriv.RegTxPowerIndexOverride){
Expand Down