hostapd: Support channel switch to 320 MHz channels
Add validatation of center frequency, and filling of appropriate bandwidth in the channel switch wrapper when the channel switch is done to a 320 MHz channel. Signed-off-by: Ramya Gnanasekar <quic_rgnanase@quicinc.com>
This commit is contained in:
parent
4d0743d5e5
commit
8f8f68ba67
4 changed files with 40 additions and 2 deletions
|
@ -2546,6 +2546,36 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params,
|
|||
return -1;
|
||||
}
|
||||
break;
|
||||
case 320:
|
||||
if (!params->center_freq1 || params->center_freq2 ||
|
||||
!params->sec_channel_offset)
|
||||
return -1;
|
||||
|
||||
switch (params->sec_channel_offset) {
|
||||
case 1:
|
||||
if (params->freq + 150 != params->center_freq1 &&
|
||||
params->freq + 110 != params->center_freq1 &&
|
||||
params->freq + 70 != params->center_freq1 &&
|
||||
params->freq + 30 != params->center_freq1 &&
|
||||
params->freq - 10 != params->center_freq1 &&
|
||||
params->freq - 50 != params->center_freq1 &&
|
||||
params->freq - 90 != params->center_freq1 &&
|
||||
params->freq - 130 != params->center_freq1)
|
||||
return -1;
|
||||
break;
|
||||
case -1:
|
||||
if (params->freq + 130 != params->center_freq1 &&
|
||||
params->freq + 90 != params->center_freq1 &&
|
||||
params->freq + 50 != params->center_freq1 &&
|
||||
params->freq + 10 != params->center_freq1 &&
|
||||
params->freq - 30 != params->center_freq1 &&
|
||||
params->freq - 70 != params->center_freq1 &&
|
||||
params->freq - 110 != params->center_freq1 &&
|
||||
params->freq - 150 != params->center_freq1)
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -978,7 +978,8 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
|
|||
hapd->iconf->ch_switch_eht_config = 0;
|
||||
|
||||
if (width == CHAN_WIDTH_40 || width == CHAN_WIDTH_80 ||
|
||||
width == CHAN_WIDTH_80P80 || width == CHAN_WIDTH_160)
|
||||
width == CHAN_WIDTH_80P80 || width == CHAN_WIDTH_160 ||
|
||||
width == CHAN_WIDTH_320)
|
||||
hapd->iconf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
|
||||
else if (width == CHAN_WIDTH_20 || width == CHAN_WIDTH_20_NOHT)
|
||||
hapd->iconf->ht_capab &= ~HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
|
||||
|
|
|
@ -3601,6 +3601,7 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
|
|||
case 40:
|
||||
case 80:
|
||||
case 160:
|
||||
case 320:
|
||||
conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
|
||||
break;
|
||||
default:
|
||||
|
@ -3673,6 +3674,9 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd,
|
|||
case 160:
|
||||
bandwidth = CONF_OPER_CHWIDTH_160MHZ;
|
||||
break;
|
||||
case 320:
|
||||
bandwidth = CONF_OPER_CHWIDTH_320MHZ;
|
||||
break;
|
||||
default:
|
||||
bandwidth = CONF_OPER_CHWIDTH_USE_HT;
|
||||
break;
|
||||
|
|
|
@ -6347,7 +6347,7 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
|
|||
!hapd->cs_freq_params.eht_enabled))
|
||||
return eid;
|
||||
|
||||
/* bandwidth: 0: 40, 1: 80, 2: 160, 3: 80+80 */
|
||||
/* bandwidth: 0: 40, 1: 80, 2: 160, 3: 80+80, 4: 320 */
|
||||
switch (hapd->cs_freq_params.bandwidth) {
|
||||
case 40:
|
||||
bw = 0;
|
||||
|
@ -6362,6 +6362,9 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
|
|||
case 160:
|
||||
bw = 2;
|
||||
break;
|
||||
case 320:
|
||||
bw = 4;
|
||||
break;
|
||||
default:
|
||||
/* not valid VHT bandwidth or not in CSA */
|
||||
return eid;
|
||||
|
|
Loading…
Reference in a new issue