diff options
author | Johannes Berg <johannes.berg@intel.com> | 2024-06-12 15:35:56 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-06-26 11:22:04 +0300 |
commit | d42fcaece03654a4b21d2da88d68ed913e0b6c46 (patch) | |
tree | 5b4540067d63285f38d49f1287c2b9eab13d2a42 /net/mac80211/sta_info.h | |
parent | dd7b1bdb5614419305089de399b7e6aa2fde8301 (diff) | |
download | linux-d42fcaece03654a4b21d2da88d68ed913e0b6c46.tar.xz |
wifi: mac80211: add ieee80211_tdls_sta_link_id()
We've open-coded this twice and will need it again,
add ieee80211_tdls_sta_link_id() to get the one link
ID for a TDLS STA.
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240612143707.9f8141ae1725.I343822bbba0ae08dedb2f54a0ce87f2ae5ebeb2b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/sta_info.h')
-rw-r--r-- | net/mac80211/sta_info.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index bd5e2f7146f6..9195d5a2de0a 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -727,6 +727,12 @@ struct sta_info { struct ieee80211_sta sta; }; +static inline int ieee80211_tdls_sta_link_id(struct sta_info *sta) +{ + /* TDLS STA can only have a single link */ + return sta->sta.valid_links ? __ffs(sta->sta.valid_links) : 0; +} + static inline enum nl80211_plink_state sta_plink_state(struct sta_info *sta) { #ifdef CONFIG_MAC80211_MESH |