Commit e76f3b4a authored by Miri Korenblit's avatar Miri Korenblit Committed by Johannes Berg
Browse files

wifi: mac80211: add link id to mgd_prepare_tx()



As we are moving to MLO and links terms, also the airtime protection
will be done for a link rather than for a vif. Thus, some
drivers will need to know for which link to protect airtime.
Add link id as a parameter to the mgd_prepare_tx() callback.

Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.c7fc59a6780b.Ic88a5037d31e184a2dce0b031ece1a0a93a3a9da@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e433304a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3641,11 +3641,14 @@ enum ieee80211_reconfig_type {
 * @success: whether the frame exchange was successful, only
 *	used with the mgd_complete_tx() method, and then only
 *	valid for auth and (re)assoc.
 * @link_id: the link id on which the frame will be TX'ed.
 *	Only used with the mgd_prepare_tx() method.
 */
struct ieee80211_prep_tx_info {
	u16 duration;
	u16 subtype;
	u8 success:1;
	int link_id;
};

/**
+1 −0
Original line number Diff line number Diff line
@@ -928,6 +928,7 @@ static inline void drv_mgd_prepare_tx(struct ieee80211_local *local,
		return;
	WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION);

	info->link_id = info->link_id < 0 ? 0 : info->link_id;
	trace_drv_mgd_prepare_tx(local, sdata, info->duration,
				 info->subtype, info->success);
	if (local->ops->mgd_prepare_tx)
+8 −1
Original line number Diff line number Diff line
@@ -1584,6 +1584,7 @@ static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)

	ifmgd->assoc_req_ies_len = pos - ie_start;

	info.link_id = assoc_data->assoc_link_id;
	drv_mgd_prepare_tx(local, sdata, &info);

	IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
@@ -2948,9 +2949,11 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
				if (link->u.mgd.have_beacon)
					break;
			}
			if (link_id == IEEE80211_MLD_MAX_NUM_LINKS)
			if (link_id == IEEE80211_MLD_MAX_NUM_LINKS) {
				info.link_id = ffs(sdata->vif.active_links) - 1;
				drv_mgd_prepare_tx(sdata->local, sdata, &info);
			}
		}

		ieee80211_send_deauth_disassoc(sdata, sdata->vif.cfg.ap_addr,
					       sdata->vif.cfg.ap_addr, stype,
@@ -3577,6 +3580,7 @@ static void ieee80211_auth_challenge(struct ieee80211_sub_if_data *sdata,
	u32 tx_flags = 0;
	struct ieee80211_prep_tx_info info = {
		.subtype = IEEE80211_STYPE_AUTH,
		.link_id = auth_data->link_id,
	};

	pos = mgmt->u.auth.variable;
@@ -6569,6 +6573,7 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
	if (auth_data->algorithm == WLAN_AUTH_SAE)
		info.duration = jiffies_to_msecs(IEEE80211_AUTH_TIMEOUT_SAE);

	info.link_id = auth_data->link_id;
	drv_mgd_prepare_tx(local, sdata, &info);

	sdata_info(sdata, "send auth to %pM (try %d/%d)\n",
@@ -7989,6 +7994,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
			   req->bssid, req->reason_code,
			   ieee80211_get_reason_code_string(req->reason_code));

		info.link_id = ifmgd->auth_data->link_id;
		drv_mgd_prepare_tx(sdata->local, sdata, &info);
		ieee80211_send_deauth_disassoc(sdata, req->bssid, req->bssid,
					       IEEE80211_STYPE_DEAUTH,
@@ -8009,6 +8015,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
			   req->bssid, req->reason_code,
			   ieee80211_get_reason_code_string(req->reason_code));

		info.link_id = ifmgd->assoc_data->assoc_link_id;
		drv_mgd_prepare_tx(sdata->local, sdata, &info);
		ieee80211_send_deauth_disassoc(sdata, req->bssid, req->bssid,
					       IEEE80211_STYPE_DEAUTH,