mirror of https://github.com/torvalds/linux.git
wifi: ath12k: move HE MCS mapper to a separate function
Refactor the HE MCS mapper functionality in ath12k_mac_copy_he_cap() into a new function. This helps improve readability, extensibility and will be used when adding support for 160 MHz bandwidth in subsequent patches. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Co-developed-by: Muna Sinada <quic_msinada@quicinc.com> Signed-off-by: Muna Sinada <quic_msinada@quicinc.com> Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Link: https://patch.msgid.link/20250701010408.1257201-4-quic_pradeepc@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
parent
df8207bc0b
commit
1eafb8d15d
|
|
@ -7537,12 +7537,24 @@ static __le16 ath12k_mac_setup_he_6ghz_cap(struct ath12k_pdev_cap *pcap,
|
|||
return cpu_to_le16(bcap->he_6ghz_capa);
|
||||
}
|
||||
|
||||
static void ath12k_mac_set_hemcsmap(struct ath12k_band_cap *band_cap,
|
||||
struct ieee80211_sta_he_cap *he_cap)
|
||||
{
|
||||
struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
|
||||
|
||||
mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
}
|
||||
|
||||
static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap,
|
||||
int iftype, u8 num_tx_chains,
|
||||
struct ieee80211_sta_he_cap *he_cap)
|
||||
{
|
||||
struct ieee80211_he_cap_elem *he_cap_elem = &he_cap->he_cap_elem;
|
||||
struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
|
||||
|
||||
he_cap->has_he = true;
|
||||
memcpy(he_cap_elem->mac_cap_info, band_cap->he_cap_info,
|
||||
|
|
@ -7582,13 +7594,7 @@ static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap,
|
|||
break;
|
||||
}
|
||||
|
||||
mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
|
||||
ath12k_mac_set_hemcsmap(band_cap, he_cap);
|
||||
memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
|
||||
if (he_cap_elem->phy_cap_info[6] &
|
||||
IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT)
|
||||
|
|
|
|||
Loading…
Reference in New Issue