Commit e263d79e authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: simplify frame type check



Reorder the code in rtw_make_wlanhdr to make the function simpler.
There's a large if statement to check that we process only data frames.
Revert the condition and exit for non-data frames.

Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20221230180646.91008-10-martin@kaiser.cx


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6dd8420d
Loading
Loading
Loading
Loading
+70 −69
Original line number Diff line number Diff line
@@ -809,7 +809,9 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr

	SetFrameSubType(fctrl, pattrib->subtype);

	if (pattrib->subtype & IEEE80211_FTYPE_DATA) {
	if (!(pattrib->subtype & IEEE80211_FTYPE_DATA))
		return _SUCCESS;

	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
		/* to_ds = 1, fr_ds = 0; */
		/* Data transfer to AP */
@@ -895,7 +897,6 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
			}
		}
	}
	}
exit:

	return res;