There are two hw modes (5 GHz and 6 GHz) with HOSTAPD_MODE_IEEE80211A
and the current hw mode may be wrong after one channel switch to 6 GHz.
This will cause hostapd_set_freq_params() to return -1 when saving
previous state and the second channel switch to fail. Fix this by adding
hostapd_determine_mode() before every channel switch.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
#include "hs20.h"
#include "airtime_policy.h"
#include "wpa_auth_kay.h"
+#include "hw_features.h"
static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason);
if (!channel)
return -1;
+ hostapd_determine_mode(hapd->iface);
mode = hapd->iface->current_mode;
/* if a pointer to old_params is provided we save previous state */
}
-static void hostapd_determine_mode(struct hostapd_iface *iface)
+void hostapd_determine_mode(struct hostapd_iface *iface)
{
int i;
enum hostapd_hw_mode target_mode;
void hostapd_stop_setup_timers(struct hostapd_iface *iface);
int hostapd_hw_skip_mode(struct hostapd_iface *iface,
struct hostapd_hw_modes *mode);
+void hostapd_determine_mode(struct hostapd_iface *iface);
#else /* NEED_AP_MLME */
static inline void
hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
return 0;
}
+static inline void hostapd_determine_mode(struct hostapd_iface *iface)
+{
+}
+
#endif /* NEED_AP_MLME */
#endif /* HW_FEATURES_H */