developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 1 | From 4be307ebbc6b94b6a334855a9efe633d77ca98fe Mon Sep 17 00:00:00 2001 |
| 2 | From: Sriram R <quic_srirrama@quicinc.com> |
| 3 | Date: Thu, 28 Mar 2024 23:46:44 +0530 |
| 4 | Subject: [PATCH 014/104] hostapd: MLO: update all partner's link beacon |
| 5 | |
| 6 | Whenever there is a beacon update of any one of the link, all its other |
| 7 | partner's link beacon should be refreshed. |
| 8 | |
| 9 | Add changes to update all partner's link beacon. |
| 10 | |
| 11 | Signed-off-by: Sriram R <quic_srirrama@quicinc.com> |
| 12 | Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com> |
| 13 | --- |
| 14 | src/ap/beacon.c | 27 +++++++++++++++++++-------- |
| 15 | 1 file changed, 19 insertions(+), 8 deletions(-) |
| 16 | |
| 17 | diff --git a/src/ap/beacon.c b/src/ap/beacon.c |
| 18 | index 195c7bbd9..b780d98e4 100644 |
| 19 | --- a/src/ap/beacon.c |
| 20 | +++ b/src/ap/beacon.c |
| 21 | @@ -2648,7 +2648,7 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd) |
| 22 | struct hostapd_iface *iface = hapd->iface; |
| 23 | int ret; |
| 24 | size_t i, j; |
| 25 | - bool is_6g; |
| 26 | + bool is_6g, hapd_mld = false; |
| 27 | |
| 28 | ret = __ieee802_11_set_beacon(hapd); |
| 29 | if (ret != 0) |
| 30 | @@ -2657,26 +2657,37 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd) |
| 31 | if (!iface->interfaces || iface->interfaces->count <= 1) |
| 32 | return 0; |
| 33 | |
| 34 | +#ifdef CONFIG_IEEE80211BE |
| 35 | + hapd_mld = hapd->conf->mld_ap; |
| 36 | +#endif /* CONFIG_IEEE80211BE */ |
| 37 | + |
| 38 | /* Update Beacon frames in case of 6 GHz colocation or AP MLD */ |
| 39 | is_6g = is_6ghz_op_class(iface->conf->op_class); |
| 40 | for (j = 0; j < iface->interfaces->count; j++) { |
| 41 | struct hostapd_iface *other; |
| 42 | - bool mld_ap = false; |
| 43 | + bool other_iface_6g; |
| 44 | |
| 45 | other = iface->interfaces->iface[j]; |
| 46 | if (other == iface || !other || !other->conf) |
| 47 | continue; |
| 48 | |
| 49 | -#ifdef CONFIG_IEEE80211BE |
| 50 | - if (hostapd_is_ml_partner(hapd, other->bss[0])) |
| 51 | - mld_ap = true; |
| 52 | -#endif /* CONFIG_IEEE80211BE */ |
| 53 | + other_iface_6g = is_6ghz_op_class(other->conf->op_class); |
| 54 | |
| 55 | - if (is_6g == is_6ghz_op_class(other->conf->op_class) && |
| 56 | - !mld_ap) |
| 57 | + if (is_6g == other_iface_6g && !hapd_mld) |
| 58 | continue; |
| 59 | |
| 60 | for (i = 0; i < other->num_bss; i++) { |
| 61 | +#ifdef CONFIG_IEEE80211BE |
| 62 | + bool mld_ap = false; |
| 63 | + |
| 64 | + if (hapd_mld && other->bss[i]->conf->mld_ap && |
| 65 | + hostapd_is_ml_partner(hapd, other->bss[i])) |
| 66 | + mld_ap = true; |
| 67 | + |
| 68 | + if (is_6g == other_iface_6g && !mld_ap) |
| 69 | + continue; |
| 70 | +#endif /* CONFIG_IEEE80211BE */ |
| 71 | + |
| 72 | if (other->bss[i] && other->bss[i]->started) |
| 73 | __ieee802_11_set_beacon(other->bss[i]); |
| 74 | } |
| 75 | -- |
| 76 | 2.39.2 |
| 77 | |