Commit 506783ff authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: r8188eu: use subtype helpers in collect_bss_info

Use the iee80211 helper functions to check the frame subtype in
collect_bss_info. Replace the call to the driver-specific
GetFrameSubType function.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20221202093159.404111-2-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3d086236
...@@ -5963,10 +5963,11 @@ void site_survey(struct adapter *padapter) ...@@ -5963,10 +5963,11 @@ void site_survey(struct adapter *padapter)
/* collect bss info from Beacon and Probe request/response frames. */ /* collect bss info from Beacon and Probe request/response frames. */
u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, struct wlan_bssid_ex *bssid) u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, struct wlan_bssid_ex *bssid)
{ {
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
int i; int i;
u32 len; u32 len;
u8 *p; u8 *p;
u16 val16, subtype; u16 val16;
u8 *pframe = precv_frame->rx_data; u8 *pframe = precv_frame->rx_data;
u32 packet_len = precv_frame->len; u32 packet_len = precv_frame->len;
u8 ie_offset; u8 ie_offset;
...@@ -5982,23 +5983,18 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st ...@@ -5982,23 +5983,18 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st
memset(bssid, 0, sizeof(struct wlan_bssid_ex)); memset(bssid, 0, sizeof(struct wlan_bssid_ex));
subtype = GetFrameSubType(pframe); if (ieee80211_is_beacon(mgmt->frame_control)) {
if (subtype == WIFI_BEACON) {
bssid->Reserved[0] = 1; bssid->Reserved[0] = 1;
ie_offset = _BEACON_IE_OFFSET_; ie_offset = _BEACON_IE_OFFSET_;
} else if (ieee80211_is_probe_req(mgmt->frame_control)) {
ie_offset = _PROBEREQ_IE_OFFSET_;
bssid->Reserved[0] = 2;
} else if (ieee80211_is_probe_resp(mgmt->frame_control)) {
ie_offset = _PROBERSP_IE_OFFSET_;
bssid->Reserved[0] = 3;
} else { } else {
/* FIXME : more type */ bssid->Reserved[0] = 0;
if (subtype == WIFI_PROBEREQ) { ie_offset = _FIXED_IE_LENGTH_;
ie_offset = _PROBEREQ_IE_OFFSET_;
bssid->Reserved[0] = 2;
} else if (subtype == WIFI_PROBERSP) {
ie_offset = _PROBERSP_IE_OFFSET_;
bssid->Reserved[0] = 3;
} else {
bssid->Reserved[0] = 0;
ie_offset = _FIXED_IE_LENGTH_;
}
} }
bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment