Commit 5b124b1a authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: collect_bss_info23a(): Collect beacon_interval correct

Only retrieve beacon_interval from frames where it is present. This
avoids setting BeaconPeriod to garbage for other frame types.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7882ef45
...@@ -4547,20 +4547,28 @@ int collect_bss_info23a(struct rtw_adapter *padapter, ...@@ -4547,20 +4547,28 @@ int collect_bss_info23a(struct rtw_adapter *padapter,
bssid->reserved = 1; bssid->reserved = 1;
ie_offset = offsetof(struct ieee80211_mgmt, u.beacon.variable); ie_offset = offsetof(struct ieee80211_mgmt, u.beacon.variable);
capab_info = mgmt->u.beacon.capab_info; capab_info = mgmt->u.beacon.capab_info;
bssid->BeaconPeriod =
get_unaligned_le16(&mgmt->u.beacon.beacon_int);
} else if (ieee80211_is_probe_req(mgmt->frame_control)) { } else if (ieee80211_is_probe_req(mgmt->frame_control)) {
ie_offset = offsetof(struct ieee80211_mgmt, ie_offset = offsetof(struct ieee80211_mgmt,
u.probe_req.variable); u.probe_req.variable);
bssid->reserved = 2; bssid->reserved = 2;
capab_info = 0; capab_info = 0;
bssid->BeaconPeriod =
padapter->registrypriv.dev_network.BeaconPeriod;
} else if (ieee80211_is_probe_resp(mgmt->frame_control)) { } else if (ieee80211_is_probe_resp(mgmt->frame_control)) {
ie_offset = offsetof(struct ieee80211_mgmt, ie_offset = offsetof(struct ieee80211_mgmt,
u.probe_resp.variable); u.probe_resp.variable);
bssid->reserved = 3; bssid->reserved = 3;
capab_info = mgmt->u.probe_resp.capab_info; capab_info = mgmt->u.probe_resp.capab_info;
bssid->BeaconPeriod =
get_unaligned_le16(&mgmt->u.probe_resp.beacon_int);
} else { } else {
bssid->reserved = 0; bssid->reserved = 0;
ie_offset = offsetof(struct ieee80211_mgmt, u.beacon.variable); ie_offset = offsetof(struct ieee80211_mgmt, u.beacon.variable);
capab_info = mgmt->u.beacon.capab_info; capab_info = mgmt->u.beacon.capab_info;
bssid->BeaconPeriod =
padapter->registrypriv.dev_network.BeaconPeriod;
} }
ie_offset -= offsetof(struct ieee80211_mgmt, u); ie_offset -= offsetof(struct ieee80211_mgmt, u);
...@@ -4654,9 +4662,6 @@ int collect_bss_info23a(struct rtw_adapter *padapter, ...@@ -4654,9 +4662,6 @@ int collect_bss_info23a(struct rtw_adapter *padapter,
return _SUCCESS; return _SUCCESS;
} }
bssid->BeaconPeriod = get_unaligned_le16(
rtw_get_beacon_interval23a_from_ie(bssid->IEs));
if (capab_info & BIT(0)) { if (capab_info & BIT(0)) {
bssid->ifmode = NL80211_IFTYPE_STATION; bssid->ifmode = NL80211_IFTYPE_STATION;
ether_addr_copy(bssid->MacAddress, mgmt->sa); ether_addr_copy(bssid->MacAddress, mgmt->sa);
......
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