@@ -4394,6 +4394,10 @@ struct ieee80211_prep_tx_info {
* if the requested TID-To-Link mapping can be accepted or not.
* If it's not accepted the driver may suggest a preferred mapping and
* modify @ttlm parameter with the suggested TID-to-Link mapping.
+ * @link_reconfig_remove: Notifies the driver about the link to be
+ * scheduled for removal with ML reconfigure IE built for that particular
+ * link along with the TBTT count until which the beacon with ML
+ * reconfigure IE should be sent.
*/
struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -4778,6 +4782,9 @@ struct ieee80211_ops {
enum ieee80211_neg_ttlm_res
(*can_neg_ttlm)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_neg_ttlm *ttlm);
+ int (*link_reconfig_remove)(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ const struct cfg80211_link_reconfig_removal_params *params);
};
/**
@@ -7600,6 +7607,24 @@ void ieee80211_set_active_links_async(struct ieee80211_vif *vif,
*/
void ieee80211_send_teardown_neg_ttlm(struct ieee80211_vif *vif);
+/* Defines for ML Reconfigure removal offload */
+
+/**
+ * ieee80211_update_link_reconfig_remove_status - Inform userspace about
+ * the removal status of link which is scheduled for removal
+ * @vif: interface in which reconfig removal status is received.
+ * @link_id: Link which is undergoing removal
+ * @tbtt_count: Current tbtt_count to be updated.
+ * @tsf: Beacon's timestamp value
+ * @action: Inform started or completed action to userspace
+ *
+ * For description, check cfg80211_link_reconfig_remove_status
+ */
+int ieee80211_update_link_reconfig_remove_status(struct ieee80211_vif *vif,
+ unsigned int link_id,
+ u8 tbtt_count, u64 tsf,
+ enum ieee80211_link_reconfig_remove_state action);
+
/* for older drivers - let's not document these ... */
int ieee80211_emulate_add_chanctx(struct ieee80211_hw *hw,
struct ieee80211_chanctx_conf *ctx);
@@ -4923,6 +4923,17 @@ static void ieee80211_del_intf_link(struct wiphy *wiphy,
ieee80211_vif_set_links(sdata, wdev->valid_links, 0);
}
+static int
+ieee80211_link_reconfig_remove(struct wiphy *wiphy,
+ struct net_device *dev,
+ const struct cfg80211_link_reconfig_removal_params *params)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+
+ return __ieee80211_link_reconfig_remove(local, sdata, params);
+}
+
static int sta_add_link_station(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct link_station_parameters *params)
@@ -5166,4 +5177,5 @@ const struct cfg80211_ops mac80211_config_ops = {
.del_link_station = ieee80211_del_link_station,
.set_hw_timestamp = ieee80211_set_hw_timestamp,
.set_ttlm = ieee80211_set_ttlm,
+ .link_reconfig_remove = ieee80211_link_reconfig_remove,
};
@@ -1716,4 +1716,23 @@ drv_can_neg_ttlm(struct ieee80211_local *local,
return res;
}
+
+static inline int
+drv_link_reconfig_remove(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ const struct cfg80211_link_reconfig_removal_params *params)
+{
+ int ret = -EOPNOTSUPP;
+
+ trace_drv_link_reconfig_remove(local, sdata, params);
+
+ if (local->ops->link_reconfig_remove)
+ ret = local->ops->link_reconfig_remove(&local->hw,
+ &sdata->vif,
+ params);
+ trace_drv_return_int(local, ret);
+
+ return ret;
+}
+
#endif /* __MAC80211_DRIVER_OPS */
@@ -2041,6 +2041,10 @@ static inline void ieee80211_vif_clear_links(struct ieee80211_sub_if_data *sdata
ieee80211_vif_set_links(sdata, 0, 0);
}
+int __ieee80211_link_reconfig_remove(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ const struct cfg80211_link_reconfig_removal_params *params);
+
/* tx handling */
void ieee80211_clear_tx_pending(struct ieee80211_local *local);
void ieee80211_tx_pending(struct tasklet_struct *t);
@@ -501,3 +501,43 @@ void ieee80211_set_active_links_async(struct ieee80211_vif *vif,
wiphy_work_queue(sdata->local->hw.wiphy, &sdata->activate_links_work);
}
EXPORT_SYMBOL_GPL(ieee80211_set_active_links_async);
+
+int __ieee80211_link_reconfig_remove(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ const struct cfg80211_link_reconfig_removal_params *params)
+{
+ struct ieee80211_link_data *link;
+ int ret;
+
+ if (!ieee80211_sdata_running(sdata))
+ return -ENETDOWN;
+
+ if (sdata->vif.type != NL80211_IFTYPE_AP)
+ return -EINVAL;
+
+ link = sdata_dereference(sdata->link[params->link_id], sdata);
+ if (!link)
+ return -ENOLINK;
+
+ ret = drv_link_reconfig_remove(local, sdata, params);
+
+ return ret;
+}
+
+int ieee80211_update_link_reconfig_remove_status(struct ieee80211_vif *vif,
+ unsigned int link_id,
+ u8 tbtt_count, u64 tsf,
+ enum ieee80211_link_reconfig_remove_state status)
+{
+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+
+ if (vif->type != NL80211_IFTYPE_AP) {
+ sdata_err(sdata, "Discarding link reconfig status for unsupported vif type\n");
+ return -EINVAL;
+ }
+
+ return cfg80211_update_link_reconfig_remove_status(sdata->dev, link_id,
+ tbtt_count, tsf,
+ status);
+}
+EXPORT_SYMBOL(ieee80211_update_link_reconfig_remove_status);
@@ -3145,6 +3145,36 @@ TRACE_EVENT(drv_neg_ttlm_res,
LOCAL_PR_ARG, VIF_PR_ARG, __entry->res
)
);
+
+TRACE_EVENT(drv_link_reconfig_remove,
+ TP_PROTO(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ const struct cfg80211_link_reconfig_removal_params *params),
+
+ TP_ARGS(local, sdata, params),
+
+ TP_STRUCT__entry(LOCAL_ENTRY
+ VIF_ENTRY
+ __field(u32, link_id)
+ __field(u16, count)
+ __dynamic_array(u8, frame, params->ie_len)
+ ),
+
+ TP_fast_assign(LOCAL_ASSIGN;
+ VIF_ASSIGN;
+ __entry->link_id = params->link_id;
+ memcpy(__get_dynamic_array(frame), params->ie,
+ params->ie_len);
+ __entry->count = params->link_removal_cntdown;
+ ),
+
+ TP_printk(LOCAL_PR_FMT ", " VIF_PR_FMT ", link_id :%u frame:0x%.2x count:%d",
+ LOCAL_PR_ARG, VIF_PR_ARG,
+ __entry->link_id,
+ le16_to_cpup((__le16 *)__get_dynamic_array(frame)),
+ __entry->count)
+);
+
#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
#undef TRACE_INCLUDE_PATH
Add mac80211 routine to support sending link removal command to offloaded driver which accepts reconfigure Multi-Link IE and the TBTT count for the link to be removed. To support this, introduce new mac80211 ops "link_reconfig_remove" to initiate link removal procedure in driver with Multi-Link reconfiguration IE and TBTT count received from the userspace. Also, add mac80211 routine "ieee80211_update_link_reconfig_remove_status" which will be used by driver for sending TSF and current TBTT count receive from driver during the following scenarios, 1) When first beacon with Multi-Link reconfigure IE is sent out in air, mac80211 will notify the userspace that link removal is started and it can proceed with further action like BTM etc., 2) When last beacon with Multi-Link reconfigure IE (i.e. with link removal tbtt count as 0) is sent out in air, mac80211 will notify the userspace that link removal is completed. After which, userspace shall initiate the disassociation of the peer(s) connected and removal of the link completely. Signed-off-by: Manish Dharanenthiran <quic_mdharane@quicinc.com> --- include/net/mac80211.h | 25 ++++++++++++++++++++++++ net/mac80211/cfg.c | 12 ++++++++++++ net/mac80211/driver-ops.h | 19 ++++++++++++++++++ net/mac80211/ieee80211_i.h | 4 ++++ net/mac80211/link.c | 40 ++++++++++++++++++++++++++++++++++++++ net/mac80211/trace.h | 30 ++++++++++++++++++++++++++++ 6 files changed, 130 insertions(+)