xref: /linux/net/mac80211/uhr.c (revision 78c1930198fc63f2d4761848cbe148c5b2958b01)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * UHR handling
4  *
5  * Copyright(c) 2025-2026 Intel Corporation
6  */
7 
8 #include "ieee80211_i.h"
9 
10 void
11 ieee80211_uhr_cap_ie_to_sta_uhr_cap(struct ieee80211_sub_if_data *sdata,
12 				    struct ieee80211_supported_band *sband,
13 				    const struct ieee80211_uhr_cap *uhr_cap,
14 				    u8 uhr_cap_len,
15 				    struct link_sta_info *link_sta)
16 {
17 	struct ieee80211_sta_uhr_cap *sta_uhr_cap = &link_sta->pub->uhr_cap;
18 
19 	memset(sta_uhr_cap, 0, sizeof(*sta_uhr_cap));
20 
21 	if (!ieee80211_get_uhr_iftype_cap_vif(sband, &sdata->vif))
22 		return;
23 
24 	sta_uhr_cap->has_uhr = true;
25 	sta_uhr_cap->mac = uhr_cap->mac;
26 	sta_uhr_cap->phy = uhr_cap->phy;
27 }
28