Skip to content

Commit a94f95f

Browse files
committed
wifi: cfg80211: Add support for link reconfiguration negotiation offload to driver
JIRA: https://issues.redhat.com/browse/RHEL-114891 commit 7c598c6 Author: Kavita Kavita <quic_kkavita@quicinc.com> Date: Wed Jun 4 16:27:57 2025 +0530 wifi: cfg80211: Add support for link reconfiguration negotiation offload to driver In the case of SME-in-driver, the driver can internally choose to update the links based on the AP MLD recommendation and do link reconfiguration negotiation with AP MLD. (e.g., After the driver processing the BSS Transition Management request frame received from the AP MLD with Neighbor Report containing Multi-Link element with recommended links information chooses to do link reconfiguration negotiation with AP MLD). To support this, extend cfg80211_mlo_reconf_add_done() and NL80211_CMD_ASSOC_MLO_RECONF to indicate added links information for driver-initiated link reconfiguration requests. For removed links, the driver indicates links information using the NL80211_CMD_LINKS_REMOVED event for driver-initiated cases, the same as supplicant initiated cases. For the driver-initiated case, cfg80211 will receive link reconfiguration result asynchronously from driver so holding BSSes of the accepted add links is needed in the event path. Also, no need of unhold call for the rejected add link BSSes since there was no hold call happened previously. Once the supplicant receives the NL80211_CMD_ASSOC_MLO_RECONF event, it needs to process the information about newly added links and install per-link group keys (e.g., GTK/IGTK/BIGTK etc.). In case of the SME-in-driver, using a vendor interface etc. to notify the supplicant to initiate a link reconfiguration request and then supplicant sending command to the cfg80211 can lead to race conditions. The correct design to avoid this is that the driver indicates the cfg80211 directly with the results of the link reconfiguration negotiation. Signed-off-by: Kavita Kavita <quic_kkavita@quicinc.com> Link: https://patch.msgid.link/20250604105757.2542-3-quic_kkavita@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
1 parent a55d0e6 commit a94f95f

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

include/net/cfg80211.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9747,6 +9747,11 @@ void cfg80211_links_removed(struct net_device *dev, u16 link_mask);
97479747
* struct cfg80211_mlo_reconf_done_data - MLO reconfiguration data
97489748
* @buf: MLO Reconfiguration Response frame (header + body)
97499749
* @len: length of the frame data
9750+
* @driver_initiated: Indicates whether the add links request is initiated by
9751+
* driver. This is set to true when the link reconfiguration request
9752+
* initiated by driver due to AP link recommendation requests
9753+
* (Ex: BTM (BSS Transition Management) request) handling offloaded to
9754+
* driver.
97509755
* @added_links: BIT mask of links successfully added to the association
97519756
* @links: per-link information indexed by link ID
97529757
* @links.bss: the BSS that MLO reconfiguration was requested for, ownership of
@@ -9759,6 +9764,7 @@ void cfg80211_links_removed(struct net_device *dev, u16 link_mask);
97599764
struct cfg80211_mlo_reconf_done_data {
97609765
const u8 *buf;
97619766
size_t len;
9767+
bool driver_initiated;
97629768
u16 added_links;
97639769
struct {
97649770
struct cfg80211_bss *bss;

include/uapi/linux/nl80211.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,11 @@
13341334
* reconfiguration request results from the driver, this command is also
13351335
* used as an event to notify userspace about the added links information.
13361336
* For notifying the removed links information, the existing
1337-
* %NL80211_CMD_LINKS_REMOVED command is used.
1337+
* %NL80211_CMD_LINKS_REMOVED command is used. This command is also used to
1338+
* notify userspace about newly added links for the current connection in
1339+
* case of AP-initiated link recommendation requests, received via
1340+
* a BTM (BSS Transition Management) request or a link reconfig notify
1341+
* frame, where the driver handles the link recommendation offload.
13381342
*
13391343
* @NL80211_CMD_EPCS_CFG: EPCS configuration for a station. Used by userland to
13401344
* control EPCS configuration. Used to notify userland on the current state

net/wireless/mlme.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,8 @@ void cfg80211_mlo_reconf_add_done(struct net_device *dev,
13311331
lockdep_assert_wiphy(wiphy);
13321332

13331333
trace_cfg80211_mlo_reconf_add_done(dev, data->added_links,
1334-
data->buf, data->len);
1334+
data->buf, data->len,
1335+
data->driver_initiated);
13351336

13361337
if (WARN_ON(!wdev->valid_links))
13371338
return;
@@ -1361,11 +1362,16 @@ void cfg80211_mlo_reconf_add_done(struct net_device *dev,
13611362
wdev->links[link_id].client.current_bss =
13621363
bss_from_pub(bss);
13631364

1365+
if (data->driver_initiated)
1366+
cfg80211_hold_bss(bss_from_pub(bss));
1367+
13641368
memcpy(wdev->links[link_id].addr,
13651369
data->links[link_id].addr,
13661370
ETH_ALEN);
13671371
} else {
1368-
cfg80211_unhold_bss(bss_from_pub(bss));
1372+
if (!data->driver_initiated)
1373+
cfg80211_unhold_bss(bss_from_pub(bss));
1374+
13691375
cfg80211_put_bss(wiphy, bss);
13701376
}
13711377
}

net/wireless/trace.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4126,20 +4126,22 @@ TRACE_EVENT(cfg80211_links_removed,
41264126

41274127
TRACE_EVENT(cfg80211_mlo_reconf_add_done,
41284128
TP_PROTO(struct net_device *netdev, u16 link_mask,
4129-
const u8 *buf, size_t len),
4130-
TP_ARGS(netdev, link_mask, buf, len),
4129+
const u8 *buf, size_t len, bool driver_initiated),
4130+
TP_ARGS(netdev, link_mask, buf, len, driver_initiated),
41314131
TP_STRUCT__entry(
41324132
NETDEV_ENTRY
41334133
__field(u16, link_mask)
41344134
__dynamic_array(u8, buf, len)
4135+
__field(bool, driver_initiated)
41354136
),
41364137
TP_fast_assign(
41374138
NETDEV_ASSIGN;
41384139
__entry->link_mask = link_mask;
41394140
memcpy(__get_dynamic_array(buf), buf, len);
4141+
__entry->driver_initiated = driver_initiated;
41404142
),
4141-
TP_printk(NETDEV_PR_FMT ", link_mask:0x%x",
4142-
NETDEV_PR_ARG, __entry->link_mask)
4143+
TP_printk(NETDEV_PR_FMT ", link_mask:0x%x, driver_initiated:%d",
4144+
NETDEV_PR_ARG, __entry->link_mask, __entry->driver_initiated)
41434145
);
41444146

41454147
TRACE_EVENT(rdev_assoc_ml_reconf,

0 commit comments

Comments
 (0)