The driver's local GetFrameSubType macro returns both frame type and
subtype.
Use the ieee80211 framework to extract the two fields. This shows more
clearly that both type and subtype are read.
Convert everything to host endianness before we use bit operations.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220417102221.466524-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int index;
struct mlme_handler *ptable;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
- u8 *pframe = precv_frame->rx_data;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data;
struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, hdr->addr2);
ptable = mlme_sta_tbl;
- index = GetFrameSubType(pframe) >> 4;
-
+ index = (le16_to_cpu(hdr->frame_control) &
+ (IEEE80211_FCTL_STYPE | IEEE80211_FCTL_FTYPE)) >> 4;
if (index > 13)
return;
ptable += index;