|
@@ -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;
|
|
|
+}
|