Commit 9216c517 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723au: Fix up some random bit-flag handling



Randomly mixing true/false/_FAIL/0/1 is a recipe for disaster

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3e3a1adf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -755,7 +755,7 @@ int rtw_setstakey_cmd23a(struct rtw_adapter *padapter, u8 *psta, u8 unicast_key)
        }

	/* jeff: set this becasue at least sw key is ready */
	padapter->securitypriv.busetkipkey = true;
	padapter->securitypriv.busetkipkey = 1;

	res = rtw_enqueue_cmd23a(pcmdpriv, ph2c);

+2 −3
Original line number Diff line number Diff line
@@ -1027,9 +1027,8 @@ rtw_joinbss_update_stainfo(struct rtw_adapter *padapter,
		/* security related */
		if (padapter->securitypriv.dot11AuthAlgrthm ==
		    dot11AuthAlgrthm_8021X) {
			padapter->securitypriv.binstallGrpkey = false;
			padapter->securitypriv.busetkipkey = false;
			padapter->securitypriv.bgrpkey_handshake = false;
			padapter->securitypriv.binstallGrpkey = 0;
			padapter->securitypriv.busetkipkey = 0;

			psta->ieee8021x_blocked = true;
			psta->dot118021XPrivacy =
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ static u8 PS_RDY_CHECK(struct rtw_adapter * padapter)
	if (pwrpriv->bInSuspend)
		return false;
	if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X &&
	    padapter->securitypriv.binstallGrpkey == false) {
	    !padapter->securitypriv.binstallGrpkey) {
		DBG_8723A("Group handshake still in progress !!!\n");
		return false;
	}
+6 −6
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ int recvframe_chkmic(struct rtw_adapter *adapter,
				RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
					 ("\n recvframe_chkmic: bcmc key\n"));

				if (psecuritypriv->binstallGrpkey == false) {
				if (!psecuritypriv->binstallGrpkey) {
					res = _FAIL;
					RT_TRACE(_module_rtl871x_recv_c_,
						 _drv_err_,
@@ -442,9 +442,9 @@ int recvframe_chkmic(struct rtw_adapter *adapter,
				res = _FAIL;
			} else {
				/* mic checked ok */
				if ((psecuritypriv->bcheck_grpkey == false) &&
				    (is_multicast_ether_addr(prxattrib->ra))) {
					psecuritypriv->bcheck_grpkey = true;
				if (!psecuritypriv->bcheck_grpkey &&
				    is_multicast_ether_addr(prxattrib->ra)) {
					psecuritypriv->bcheck_grpkey = 1;
					RT_TRACE(_module_rtl871x_recv_c_,
						 _drv_err_,
						 ("psecuritypriv->bcheck_grp"
@@ -507,7 +507,7 @@ struct recv_frame *decryptor(struct rtw_adapter *padapter,
	}

	if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0))) {
		psecuritypriv->hw_decrypted = false;
		psecuritypriv->hw_decrypted = 0;
		switch (prxattrib->encrypt) {
		case _WEP40_:
		case _WEP104_:
@@ -525,7 +525,7 @@ struct recv_frame *decryptor(struct rtw_adapter *padapter,
	} else if (prxattrib->bdecrypted == 1 && prxattrib->encrypt > 0 &&
		   (psecuritypriv->busetkipkey == 1 ||
		    prxattrib->encrypt != _TKIP_)) {
			psecuritypriv->hw_decrypted = true;
			psecuritypriv->hw_decrypted = 1;
	}

	if (res == _FAIL) {
+2 −2
Original line number Diff line number Diff line
@@ -744,7 +744,7 @@ int rtw_tkip_decrypt23a(struct rtw_adapter *padapter,
		if (stainfo!= NULL) {

			if (is_multicast_ether_addr(prxattrib->ra)) {
				if (psecuritypriv->binstallGrpkey == false) {
				if (psecuritypriv->binstallGrpkey == 0) {
					res = _FAIL;
					DBG_8723A("%s:rx bc/mc packets, but didn't install group key!!!!!!!!!!\n", __func__);
					goto exit;
@@ -1645,7 +1645,7 @@ void rtw_use_tkipkey_handler23a(void *FunctionContext)
	struct rtw_adapter *padapter = (struct rtw_adapter *)FunctionContext;

	RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("^^^rtw_use_tkipkey_handler23a ^^^\n"));
	padapter->securitypriv.busetkipkey = true;
	padapter->securitypriv.busetkipkey = 1;
	RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
		 ("^^^rtw_use_tkipkey_handler23a padapter->securitypriv.busetkipkey =%d^^^\n",
		 padapter->securitypriv.busetkipkey));
Loading