mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 21:15:53 +02:00
staging: rtl8723bs: move rtw_reset_securitypriv to core/rtw_mlme.c
Move the function rtw_reset_securitypriv from os_dep/mlme_linux.c to core/rtw_mlme.c to reduce code in the os_dep directory. The file os_dep/mlme_linux.c is finally empty now and we can remove it. Signed-off-by: Michael Straube <straube.linux@gmail.com> Tested-by: Hans de Goede <hansg@kernel.org> Reviewed-by: Hans de Goede <hansg@kernel.org> Link: https://lore.kernel.org/r/20250801083131.82915-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
522440e417
commit
c158e7c293
|
|
@ -48,7 +48,6 @@ r8723bs-y = \
|
|||
hal/HalHWImg8723B_RF.o \
|
||||
hal/HalPhyRf_8723B.o \
|
||||
os_dep/ioctl_cfg80211.o \
|
||||
os_dep/mlme_linux.o \
|
||||
os_dep/osdep_service.o \
|
||||
os_dep/os_intfs.o \
|
||||
os_dep/recv_linux.o \
|
||||
|
|
|
|||
|
|
@ -1118,6 +1118,66 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
|
|||
rtw_update_ht_cap(padapter, cur_network->network.ies, cur_network->network.ie_length, (u8) cur_network->network.configuration.ds_config);
|
||||
}
|
||||
|
||||
static struct rt_pmkid_list backupPMKIDList[NUM_PMKID_CACHE];
|
||||
void rtw_reset_securitypriv(struct adapter *adapter)
|
||||
{
|
||||
u8 backupPMKIDIndex = 0;
|
||||
u8 backupTKIPCountermeasure = 0x00;
|
||||
u32 backupTKIPcountermeasure_time = 0;
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
|
||||
spin_lock_bh(&adapter->security_key_mutex);
|
||||
|
||||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
||||
/* 802.1x */
|
||||
/* Added by Albert 2009/02/18 */
|
||||
/* We have to backup the PMK information for WiFi PMK Caching test item. */
|
||||
/* */
|
||||
/* Backup the btkip_countermeasure information. */
|
||||
/* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
|
||||
|
||||
memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
|
||||
backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
|
||||
backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
|
||||
|
||||
/* reset RX BIP packet number */
|
||||
pmlmeext->mgnt_80211w_IPN_rx = 0;
|
||||
|
||||
memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
|
||||
|
||||
/* Added by Albert 2009/02/18 */
|
||||
/* Restore the PMK information to securitypriv structure for the following connection. */
|
||||
memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
adapter->securitypriv.PMKIDIndex = backupPMKIDIndex;
|
||||
adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure;
|
||||
adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
|
||||
|
||||
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
|
||||
} else {
|
||||
/* reset values in securitypriv */
|
||||
/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
|
||||
/* */
|
||||
struct security_priv *psec_priv = &adapter->securitypriv;
|
||||
|
||||
psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psec_priv->dot11PrivacyKeyIndex = 0;
|
||||
|
||||
psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_;
|
||||
psec_priv->dot118021XGrpKeyid = 1;
|
||||
|
||||
psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
/* */
|
||||
}
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
spin_unlock_bh(&adapter->security_key_mutex);
|
||||
}
|
||||
|
||||
/* Notes: the function could be > passive_level (the same context as Rx tasklet) */
|
||||
/* pnetwork : returns from rtw_joinbss_event_callback */
|
||||
/* ptarget_wlan: found from scanned_queue */
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@
|
|||
#include <rtw_qos.h>
|
||||
#include <rtw_pwrctrl.h>
|
||||
#include <rtw_mlme.h>
|
||||
#include <mlme_osdep.h>
|
||||
#include <rtw_io.h>
|
||||
#include <rtw_ioctl_set.h>
|
||||
#include <osdep_intf.h>
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef __MLME_OSDEP_H_
|
||||
#define __MLME_OSDEP_H_
|
||||
|
||||
|
||||
void rtw_reset_securitypriv(struct adapter *adapter);
|
||||
|
||||
#endif /* _MLME_OSDEP_H_ */
|
||||
|
|
@ -395,5 +395,6 @@ u8 rtw_to_roam(struct adapter *adapter);
|
|||
int rtw_select_roaming_candidate(struct mlme_priv *pmlmepriv);
|
||||
|
||||
void rtw_sta_media_status_rpt(struct adapter *adapter, struct sta_info *psta, u32 mstatus);
|
||||
void rtw_reset_securitypriv(struct adapter *adapter);
|
||||
|
||||
#endif /* __RTL871X_MLME_H_ */
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
******************************************************************************/
|
||||
#include <drv_types.h>
|
||||
|
||||
static struct rt_pmkid_list backupPMKIDList[NUM_PMKID_CACHE];
|
||||
void rtw_reset_securitypriv(struct adapter *adapter)
|
||||
{
|
||||
u8 backupPMKIDIndex = 0;
|
||||
u8 backupTKIPCountermeasure = 0x00;
|
||||
u32 backupTKIPcountermeasure_time = 0;
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
|
||||
spin_lock_bh(&adapter->security_key_mutex);
|
||||
|
||||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
||||
/* 802.1x */
|
||||
/* Added by Albert 2009/02/18 */
|
||||
/* We have to backup the PMK information for WiFi PMK Caching test item. */
|
||||
/* */
|
||||
/* Backup the btkip_countermeasure information. */
|
||||
/* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
|
||||
|
||||
memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
|
||||
backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
|
||||
backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
|
||||
|
||||
/* reset RX BIP packet number */
|
||||
pmlmeext->mgnt_80211w_IPN_rx = 0;
|
||||
|
||||
memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
|
||||
|
||||
/* Added by Albert 2009/02/18 */
|
||||
/* Restore the PMK information to securitypriv structure for the following connection. */
|
||||
memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
adapter->securitypriv.PMKIDIndex = backupPMKIDIndex;
|
||||
adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure;
|
||||
adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
|
||||
|
||||
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
|
||||
} else {
|
||||
/* reset values in securitypriv */
|
||||
/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
|
||||
/* */
|
||||
struct security_priv *psec_priv = &adapter->securitypriv;
|
||||
|
||||
psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psec_priv->dot11PrivacyKeyIndex = 0;
|
||||
|
||||
psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_;
|
||||
psec_priv->dot118021XGrpKeyid = 1;
|
||||
|
||||
psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
/* */
|
||||
}
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
spin_unlock_bh(&adapter->security_key_mutex);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user