From bebd91e9c49bac7e5d72fbb58cd8d85432b4d682 Mon Sep 17 00:00:00 2001 From: Alexei Avshalom Lazar Date: Wed, 11 Sep 2019 12:03:07 +0300 Subject: [PATCH] Add EDMG parameters to set_freq functions This updates the frequency parameter setting functions to include argument for EDMG. Signed-off-by: Alexei Avshalom Lazar --- src/ap/ap_drv_ops.c | 9 ++++++--- src/ap/ap_drv_ops.h | 3 ++- src/ap/beacon.c | 3 ++- src/ap/dfs.c | 2 ++ src/ap/hostapd.c | 5 ++++- src/common/hw_features_common.c | 6 +++++- src/common/hw_features_common.h | 3 ++- wpa_supplicant/wpa_supplicant.c | 3 ++- 8 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index 095810ff7..45d46febd 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -538,7 +538,8 @@ int hostapd_flush(struct hostapd_data *hapd) int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode, - int freq, int channel, int ht_enabled, int vht_enabled, + int freq, int channel, int edmg, u8 edmg_channel, + int ht_enabled, int vht_enabled, int he_enabled, int sec_channel_offset, int oper_chwidth, int center_segment0, int center_segment1) @@ -546,7 +547,8 @@ int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode, struct hostapd_freq_params data; struct hostapd_hw_modes *cmode = hapd->iface->current_mode; - if (hostapd_set_freq_params(&data, mode, freq, channel, ht_enabled, + if (hostapd_set_freq_params(&data, mode, freq, channel, edmg, + edmg_channel, ht_enabled, vht_enabled, he_enabled, sec_channel_offset, oper_chwidth, center_segment0, center_segment1, @@ -808,7 +810,8 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface, return -1; } - if (hostapd_set_freq_params(&data, mode, freq, channel, ht_enabled, + if (hostapd_set_freq_params(&data, mode, freq, channel, 0, 0, + ht_enabled, vht_enabled, he_enabled, sec_channel_offset, oper_chwidth, center_segment0, center_segment1, diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h index ca7f7abe0..79b1302ac 100644 --- a/src/ap/ap_drv_ops.h +++ b/src/ap/ap_drv_ops.h @@ -62,7 +62,8 @@ int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd, const u8 *addr, int idx, u8 *seq); int hostapd_flush(struct hostapd_data *hapd); int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode, - int freq, int channel, int ht_enabled, int vht_enabled, + int freq, int channel, int edmg, u8 edmg_channel, + int ht_enabled, int vht_enabled, int he_enabled, int sec_channel_offset, int oper_chwidth, int center_segment0, int center_segment1); int hostapd_set_rts(struct hostapd_data *hapd, int rts); diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 6c94f9521..0754ada73 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -1434,7 +1434,8 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd) if (cmode && hostapd_set_freq_params(&freq, iconf->hw_mode, iface->freq, - iconf->channel, iconf->ieee80211n, + iconf->channel, iconf->enable_edmg, + iconf->edmg_channel, iconf->ieee80211n, iconf->ieee80211ac, iconf->ieee80211ax, iconf->secondary_channel, hostapd_get_oper_chwidth(iconf), diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 2de338d45..c4c00fc4f 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -960,6 +960,8 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) iface->conf->hw_mode, channel->freq, channel->chan, + iface->conf->enable_edmg, + iface->conf->edmg_channel, iface->conf->ieee80211n, iface->conf->ieee80211ac, iface->conf->ieee80211ax, diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index bf7b1f89e..83e64743d 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1914,6 +1914,8 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, if (!delay_apply_cfg && hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq, hapd->iconf->channel, + hapd->iconf->enable_edmg, + hapd->iconf->edmg_channel, hapd->iconf->ieee80211n, hapd->iconf->ieee80211ac, hapd->iconf->ieee80211ax, @@ -3282,7 +3284,8 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd, if (old_params && hostapd_set_freq_params(old_params, conf->hw_mode, hostapd_hw_get_freq(hapd, conf->channel), - conf->channel, conf->ieee80211n, + conf->channel, conf->enable_edmg, + conf->edmg_channel, conf->ieee80211n, conf->ieee80211ac, conf->ieee80211ax, conf->secondary_channel, hostapd_get_oper_chwidth(conf), diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c index 3fdbf893d..57f5e3981 100644 --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c @@ -360,7 +360,8 @@ int check_40mhz_2g4(struct hostapd_hw_modes *mode, int hostapd_set_freq_params(struct hostapd_freq_params *data, enum hostapd_hw_mode mode, - int freq, int channel, int ht_enabled, + int freq, int channel, int enable_edmg, + u8 edmg_channel, int ht_enabled, int vht_enabled, int he_enabled, int sec_channel_offset, int oper_chwidth, int center_segment0, @@ -381,6 +382,9 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data, data->center_freq2 = 0; data->bandwidth = sec_channel_offset ? 40 : 20; + hostapd_encode_edmg_chan(enable_edmg, edmg_channel, channel, + &data->edmg); + if (data->vht_enabled) switch (oper_chwidth) { case CHANWIDTH_USE_HT: if (center_segment1 || diff --git a/src/common/hw_features_common.h b/src/common/hw_features_common.h index 2d2a53994..c86e19559 100644 --- a/src/common/hw_features_common.h +++ b/src/common/hw_features_common.h @@ -31,7 +31,8 @@ int check_40mhz_2g4(struct hostapd_hw_modes *mode, int sec_chan); int hostapd_set_freq_params(struct hostapd_freq_params *data, enum hostapd_hw_mode mode, - int freq, int channel, int ht_enabled, + int freq, int channel, int edmg, u8 edmg_channel, + int ht_enabled, int vht_enabled, int he_enabled, int sec_channel_offset, int oper_chwidth, int center_segment0, diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index e7ddaa1d0..1c663ea85 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2433,7 +2433,8 @@ skip_ht40: } if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq, - freq->channel, freq->ht_enabled, + freq->channel, ssid->enable_edmg, + ssid->edmg_channel, freq->ht_enabled, vht_freq.vht_enabled, freq->he_enabled, freq->sec_channel_offset, chwidth, seg0, seg1, vht_caps,