staging: rtl8712: Fix some tests against some 'data' subtype frames

Commit 6e2baa44c6 ("staging: rtl8712: remove enum WIFI_FRAME_SUBTYPE")
was wrong because:
	WIFI_DATA_NULL != IEEE80211_STYPE_NULLFUNC
	WIFI_DATA_CFACK != IEEE80211_STYPE_DATA_CFACK
	WIFI_DATA_CFPOLL != IEEE80211_STYPE_DATA_CFPOLL
	WIFI_DATA_CFACKPOLL != IEEE80211_STYPE_DATA_CFACKPOLL

the WIFI_DATA_xxx definitions include WIFI_DATA_TYPE, which is 'BIT(3)'.
Restore the previous behavior by adding the missing
'IEEE80211_FTYPE_DATA |' (0x0008, that is to say BIT(3)) when these values
are used.

Hopefully, the wrong commit was small enough and hand review is possible.

Fixes: 6e2baa44c6 ("staging: rtl8712: remove enum WIFI_FRAME_SUBTYPE")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/44aebfa3c5ce8f45ae05369c73e9ff77c6d271f9.1619939806.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Christophe JAILLET 2021-05-02 09:21:08 +02:00 committed by Greg Kroah-Hartman
parent a616d1212a
commit 116138c3bd
2 changed files with 7 additions and 7 deletions

View File

@ -374,7 +374,7 @@ static sint ap2sta_data_frame(struct _adapter *adapter,
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
check_fwstate(pmlmepriv, _FW_LINKED)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
/* if NULL-frame, drop packet */ /* if NULL-frame, drop packet */
if ((GetFrameSubType(ptr)) == IEEE80211_STYPE_NULLFUNC) if ((GetFrameSubType(ptr)) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC))
return _FAIL; return _FAIL;
/* drop QoS-SubType Data, including QoS NULL, /* drop QoS-SubType Data, including QoS NULL,
* excluding QoS-Data * excluding QoS-Data

View File

@ -1045,9 +1045,9 @@ static void aes_cipher(u8 *key, uint hdrlen,
else else
a4_exists = 1; a4_exists = 1;
if ((frtype == IEEE80211_STYPE_DATA_CFACK) || if ((frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACK)) ||
(frtype == IEEE80211_STYPE_DATA_CFPOLL) || (frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFPOLL)) ||
(frtype == IEEE80211_STYPE_DATA_CFACKPOLL)) { (frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACKPOLL))) {
qc_exists = 1; qc_exists = 1;
if (hdrlen != WLAN_HDR_A3_QOS_LEN) if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2; hdrlen += 2;
@ -1225,9 +1225,9 @@ static void aes_decipher(u8 *key, uint hdrlen,
a4_exists = 0; a4_exists = 0;
else else
a4_exists = 1; a4_exists = 1;
if ((frtype == IEEE80211_STYPE_DATA_CFACK) || if ((frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACK)) ||
(frtype == IEEE80211_STYPE_DATA_CFPOLL) || (frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFPOLL)) ||
(frtype == IEEE80211_STYPE_DATA_CFACKPOLL)) { (frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACKPOLL))) {
qc_exists = 1; qc_exists = 1;
if (hdrlen != WLAN_HDR_A3_QOS_LEN) if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2; hdrlen += 2;