mirror of
https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
synced 2026-01-19 10:26:35 +00:00
Update to 5.6.1.5
This commit is contained in:
344
os_dep/linux/ioctl_cfg80211.c
Normal file → Executable file
344
os_dep/linux/ioctl_cfg80211.c
Normal file → Executable file
@@ -407,6 +407,23 @@ static void rtw_get_chbw_from_cfg80211_chan_def(struct cfg80211_chan_def *chdef,
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) */
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0))
|
||||
bool rtw_cfg80211_allow_ch_switch_notify(_adapter *adapter)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0))
|
||||
if ((!MLME_IS_AP(adapter))
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
|
||||
&& (!MLME_IS_ADHOC(adapter))
|
||||
&& (!MLME_IS_ADHOC_MASTER(adapter))
|
||||
&& (!MLME_IS_MESH(adapter))
|
||||
#elif defined(CONFIG_RTW_MESH)
|
||||
&& (!MLME_IS_MESH(adapter))
|
||||
#endif
|
||||
)
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 ht)
|
||||
{
|
||||
struct wiphy *wiphy = adapter_to_wiphy(adapter);
|
||||
@@ -415,6 +432,9 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8
|
||||
#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;
|
||||
@@ -425,6 +445,9 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8
|
||||
int freq = rtw_ch2freq(ch);
|
||||
enum nl80211_channel_type ctype;
|
||||
|
||||
if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
|
||||
goto exit;
|
||||
|
||||
if (!freq) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
@@ -537,6 +560,7 @@ static const struct ieee80211_txrx_stypes
|
||||
[NL80211_IFTYPE_STATION] = {
|
||||
.tx = 0xffff,
|
||||
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
|
||||
BIT(IEEE80211_STYPE_AUTH >> 4) |
|
||||
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
|
||||
},
|
||||
[NL80211_IFTYPE_AP] = {
|
||||
@@ -688,11 +712,7 @@ static int rtw_cfg80211_sync_iftype(_adapter *adapter)
|
||||
|
||||
static u64 rtw_get_systime_us(void)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
|
||||
struct timespec ts;
|
||||
getboottime(&ts);
|
||||
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
struct timespec ts;
|
||||
get_monotonic_boottime(&ts);
|
||||
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
|
||||
@@ -3265,6 +3285,7 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
|
||||
{
|
||||
RTW_INFO("%s, nl80211_auth_type=%d\n", __func__, sme_auth_type);
|
||||
|
||||
psecuritypriv->auth_type = sme_auth_type;
|
||||
|
||||
switch (sme_auth_type) {
|
||||
case NL80211_AUTHTYPE_AUTOMATIC:
|
||||
@@ -3292,6 +3313,9 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
|
||||
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||
|
||||
|
||||
break;
|
||||
case NL80211_AUTHTYPE_SAE:
|
||||
psecuritypriv->auth_alg = WLAN_AUTH_SAE;
|
||||
break;
|
||||
default:
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
|
||||
@@ -3760,6 +3784,38 @@ static int _rtw_disconnect(struct wiphy *wiphy, struct net_device *ndev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if (KERNEL_VERSION(4, 17, 0) > LINUX_VERSION_CODE)
|
||||
static bool rtw_check_connect_sae_compat(struct cfg80211_connect_params *sme)
|
||||
{
|
||||
struct rtw_ieee802_11_elems elems;
|
||||
struct rsne_info info;
|
||||
u8 AKM_SUITE_SAE[] = { 0x00, 0x0f, 0xac, 8 };
|
||||
int i;
|
||||
|
||||
if (sme->auth_type != 1)
|
||||
return false;
|
||||
|
||||
if (rtw_ieee802_11_parse_elems((u8 *)sme->ie, sme->ie_len, &elems, 0)
|
||||
== ParseFailed)
|
||||
return false;
|
||||
|
||||
if (!elems.rsn_ie)
|
||||
return false;
|
||||
|
||||
if (rtw_rsne_info_parse(elems.rsn_ie - 2, elems.rsn_ie_len + 2, &info) == _FAIL)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < info.akm_cnt; i++)
|
||||
if (memcmp(info.akm_list + i * RSN_SELECTOR_LEN,
|
||||
AKM_SUITE_SAE, RSN_SELECTOR_LEN) == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
#define rtw_check_connect_sae_compat(sme) false
|
||||
#endif
|
||||
|
||||
static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
|
||||
struct cfg80211_connect_params *sme)
|
||||
{
|
||||
@@ -3782,6 +3838,11 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
|
||||
RTW_INFO("privacy=%d, key=%p, key_len=%d, key_idx=%d, auth_type=%d\n",
|
||||
sme->privacy, sme->key, sme->key_len, sme->key_idx, sme->auth_type);
|
||||
|
||||
if (rtw_check_connect_sae_compat(sme)) {
|
||||
sme->auth_type = NL80211_AUTHTYPE_SAE;
|
||||
RTW_INFO("%s set sme->auth_type=4 for SAE compat\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
if (pwdev_priv->block == _TRUE) {
|
||||
ret = -EBUSY;
|
||||
RTW_INFO("%s wdev_priv.block is set\n", __FUNCTION__);
|
||||
@@ -3852,6 +3913,8 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
|
||||
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_;
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
psecuritypriv->auth_alg = WLAN_AUTH_OPEN;
|
||||
psecuritypriv->extauth_status = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
padapter->wapiInfo.bWapiEnable = false;
|
||||
@@ -4118,36 +4181,20 @@ static int cfg80211_rtw_set_power_mgmt(struct wiphy *wiphy,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy,
|
||||
struct net_device *ndev,
|
||||
struct cfg80211_pmksa *pmksa)
|
||||
static void _rtw_set_pmksa(struct net_device *ndev,
|
||||
u8 *bssid, u8 *pmkid)
|
||||
{
|
||||
u8 index, blInserted = _FALSE;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
|
||||
struct mlme_priv *mlme = &padapter->mlmepriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
u8 strZeroMacAddress[ETH_ALEN] = { 0x00 };
|
||||
|
||||
RTW_INFO(FUNC_NDEV_FMT" "MAC_FMT" "KEY_FMT"\n", FUNC_NDEV_ARG(ndev)
|
||||
, MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid));
|
||||
|
||||
if (_rtw_memcmp((u8 *)pmksa->bssid, strZeroMacAddress, ETH_ALEN) == _TRUE)
|
||||
return -EINVAL;
|
||||
|
||||
if (check_fwstate(mlme, _FW_LINKED) == _FALSE) {
|
||||
RTW_INFO(FUNC_NDEV_FMT" not set pmksa cause not in linked state\n", FUNC_NDEV_ARG(ndev));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
blInserted = _FALSE;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
u8 index, blInserted = _FALSE;
|
||||
|
||||
/* overwrite PMKID */
|
||||
for (index = 0 ; index < NUM_PMKID_CACHE; index++) {
|
||||
if (_rtw_memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) == _TRUE) {
|
||||
if (_rtw_memcmp(psecuritypriv->PMKIDList[index].Bssid, bssid, ETH_ALEN) == _TRUE) {
|
||||
/* BSSID is matched, the same AP => rewrite with new PMKID. */
|
||||
RTW_INFO(FUNC_NDEV_FMT" BSSID exists in the PMKList.\n", FUNC_NDEV_ARG(ndev));
|
||||
RTW_INFO("BSSID("MAC_FMT") exists in the PMKList.\n", MAC_ARG(bssid));
|
||||
|
||||
_rtw_memcpy(psecuritypriv->PMKIDList[index].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN);
|
||||
_rtw_memcpy(psecuritypriv->PMKIDList[index].PMKID, pmkid, WLAN_PMKID_LEN);
|
||||
psecuritypriv->PMKIDList[index].bUsed = _TRUE;
|
||||
psecuritypriv->PMKIDIndex = index + 1;
|
||||
blInserted = _TRUE;
|
||||
@@ -4157,17 +4204,48 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy,
|
||||
|
||||
if (!blInserted) {
|
||||
/* Find a new entry */
|
||||
RTW_INFO(FUNC_NDEV_FMT" Use the new entry index = %d for this PMKID.\n",
|
||||
FUNC_NDEV_ARG(ndev), psecuritypriv->PMKIDIndex);
|
||||
RTW_INFO("Use the new entry index = %d for this PMKID.\n",
|
||||
psecuritypriv->PMKIDIndex);
|
||||
|
||||
_rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, (u8 *)pmksa->bssid, ETH_ALEN);
|
||||
_rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN);
|
||||
_rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, bssid, ETH_ALEN);
|
||||
_rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pmkid, WLAN_PMKID_LEN);
|
||||
|
||||
psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed = _TRUE;
|
||||
psecuritypriv->PMKIDIndex++ ;
|
||||
if (psecuritypriv->PMKIDIndex == 16)
|
||||
psecuritypriv->PMKIDIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy,
|
||||
struct net_device *ndev,
|
||||
struct cfg80211_pmksa *pmksa)
|
||||
{
|
||||
u8 index, blInserted = _FALSE;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
|
||||
struct mlme_priv *mlme = &padapter->mlmepriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
u8 strZeroMacAddress[ETH_ALEN] = { 0x00 };
|
||||
bool sae_auth = rtw_sec_chk_auth_type(padapter, NL80211_AUTHTYPE_SAE);
|
||||
|
||||
RTW_INFO(FUNC_NDEV_FMT" "MAC_FMT" "KEY_FMT"\n", FUNC_NDEV_ARG(ndev)
|
||||
, MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid));
|
||||
|
||||
if (_rtw_memcmp((u8 *)pmksa->bssid, strZeroMacAddress, ETH_ALEN) == _TRUE)
|
||||
return -EINVAL;
|
||||
|
||||
if (check_fwstate(mlme, _FW_LINKED) == _FALSE && !sae_auth) {
|
||||
RTW_INFO(FUNC_NDEV_FMT" not set pmksa cause not in linked state\n", FUNC_NDEV_ARG(ndev));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
_rtw_set_pmksa(ndev, (u8 *)pmksa->bssid, (u8 *)pmksa->pmkid);
|
||||
|
||||
if (sae_auth &&
|
||||
(psecuritypriv->extauth_status == WLAN_STATUS_SUCCESS)) {
|
||||
RTW_PRINT("SAE: auth success, start assoc\n");
|
||||
start_clnt_assoc(padapter);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -4923,6 +5001,14 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev,
|
||||
ret = -ENOTSUPP;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
Kernel < v5.1, the auth_type set as NL80211_AUTHTYPE_AUTOMATIC.
|
||||
if the AKM SAE in the RSN IE, we have to update the auth_type for SAE
|
||||
in rtw_check_beacon_data().
|
||||
*/
|
||||
rtw_cfg80211_set_auth_type(&adapter->securitypriv, settings->auth_type);
|
||||
|
||||
rtw_mi_scan_abort(adapter, _TRUE);
|
||||
rtw_mi_buddy_set_scan_deny(adapter, 300);
|
||||
ret = rtw_add_beacon(adapter, settings->beacon.head, settings->beacon.head_len,
|
||||
@@ -6172,10 +6258,7 @@ void rtw_cfg80211_rx_mframe(_adapter *adapter, union recv_frame *rframe, const c
|
||||
#endif
|
||||
|
||||
RTW_INFO("RTW_Rx:ch=%d(%d), ta="MAC_FMT"\n", ch, sch, MAC_ARG(get_addr2_ptr(frame)));
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
if (!rtw_sae_check_frames(adapter, frame, frame_len, _FALSE))
|
||||
#endif
|
||||
{
|
||||
if (!rtw_sae_preprocess(adapter, frame, frame_len, _FALSE)) {
|
||||
if (msg)
|
||||
RTW_INFO("RTW_Rx:%s\n", msg);
|
||||
else
|
||||
@@ -6447,6 +6530,54 @@ static s32 cfg80211_rtw_update_ft_ies(struct wiphy *wiphy,
|
||||
}
|
||||
#endif
|
||||
|
||||
void rtw_cfg80211_external_auth_request(_adapter *padapter, union recv_frame *rframe)
|
||||
{
|
||||
struct rtw_external_auth_params params;
|
||||
struct wireless_dev *wdev = padapter->rtw_wdev;
|
||||
struct net_device *netdev = wdev_to_ndev(wdev);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
u8 frame[256] = { 0 };
|
||||
uint frame_len = 24;
|
||||
s32 freq = 0;
|
||||
|
||||
/* rframe, in this case is null point */
|
||||
|
||||
freq = rtw_ch2freq(pmlmeext->cur_channel);
|
||||
|
||||
#ifdef CONFIG_DEBUG_CFG80211
|
||||
RTW_INFO(FUNC_ADPT_FMT": freq(%d, %d)\n", FUNC_ADPT_ARG(padapter), freq);
|
||||
#endif
|
||||
|
||||
#if (KERNEL_VERSION(4, 17, 0) <= LINUX_VERSION_CODE)
|
||||
params.action = EXTERNAL_AUTH_START;
|
||||
_rtw_memcpy(params.bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN);
|
||||
params.ssid.ssid_len = pmlmeinfo->network.Ssid.SsidLength;
|
||||
_rtw_memcpy(params.ssid.ssid, pmlmeinfo->network.Ssid.Ssid,
|
||||
pmlmeinfo->network.Ssid.SsidLength);
|
||||
params.key_mgmt_suite = 0x8ac0f00;
|
||||
|
||||
cfg80211_external_auth_request(netdev,
|
||||
(struct cfg80211_external_auth_params *)¶ms, GFP_ATOMIC);
|
||||
#elif (KERNEL_VERSION(2, 6, 37) <= LINUX_VERSION_CODE)
|
||||
set_frame_sub_type(frame, WIFI_AUTH);
|
||||
|
||||
_rtw_memcpy(frame + 4, get_my_bssid(&pmlmeinfo->network), ETH_ALEN);
|
||||
_rtw_memcpy(frame + 10, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
_rtw_memcpy(frame + 16, get_my_bssid(&pmlmeinfo->network), ETH_ALEN);
|
||||
RTW_PUT_LE32((frame + 18), 0x8ac0f00);
|
||||
|
||||
if (pmlmeinfo->network.Ssid.SsidLength) {
|
||||
*(frame + 23) = pmlmeinfo->network.Ssid.SsidLength;
|
||||
_rtw_memcpy(frame + 24, pmlmeinfo->network.Ssid.Ssid,
|
||||
pmlmeinfo->network.Ssid.SsidLength);
|
||||
frame_len = 24 + pmlmeinfo->network.Ssid.SsidLength;
|
||||
}
|
||||
rtw_cfg80211_rx_mgmt(wdev, freq, 0, frame, frame_len, GFP_ATOMIC);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void rtw_cfg80211_set_is_roch(_adapter *adapter, bool val)
|
||||
{
|
||||
adapter->cfg80211_wdinfo.is_ro_ch = val;
|
||||
@@ -7193,15 +7324,19 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
|
||||
wait_ack = 0;
|
||||
goto dump;
|
||||
}
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
else if (frame_styp == RTW_IEEE80211_STYPE_AUTH) {
|
||||
int retval = 0;
|
||||
|
||||
RTW_INFO("RTW_Tx:tx_ch=%d, no_cck=%u, da="MAC_FMT"\n", tx_ch, no_cck, MAC_ARG(GetAddr1Ptr(buf)));
|
||||
if (!rtw_sae_check_frames(padapter, buf, len, _TRUE))
|
||||
|
||||
retval = rtw_sae_preprocess(padapter, buf, len, _TRUE);
|
||||
if (retval == 2)
|
||||
goto exit;
|
||||
if (retval == 0)
|
||||
RTW_INFO("RTW_Tx:AUTH\n");
|
||||
dump_limit = 1;
|
||||
goto dump;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rtw_action_frame_parse(buf, len, &category, &action) == _FALSE) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" frame_control:0x%02x\n", FUNC_ADPT_ARG(padapter),
|
||||
@@ -7347,16 +7482,27 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
||||
frame_type, reg);
|
||||
#endif
|
||||
|
||||
/* Wait QC Verify */
|
||||
return;
|
||||
|
||||
switch (frame_type) {
|
||||
case IEEE80211_STYPE_AUTH: /* 0x00B0 */
|
||||
if (reg > 0)
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH, reg);
|
||||
else
|
||||
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH, reg);
|
||||
break;
|
||||
#ifdef not_yet
|
||||
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
|
||||
if (reg > 0)
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
|
||||
else
|
||||
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
|
||||
break;
|
||||
case IEEE80211_STYPE_ACTION: /* 0x00D0 */
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION, reg);
|
||||
if (reg > 0)
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION, reg);
|
||||
else
|
||||
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION, reg);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -8594,8 +8740,13 @@ exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
|
||||
static int cfg80211_rtw_sched_scan_stop(struct wiphy *wiphy,
|
||||
struct net_device *dev, u64 reqid)
|
||||
#else
|
||||
static int cfg80211_rtw_sched_scan_stop(struct wiphy *wiphy,
|
||||
struct net_device *dev)
|
||||
#endif
|
||||
{
|
||||
return rtw_android_pno_enable(dev, _FALSE);
|
||||
}
|
||||
@@ -8611,11 +8762,12 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) {
|
||||
_adapter *padapter;
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
struct mlme_priv *pmlmepriv;
|
||||
struct sitesurvey_parm parm;
|
||||
int i, len;
|
||||
|
||||
padapter = wiphy_to_adapter(wiphy);
|
||||
pwrpriv = adapter_to_pwrctl(padapter);
|
||||
pmlmepriv = &padapter->mlmepriv;
|
||||
struct sitesurvey_parm parm;
|
||||
int i, len;
|
||||
|
||||
|
||||
RTW_DBG("==> %s\n",__func__);
|
||||
@@ -8648,7 +8800,12 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) {
|
||||
}
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
|
||||
cfg80211_sched_scan_results(padapter->rtw_wdev->wiphy, 0);
|
||||
#else
|
||||
cfg80211_sched_scan_results(padapter->rtw_wdev->wiphy);
|
||||
#endif
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
}
|
||||
@@ -9378,6 +9535,10 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *adapter, struct wiphy *wiphy)
|
||||
;
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)) */
|
||||
#endif /* CONFIG_RTW_MESH */
|
||||
|
||||
#if (KERNEL_VERSION(3, 8, 0) <= LINUX_VERSION_CODE)
|
||||
wiphy->features |= NL80211_FEATURE_SAE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RFKILL_POLL
|
||||
@@ -9551,6 +9712,94 @@ int rtw_hostapd_acs_dump_survey(struct wiphy *wiphy, struct net_device *netdev,
|
||||
}
|
||||
#endif /* defined(CONFIG_RTW_HOSTAPD_ACS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)) */
|
||||
|
||||
#if (KERNEL_VERSION(4, 17, 0) <= LINUX_VERSION_CODE)
|
||||
int cfg80211_rtw_external_auth(struct wiphy *wiphy, struct net_device *dev,
|
||||
struct cfg80211_external_auth_params *params)
|
||||
{
|
||||
PADAPTER padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
|
||||
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(dev));
|
||||
|
||||
rtw_cfg80211_external_auth_status(wiphy, dev,
|
||||
(struct rtw_external_auth_params *)params);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void rtw_cfg80211_external_auth_status(struct wiphy *wiphy, struct net_device *dev,
|
||||
struct rtw_external_auth_params *params)
|
||||
{
|
||||
PADAPTER padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta = NULL;
|
||||
u8 *buf = NULL;
|
||||
u32 len = 0;
|
||||
_irqL irqL;
|
||||
|
||||
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(dev));
|
||||
|
||||
RTW_INFO("SAE: action: %u, status: %u\n", params->action, params->status);
|
||||
if (params->status == WLAN_STATUS_SUCCESS) {
|
||||
RTW_INFO("bssid: "MAC_FMT"\n", MAC_ARG(params->bssid));
|
||||
RTW_INFO("SSID: [%s]\n",
|
||||
((params->ssid.ssid_len == 0) ? "" : (char *)params->ssid.ssid));
|
||||
RTW_INFO("suite: 0x%08x\n", params->key_mgmt_suite);
|
||||
}
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, params->bssid);
|
||||
if (psta && (params->status == WLAN_STATUS_SUCCESS)) {
|
||||
/* AP mode */
|
||||
RTW_INFO("station match\n");
|
||||
|
||||
psta->state &= ~WIFI_FW_AUTH_NULL;
|
||||
psta->state |= WIFI_FW_AUTH_SUCCESS;
|
||||
psta->expire_to = padapter->stapriv.assoc_to;
|
||||
|
||||
if (params->pmkid != NULL) {
|
||||
/* RTW_INFO_DUMP("PMKID:", params->pmkid, PMKID_LEN); */
|
||||
_rtw_set_pmksa(dev, params->bssid, params->pmkid);
|
||||
}
|
||||
|
||||
_enter_critical_bh(&psta->lock, &irqL);
|
||||
if ((psta->auth_len != 0) && (psta->pauth_frame != NULL)) {
|
||||
buf = rtw_zmalloc(psta->auth_len);
|
||||
if (buf) {
|
||||
_rtw_memcpy(buf, psta->pauth_frame, psta->auth_len);
|
||||
len = psta->auth_len;
|
||||
}
|
||||
|
||||
rtw_mfree(psta->pauth_frame, psta->auth_len);
|
||||
psta->pauth_frame = NULL;
|
||||
psta->auth_len = 0;
|
||||
}
|
||||
_exit_critical_bh(&psta->lock, &irqL);
|
||||
|
||||
if (buf) {
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
/* send the SAE auth Confirm */
|
||||
|
||||
rtw_ps_deny(padapter, PS_DENY_MGNT_TX);
|
||||
if (_SUCCESS == rtw_pwr_wakeup(padapter)) {
|
||||
rtw_mi_set_scan_deny(padapter, 1000);
|
||||
rtw_mi_scan_abort(padapter, _TRUE);
|
||||
|
||||
RTW_INFO("SAE: Tx auth Confirm\n");
|
||||
rtw_mgnt_tx_cmd(padapter, pmlmeext->cur_channel, 1, buf, len, 0, RTW_CMDF_DIRECTLY);
|
||||
|
||||
rtw_mfree(buf, len);
|
||||
buf = NULL;
|
||||
len = 0;
|
||||
}
|
||||
rtw_ps_deny_cancel(padapter, PS_DENY_MGNT_TX);
|
||||
}
|
||||
} else {
|
||||
/* STA mode */
|
||||
psecuritypriv->extauth_status = params->status;
|
||||
}
|
||||
}
|
||||
|
||||
static struct cfg80211_ops rtw_cfg80211_ops = {
|
||||
.change_virtual_intf = cfg80211_rtw_change_iface,
|
||||
.add_key = cfg80211_rtw_add_key,
|
||||
@@ -9667,6 +9916,9 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
|
||||
#if defined(CONFIG_RTW_HOSTAPD_ACS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33))
|
||||
.dump_survey = rtw_hostapd_acs_dump_survey,
|
||||
#endif
|
||||
#if (KERNEL_VERSION(4, 17, 0) <= LINUX_VERSION_CODE)
|
||||
.external_auth = cfg80211_rtw_external_auth,
|
||||
#endif
|
||||
};
|
||||
|
||||
struct wiphy *rtw_wiphy_alloc(_adapter *padapter, struct device *dev)
|
||||
|
||||
@@ -193,6 +193,20 @@ struct rtw_wdev_priv {
|
||||
|
||||
};
|
||||
|
||||
enum external_auth_action {
|
||||
EXTERNAL_AUTH_START,
|
||||
EXTERNAL_AUTH_ABORT,
|
||||
};
|
||||
|
||||
struct rtw_external_auth_params {
|
||||
enum external_auth_action action;
|
||||
u8 bssid[ETH_ALEN]__aligned(2);
|
||||
struct cfg80211_ssid ssid;
|
||||
unsigned int key_mgmt_suite;
|
||||
u16 status;
|
||||
u8 pmkid[PMKID_LEN];
|
||||
};
|
||||
|
||||
bool rtw_cfg80211_is_connect_requested(_adapter *adapter);
|
||||
|
||||
#if RTW_CFG80211_BLOCK_STA_DISCON_EVENT
|
||||
@@ -246,7 +260,8 @@ struct rtw_wiphy_data {
|
||||
#define FUNC_WIPHY_FMT "%s("WIPHY_FMT")"
|
||||
#define FUNC_WIPHY_ARG(wiphy) __func__, WIPHY_ARG(wiphy)
|
||||
|
||||
#define SET_CFG80211_REPORT_MGMT(w, t, v) (w->report_mgmt |= (v ? BIT(t >> 4) : 0))
|
||||
#define SET_CFG80211_REPORT_MGMT(w, t, v) (w->report_mgmt |= BIT(t >> 4))
|
||||
#define CLR_CFG80211_REPORT_MGMT(w, t, v) (w->report_mgmt &= (~BIT(t >> 4)))
|
||||
#define GET_CFG80211_REPORT_MGMT(w, t) ((w->report_mgmt & BIT(t >> 4)) > 0)
|
||||
|
||||
struct wiphy *rtw_wiphy_alloc(_adapter *padapter, struct device *dev);
|
||||
@@ -320,6 +335,10 @@ void rtw_cfg80211_rx_action(_adapter *adapter, union recv_frame *rframe, const c
|
||||
void rtw_cfg80211_rx_mframe(_adapter *adapter, union recv_frame *rframe, const char *msg);
|
||||
void rtw_cfg80211_rx_probe_request(_adapter *padapter, union recv_frame *rframe);
|
||||
|
||||
void rtw_cfg80211_external_auth_request(_adapter *padapter, union recv_frame *rframe);
|
||||
void rtw_cfg80211_external_auth_status(struct wiphy *wiphy, struct net_device *dev,
|
||||
struct rtw_external_auth_params *params);
|
||||
|
||||
int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, int type);
|
||||
|
||||
bool rtw_cfg80211_pwr_mgmt(_adapter *adapter);
|
||||
|
||||
@@ -124,6 +124,8 @@ void rtw_reset_securitypriv(_adapter *adapter)
|
||||
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
|
||||
adapter->securitypriv.extauth_status = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
|
||||
} else { /* reset values in securitypriv */
|
||||
/* if(adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
|
||||
/* { */
|
||||
@@ -139,6 +141,8 @@ void rtw_reset_securitypriv(_adapter *adapter)
|
||||
psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
/* } */
|
||||
|
||||
psec_priv->extauth_status = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
}
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
_exit_critical_bh(&adapter->security_key_mutex, &irqL);
|
||||
|
||||
@@ -1338,15 +1338,9 @@ unsigned int rtw_classify8021d(struct sk_buff *skb)
|
||||
|
||||
static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)
|
||||
, struct net_device *sb_dev
|
||||
#else
|
||||
, void *accel_priv
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
|
||||
, select_queue_fallback_t fallback
|
||||
#endif
|
||||
, select_queue_fallback_t fallback
|
||||
#endif
|
||||
#endif
|
||||
)
|
||||
@@ -4757,6 +4751,11 @@ int rtw_resume_process_wow(_adapter *padapter)
|
||||
if (pwrpriv->wowlan_pno_enable)
|
||||
rtw_set_fw_in_ips_mode(padapter, _FALSE);
|
||||
#endif /* CONFIG_FWLPS_IN_IPS */
|
||||
#if defined(CONFIG_LPS_LCLK) && defined(RTW_HALMAC)
|
||||
if (pwrpriv->wowlan_pno_enable)
|
||||
rtw_set_fw_config_32k(padapter, _FALSE);
|
||||
|
||||
#endif
|
||||
#endif/* CONFIG_PNO_SUPPORT */
|
||||
|
||||
if (pwrpriv->wowlan_mode == _TRUE) {
|
||||
|
||||
@@ -95,6 +95,7 @@ const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = {
|
||||
/* Private command for P2P disable*/
|
||||
"P2P_DISABLE",
|
||||
"SET_AEK",
|
||||
"EXT_AUTH_STATUS",
|
||||
"DRIVER_VERSION"
|
||||
};
|
||||
|
||||
@@ -663,11 +664,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
|
||||
if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)) {
|
||||
#else
|
||||
if (!access_ok(priv_cmd.buf, priv_cmd.total_len)) {
|
||||
#endif
|
||||
RTW_INFO("%s: failed to access memory\n", __FUNCTION__);
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
@@ -936,6 +933,12 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ANDROID_WIFI_CMD_EXT_AUTH_STATUS: {
|
||||
rtw_set_external_auth_status(padapter,
|
||||
command + strlen("EXT_AUTH_STATUS "),
|
||||
priv_cmd.total_len - strlen("EXT_AUTH_STATUS "));
|
||||
break;
|
||||
}
|
||||
case ANDROID_WIFI_CMD_DRIVERVERSION: {
|
||||
bytes_written = strlen(DRIVERVERSION);
|
||||
snprintf(command, bytes_written + 1, DRIVERVERSION);
|
||||
|
||||
@@ -1748,9 +1748,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = GSCAN_SUBCMD_GET_CAPABILITIES
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_gscan_get_capabilities
|
||||
},
|
||||
{
|
||||
@@ -1759,9 +1756,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = GSCAN_SUBCMD_SET_CONFIG
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_set_scan_cfg
|
||||
},
|
||||
{
|
||||
@@ -1770,9 +1764,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = GSCAN_SUBCMD_SET_SCAN_CONFIG
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_set_batch_scan_cfg
|
||||
},
|
||||
{
|
||||
@@ -1781,9 +1772,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = GSCAN_SUBCMD_ENABLE_GSCAN
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_initiate_gscan
|
||||
},
|
||||
{
|
||||
@@ -1792,9 +1780,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_enable_full_scan_result
|
||||
},
|
||||
{
|
||||
@@ -1803,9 +1788,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = GSCAN_SUBCMD_SET_HOTLIST
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_hotlist_cfg
|
||||
},
|
||||
{
|
||||
@@ -1814,9 +1796,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_significant_change_cfg
|
||||
},
|
||||
{
|
||||
@@ -1825,9 +1804,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = GSCAN_SUBCMD_GET_SCAN_RESULTS
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_gscan_get_batch_results
|
||||
},
|
||||
{
|
||||
@@ -1836,9 +1812,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = GSCAN_SUBCMD_GET_CHANNEL_LIST
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_gscan_get_channel_list
|
||||
},
|
||||
#endif /* GSCAN_SUPPORT */
|
||||
@@ -1849,9 +1822,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = RTT_SUBCMD_SET_CONFIG
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_rtt_set_config
|
||||
},
|
||||
{
|
||||
@@ -1860,9 +1830,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = RTT_SUBCMD_CANCEL_CONFIG
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_rtt_cancel_config
|
||||
},
|
||||
{
|
||||
@@ -1871,9 +1838,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = RTT_SUBCMD_GETCAPABILITY
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_rtt_get_capability
|
||||
},
|
||||
#endif /* RTT_SUPPORT */
|
||||
@@ -1884,9 +1848,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LSTATS_SUBCMD_GET_INFO
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_lstats_get_info
|
||||
},
|
||||
{
|
||||
@@ -1895,9 +1856,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LSTATS_SUBCMD_SET_INFO
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_lstats_set_info
|
||||
},
|
||||
{
|
||||
@@ -1906,9 +1864,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LSTATS_SUBCMD_CLEAR_INFO
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_lstats_clear_info
|
||||
},
|
||||
#endif /* CONFIG_RTW_CFGVEDNOR_LLSTATS */
|
||||
@@ -1919,9 +1874,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = WIFI_SUBCMD_SET_RSSI_MONITOR
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_set_rssi_monitor
|
||||
},
|
||||
#endif /* CONFIG_RTW_CFGVEDNOR_RSSIMONITOR */
|
||||
@@ -1932,9 +1884,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LOGGER_START_LOGGING
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_logger_start_logging
|
||||
},
|
||||
{
|
||||
@@ -1943,9 +1892,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LOGGER_GET_FEATURE
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_logger_get_feature
|
||||
},
|
||||
{
|
||||
@@ -1954,9 +1900,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LOGGER_GET_VER
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_logger_get_version
|
||||
},
|
||||
{
|
||||
@@ -1965,9 +1908,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LOGGER_GET_RING_STATUS
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_logger_get_ring_status
|
||||
},
|
||||
{
|
||||
@@ -1976,9 +1916,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LOGGER_GET_RING_DATA
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_logger_get_ring_data
|
||||
},
|
||||
{
|
||||
@@ -1987,9 +1924,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LOGGER_TRIGGER_MEM_DUMP
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_logger_get_firmware_memory_dump
|
||||
},
|
||||
{
|
||||
@@ -1998,9 +1932,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LOGGER_START_PKT_FATE_MONITORING
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_logger_start_pkt_fate_monitoring
|
||||
},
|
||||
{
|
||||
@@ -2009,9 +1940,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LOGGER_GET_TX_PKT_FATES
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_logger_get_tx_pkt_fates
|
||||
},
|
||||
{
|
||||
@@ -2020,9 +1948,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = LOGGER_GET_RX_PKT_FATES
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_logger_get_rx_pkt_fates
|
||||
},
|
||||
#endif /* CONFIG_RTW_CFGVENDOR_WIFI_LOGGER */
|
||||
@@ -2034,9 +1959,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = WIFI_SUBCMD_SET_PNO_RANDOM_MAC_OUI
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_set_rand_mac_oui
|
||||
},
|
||||
#endif
|
||||
@@ -2046,9 +1968,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = WIFI_SUBCMD_NODFS_SET
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_set_nodfs_flag
|
||||
|
||||
},
|
||||
@@ -2058,9 +1977,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = WIFI_SUBCMD_SET_COUNTRY_CODE
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_set_country
|
||||
},
|
||||
{
|
||||
@@ -2069,9 +1985,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = WIFI_SUBCMD_CONFIG_ND_OFFLOAD
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_set_nd_offload
|
||||
},
|
||||
#endif /* CONFIG_RTW_WIFI_HAL */
|
||||
@@ -2081,9 +1994,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = WIFI_SUBCMD_GET_FEATURE_SET
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_get_feature_set
|
||||
},
|
||||
{
|
||||
@@ -2092,9 +2002,6 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
|
||||
.subcmd = WIFI_SUBCMD_GET_FEATURE_SET_MATRIX
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
.doit = rtw_cfgvendor_get_feature_set_matrix
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3724,6 +3724,17 @@ exit:
|
||||
}
|
||||
#endif /* CONFIG_RTW_TPT_MODE */
|
||||
|
||||
int proc_get_cur_beacon_keys(struct seq_file *m, void *v)
|
||||
{
|
||||
struct net_device *dev = m->private;
|
||||
_adapter *adapter = rtw_netdev_priv(dev);
|
||||
struct mlme_priv *mlme = &adapter->mlmepriv;
|
||||
|
||||
rtw_dump_bcn_keys(m, &mlme->cur_beacon_keys);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* rtw_adapter_proc:
|
||||
* init/deinit when register/unregister net_device
|
||||
@@ -4089,6 +4100,7 @@ const struct rtw_proc_hdl adapter_proc_hdls[] = {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
RTW_PROC_HDL_SSEQ("cur_beacon_keys", proc_get_cur_beacon_keys, NULL),
|
||||
};
|
||||
|
||||
const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(struct rtw_proc_hdl);
|
||||
|
||||
@@ -242,11 +242,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB812, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Default ID for USB Single-function, WiFi only */
|
||||
/*=== Customer ID ===*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x0043, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Alpha - Alpha*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0115, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T4U V3 */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xB822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax EW-7822ULC */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xC822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax EW-7822UTC */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x1841, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS AC1300 USB-AC55 B1 */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x184C, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS U2*/
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331c, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Dlink - DWA-182*/
|
||||
#endif /* CONFIG_RTL8822B */
|
||||
|
||||
#ifdef CONFIG_RTL8723D
|
||||
|
||||
@@ -2201,11 +2201,7 @@ static int isFileReadable(const char *path, u32 *sz)
|
||||
ret = PTR_ERR(fp);
|
||||
else {
|
||||
oldfs = get_fs();
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
|
||||
set_fs(KERNEL_DS);
|
||||
#else
|
||||
set_fs(get_ds());
|
||||
#endif
|
||||
set_fs(get_ds());
|
||||
|
||||
if (1 != readFile(fp, &buf, 1))
|
||||
ret = PTR_ERR(fp);
|
||||
@@ -2243,11 +2239,7 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
||||
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
|
||||
|
||||
oldfs = get_fs();
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
|
||||
set_fs(KERNEL_DS);
|
||||
#else
|
||||
set_fs(get_ds());
|
||||
#endif
|
||||
set_fs(get_ds());
|
||||
ret = readFile(fp, buf, sz);
|
||||
set_fs(oldfs);
|
||||
closeFile(fp);
|
||||
@@ -2282,11 +2274,7 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
|
||||
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
|
||||
|
||||
oldfs = get_fs();
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
|
||||
set_fs(KERNEL_DS);
|
||||
#else
|
||||
set_fs(get_ds());
|
||||
#endif
|
||||
set_fs(get_ds());
|
||||
ret = writeFile(fp, buf, sz);
|
||||
set_fs(oldfs);
|
||||
closeFile(fp);
|
||||
|
||||
Reference in New Issue
Block a user