staging:r8188eu: replace rtw_software_decrypt with its value
PATCH 1/6 staging:r8188eu: replace rtw_software_decrypt with its value
rtw_software_decrypt used only once and does not changed. Replace it with 0.
--- drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8188eu/os_dep/os_intfs.c +1 -2
@@ -50,7 +50,6 @@ MODULE_PARM_DESC(rtw_ips_mode, "The default IPS mode");static int rtw_debug =1 ;static int rtw_software_encrypt; -static int rtw_software_decrypt;static int rtw_acm_method;/* 0:By SW 1:By HW. */
@@ -167,7 +166,7 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev) registry_par->ips_mode = (u8 )rtw_ips_mode; registry_par->mp_mode =0 ; registry_par->software_encrypt = (u8 )rtw_software_encrypt; - registry_par->software_decrypt = (u8 )rtw_software_decrypt; + registry_par->software_decrypt =0 ; registry_par->acm_method = (u8 )rtw_acm_method;/* UAPSD */
Signature · 1 line
2.10.2
PATCH 2/6 staging:r8188eu: remove software_decrypt member of registry_priv struct
Value of this variable has no changes, and used once. Replace software_decrypt with its value.
--- drivers/staging/rtl8188eu/include/drv_types.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8188eu/include/drv_types.h +0 -1
@@ -66,7 +66,6 @@ struct registry_priv {u8 smart_ps;u8 mp_mode;u8 software_encrypt; -u8 software_decrypt;u8 acm_method;/* UAPSD */ u8 wmm_enable;
drivers/staging/rtl8188eu/os_dep/os_intfs.c +1 -2
@@ -166,7 +166,6 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev) registry_par->ips_mode = (u8 )rtw_ips_mode; registry_par->mp_mode =0 ; registry_par->software_encrypt = (u8 )rtw_software_encrypt; - registry_par->software_decrypt =0 ; registry_par->acm_method = (u8 )rtw_acm_method;/* UAPSD */
@@ -393,7 +392,7 @@ static u8 rtw_init_default_value(struct adapter *padapter)/* security_priv */ psecuritypriv->binstallGrpkey = _FAIL; psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt; - psecuritypriv->sw_decrypt = pregistrypriv->software_decrypt; + psecuritypriv->sw_decrypt =0 ; psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_; psecuritypriv->dot11PrivacyKeyIndex =0 ;
Signature · 1 line
2.10.2
PATCH 3/6 staging:r8188eu: remove sw_decrypt member of security_priv struct
In reply to Ivan Safonovsw_decrypt always is 0, so replace it with 0.
--- drivers/staging/rtl8188eu/core/rtw_recv.c | 4 ++-- drivers/staging/rtl8188eu/include/rtw_security.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 1 - 3 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8188eu/core/rtw_recv.c +2 -2
@@ -392,7 +392,7 @@ static struct recv_frame *decryptor(struct adapter *padapter, } } -if ((prxattrib->encrypt >0 ) && ((prxattrib->bdecrypted ==0 ) || (psecuritypriv->sw_decrypt))) { +if ((prxattrib->encrypt >0 ) && (prxattrib->bdecrypted ==0 )) { psecuritypriv->hw_decrypted = false;switch (prxattrib->encrypt) {
@@ -1979,7 +1979,7 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)/* check if need to enqueue into uc_swdec_pending_queue*/ if (check_fwstate (mlmepriv,WIFI_STATION_STATE ) && !IS_MCAST (prxattrib->ra) && prxattrib->encrypt >0 && - (prxattrib->bdecrypted ==0 || psecuritypriv->sw_decrypt) && + prxattrib->bdecrypted ==0 && !is_wep_enc (psecuritypriv->dot11PrivacyAlgrthm) && !psecuritypriv->busetkipkey) {rtw_enqueue_recvframe (rframe, &padapter->recvpriv.uc_swdec_pending_queue);
drivers/staging/rtl8188eu/include/rtw_security.h +0 -1
@@ -134,7 +134,6 @@ struct security_priv {u8 bcheck_grpkey;u8 bgrpkey_handshake;s32 sw_encrypt;/* from registry_priv */ -s32 sw_decrypt;/* from registry_priv */ s32 hw_decrypted;/* if the rx packets is hw_decrypted==false,i * it means the hw has not been ready. */
drivers/staging/rtl8188eu/os_dep/os_intfs.c +0 -1
@@ -392,7 +392,6 @@ static u8 rtw_init_default_value(struct adapter *padapter)/* security_priv */ psecuritypriv->binstallGrpkey = _FAIL; psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt; - psecuritypriv->sw_decrypt =0 ; psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_; psecuritypriv->dot11PrivacyKeyIndex =0 ;
Signature · 1 line
2.10.2
PATCH 4/6 staging:r8188eu: replace rtw_software_encrypt with its default value
In reply to Ivan Safonovrtw_software_encrypt used only once and does not changed. Replace it with 0.
--- drivers/staging/rtl8188eu/os_dep/os_intfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8188eu/os_dep/os_intfs.c +1 -3
@@ -49,8 +49,6 @@ MODULE_PARM_DESC(rtw_ips_mode, "The default IPS mode");static int rtw_debug =1 ; -static int rtw_software_encrypt; -static int rtw_acm_method;/* 0:By SW 1:By HW. */ static int rtw_wmm_enable =1 ;/* default is set to enable the wmm. */
@@ -165,7 +163,7 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev) registry_par->power_mgnt = (u8 )rtw_power_mgnt; registry_par->ips_mode = (u8 )rtw_ips_mode; registry_par->mp_mode =0 ; - registry_par->software_encrypt = (u8 )rtw_software_encrypt; + registry_par->software_encrypt =0 ; registry_par->acm_method = (u8 )rtw_acm_method;/* UAPSD */
Signature · 1 line
2.10.2
PATCH 5/6 staging:r8188eu: remove software_encrypt member of registry_priv struct
In reply to Ivan SafonovValue of this variable does not changed after initialization. Replace software_encrypt with its default value.
--- drivers/staging/rtl8188eu/include/drv_types.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8188eu/include/drv_types.h +0 -1
@@ -65,7 +65,6 @@ struct registry_priv {u8 ips_mode;u8 smart_ps;u8 mp_mode; -u8 software_encrypt;u8 acm_method;/* UAPSD */ u8 wmm_enable;
drivers/staging/rtl8188eu/os_dep/os_intfs.c +1 -2
@@ -163,7 +163,6 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev) registry_par->power_mgnt = (u8 )rtw_power_mgnt; registry_par->ips_mode = (u8 )rtw_ips_mode; registry_par->mp_mode =0 ; - registry_par->software_encrypt =0 ; registry_par->acm_method = (u8 )rtw_acm_method;/* UAPSD */
@@ -389,7 +388,7 @@ static u8 rtw_init_default_value(struct adapter *padapter)/* security_priv */ psecuritypriv->binstallGrpkey = _FAIL; - psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt; + psecuritypriv->sw_encrypt =0 ; psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_; psecuritypriv->dot11PrivacyKeyIndex =0 ;
Signature · 1 line
2.10.2
PATCH 6/6 staging:r8188eu: remove sw_encrypt member of security_priv struct
In reply to Ivan Safonovsw_encrypt always is 0. Replace sw_encrypt with 0.
--- drivers/staging/rtl8188eu/core/rtw_xmit.c | 10 ++++------ drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c | 3 +-- drivers/staging/rtl8188eu/include/rtw_security.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 1 - 4 files changed, 5 insertions(+), 10 deletions(-)
drivers/staging/rtl8188eu/core/rtw_xmit.c +4 -6
@@ -587,15 +587,13 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p }RT_TRACE (_module_rtl871x_xmit_c_, _drv_info_, - ("update_attrib: encrypt=%d securitypriv.sw_encrypt=%d\n" , - pattrib->encrypt, padapter->securitypriv.sw_encrypt)); + ("update_attrib: encrypt=%d\n" , pattrib->encrypt)); -if (pattrib->encrypt && - (padapter->securitypriv.sw_encrypt || !psecuritypriv->hw_decrypted)) { +if (pattrib->encrypt && !psecuritypriv->hw_decrypted) { pattrib->bswenc = true;RT_TRACE (_module_rtl871x_xmit_c_, _drv_err_, - ("update_attrib: encrypt=%d securitypriv.hw_decrypted=%d bswenc = true\n" , - pattrib->encrypt, padapter->securitypriv.sw_encrypt)); + ("update_attrib: encrypt=%d bswenc = true\n" , + pattrib->encrypt)); }else { pattrib->bswenc = false;RT_TRACE (_module_rtl871x_xmit_c_, _drv_info_, ("update_attrib: bswenc = false\n" ));
drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c +1 -2
@@ -346,7 +346,6 @@ static s32 rtw_dump_xframe(struct adapter *adapt, struct xmit_frame *pxmitframe)struct xmit_buf *pxmitbuf = pxmitframe->pxmitbuf;struct pkt_attrib *pattrib = &pxmitframe->attrib;struct xmit_priv *pxmitpriv = &adapt->xmitpriv; -struct security_priv *psecuritypriv = &adapt->securitypriv; if ((pxmitframe->frame_tag == DATA_FRAMETAG) && (pxmitframe->attrib.ether_type != 0x0806) &&
@@ -366,7 +365,7 @@ static s32 rtw_dump_xframe(struct adapter *adapt, struct xmit_frame *pxmitframe)RT_TRACE (_module_rtl871x_xmit_c_, _drv_err_, ("pattrib->nr_frags=%d\n" , pattrib->nr_frags)); sz = pxmitpriv->frag_len; - sz = sz -4 - (psecuritypriv->sw_encrypt ?0 : pattrib->icv_len); + sz = sz -4 - pattrib->icv_len; }else {/* no frag */ sz = pattrib->last_txcmdsz;
drivers/staging/rtl8188eu/include/rtw_security.h +0 -1
@@ -133,7 +133,6 @@ struct security_priv {u8 busetkipkey;u8 bcheck_grpkey;u8 bgrpkey_handshake; -s32 sw_encrypt;/* from registry_priv */ s32 hw_decrypted;/* if the rx packets is hw_decrypted==false,i * it means the hw has not been ready. */
drivers/staging/rtl8188eu/os_dep/os_intfs.c +0 -1
@@ -388,7 +388,6 @@ static u8 rtw_init_default_value(struct adapter *padapter)/* security_priv */ psecuritypriv->binstallGrpkey = _FAIL; - psecuritypriv->sw_encrypt =0 ; psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_; psecuritypriv->dot11PrivacyKeyIndex =0 ;
Signature · 1 line
2.10.2