Skip to content

Commit 1d9e4c9

Browse files
benzeajmberg-intel
authored andcommitted
wifi: mac80211: add pointer from link STA to STA
While often not needed, this considerably simplifies going from a link to the STA. This helps in cases such as debugfs where a single pointer should allow accessing a specific link and the STA. Signed-off-by: Benjamin Berg <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 8af9d40 commit 1d9e4c9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/net/mac80211.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,7 @@ struct ieee80211_sta_aggregates {
21762176
* All link specific info for a STA link for a non MLD STA(single)
21772177
* or a MLD STA(multiple entries) are stored here.
21782178
*
2179+
* @sta: reference to owning STA
21792180
* @addr: MAC address of the Link STA. For non-MLO STA this is same as the addr
21802181
* in ieee80211_sta. For MLO Link STA this addr can be same or different
21812182
* from addr in ieee80211_sta (representing MLD STA addr)
@@ -2196,6 +2197,8 @@ struct ieee80211_sta_aggregates {
21962197
*
21972198
*/
21982199
struct ieee80211_link_sta {
2200+
struct ieee80211_sta *sta;
2201+
21992202
u8 addr[ETH_ALEN];
22002203
u8 link_id;
22012204
enum ieee80211_smps_mode smps_mode;

net/mac80211/sta_info.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ static void sta_info_add_link(struct sta_info *sta,
511511
link_info->sta = sta;
512512
link_info->link_id = link_id;
513513
link_info->pub = link_sta;
514+
link_info->pub->sta = &sta->sta;
514515
link_sta->link_id = link_id;
515516
rcu_assign_pointer(sta->link[link_id], link_info);
516517
rcu_assign_pointer(sta->sta.link[link_id], link_sta);

0 commit comments

Comments
 (0)