Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rtw_cfg80211_ch_switch_notify error #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion core/rtw_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ void start_bss_network(_adapter *padapter, struct createbss_parm *parm)
, pdvobj->padapters[i]->mlmeextpriv.cur_channel
, pdvobj->padapters[i]->mlmeextpriv.cur_bwmode
, pdvobj->padapters[i]->mlmeextpriv.cur_ch_offset
, ht_option);
, ht_option, 0);
}
}
#endif /* defined(CONFIG_IOCTL_CFG80211) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) */
Expand Down
4 changes: 2 additions & 2 deletions core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -16128,7 +16128,7 @@ void rtw_join_done_chk_ch(_adapter *adapter, int join_res)

rtw_cfg80211_ch_switch_notify(iface
, mlmeext->cur_channel, mlmeext->cur_bwmode, mlmeext->cur_ch_offset
, ht_option);
, ht_option, 0);
#endif
}
}
Expand Down Expand Up @@ -16346,7 +16346,7 @@ int rtw_chk_start_clnt_join(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset)
the bss freq is updated by channel switch event.
*/
rtw_cfg80211_ch_switch_notify(adapter,
cur_ch, cur_bw, cur_ch_offset, ht_option);
cur_ch, cur_bw, cur_ch_offset, ht_option, 1);
}
#endif
}
Expand Down
25 changes: 20 additions & 5 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,21 +424,36 @@ bool rtw_cfg80211_allow_ch_switch_notify(_adapter *adapter)
return 1;
}

u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 ht)
u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 ht, bool started)
{
struct wiphy *wiphy = adapter_to_wiphy(adapter);
u8 ret = _SUCCESS;

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
struct cfg80211_chan_def chdef = {};

if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
goto exit;

ret = rtw_chbw_to_cfg80211_chan_def(wiphy, &chdef, ch, bw, offset, ht);
if (ret != _SUCCESS)
goto exit;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,3, 0))

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
if (started) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, false);
#else
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0);
#endif
goto exit;
}
#endif

if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
goto exit;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
Expand Down
2 changes: 1 addition & 1 deletion os_dep/linux/ioctl_cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ void rtw_cfg80211_deinit_rfkill(struct wiphy *wiphy);
#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0))
u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 ht);
u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 ht, bool started);
#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))
Expand Down
Loading