Revert "[wpa_supplicant] Cumulative patch from b8491ae5a"
This reverts commit 878cf7bcbf2d7d8f08c3d060b8c5fbfcf0743eda.
Reason for revert: git_master/sdk_phone_armv7-sdk
Change-Id: I6070fc5c1f9c20867f6dfce90e529e35578d572e
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index ac23c2b..79cd00f 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -28,17 +28,17 @@
if (iface->conf->ieee80211n && iface->conf->secondary_channel)
n_chans = 2;
- if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) {
- switch (hostapd_get_oper_chwidth(iface->conf)) {
- case CHANWIDTH_USE_HT:
+ if (iface->conf->ieee80211ac) {
+ switch (iface->conf->vht_oper_chwidth) {
+ case VHT_CHANWIDTH_USE_HT:
break;
- case CHANWIDTH_80MHZ:
+ case VHT_CHANWIDTH_80MHZ:
n_chans = 4;
break;
- case CHANWIDTH_160MHZ:
+ case VHT_CHANWIDTH_160MHZ:
n_chans = 8;
break;
- case CHANWIDTH_80P80MHZ:
+ case VHT_CHANWIDTH_80P80MHZ:
n_chans = 4;
*seg1 = 4;
break;
@@ -188,8 +188,8 @@
* The function assumes HT40+ operation.
* Make sure to adjust the following variables after calling this:
* - hapd->secondary_channel
- * - hapd->vht/he_oper_centr_freq_seg0_idx
- * - hapd->vht/he_oper_centr_freq_seg1_idx
+ * - hapd->vht_oper_centr_freq_seg0_idx
+ * - hapd->vht_oper_centr_freq_seg1_idx
*/
static int dfs_find_channel(struct hostapd_iface *iface,
struct hostapd_channel_data **ret_chan,
@@ -232,44 +232,44 @@
}
-static void dfs_adjust_center_freq(struct hostapd_iface *iface,
- struct hostapd_channel_data *chan,
- int secondary_channel,
- u8 *oper_centr_freq_seg0_idx,
- u8 *oper_centr_freq_seg1_idx)
+static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface,
+ struct hostapd_channel_data *chan,
+ int secondary_channel,
+ u8 *vht_oper_centr_freq_seg0_idx,
+ u8 *vht_oper_centr_freq_seg1_idx)
{
- if (!iface->conf->ieee80211ac && !iface->conf->ieee80211ax)
+ if (!iface->conf->ieee80211ac)
return;
if (!chan)
return;
- *oper_centr_freq_seg1_idx = 0;
+ *vht_oper_centr_freq_seg1_idx = 0;
- switch (hostapd_get_oper_chwidth(iface->conf)) {
- case CHANWIDTH_USE_HT:
+ switch (iface->conf->vht_oper_chwidth) {
+ case VHT_CHANWIDTH_USE_HT:
if (secondary_channel == 1)
- *oper_centr_freq_seg0_idx = chan->chan + 2;
+ *vht_oper_centr_freq_seg0_idx = chan->chan + 2;
else if (secondary_channel == -1)
- *oper_centr_freq_seg0_idx = chan->chan - 2;
+ *vht_oper_centr_freq_seg0_idx = chan->chan - 2;
else
- *oper_centr_freq_seg0_idx = chan->chan;
+ *vht_oper_centr_freq_seg0_idx = chan->chan;
break;
- case CHANWIDTH_80MHZ:
- *oper_centr_freq_seg0_idx = chan->chan + 6;
+ case VHT_CHANWIDTH_80MHZ:
+ *vht_oper_centr_freq_seg0_idx = chan->chan + 6;
break;
- case CHANWIDTH_160MHZ:
- *oper_centr_freq_seg0_idx = chan->chan + 14;
+ case VHT_CHANWIDTH_160MHZ:
+ *vht_oper_centr_freq_seg0_idx = chan->chan + 14;
break;
default:
wpa_printf(MSG_INFO, "DFS only VHT20/40/80/160 is supported now");
- *oper_centr_freq_seg0_idx = 0;
+ *vht_oper_centr_freq_seg0_idx = 0;
break;
}
wpa_printf(MSG_DEBUG, "DFS adjusting VHT center frequency: %d, %d",
- *oper_centr_freq_seg0_idx,
- *oper_centr_freq_seg1_idx);
+ *vht_oper_centr_freq_seg0_idx,
+ *vht_oper_centr_freq_seg1_idx);
}
@@ -288,24 +288,24 @@
if (iface->conf->ieee80211n && iface->conf->secondary_channel == -1)
channel_no -= 4;
- /* VHT/HE */
- if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) {
- switch (hostapd_get_oper_chwidth(iface->conf)) {
- case CHANWIDTH_USE_HT:
+ /* VHT */
+ if (iface->conf->ieee80211ac) {
+ switch (iface->conf->vht_oper_chwidth) {
+ case VHT_CHANWIDTH_USE_HT:
break;
- case CHANWIDTH_80MHZ:
- channel_no = hostapd_get_oper_centr_freq_seg0_idx(
- iface->conf) - 6;
+ case VHT_CHANWIDTH_80MHZ:
+ channel_no =
+ iface->conf->vht_oper_centr_freq_seg0_idx - 6;
break;
- case CHANWIDTH_160MHZ:
- channel_no = hostapd_get_oper_centr_freq_seg0_idx(
- iface->conf) - 14;
+ case VHT_CHANWIDTH_160MHZ:
+ channel_no =
+ iface->conf->vht_oper_centr_freq_seg0_idx - 14;
break;
- case CHANWIDTH_80P80MHZ:
- channel_no = hostapd_get_oper_centr_freq_seg0_idx(
- iface->conf) - 6;
- chan_seg1 = hostapd_get_oper_centr_freq_seg1_idx(
- iface->conf) - 6;
+ case VHT_CHANWIDTH_80P80MHZ:
+ channel_no =
+ iface->conf->vht_oper_centr_freq_seg0_idx - 6;
+ chan_seg1 =
+ iface->conf->vht_oper_centr_freq_seg1_idx - 6;
break;
default:
wpa_printf(MSG_INFO,
@@ -348,7 +348,7 @@
mode->num_channels, channel_no, iface->conf->channel,
iface->conf->ieee80211n,
iface->conf->secondary_channel,
- hostapd_get_oper_chwidth(iface->conf));
+ iface->conf->vht_oper_chwidth);
for (i = 0; i < mode->num_channels; i++) {
wpa_printf(MSG_DEBUG, "Available channel: %d",
@@ -435,8 +435,8 @@
static struct hostapd_channel_data *
dfs_get_valid_channel(struct hostapd_iface *iface,
int *secondary_channel,
- u8 *oper_centr_freq_seg0_idx,
- u8 *oper_centr_freq_seg1_idx,
+ u8 *vht_oper_centr_freq_seg0_idx,
+ u8 *vht_oper_centr_freq_seg1_idx,
int skip_radar)
{
struct hostapd_hw_modes *mode;
@@ -447,8 +447,8 @@
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
*secondary_channel = 0;
- *oper_centr_freq_seg0_idx = 0;
- *oper_centr_freq_seg1_idx = 0;
+ *vht_oper_centr_freq_seg0_idx = 0;
+ *vht_oper_centr_freq_seg1_idx = 0;
if (iface->current_mode == NULL)
return NULL;
@@ -473,10 +473,10 @@
else
*secondary_channel = 0;
- dfs_adjust_center_freq(iface, chan,
- *secondary_channel,
- oper_centr_freq_seg0_idx,
- oper_centr_freq_seg1_idx);
+ dfs_adjust_vht_center_freq(iface, chan,
+ *secondary_channel,
+ vht_oper_centr_freq_seg0_idx,
+ vht_oper_centr_freq_seg1_idx);
return chan;
}
@@ -724,8 +724,8 @@
iface->freq = channel->freq;
iface->conf->channel = channel->chan;
iface->conf->secondary_channel = sec;
- hostapd_set_oper_centr_freq_seg0_idx(iface->conf, cf1);
- hostapd_set_oper_centr_freq_seg1_idx(iface->conf, cf2);
+ iface->conf->vht_oper_centr_freq_seg0_idx = cf1;
+ iface->conf->vht_oper_centr_freq_seg1_idx = cf2;
}
} while (res);
@@ -736,19 +736,20 @@
"freq=%d chan=%d sec_chan=%d, width=%d, seg0=%d, seg1=%d, cac_time=%ds",
iface->freq,
iface->conf->channel, iface->conf->secondary_channel,
- hostapd_get_oper_chwidth(iface->conf),
- hostapd_get_oper_centr_freq_seg0_idx(iface->conf),
- hostapd_get_oper_centr_freq_seg1_idx(iface->conf),
+ iface->conf->vht_oper_chwidth,
+ iface->conf->vht_oper_centr_freq_seg0_idx,
+ iface->conf->vht_oper_centr_freq_seg1_idx,
iface->dfs_cac_ms / 1000);
- res = hostapd_start_dfs_cac(
- iface, iface->conf->hw_mode, iface->freq, iface->conf->channel,
- iface->conf->ieee80211n, iface->conf->ieee80211ac,
- iface->conf->ieee80211ax,
- iface->conf->secondary_channel,
- hostapd_get_oper_chwidth(iface->conf),
- hostapd_get_oper_centr_freq_seg0_idx(iface->conf),
- hostapd_get_oper_centr_freq_seg1_idx(iface->conf));
+ res = hostapd_start_dfs_cac(iface, iface->conf->hw_mode,
+ iface->freq,
+ iface->conf->channel,
+ iface->conf->ieee80211n,
+ iface->conf->ieee80211ac,
+ iface->conf->secondary_channel,
+ iface->conf->vht_oper_chwidth,
+ iface->conf->vht_oper_centr_freq_seg0_idx,
+ iface->conf->vht_oper_centr_freq_seg1_idx);
if (res) {
wpa_printf(MSG_ERROR, "DFS start_dfs_cac() failed, %d", res);
@@ -841,16 +842,16 @@
{
struct hostapd_channel_data *channel;
int secondary_channel;
- u8 oper_centr_freq_seg0_idx = 0;
- u8 oper_centr_freq_seg1_idx = 0;
+ u8 vht_oper_centr_freq_seg0_idx = 0;
+ u8 vht_oper_centr_freq_seg1_idx = 0;
int skip_radar = 0;
int err = 1;
/* Radar detected during active CAC */
iface->cac_started = 0;
channel = dfs_get_valid_channel(iface, &secondary_channel,
- &oper_centr_freq_seg0_idx,
- &oper_centr_freq_seg1_idx,
+ &vht_oper_centr_freq_seg0_idx,
+ &vht_oper_centr_freq_seg1_idx,
skip_radar);
if (!channel) {
@@ -867,10 +868,10 @@
iface->freq = channel->freq;
iface->conf->channel = channel->chan;
iface->conf->secondary_channel = secondary_channel;
- hostapd_set_oper_centr_freq_seg0_idx(iface->conf,
- oper_centr_freq_seg0_idx);
- hostapd_set_oper_centr_freq_seg1_idx(iface->conf,
- oper_centr_freq_seg1_idx);
+ iface->conf->vht_oper_centr_freq_seg0_idx =
+ vht_oper_centr_freq_seg0_idx;
+ iface->conf->vht_oper_centr_freq_seg1_idx =
+ vht_oper_centr_freq_seg1_idx;
err = 0;
hostapd_setup_interface_complete(iface, err);
@@ -882,13 +883,12 @@
{
struct hostapd_channel_data *channel;
int secondary_channel;
- u8 oper_centr_freq_seg0_idx;
- u8 oper_centr_freq_seg1_idx;
+ u8 vht_oper_centr_freq_seg0_idx;
+ u8 vht_oper_centr_freq_seg1_idx;
int skip_radar = 1;
struct csa_settings csa_settings;
unsigned int i;
int err = 1;
- struct hostapd_hw_modes *cmode = iface->current_mode;
wpa_printf(MSG_DEBUG, "%s called (CAC active: %s, CSA active: %s)",
__func__, iface->cac_started ? "yes" : "no",
@@ -911,8 +911,8 @@
/* Perform channel switch/CSA */
channel = dfs_get_valid_channel(iface, &secondary_channel,
- &oper_centr_freq_seg0_idx,
- &oper_centr_freq_seg1_idx,
+ &vht_oper_centr_freq_seg0_idx,
+ &vht_oper_centr_freq_seg1_idx,
skip_radar);
if (!channel) {
@@ -923,8 +923,8 @@
*/
skip_radar = 0;
channel = dfs_get_valid_channel(iface, &secondary_channel,
- &oper_centr_freq_seg0_idx,
- &oper_centr_freq_seg1_idx,
+ &vht_oper_centr_freq_seg0_idx,
+ &vht_oper_centr_freq_seg1_idx,
skip_radar);
if (!channel) {
wpa_printf(MSG_INFO,
@@ -936,10 +936,10 @@
iface->freq = channel->freq;
iface->conf->channel = channel->chan;
iface->conf->secondary_channel = secondary_channel;
- hostapd_set_oper_centr_freq_seg0_idx(iface->conf,
- oper_centr_freq_seg0_idx);
- hostapd_set_oper_centr_freq_seg1_idx(iface->conf,
- oper_centr_freq_seg1_idx);
+ iface->conf->vht_oper_centr_freq_seg0_idx =
+ vht_oper_centr_freq_seg0_idx;
+ iface->conf->vht_oper_centr_freq_seg1_idx =
+ vht_oper_centr_freq_seg1_idx;
hostapd_disable_iface(iface);
hostapd_enable_iface(iface);
@@ -962,13 +962,11 @@
channel->chan,
iface->conf->ieee80211n,
iface->conf->ieee80211ac,
- iface->conf->ieee80211ax,
secondary_channel,
- hostapd_get_oper_chwidth(iface->conf),
- oper_centr_freq_seg0_idx,
- oper_centr_freq_seg1_idx,
- cmode->vht_capab,
- &cmode->he_capab[IEEE80211_MODE_AP]);
+ iface->conf->vht_oper_chwidth,
+ vht_oper_centr_freq_seg0_idx,
+ vht_oper_centr_freq_seg1_idx,
+ iface->current_mode->vht_capab);
if (err) {
wpa_printf(MSG_ERROR, "DFS failed to calculate CSA freq params");
@@ -988,10 +986,10 @@
iface->freq = channel->freq;
iface->conf->channel = channel->chan;
iface->conf->secondary_channel = secondary_channel;
- hostapd_set_oper_centr_freq_seg0_idx(iface->conf,
- oper_centr_freq_seg0_idx);
- hostapd_set_oper_centr_freq_seg1_idx(iface->conf,
- oper_centr_freq_seg1_idx);
+ iface->conf->vht_oper_centr_freq_seg0_idx =
+ vht_oper_centr_freq_seg0_idx;
+ iface->conf->vht_oper_centr_freq_seg1_idx =
+ vht_oper_centr_freq_seg1_idx;
hostapd_disable_iface(iface);
hostapd_enable_iface(iface);