}
+static void hostapd_set_6ghz_sec_chan(struct hostapd_iface *iface)
+{
+ int bw, seg0;
+
+ if (!is_6ghz_op_class(iface->conf->op_class))
+ return;
+
+ seg0 = hostapd_get_oper_centr_freq_seg0_idx(iface->conf);
+ bw = center_idx_to_bw_6ghz(seg0);
+ /* Assign the secondary channel if absent in config for
+ * bandwidths > 20 MHz */
+ if (bw > 20 && !iface->conf->secondary_channel) {
+ if (((iface->conf->channel - 1) / 4) % 2)
+ iface->conf->secondary_channel = -1;
+ else
+ iface->conf->secondary_channel = 1;
+ }
+}
+
+
static int setup_interface2(struct hostapd_iface *iface)
{
iface->wait_channel_update = 0;
ch_width = op_class_to_ch_width(iface->conf->op_class);
hostapd_set_oper_chwidth(iface->conf, ch_width);
+ hostapd_set_6ghz_sec_chan(iface);
}
ret = hostapd_select_hw_mode(iface);