aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bss.c
diff options
context:
space:
mode:
authorWitold Sowa <witold.sowa@gmail.com>2010-01-04 14:52:30 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-04 14:52:30 (GMT)
commit75d328af5070217672b7dc25dbcd74fad05fb6e5 (patch)
tree3abc14484edbcf2b4dc4d77da32c1cbf44843eff /wpa_supplicant/bss.c
parent58e1452474b4ad09515cb7853085a0900114bb3c (diff)
downloadhostap-75d328af5070217672b7dc25dbcd74fad05fb6e5.zip
hostap-75d328af5070217672b7dc25dbcd74fad05fb6e5.tar.gz
hostap-75d328af5070217672b7dc25dbcd74fad05fb6e5.tar.bz2
dbus: Change BSS property MaxRate to Rates
Instead of exposing maximum BSS bit rate, expose sorted array of all supported rates.
Diffstat (limited to 'wpa_supplicant/bss.c')
-rw-r--r--wpa_supplicant/bss.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index a125ca1..bd8d061 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -434,3 +434,27 @@ int wpa_bss_get_max_rate(const struct wpa_bss *bss)
return rate;
}
+
+
+int wpa_bss_get_bit_rates(const struct wpa_bss *bss, u8 **rates)
+{
+ const u8 *ie, *ie2;
+ int i, j, len;
+
+ ie = wpa_bss_get_ie(bss, WLAN_EID_SUPP_RATES);
+ ie2 = wpa_bss_get_ie(bss, WLAN_EID_EXT_SUPP_RATES);
+
+ len = (ie ? ie[1] : 0) + (ie2 ? ie2[1] : 0);
+
+ *rates = os_malloc(len);
+ if (!rates)
+ return -1;
+
+ for (i = 0; ie && i < ie[1]; i++)
+ (*rates)[i] = ie[i + 2] & 0x7f;
+
+ for (j = 0; ie2 && j < ie2[1]; j++)
+ (*rates)[i + j] = ie2[j + 2] & 0x7f;
+
+ return len;
+}