Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: r8188eu: use subtype helper in rtw_check_bcn_info

Use ieee80211_is_beacon to check the frame subtype in rtw_check_bcn_info.
Replace the call to the driver-specific GetFrameSubType function.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20221202093159.404111-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Martin Kaiser and committed by
Greg Kroah-Hartman
7868f8f8 506783ff

+3 -4
+3 -4
drivers/staging/r8188eu/core/rtw_wlan_util.c
··· 874 874 875 875 int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) 876 876 { 877 + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)pframe; 877 878 unsigned int len; 878 879 unsigned char *p; 879 - unsigned short val16, subtype; 880 + unsigned short val16; 880 881 struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network; 881 882 /* u8 wpa_ie[255], rsn_ie[255]; */ 882 883 u16 wpa_len = 0, rsn_len = 0; ··· 909 908 if (!bssid) 910 909 return _FAIL; 911 910 912 - subtype = GetFrameSubType(pframe) >> 4; 913 - 914 - if (subtype == WIFI_BEACON) 911 + if (ieee80211_is_beacon(mgmt->frame_control)) 915 912 bssid->Reserved[0] = 1; 916 913 917 914 bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;