Skip to content

Commit 36e05b0

Browse files
ilanpeer2jmberg-intel
authored andcommitted
wifi: mac80211: Support dynamic link addition and removal
Add support for adding and removing station links: - Adding links is done asynchronously, i.e., first an ML reconfiguration action frame is sent to the AP requesting to add links, and only when the AP replies, links which were added successfully by the AP are added locally. - Removing links is done synchronously, i.e., the links are removed before sending the ML reconfiguration action frame to the AP (to avoid using this links after the AP MLD removed them but before the station got the ML reconfiguration response). In case the AP replies with a status indicating that a link removal was not successful, disconnect (as this should not happen an is an indication that something might be wrong on the AP MLD). Signed-off-by: Ilan Peer <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250102161730.ec0492a8dd21.I2869686642bbc0f86c40f284ebf7e6f644b551ab@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent fa2b73b commit 36e05b0

File tree

6 files changed

+811
-1
lines changed

6 files changed

+811
-1
lines changed

include/linux/ieee80211.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,17 @@ struct ieee80211_mgmt {
15321532
struct {
15331533
u8 action_code;
15341534
} __packed ttlm_tear_down;
1535+
struct {
1536+
u8 action_code;
1537+
u8 dialog_token;
1538+
u8 variable[];
1539+
} __packed ml_reconf_req;
1540+
struct {
1541+
u8 action_code;
1542+
u8 dialog_token;
1543+
u8 count;
1544+
u8 variable[];
1545+
} __packed ml_reconf_resp;
15351546
} u;
15361547
} __packed action;
15371548
DECLARE_FLEX_ARRAY(u8, body); /* Generic frame body */

net/mac80211/cfg.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5180,6 +5180,18 @@ ieee80211_set_ttlm(struct wiphy *wiphy, struct net_device *dev,
51805180
return ieee80211_req_neg_ttlm(sdata, params);
51815181
}
51825182

5183+
static int
5184+
ieee80211_assoc_ml_reconf(struct wiphy *wiphy, struct net_device *dev,
5185+
struct cfg80211_assoc_link *add_links,
5186+
u16 rem_links)
5187+
{
5188+
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
5189+
5190+
lockdep_assert_wiphy(sdata->local->hw.wiphy);
5191+
5192+
return ieee80211_mgd_assoc_ml_reconf(sdata, add_links, rem_links);
5193+
}
5194+
51835195
const struct cfg80211_ops mac80211_config_ops = {
51845196
.add_virtual_intf = ieee80211_add_iface,
51855197
.del_virtual_intf = ieee80211_del_iface,
@@ -5294,4 +5306,5 @@ const struct cfg80211_ops mac80211_config_ops = {
52945306
.set_hw_timestamp = ieee80211_set_hw_timestamp,
52955307
.set_ttlm = ieee80211_set_ttlm,
52965308
.get_radio_mask = ieee80211_get_radio_mask,
5309+
.assoc_ml_reconf = ieee80211_assoc_ml_reconf,
52975310
};

net/mac80211/ieee80211_i.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,15 @@ struct ieee80211_if_managed {
606606
/* dialog token enumerator for neg TTLM request */
607607
u8 dialog_token_alloc;
608608
struct wiphy_delayed_work neg_ttlm_timeout_work;
609+
610+
/* Locally initiated multi-link reconfiguration */
611+
struct {
612+
struct ieee80211_mgd_assoc_data *add_links_data;
613+
struct wiphy_delayed_work wk;
614+
u16 removed_links;
615+
u16 added_links;
616+
u8 dialog_token;
617+
} reconf;
609618
};
610619

611620
struct ieee80211_if_ibss {
@@ -2768,6 +2777,12 @@ void ieee80211_check_wbrf_support(struct ieee80211_local *local);
27682777
void ieee80211_add_wbrf(struct ieee80211_local *local, struct cfg80211_chan_def *chandef);
27692778
void ieee80211_remove_wbrf(struct ieee80211_local *local, struct cfg80211_chan_def *chandef);
27702779

2780+
int ieee80211_mgd_assoc_ml_reconf(struct ieee80211_sub_if_data *sdata,
2781+
struct cfg80211_assoc_link *add_links,
2782+
u16 rem_links);
2783+
2784+
void ieee80211_process_ml_reconf_resp(struct ieee80211_sub_if_data *sdata,
2785+
struct ieee80211_mgmt *mgmt, size_t len);
27712786
#if IS_ENABLED(CONFIG_MAC80211_KUNIT_TEST)
27722787
#define EXPORT_SYMBOL_IF_MAC80211_KUNIT(sym) EXPORT_SYMBOL_IF_KUNIT(sym)
27732788
#define VISIBLE_IF_MAC80211_KUNIT

net/mac80211/iface.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,10 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local,
15601560
ieee80211_process_neg_ttlm_res(sdata, mgmt,
15611561
skb->len);
15621562
break;
1563+
case WLAN_PROTECTED_EHT_ACTION_LINK_RECONFIG_RESP:
1564+
ieee80211_process_ml_reconf_resp(sdata, mgmt,
1565+
skb->len);
1566+
break;
15631567
default:
15641568
break;
15651569
}

0 commit comments

Comments
 (0)