Skip to content
Snippets Groups Projects
Commit 84328dba authored by Janusz Dziedzic's avatar Janusz Dziedzic
Browse files

add 6GHz support

parent d9ef37a9
No related branches found
No related tags found
2 merge requests!137intruduce wifi_opclass,!129add 6GHz support
Pipeline #54707 passed
......@@ -608,6 +608,8 @@ struct cmdu_buff *cntlr_gen_ap_autoconfig_wsc(struct controller *c,
strcpy(band, "2");
if (e_band == BAND_5)
strcpy(band, "5");
if (e_band == BAND_6)
strcpy(band, "6");
cntlr_config_add_agent_radio(&c->cfg, alidstr, macstr, band);
cntlr_resync_config(c, true);
......
......@@ -608,9 +608,11 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rx_cmdu)
}
freq = (struct tlv_autoconfig_band *)tv[2][0]->data;
if (freq->band > IEEE80211_FREQUENCY_BAND_60_GHZ) {
trace("%s: Discard ap-autoconfig search for invalid WiFi band\n",
__func__);
if (freq->band != IEEE80211_FREQUENCY_BAND_2_4_GHZ &&
freq->band != IEEE80211_FREQUENCY_BAND_5_GHZ &&
freq->band != IEEE80211_FREQUENCY_BAND_6_GHZ) {
trace("%s: Discard ap-autoconfig search for invalid WiFi band %d\n",
__func__, freq->band);
return -1;
}
......@@ -620,11 +622,25 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rx_cmdu)
} else if (freq->band == IEEE80211_FREQUENCY_BAND_5_GHZ) {
if (!c->cfg.has_registrar_5g)
return -1;
} else if (freq->band == IEEE80211_FREQUENCY_BAND_6_GHZ) {
if (!c->cfg.has_registrar_6g)
return -1;
} else
return -1;
snprintf(freq_band, sizeof(freq_band), "%s",
(freq->band == IEEE80211_FREQUENCY_BAND_2_4_GHZ) ? "2" : "5");
switch (freq->band) {
case IEEE80211_FREQUENCY_BAND_2_4_GHZ:
sprintf(freq_band, "%d", 2);
break;
case IEEE80211_FREQUENCY_BAND_5_GHZ:
sprintf(freq_band, "%d", 5);
break;
case IEEE80211_FREQUENCY_BAND_6_GHZ:
sprintf(freq_band, "%d", 6);
break;
default:
return -1;
}
/* if supports agent, add to config */
for (i = 1; i <= tv[3][0]->data[0]; i++) {
......
......@@ -36,6 +36,7 @@
#include "cntlr.h"
#include "config.h"
#define CONFIG_DEFAULT_RCPI_TH_6G 86
#define CONFIG_DEFAULT_RCPI_TH_5G 86
#define CONFIG_DEFAULT_RCPI_TH_2G 70
......@@ -576,6 +577,7 @@ static int cntlr_config_get_base(struct controller_config *c,
if (tb[CNTLR_REGISTRAR]) {
const char *val = tb[CNTLR_REGISTRAR]->v.string;
c->has_registrar_6g = !strstr(val, "6") ? false : true;
c->has_registrar_5g = !strstr(val, "5") ? false : true;
c->has_registrar_2g = !strstr(val, "2") ? false : true;
}
......@@ -798,6 +800,8 @@ static int cntlr_config_get_credentials(struct controller_config *c,
cred->band = BAND_5;
else if (atoi(tb[CRED_BAND]->v.string) == 2)
cred->band = BAND_2;
else if (atoi(tb[CRED_BAND]->v.string) == 6)
cred->band = BAND_6;
else
cred->band = BAND_UNKNOWN;
} else
......@@ -1085,6 +1089,9 @@ static int cntlr_config_get_agent_radio(struct controller_config *c,
} else if (atoi(tb[RADIO_BAND]->v.string) == 2) {
a->band = BAND_2;
a->rcpi_threshold = CONFIG_DEFAULT_RCPI_TH_2G;
} else if (atoi(tb[RADIO_BAND]->v.string) == 6) {
a->band = BAND_6;
a->rcpi_threshold = CONFIG_DEFAULT_RCPI_TH_6G;
} else
a->band = BAND_UNKNOWN;
......
......@@ -116,6 +116,7 @@ struct steer_control_config {
struct controller_config {
bool enabled;
bool has_registrar_6g;
bool has_registrar_5g;
bool has_registrar_2g;
int debug_level;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment