/* TODO: check this. hostapd_get_hw_features() initializes
* too much stuff. */
/* hostapd_get_hw_features(hapd->iface); */
- hostapd_channel_list_updated(hapd->iface);
+ hostapd_channel_list_updated(
+ hapd->iface, data->channel_list_changed.initiator);
break;
#endif /* NEED_AP_MLME */
default:
}
-void hostapd_channel_list_updated(struct hostapd_iface *iface)
+void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator)
{
- if (!iface->wait_channel_update)
+ if (!iface->wait_channel_update || initiator != REGDOM_SET_BY_USER)
return;
wpa_printf(MSG_DEBUG, "Channel list updated - continue setup");
int hostapd_disable_iface(struct hostapd_iface *hapd_iface);
int hostapd_add_iface(struct hapd_interfaces *ifaces, char *buf);
int hostapd_remove_iface(struct hapd_interfaces *ifaces, char *buf);
-void hostapd_channel_list_updated(struct hostapd_iface *iface);
+void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator);
void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s);
const char * hostapd_state_text(enum hostapd_iface_state s);
#define HOSTAPD_CHAN_VHT_50_30 0x00002000
#define HOSTAPD_CHAN_VHT_70_10 0x00004000
+enum reg_change_initiator {
+ REGDOM_SET_BY_CORE,
+ REGDOM_SET_BY_USER,
+ REGDOM_SET_BY_DRIVER,
+ REGDOM_SET_BY_COUNTRY_IE,
+};
+
/**
* struct hostapd_channel_data - Channel information
*/
unsigned int freq_filter;
struct dl_list survey_list; /* struct freq_survey */
} survey_results;
+
+ /**
+ * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
+ * @initiator: Initiator of the regulatory change
+ */
+ struct channel_list_changed {
+ enum reg_change_initiator initiator;
+ } channel_list_changed;
};
/**
struct nlattr **tb)
{
struct wpa_driver_nl80211_data *drv = bss->drv;
+ union wpa_event_data data;
wpa_printf(MSG_DEBUG, "nl80211: Drv Event %d (%s) received for %s",
cmd, nl80211_command_to_string(cmd), bss->ifname);
break;
case NL80211_CMD_REG_CHANGE:
wpa_printf(MSG_DEBUG, "nl80211: Regulatory domain change");
+ if (tb[NL80211_ATTR_REG_INITIATOR] == NULL)
+ break;
+ os_memset(&data, 0, sizeof(data));
+ switch (nla_get_u8(tb[NL80211_ATTR_REG_INITIATOR])) {
+ case NL80211_REGDOM_SET_BY_CORE:
+ data.channel_list_changed.initiator =
+ REGDOM_SET_BY_CORE;
+ break;
+ case NL80211_REGDOM_SET_BY_USER:
+ data.channel_list_changed.initiator =
+ REGDOM_SET_BY_USER;
+ break;
+ case NL80211_REGDOM_SET_BY_DRIVER:
+ data.channel_list_changed.initiator =
+ REGDOM_SET_BY_DRIVER;
+ break;
+ case NL80211_REGDOM_SET_BY_COUNTRY_IE:
+ data.channel_list_changed.initiator =
+ REGDOM_SET_BY_COUNTRY_IE;
+ break;
+ default:
+ wpa_printf(MSG_DEBUG, "nl80211: Unknown reg change initiator %d received",
+ nla_get_u8(tb[NL80211_ATTR_REG_INITIATOR]));
+ break;
+ }
wpa_supplicant_event(drv->ctx, EVENT_CHANNEL_LIST_CHANGED,
- NULL);
+ &data);
break;
case NL80211_CMD_REG_BEACON_HINT:
wpa_printf(MSG_DEBUG, "nl80211: Regulatory beacon hint");