if (!iface->interfaces || iface->interfaces->count <= 1)
return 0;
- /* Update Beacon frames in case of 6 GHz colocation */
+ /* Update Beacon frames in case of 6 GHz colocation or AP MLD */
is_6g = is_6ghz_op_class(iface->conf->op_class);
for (j = 0; j < iface->interfaces->count; j++) {
- struct hostapd_iface *colocated;
+ struct hostapd_iface *other;
+ bool mld_ap = false;
- colocated = iface->interfaces->iface[j];
- if (colocated == iface || !colocated || !colocated->conf)
+ other = iface->interfaces->iface[j];
+ if (other == iface || !other || !other->conf)
continue;
- if (is_6g == is_6ghz_op_class(colocated->conf->op_class))
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->conf->mld_ap && other->bss[0]->conf->mld_ap &&
+ hapd->conf->mld_id == other->bss[0]->conf->mld_id)
+ mld_ap = true;
+#endif /* CONFIG_IEEE80211BE */
+
+ if (is_6g == is_6ghz_op_class(other->conf->op_class) &&
+ !mld_ap)
continue;
- for (i = 0; i < colocated->num_bss; i++) {
- if (colocated->bss[i] && colocated->bss[i]->started)
- __ieee802_11_set_beacon(colocated->bss[i]);
+ for (i = 0; i < other->num_bss; i++) {
+ if (other->bss[i] && other->bss[i]->started)
+ __ieee802_11_set_beacon(other->bss[i]);
}
}
size_t total_len = 0, len = *current_len;
int tbtt_count = 0;
size_t i, start = 0;
+ bool ap_mld = false;
+
+#ifdef CONFIG_IEEE80211BE
+ ap_mld = !!hapd->conf->mld_ap;
+#endif /* CONFIG_IEEE80211BE */
while (start < hapd->iface->num_bss) {
if (!len ||
tbtt_count >= RNR_TBTT_INFO_COUNT_MAX)
break;
- len += RNR_TBTT_INFO_LEN;
- total_len += RNR_TBTT_INFO_LEN;
+ if (!ap_mld) {
+ len += RNR_TBTT_INFO_LEN;
+ total_len += RNR_TBTT_INFO_LEN;
+ } else {
+ len += RNR_TBTT_INFO_MLD_LEN;
+ total_len += RNR_TBTT_INFO_MLD_LEN;
+ }
tbtt_count++;
}
start = i;
}
-static size_t hostapd_eid_rnr_colocation_len(struct hostapd_data *hapd,
- size_t *current_len)
+static size_t hostapd_eid_rnr_multi_iface_len(struct hostapd_data *hapd,
+ size_t *current_len)
{
struct hostapd_iface *iface;
size_t len = 0;
for (i = 0; i < hapd->iface->interfaces->count; i++) {
iface = hapd->iface->interfaces->iface[i];
+ bool ap_mld = false;
+
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->conf->mld_ap && iface->bss[0]->conf->mld_ap &&
+ hapd->conf->mld_id == iface->bss[0]->conf->mld_id)
+ ap_mld = true;
+#endif /* CONFIG_IEEE80211BE */
if (iface == hapd->iface ||
- !is_6ghz_op_class(iface->conf->op_class))
+ !(is_6ghz_op_class(iface->conf->op_class) || ap_mld))
continue;
len += hostapd_eid_rnr_iface_len(iface->bss[0], hapd,
{
size_t total_len = 0, current_len = 0;
enum colocation_mode mode = get_colocation_mode(hapd);
+ bool ap_mld = false;
+
+#ifdef CONFIG_IEEE80211BE
+ ap_mld = !!hapd->conf->mld_ap;
+#endif /* CONFIG_IEEE80211BE */
switch (type) {
case WLAN_FC_STYPE_BEACON:
/* fallthrough */
case WLAN_FC_STYPE_PROBE_RESP:
- if (mode == COLOCATED_LOWER_BAND)
- total_len += hostapd_eid_rnr_colocation_len(
- hapd, ¤t_len);
+ if (mode == COLOCATED_LOWER_BAND || ap_mld)
+ total_len +=
+ hostapd_eid_rnr_multi_iface_len(hapd,
+ ¤t_len);
if (hapd->conf->rnr && hapd->iface->num_bss > 1 &&
!hapd->iconf->mbssid)
size_t len = *current_len;
u8 *tbtt_count_pos, *eid_start = eid, *size_offset = (eid - len) + 1;
u8 tbtt_count = 0, op_class, channel, bss_param;
+ bool ap_mld = false;
+
+#ifdef CONFIG_IEEE80211BE
+ ap_mld = !!hapd->conf->mld_ap;
+#endif /* CONFIG_IEEE80211BE */
if (!(iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || !iface->freq)
return eid;
}
tbtt_count_pos = eid++;
- *eid++ = RNR_TBTT_INFO_LEN;
+ *eid++ = ap_mld ? RNR_TBTT_INFO_MLD_LEN : RNR_TBTT_INFO_LEN;
*eid++ = op_class;
*eid++ = hapd->iconf->channel;
len += RNR_TBTT_HEADER_LEN;
*eid++ = bss_param;
*eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER - 1;
- len += RNR_TBTT_INFO_LEN;
+
+ if (!ap_mld) {
+ len += RNR_TBTT_INFO_LEN;
+ } else {
+#ifdef CONFIG_IEEE80211BE
+ *eid++ = hapd->conf->mld_id;
+ *eid++ = hapd->mld_link_id | (1 << 4);
+ *eid++ = 0;
+ len += RNR_TBTT_INFO_MLD_LEN;
+#endif /* CONFIG_IEEE80211BE */
+ }
+
tbtt_count += 1;
}
}
-static u8 * hostapd_eid_rnr_colocation(struct hostapd_data *hapd, u8 *eid,
- size_t *current_len)
+static u8 * hostapd_eid_rnr_multi_iface(struct hostapd_data *hapd, u8 *eid,
+ size_t *current_len)
{
struct hostapd_iface *iface;
size_t i;
for (i = 0; i < hapd->iface->interfaces->count; i++) {
iface = hapd->iface->interfaces->iface[i];
+ bool ap_mld = false;
+
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->conf->mld_ap && iface->bss[0]->conf->mld_ap &&
+ hapd->conf->mld_id == iface->bss[0]->conf->mld_id)
+ ap_mld = true;
+#endif /* CONFIG_IEEE80211BE */
if (iface == hapd->iface ||
- !is_6ghz_op_class(iface->conf->op_class))
+ !(is_6ghz_op_class(iface->conf->op_class) || ap_mld))
continue;
eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid,
u8 *eid_start = eid;
size_t current_len = 0;
enum colocation_mode mode = get_colocation_mode(hapd);
+ bool ap_mld = false;
+
+#ifdef CONFIG_IEEE80211BE
+ ap_mld = !!hapd->conf->mld_ap;
+#endif /* CONFIG_IEEE80211BE */
switch (type) {
case WLAN_FC_STYPE_BEACON:
/* fallthrough */
case WLAN_FC_STYPE_PROBE_RESP:
- if (mode == COLOCATED_LOWER_BAND)
- eid = hostapd_eid_rnr_colocation(hapd, eid,
- ¤t_len);
+ if (mode == COLOCATED_LOWER_BAND || ap_mld)
+ eid = hostapd_eid_rnr_multi_iface(hapd, eid,
+ ¤t_len);
if (hapd->conf->rnr && hapd->iface->num_bss > 1 &&
!hapd->iconf->mbssid)
if (hapd->conf->rnr)
rnr_eid = hostapd_eid_nr_db(hapd, rnr_eid, &cur_len);
if (get_colocation_mode(hapd) == COLOCATED_LOWER_BAND)
- rnr_eid = hostapd_eid_rnr_colocation(hapd, rnr_eid,
- &cur_len);
+ rnr_eid = hostapd_eid_rnr_multi_iface(hapd, rnr_eid,
+ &cur_len);
}
return eid;