mirror of
https://github.com/torvalds/linux.git
synced 2024-12-13 06:32:50 +00:00
046d2e7c50
Currently in mac80211 each STA object is represented using sta_info datastructure with the associated STA specific information and drivers access ieee80211_sta part of it. With MLO (Multi Link Operation) support being added in 802.11be standard, though the association is logically with a single Multi Link capable STA, at the physical level communication can happen via different advertised links (uniquely identified by Channel, operating class, BSSID) and hence the need to handle multiple link STA parameters within a composite sta_info object called the MLD STA. The different link STA part of MLD STA are identified using the link address which can be same or different as the MLD STA address and unique link id based on the link vif. To support extension of such a model, the sta_info datastructure is modified to hold multiple link STA objects with link specific params currently within sta_info moved to this new structure. Similarly this is done for ieee80211_sta as well which will be accessed within mac80211 as well as by drivers, hence trivial driver changes are expected to support this. For current non MLO supported drivers, only one link STA is present and link information is accessed via 'deflink' member. For MLO drivers, we still need to define the APIs etc. to get the correct link ID and access the correct part of the station info. Currently in mac80211, all link STA info are accessed directly via deflink. These will be updated to access via link pointers indexed by link id with MLO support patches, with link id being 0 for non MLO supported cases. Except for couple of macro related changes, below spatch takes care of updating mac80211 and driver code to access to the link STA info via deflink. @ieee80211_sta@ struct ieee80211_sta *s; struct sta_info *si; identifier var = {supp_rates, ht_cap, vht_cap, he_cap, he_6ghz_capa, eht_cap, rx_nss, bandwidth, txpwr}; @@ ( s-> - var + deflink.var | si->sta. - var + deflink.var ) @sta_info@ struct sta_info *si; identifier var = {gtk, pcpu_rx_stats, rx_stats, rx_stats_avg, status_stats, tx_stats, cur_max_bandwidth}; @@ ( si-> - var + deflink.var ) Signed-off-by: Sriram R <quic_srirrama@quicinc.com> Link: https://lore.kernel.org/r/1649086883-13246-1-git-send-email-quic_srirrama@quicinc.com [remove MLO-drivers notes from commit message, not clear yet; run spatch] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
77 lines
2.2 KiB
C
77 lines
2.2 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* EHT handling
|
|
*
|
|
* Copyright(c) 2021-2022 Intel Corporation
|
|
*/
|
|
|
|
#include "ieee80211_i.h"
|
|
|
|
void
|
|
ieee80211_eht_cap_ie_to_sta_eht_cap(struct ieee80211_sub_if_data *sdata,
|
|
struct ieee80211_supported_band *sband,
|
|
const u8 *he_cap_ie, u8 he_cap_len,
|
|
const struct ieee80211_eht_cap_elem *eht_cap_ie_elem,
|
|
u8 eht_cap_len, struct sta_info *sta)
|
|
{
|
|
struct ieee80211_sta_eht_cap *eht_cap = &sta->sta.deflink.eht_cap;
|
|
struct ieee80211_he_cap_elem *he_cap_ie_elem = (void *)he_cap_ie;
|
|
u8 eht_ppe_size = 0;
|
|
u8 mcs_nss_size;
|
|
u8 eht_total_size = sizeof(eht_cap->eht_cap_elem);
|
|
u8 *pos = (u8 *)eht_cap_ie_elem;
|
|
|
|
memset(eht_cap, 0, sizeof(*eht_cap));
|
|
|
|
if (!eht_cap_ie_elem ||
|
|
!ieee80211_get_eht_iftype_cap(sband,
|
|
ieee80211_vif_type_p2p(&sdata->vif)))
|
|
return;
|
|
|
|
mcs_nss_size = ieee80211_eht_mcs_nss_size(he_cap_ie_elem,
|
|
&eht_cap_ie_elem->fixed);
|
|
|
|
eht_total_size += mcs_nss_size;
|
|
|
|
/* Calculate the PPE thresholds length only if the header is present */
|
|
if (eht_cap_ie_elem->fixed.phy_cap_info[5] &
|
|
IEEE80211_EHT_PHY_CAP5_PPE_THRESHOLD_PRESENT) {
|
|
u16 eht_ppe_hdr;
|
|
|
|
if (eht_cap_len < eht_total_size + sizeof(u16))
|
|
return;
|
|
|
|
eht_ppe_hdr = get_unaligned_le16(eht_cap_ie_elem->optional + mcs_nss_size);
|
|
eht_ppe_size =
|
|
ieee80211_eht_ppe_size(eht_ppe_hdr,
|
|
eht_cap_ie_elem->fixed.phy_cap_info);
|
|
eht_total_size += eht_ppe_size;
|
|
|
|
/* we calculate as if NSS > 8 are valid, but don't handle that */
|
|
if (eht_ppe_size > sizeof(eht_cap->eht_ppe_thres))
|
|
return;
|
|
}
|
|
|
|
if (eht_cap_len < eht_total_size)
|
|
return;
|
|
|
|
/* Copy the static portion of the EHT capabilities */
|
|
memcpy(&eht_cap->eht_cap_elem, pos, sizeof(eht_cap->eht_cap_elem));
|
|
pos += sizeof(eht_cap->eht_cap_elem);
|
|
|
|
/* Copy MCS/NSS which depends on the peer capabilities */
|
|
memset(&eht_cap->eht_mcs_nss_supp, 0,
|
|
sizeof(eht_cap->eht_mcs_nss_supp));
|
|
memcpy(&eht_cap->eht_mcs_nss_supp, pos, mcs_nss_size);
|
|
|
|
if (eht_ppe_size)
|
|
memcpy(eht_cap->eht_ppe_thres,
|
|
&eht_cap_ie_elem->optional[mcs_nss_size],
|
|
eht_ppe_size);
|
|
|
|
eht_cap->has_eht = true;
|
|
|
|
sta->deflink.cur_max_bandwidth = ieee80211_sta_cap_rx_bw(sta);
|
|
sta->sta.deflink.bandwidth = ieee80211_sta_cur_vht_bw(sta);
|
|
}
|