armbian-build/patch/misc/wireless-rtl8723ds-Fix-v6.1...

281 lines
11 KiB
Diff

diff --git a/drivers/net/wireless/rtl8723ds/core/rtw_p2p.c b/drivers/net/wireless/rtl8723ds/core/rtw_p2p.c
index 17cd93a1819..4e1bf442b6a 100644
--- a/drivers/net/wireless/rtl8723ds/core/rtw_p2p.c
+++ b/drivers/net/wireless/rtl8723ds/core/rtw_p2p.c
@@ -3377,7 +3377,11 @@ static void ro_ch_timer_process(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, wdinfo.reset_ch_sitesurvey);
+#else
_adapter *adapter = from_timer(adapter, t, wdinfo.reset_ch_sitesurvey);
+#endif
#else
_adapter *adapter = (_adapter *)FunctionContext;
#endif
@@ -4534,7 +4538,11 @@ static void reset_ch_sitesurvey_timer_process(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, wdinfo.reset_ch_sitesurvey2);
+#else
_adapter *adapter = from_timer(adapter, t, wdinfo.reset_ch_sitesurvey2);
+#endif
#else
_adapter *adapter = (_adapter *)FunctionContext;
#endif
@@ -4561,7 +4569,11 @@ static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, wdinfo.reset_ch_sitesurvey2);
+#else
_adapter *adapter = from_timer(adapter, t, wdinfo.reset_ch_sitesurvey2);
+#endif
#else
_adapter *adapter = (_adapter *)FunctionContext;
#endif
@@ -4588,7 +4600,11 @@ static void restore_p2p_state_timer_process (void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, wdinfo.restore_p2p_state_timer);
+#else
_adapter *adapter = from_timer(adapter, t, wdinfo.restore_p2p_state_timer);
+#endif
#else
_adapter *adapter = (_adapter *)FunctionContext;
#endif
@@ -4607,7 +4623,11 @@ static void pre_tx_scan_timer_process(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, wdinfo.pre_tx_scan_timer);
+#else
_adapter *adapter = from_timer(adapter, t, wdinfo.pre_tx_scan_timer);
+#endif
#else
_adapter *adapter = (_adapter *)FunctionContext;
#endif
@@ -4648,8 +4668,12 @@ static void find_phase_timer_process(struct timer_list *t)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *adapter = (_adapter *)FunctionContext;
+#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, wdinfo.find_phase_timer);
#else
_adapter *adapter = from_timer(adapter, t, wdinfo.find_phase_timer);
+#endif
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
@@ -4669,7 +4693,11 @@ void ap_p2p_switch_timer_process (void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, wdinfo.ap_p2p_switch_timer);
+#else
_adapter *adapter = from_timer(adapter, t, wdinfo.ap_p2p_switch_timer);
+#endif
#else
_adapter *adapter = (_adapter *)FunctionContext;
#endif
diff --git a/drivers/net/wireless/rtl8723ds/core/rtw_pwrctrl.c b/drivers/net/wireless/rtl8723ds/core/rtw_pwrctrl.c
index 2141d29f307..abef8c91b40 100644
--- a/drivers/net/wireless/rtl8723ds/core/rtw_pwrctrl.c
+++ b/drivers/net/wireless/rtl8723ds/core/rtw_pwrctrl.c
@@ -401,8 +401,12 @@ void pwr_state_check_handler(struct timer_list *t)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_adapter *padapter = (_adapter *)FunctionContext;
+#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ struct pwrctrl_priv *pwrpriv = timer_container_of(pwrpriv, t, pwr_state_check_timer);
#else
struct pwrctrl_priv *pwrpriv = from_timer(pwrpriv, t, pwr_state_check_timer);
+#endif
_adapter *padapter = pwrpriv->padapter;
#endif
rtw_ps_cmd(padapter);
@@ -1455,8 +1459,12 @@ static void pwr_rpwm_timeout_handler(struct timer_list *t)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
PADAPTER padapter = (PADAPTER)FunctionContext;
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
+#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ struct pwrctrl_priv *pwrpriv = timer_container_of(pwrpriv, t, pwr_rpwm_timer);
#else
struct pwrctrl_priv *pwrpriv = from_timer(pwrpriv, t, pwr_rpwm_timer);
+#endif
#endif
RTW_INFO("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
diff --git a/drivers/net/wireless/rtl8723ds/core/rtw_recv.c b/drivers/net/wireless/rtl8723ds/core/rtw_recv.c
index e2f29d213f7..bfc6df6250a 100644
--- a/drivers/net/wireless/rtl8723ds/core/rtw_recv.c
+++ b/drivers/net/wireless/rtl8723ds/core/rtw_recv.c
@@ -4186,8 +4186,12 @@ void rtw_signal_stat_timer_hdl(struct timer_list *t)
{
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0))
_adapter *adapter = (_adapter *)FunctionContext;
+#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, recvpriv.signal_stat_timer);
#else
_adapter *adapter = from_timer(adapter, t, recvpriv.signal_stat_timer);
+#endif
#endif
struct recv_priv *recvpriv = &adapter->recvpriv;
diff --git a/drivers/net/wireless/rtl8723ds/hal/led/hal_sdio_led.c b/drivers/net/wireless/rtl8723ds/hal/led/hal_sdio_led.c
index bda1d421c84..b294a14288b 100644
--- a/drivers/net/wireless/rtl8723ds/hal/led/hal_sdio_led.c
+++ b/drivers/net/wireless/rtl8723ds/hal/led/hal_sdio_led.c
@@ -826,7 +826,11 @@ void BlinkTimerCallback(void *data)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ PLED_SDIO pLed = timer_container_of(pLed, t, BlinkTimer);
+#else
PLED_SDIO pLed = from_timer(pLed, t, BlinkTimer);
+#endif
#else
PLED_SDIO pLed = (PLED_SDIO)data;
#endif
diff --git a/drivers/net/wireless/rtl8723ds/os_dep/linux/mlme_linux.c b/drivers/net/wireless/rtl8723ds/os_dep/linux/mlme_linux.c
index 6509df0aec4..985102bf887 100644
--- a/drivers/net/wireless/rtl8723ds/os_dep/linux/mlme_linux.c
+++ b/drivers/net/wireless/rtl8723ds/os_dep/linux/mlme_linux.c
@@ -75,7 +75,11 @@ void rtw_join_timeout_handler(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, mlmepriv.assoc_timer);
+#else
_adapter *adapter = from_timer(adapter, t, mlmepriv.assoc_timer);
+#endif
#else
_adapter *adapter = (_adapter *)FunctionContext;
#endif
@@ -90,7 +94,11 @@ void _rtw_scan_timeout_handler(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, mlmepriv.scan_to_timer);
+#else
_adapter *adapter = from_timer(adapter, t, mlmepriv.scan_to_timer);
+#endif
#else
_adapter *adapter = (_adapter *)FunctionContext;
#endif
@@ -105,7 +113,11 @@ void _dynamic_check_timer_handlder(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ struct dvobj_priv *pdvobj = timer_container_of(pdvobj, t, dynamic_chk_timer);
+#else
struct dvobj_priv *pdvobj = from_timer(pdvobj, t, dynamic_chk_timer);
+#endif
#else
struct dvobj_priv *pdvobj = (struct dvobj_priv *)FunctionContext;
#endif
@@ -132,7 +144,11 @@ void _rtw_set_scan_deny_timer_hdl(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *adapter = timer_container_of(adapter, t, mlmepriv.set_scan_deny_timer);
+#else
_adapter *adapter = from_timer(adapter, t, mlmepriv.set_scan_deny_timer);
+#endif
#else
_adapter *adapter = (_adapter *)FunctionContext;
#endif
@@ -350,7 +366,11 @@ void _survey_timer_hdl(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *padapter = timer_container_of(padapter, t, mlmeextpriv.survey_timer);
+#else
_adapter *padapter = from_timer(padapter, t, mlmeextpriv.survey_timer);
+#endif
#else
_adapter *padapter = (_adapter *)FunctionContext;
#endif
@@ -365,7 +385,11 @@ void _link_timer_hdl(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *padapter = timer_container_of(padapter, t, mlmeextpriv.link_timer);
+#else
_adapter *padapter = from_timer(padapter, t, mlmeextpriv.link_timer);
+#endif
#else
_adapter *padapter = (_adapter *)FunctionContext;
#endif
@@ -380,7 +404,11 @@ void _ft_link_timer_hdl(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *padapter = timer_container_of(padapter, t, mlmeextpriv.ft_link_timer);
+#else
_adapter *padapter = from_timer(padapter, t, mlmeextpriv.ft_link_timer);
+#endif
#else
_adapter *padapter = (_adapter *)FunctionContext;
#endif
@@ -395,7 +423,11 @@ void _ft_roam_timer_hdl(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ _adapter *padapter = timer_container_of(padapter, t, mlmeextpriv.ft_roam_timer);
+#else
_adapter *padapter = from_timer(padapter, t, mlmeextpriv.ft_roam_timer);
+#endif
#else
_adapter *padapter = (_adapter *)FunctionContext;
#endif
@@ -411,7 +443,11 @@ void _addba_timer_hdl(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ struct sta_info *psta = timer_container_of(psta, t, addba_retry_timer);
+#else
struct sta_info *psta = from_timer(psta, t, addba_retry_timer);
+#endif
#else
struct sta_info *psta = (struct sta_info *)FunctionContext;
#endif
diff --git a/drivers/net/wireless/rtl8723ds/os_dep/linux/recv_linux.c b/drivers/net/wireless/rtl8723ds/os_dep/linux/recv_linux.c
index dd64495b792..49b9a70e72d 100644
--- a/drivers/net/wireless/rtl8723ds/os_dep/linux/recv_linux.c
+++ b/drivers/net/wireless/rtl8723ds/os_dep/linux/recv_linux.c
@@ -866,7 +866,11 @@ void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+ struct recv_reorder_ctrl *preorder_ctrl = timer_container_of(preorder_ctrl, t, reordering_ctrl_timer);
+#else
struct recv_reorder_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t, reordering_ctrl_timer);
+#endif
#else
struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)FunctionContext;
#endif