Adapt `rtw_cfg80211_indicate_connect()` to Linux kernel [29ce6ecbb83c9185d76e3a7c340c9702d2a54961].

The function `cfg80211_roamed()` and `cfg80211_roamed_bss()` were unified.
See: 29ce6ecbb8 (diff-6788d961d43074bcd7966d231861f6b8)
master
Fomalhaut Weisszwerg 2017-11-05 01:27:20 +09:00
parent b281b12ffc
commit 1cdec984ea
1 changed files with 21 additions and 2 deletions

View File

@ -733,6 +733,10 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) {
}
check_bss:
/* The function `cfg80211_roamed()` and `cfg80211_roamed_bss()` were unified by commit [29ce6ec].
* See https://github.com/torvalds/linux/commit/29ce6ecbb83c9185d76e3a7c340c9702d2a54961#diff-6788d961d43074bcd7966d231861f6b8
*/
if (!rtw_cfg80211_check_bss(padapter))
RTW_PRINT(FUNC_ADPT_FMT" BSS not found !!\n", FUNC_ADPT_ARG(padapter));
@ -747,17 +751,32 @@ check_bss:
notify_channel = ieee80211_get_channel(wiphy, freq);
#endif
#if KERNEL_VERSION(4, 12, 0) <= LINUX_VERSION_CODE
struct cfg80211_roam_info roam_info;
memset(&roam_info, 0, sizeof(struct cfg80211_roam_info));
roam_info.channel = notify_channel;
roam_info.bssid = cur_network->network.MacAddress;
roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
roam_info.resp_ie_len = pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6;
#endif
RTW_INFO(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
cfg80211_roamed(padapter->pnetdev
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE)
#if (KERNEL_VERSION(2, 6, 39) < LINUX_VERSION_CODE && LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)) || defined(COMPAT_KERNEL_RELEASE)
, notify_channel
#endif
#elif KERNEL_VERSION(4, 12, 0) <= LINUX_VERSION_CODE
, &roam_info
, GFP_ATOMIC);
#else
, cur_network->network.MacAddress
, pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2
, pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2
, pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6
, pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6
, GFP_ATOMIC);
#endif
} else {
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) || defined(COMPAT_KERNEL_RELEASE)
RTW_INFO("pwdev->sme_state(b)=%d\n", pwdev->sme_state);