aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bss.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-27 23:09:32 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-27 23:09:32 (GMT)
commit99a6a63f2546ed0afb5c15c633e5304dad7118fa (patch)
tree5aeef1dfeef50d121bd5b7eb969605d1bc8f5698 /wpa_supplicant/bss.c
parent332d630a4422e99b3c7643f9dd9d9f0afb23fc8f (diff)
downloadhostap-99a6a63f2546ed0afb5c15c633e5304dad7118fa.zip
hostap-99a6a63f2546ed0afb5c15c633e5304dad7118fa.tar.gz
hostap-99a6a63f2546ed0afb5c15c633e5304dad7118fa.tar.bz2
Add wpa_bss_get_max_rate() to match with old scan_res helpers
Diffstat (limited to 'wpa_supplicant/bss.c')
-rw-r--r--wpa_supplicant/bss.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 96ab955..3d2a13b 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -356,3 +356,25 @@ struct wpabuf * wpa_bss_get_vendor_ie_multi(const struct wpa_bss *bss,
return buf;
}
+
+
+int wpa_bss_get_max_rate(const struct wpa_bss *bss)
+{
+ int rate = 0;
+ const u8 *ie;
+ int i;
+
+ ie = wpa_bss_get_ie(bss, WLAN_EID_SUPP_RATES);
+ for (i = 0; ie && i < ie[1]; i++) {
+ if ((ie[i + 2] & 0x7f) > rate)
+ rate = ie[i + 2] & 0x7f;
+ }
+
+ ie = wpa_bss_get_ie(bss, WLAN_EID_EXT_SUPP_RATES);
+ for (i = 0; ie && i < ie[1]; i++) {
+ if ((ie[i + 2] & 0x7f) > rate)
+ rate = ie[i + 2] & 0x7f;
+ }
+
+ return rate;
+}