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

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@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e433304a
...@@ -3641,11 +3641,14 @@ enum ieee80211_reconfig_type { ...@@ -3641,11 +3641,14 @@ enum ieee80211_reconfig_type {
* @success: whether the frame exchange was successful, only * @success: whether the frame exchange was successful, only
* used with the mgd_complete_tx() method, and then only * used with the mgd_complete_tx() method, and then only
* valid for auth and (re)assoc. * 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 { struct ieee80211_prep_tx_info {
u16 duration; u16 duration;
u16 subtype; u16 subtype;
u8 success:1; u8 success:1;
int link_id;
}; };
/** /**
......
...@@ -928,6 +928,7 @@ static inline void drv_mgd_prepare_tx(struct ieee80211_local *local, ...@@ -928,6 +928,7 @@ static inline void drv_mgd_prepare_tx(struct ieee80211_local *local,
return; return;
WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION); 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, trace_drv_mgd_prepare_tx(local, sdata, info->duration,
info->subtype, info->success); info->subtype, info->success);
if (local->ops->mgd_prepare_tx) if (local->ops->mgd_prepare_tx)
......
...@@ -1584,6 +1584,7 @@ static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) ...@@ -1584,6 +1584,7 @@ static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
ifmgd->assoc_req_ies_len = pos - ie_start; ifmgd->assoc_req_ies_len = pos - ie_start;
info.link_id = assoc_data->assoc_link_id;
drv_mgd_prepare_tx(local, sdata, &info); drv_mgd_prepare_tx(local, sdata, &info);
IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
...@@ -2948,8 +2949,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -2948,8 +2949,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
if (link->u.mgd.have_beacon) if (link->u.mgd.have_beacon)
break; 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); drv_mgd_prepare_tx(sdata->local, sdata, &info);
}
} }
ieee80211_send_deauth_disassoc(sdata, sdata->vif.cfg.ap_addr, ieee80211_send_deauth_disassoc(sdata, sdata->vif.cfg.ap_addr,
...@@ -3577,6 +3580,7 @@ static void ieee80211_auth_challenge(struct ieee80211_sub_if_data *sdata, ...@@ -3577,6 +3580,7 @@ static void ieee80211_auth_challenge(struct ieee80211_sub_if_data *sdata,
u32 tx_flags = 0; u32 tx_flags = 0;
struct ieee80211_prep_tx_info info = { struct ieee80211_prep_tx_info info = {
.subtype = IEEE80211_STYPE_AUTH, .subtype = IEEE80211_STYPE_AUTH,
.link_id = auth_data->link_id,
}; };
pos = mgmt->u.auth.variable; pos = mgmt->u.auth.variable;
...@@ -6569,6 +6573,7 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) ...@@ -6569,6 +6573,7 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
if (auth_data->algorithm == WLAN_AUTH_SAE) if (auth_data->algorithm == WLAN_AUTH_SAE)
info.duration = jiffies_to_msecs(IEEE80211_AUTH_TIMEOUT_SAE); info.duration = jiffies_to_msecs(IEEE80211_AUTH_TIMEOUT_SAE);
info.link_id = auth_data->link_id;
drv_mgd_prepare_tx(local, sdata, &info); drv_mgd_prepare_tx(local, sdata, &info);
sdata_info(sdata, "send auth to %pM (try %d/%d)\n", 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, ...@@ -7989,6 +7994,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
req->bssid, req->reason_code, req->bssid, req->reason_code,
ieee80211_get_reason_code_string(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); drv_mgd_prepare_tx(sdata->local, sdata, &info);
ieee80211_send_deauth_disassoc(sdata, req->bssid, req->bssid, ieee80211_send_deauth_disassoc(sdata, req->bssid, req->bssid,
IEEE80211_STYPE_DEAUTH, IEEE80211_STYPE_DEAUTH,
...@@ -8009,6 +8015,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, ...@@ -8009,6 +8015,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
req->bssid, req->reason_code, req->bssid, req->reason_code,
ieee80211_get_reason_code_string(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); drv_mgd_prepare_tx(sdata->local, sdata, &info);
ieee80211_send_deauth_disassoc(sdata, req->bssid, req->bssid, ieee80211_send_deauth_disassoc(sdata, req->bssid, req->bssid,
IEEE80211_STYPE_DEAUTH, IEEE80211_STYPE_DEAUTH,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment