mesh: Enable 160 MHz bandwidth support for 6 GHz in IEEE 802.11s mesh
Since the 6 GHz band has no DFS channels, enable 6 GHz 160 MHz bandwidth as the default configuration for IEEE 802.11s mesh. example: network={ ssid="6gmesh160" key_mgmt=SAE mode=5 frequency=6275 psk="1234567890" } Signed-off-by: P Praneesh <ppranees@codeaurora.org> Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
This commit is contained in:
parent
ab0af709df
commit
c8b94bc7b3
1 changed files with 40 additions and 11 deletions
|
@ -2409,6 +2409,23 @@ static int drv_supports_vht(struct wpa_supplicant *wpa_s,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = channel; i < channel + 16; i += 4) {
|
||||||
|
struct hostapd_channel_data *chan;
|
||||||
|
|
||||||
|
chan = hw_get_channel_chan(mode, i, NULL);
|
||||||
|
if (!chan ||
|
||||||
|
chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
|
void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
|
||||||
const struct wpa_ssid *ssid,
|
const struct wpa_ssid *ssid,
|
||||||
struct hostapd_freq_params *freq)
|
struct hostapd_freq_params *freq)
|
||||||
|
@ -2421,6 +2438,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
|
||||||
int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955,
|
int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955,
|
||||||
6035, 6115, 6195, 6275, 6355, 6435, 6515,
|
6035, 6115, 6195, 6275, 6355, 6435, 6515,
|
||||||
6595, 6675, 6755, 6835, 6915, 6995 };
|
6595, 6675, 6755, 6835, 6915, 6995 };
|
||||||
|
int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 };
|
||||||
struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
|
struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
|
||||||
u8 channel;
|
u8 channel;
|
||||||
int i, chan_idx, ht40 = -1, res, obss_scan = 1;
|
int i, chan_idx, ht40 = -1, res, obss_scan = 1;
|
||||||
|
@ -2648,22 +2666,33 @@ skip_to_6ghz:
|
||||||
ieee80211_freq_to_chan(bw80[j], &channel) == NUM_HOSTAPD_MODES)
|
ieee80211_freq_to_chan(bw80[j], &channel) == NUM_HOSTAPD_MODES)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = channel; i < channel + 16; i += 4) {
|
/* Back to HT configuration if channel not usable */
|
||||||
struct hostapd_channel_data *chan;
|
if (!ibss_mesh_is_80mhz_avail(channel, mode))
|
||||||
|
return;
|
||||||
chan = hw_get_channel_chan(mode, i, NULL);
|
|
||||||
if (!chan)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Back to HT configuration if channel not usable */
|
|
||||||
if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
chwidth = CHANWIDTH_80MHZ;
|
chwidth = CHANWIDTH_80MHZ;
|
||||||
seg0 = channel + 6;
|
seg0 = channel + 6;
|
||||||
seg1 = 0;
|
seg1 = 0;
|
||||||
|
|
||||||
|
if ((mode->he_capab[ieee80211_mode].phy_cap[
|
||||||
|
HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] &
|
||||||
|
HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G) && is_6ghz) {
|
||||||
|
/* In 160 MHz, the initial four 20 MHz channels were validated
|
||||||
|
* above; check the remaining four 20 MHz channels for the total
|
||||||
|
* of 160 MHz bandwidth.
|
||||||
|
*/
|
||||||
|
if (!ibss_mesh_is_80mhz_avail(channel + 16, mode))
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (j = 0; j < ARRAY_SIZE(bw160); j++) {
|
||||||
|
if (freq->freq == bw160[j]) {
|
||||||
|
chwidth = CHANWIDTH_160MHZ;
|
||||||
|
seg0 = channel + 14;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ssid->max_oper_chwidth == CHANWIDTH_80P80MHZ) {
|
if (ssid->max_oper_chwidth == CHANWIDTH_80P80MHZ) {
|
||||||
/* setup center_freq2, bandwidth */
|
/* setup center_freq2, bandwidth */
|
||||||
for (k = 0; k < ARRAY_SIZE(bw80); k++) {
|
for (k = 0; k < ARRAY_SIZE(bw80); k++) {
|
||||||
|
|
Loading…
Reference in a new issue