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>
This commit is contained in:
Martin Kaiser 2022-12-02 10:31:59 +01:00 committed by Greg Kroah-Hartman
parent 506783ffa9
commit 7868f8f858
1 changed files with 3 additions and 4 deletions

View File

@ -874,9 +874,10 @@ void VCS_update(struct adapter *padapter, struct sta_info *psta)
int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
{ {
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)pframe;
unsigned int len; unsigned int len;
unsigned char *p; unsigned char *p;
unsigned short val16, subtype; unsigned short val16;
struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network; struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network;
/* u8 wpa_ie[255], rsn_ie[255]; */ /* u8 wpa_ie[255], rsn_ie[255]; */
u16 wpa_len = 0, rsn_len = 0; u16 wpa_len = 0, rsn_len = 0;
@ -908,9 +909,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
if (!bssid) if (!bssid)
return _FAIL; return _FAIL;
subtype = GetFrameSubType(pframe) >> 4; if (ieee80211_is_beacon(mgmt->frame_control))
if (subtype == WIFI_BEACON)
bssid->Reserved[0] = 1; bssid->Reserved[0] = 1;
bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;