diff options
author | Jouni Malinen <j@w1.fi> | 2009-12-09 21:57:50 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2009-12-09 21:57:50 +0200 |
commit | fb7842aa5131c9a0b5e044432c4030e71e04918b (patch) | |
tree | b888a7d2d40aea15b97a729a0795fcacb7f63517 /src/drivers/driver_nl80211.c | |
parent | 217e7eeaf070cc47c25712937cc84a75c77b44f8 (diff) | |
download | external_wpa_supplicant_8_ti-fb7842aa5131c9a0b5e044432c4030e71e04918b.zip external_wpa_supplicant_8_ti-fb7842aa5131c9a0b5e044432c4030e71e04918b.tar.gz external_wpa_supplicant_8_ti-fb7842aa5131c9a0b5e044432c4030e71e04918b.tar.bz2 |
Remove struct hostapd_rate_data from driver API
In addition to the bitrate, the only other variable in this structure
is used internally in hostapd. Move this structure into hostapd.h and
make the driver API use simpler data structure (array of bitrates).
Diffstat (limited to 'src/drivers/driver_nl80211.c')
-rw-r--r-- | src/drivers/driver_nl80211.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 26e4758..91757b1 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2376,7 +2376,7 @@ static int phy_info_handler(struct nl_msg *msg, void *arg) mode->num_rates++; } - mode->rates = calloc(mode->num_rates, sizeof(struct hostapd_rate_data)); + mode->rates = calloc(mode->num_rates, sizeof(int)); if (!mode->rates) return NL_SKIP; @@ -2387,11 +2387,11 @@ static int phy_info_handler(struct nl_msg *msg, void *arg) nla_len(nl_rate), rate_policy); if (!tb_rate[NL80211_BITRATE_ATTR_RATE]) continue; - mode->rates[idx].rate = nla_get_u32(tb_rate[NL80211_BITRATE_ATTR_RATE]); + mode->rates[idx] = nla_get_u32(tb_rate[NL80211_BITRATE_ATTR_RATE]); /* crude heuristic */ if (mode->mode == HOSTAPD_MODE_IEEE80211B && - mode->rates[idx].rate > 200) + mode->rates[idx] > 200) mode->mode = HOSTAPD_MODE_IEEE80211G; idx++; @@ -2444,7 +2444,7 @@ wpa_driver_nl80211_add_11b(struct hostapd_hw_modes *modes, u16 *num_modes) mode11g->num_channels * sizeof(struct hostapd_channel_data)); mode->num_rates = 0; - mode->rates = os_malloc(4 * sizeof(struct hostapd_rate_data)); + mode->rates = os_malloc(4 * sizeof(int)); if (mode->rates == NULL) { os_free(mode->channels); (*num_modes)--; @@ -2452,10 +2452,8 @@ wpa_driver_nl80211_add_11b(struct hostapd_hw_modes *modes, u16 *num_modes) } for (i = 0; i < mode11g->num_rates; i++) { - if (mode11g->rates[i].rate != 10 && - mode11g->rates[i].rate != 20 && - mode11g->rates[i].rate != 55 && - mode11g->rates[i].rate != 110) + if (mode11g->rates[i] != 10 && mode11g->rates[i] != 20 && + mode11g->rates[i] != 55 && mode11g->rates[i] != 110) continue; mode->rates[mode->num_rates] = mode11g->rates[i]; mode->num_rates++; |