[PATCH] wifi: ath11k: mac: fix struct ieee80211_sband_iftype_data handling
Kalle Valo
kvalo at kernel.org
Fri Sep 22 02:49:19 PDT 2023
Kalle Valo <kvalo at kernel.org> writes:
> From: Kalle Valo <quic_kvalo at quicinc.com>
>
> Commit e8c1841278a7 ("wifi: cfg80211: annotate iftype_data pointer with
> sparse") added sparse checks for struct ieee80211_sband_iftype_data handling
> which immediately found an issue in ath11k:
>
> drivers/net/wireless/ath/ath11k/mac.c:7952:22: warning: incorrect type
> in argument 1 (different address spaces)
> drivers/net/wireless/ath/ath11k/mac.c:7952:22: expected struct
> ieee80211_sta_he_cap const *he_cap
> drivers/net/wireless/ath/ath11k/mac.c:7952:22: got struct
> ieee80211_sta_he_cap const [noderef] __iftype_data *
>
> The problem here is that we are accessing sband->iftype_data directly even
> though we should use for_each_sband_iftype_data(). Now we iterate over each
> item in the array and use the correct vif type which this vif is using.
>
> Tested-on: WCN6855 hw2.0 PCI
> WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
>
> Reported-by: Johannes Berg <johannes at sipsolutions.net>
> Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
[...]
> @@ -7949,7 +7951,17 @@ ath11k_mac_bitrate_mask_get_single_nss(struct ath11k *ar,
> return false;
> }
>
> - he_mcs_map = le16_to_cpu(ath11k_mac_get_tx_mcs_map(&sband->iftype_data->he_cap));
> + for_each_sband_iftype_data(sband, i, iftd) {
> + if (iftd->types_mask & BIT(arvif->vif->type)) {
> + iftype_data = iftd;
> + break;
> + }
> + }
> +
> + if (iftype_data == NULL)
> + return false;
> +
> + he_mcs_map = le16_to_cpu(ath11k_mac_get_tx_mcs_map(&iftype_data->he_cap));
Johannes pointed out that I should use ieee80211_get_he_iftype_cap_vif()
instead. I'll submit v2.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
More information about the ath11k
mailing list