Skip to content

Commit ad75fba

Browse files
Miriam-Rachelzhoufuro
authored andcommitted
wifi: mac80211: add link id to mgd_prepare_tx()
commit e76f3b4 ("wifi: mac80211: add link id to mgd_prepare_tx()") upstream. 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. deepin-Intel-SIG: commit e76f3b4 ("wifi: mac80211: add link id to mgd_prepare_tx()"). Signed-off-by: Miri Korenblit <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20230928172905.c7fc59a6780b.Ic88a5037d31e184a2dce0b031ece1a0a93a3a9da@changeid Signed-off-by: Johannes Berg <[email protected]> [ Furong Zhou: amend commit log ] Signed-off-by: Furong Zhou <[email protected]>
1 parent 96fa71a commit ad75fba

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

include/net/mac80211.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3641,11 +3641,14 @@ enum ieee80211_reconfig_type {
36413641
* @success: whether the frame exchange was successful, only
36423642
* used with the mgd_complete_tx() method, and then only
36433643
* valid for auth and (re)assoc.
3644+
* @link_id: the link id on which the frame will be TX'ed.
3645+
* Only used with the mgd_prepare_tx() method.
36443646
*/
36453647
struct ieee80211_prep_tx_info {
36463648
u16 duration;
36473649
u16 subtype;
36483650
u8 success:1;
3651+
int link_id;
36493652
};
36503653

36513654
/**

net/mac80211/driver-ops.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ static inline void drv_mgd_prepare_tx(struct ieee80211_local *local,
884884
return;
885885
WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION);
886886

887+
info->link_id = info->link_id < 0 ? 0 : info->link_id;
887888
trace_drv_mgd_prepare_tx(local, sdata, info->duration,
888889
info->subtype, info->success);
889890
if (local->ops->mgd_prepare_tx)

net/mac80211/mlme.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,7 @@ static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
15861586

15871587
ifmgd->assoc_req_ies_len = pos - ie_start;
15881588

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

15911592
IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
@@ -2966,8 +2967,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
29662967
if (link->u.mgd.have_beacon)
29672968
break;
29682969
}
2969-
if (link_id == IEEE80211_MLD_MAX_NUM_LINKS)
2970+
if (link_id == IEEE80211_MLD_MAX_NUM_LINKS) {
2971+
info.link_id = ffs(sdata->vif.active_links) - 1;
29702972
drv_mgd_prepare_tx(sdata->local, sdata, &info);
2973+
}
29712974
}
29722975

29732976
ieee80211_send_deauth_disassoc(sdata, sdata->vif.cfg.ap_addr,
@@ -3617,6 +3620,7 @@ static void ieee80211_auth_challenge(struct ieee80211_sub_if_data *sdata,
36173620
u32 tx_flags = 0;
36183621
struct ieee80211_prep_tx_info info = {
36193622
.subtype = IEEE80211_STYPE_AUTH,
3623+
.link_id = auth_data->link_id,
36203624
};
36213625

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

6446+
info.link_id = auth_data->link_id;
64426447
drv_mgd_prepare_tx(local, sdata, &info);
64436448

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

7802+
info.link_id = ifmgd->auth_data->link_id;
77977803
drv_mgd_prepare_tx(sdata->local, sdata, &info);
77987804
ieee80211_send_deauth_disassoc(sdata, req->bssid, req->bssid,
77997805
IEEE80211_STYPE_DEAUTH,
@@ -7814,6 +7820,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
78147820
req->bssid, req->reason_code,
78157821
ieee80211_get_reason_code_string(req->reason_code));
78167822

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

0 commit comments

Comments
 (0)