3 @@ -716,6 +716,16 @@ int hostapd_setup_interface_complete(str
7 + if (iface->current_mode) {
8 + if (hostapd_prepare_rates(hapd, iface->current_mode)) {
9 + wpa_printf(MSG_ERROR, "Failed to prepare rates table.");
10 + hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
11 + HOSTAPD_LEVEL_WARNING,
12 + "Failed to prepare rates table.");
17 if (hapd->iconf->rts_threshold > -1 &&
18 hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) {
19 wpa_printf(MSG_ERROR, "Could not set RTS threshold for "
20 --- a/src/ap/hw_features.c
21 +++ b/src/ap/hw_features.c
22 @@ -101,8 +101,8 @@ int hostapd_get_hw_features(struct hosta
26 -static int hostapd_prepare_rates(struct hostapd_data *hapd,
27 - struct hostapd_hw_modes *mode)
28 +int hostapd_prepare_rates(struct hostapd_data *hapd,
29 + struct hostapd_hw_modes *mode)
31 int i, num_basic_rates = 0;
32 int basic_rates_a[] = { 60, 120, 240, -1 };
33 @@ -668,14 +668,6 @@ int hostapd_select_hw_mode(struct hostap
37 - if (hostapd_prepare_rates(iface->bss[0], iface->current_mode)) {
38 - wpa_printf(MSG_ERROR, "Failed to prepare rates table.");
39 - hostapd_logger(iface->bss[0], NULL, HOSTAPD_MODULE_IEEE80211,
40 - HOSTAPD_LEVEL_WARNING,
41 - "Failed to prepare rates table.");
48 --- a/src/ap/hw_features.h
49 +++ b/src/ap/hw_features.h
50 @@ -25,6 +25,8 @@ const char * hostapd_hw_mode_txt(int mod
51 int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan);
52 int hostapd_hw_get_channel(struct hostapd_data *hapd, int freq);
53 int hostapd_check_ht_capab(struct hostapd_iface *iface);
54 +int hostapd_prepare_rates(struct hostapd_data *hapd,
55 + struct hostapd_hw_modes *mode);
56 #else /* NEED_AP_MLME */
58 hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
59 @@ -56,6 +58,11 @@ static inline int hostapd_check_ht_capab
63 +static inline int hostapd_prepare_rates(struct hostapd_data *hapd,
64 + struct hostapd_hw_modes *mode)
69 #endif /* NEED_AP_MLME */