Skip to content

Commit

Permalink
wifi: mac80211: handle sdata->u.ap.active flag with MLO
Browse files Browse the repository at this point in the history
Currently whenever link AP beacon is assigned, sdata->u.ap.active flag is
set and whenever it is brought down, the flag is reset. However, with MLO,
all the links of the same MLD would use the same sdata. Hence there is no
need to set/reset for each link up/down. Also, resetting it  when only one
of the links went down is not desirable.

Add changes to set the active flag only when first link is assigned
beacon. Similarly, add changes to reset that flag only when last link is
brought down.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://msgid.link/20240409094017.3165560-1-quic_adisi@quicinc.com
[remove unnecessary check before constant true assignment]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Aditya Kumar Singh authored and Johannes Berg committed Apr 19, 2024
1 parent 2bf78f0 commit 6d4ed5b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
if (old)
kfree_rcu(old, rcu_head);
RCU_INIT_POINTER(link->u.ap.beacon, NULL);
sdata->u.ap.active = false;

if (ieee80211_num_beaconing_links(sdata) == 0)
sdata->u.ap.active = false;

goto error;
}

Expand Down Expand Up @@ -1619,11 +1622,12 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
netif_carrier_off(vlan->dev);

if (ieee80211_num_beaconing_links(sdata) <= 1)
if (ieee80211_num_beaconing_links(sdata) <= 1) {
netif_carrier_off(dev);
sdata->u.ap.active = false;
}

/* remove beacon and probe response */
sdata->u.ap.active = false;
RCU_INIT_POINTER(link->u.ap.beacon, NULL);
RCU_INIT_POINTER(link->u.ap.probe_resp, NULL);
RCU_INIT_POINTER(link->u.ap.fils_discovery, NULL);
Expand Down

0 comments on commit 6d4ed5b

Please sign in to comment.