6 GHz: Fix Channel Width value for 80+80 in 6 GHZ Operation Info field

The Channel Width field value is 0 for 20 MHz, 1 for 40 MHz, 2 for 80
MHz, and 3 for both 160 MHz and 80+80 MHz channels. The 80+80 MHz case
was not addressed previously correctly since it cannot be derived from
seg0 only.

The Channel Center Frequency Segment 0 field value is the index of
channel center frequency for 20 MHz, 40 MHz, and 80 MHz channels. The
value is the center frequency index of the primary 80 MHz segment for
160 MHz and 80+80 MHz channels.

The Channel Center Frequency Segment 1 field value is zero for 20 MHz,
40 MHz, and 80 MHz channels. The value is the index of the channel
center frequency for 160 MHz channel and the center frequency index of
the secondary 80 MHz segment for 80+80 MHz channels.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Vamsi Krishna 2019-12-24 17:32:29 +05:30 committed by Jouni Malinen
parent b4fe37c4fa
commit 881177201a

View file

@ -206,17 +206,25 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid)
if (is_6ghz_op_class(hapd->iconf->op_class)) { if (is_6ghz_op_class(hapd->iconf->op_class)) {
u8 seg0 = hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf); u8 seg0 = hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf);
u8 seg1 = hostapd_get_oper_centr_freq_seg1_idx(hapd->iconf);
if (!seg0) if (!seg0)
seg0 = hapd->iconf->channel; seg0 = hapd->iconf->channel;
params |= HE_OPERATION_6GHZ_OPER_INFO; params |= HE_OPERATION_6GHZ_OPER_INFO;
/* 6 GHz Operation Information field */
*pos++ = hapd->iconf->channel; /* Primary Channel */ *pos++ = hapd->iconf->channel; /* Primary Channel */
*pos++ = center_idx_to_bw_6ghz(seg0); /* Control: Channel Width
*/ /* Control: Channel Width */
/* Channel Center Freq Seg0/Seg0 */ if (seg1)
*pos++ = 3;
else
*pos++ = center_idx_to_bw_6ghz(seg0);
/* Channel Center Freq Seg0/Seg1 */
*pos++ = seg0; *pos++ = seg0;
*pos++ = hostapd_get_oper_centr_freq_seg1_idx(hapd->iconf); *pos++ = seg1;
/* Minimum Rate */ /* Minimum Rate */
*pos++ = 6; /* TODO: what should be set here? */ *pos++ = 6; /* TODO: what should be set here? */
} }