Re: [PATCH 23/50] wifi: ath12k: add hal_rx.h

Jeff Johnson
2022-08-18T04:17:16Z

On 8/12/2022 9:09 AM, Kalle Valo wrote:
> From: Kalle Valo <quic_kvalo@quicinc.com>
>
> (Patches split into one patch per file for easier review, but the final
> commit will be one big patch. See the cover letter for more info.)
>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> ---
> drivers/net/wireless/ath/ath12k/hal_rx.h | 694 +++++++++++++++++++++++++++++++
> 1 file changed, 694 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath12k/hal_rx.h b/drivers/net/wireless/ath/ath12k/hal_rx.h
> new file mode 100644
> index 000000000000..883ea1be2525
> --- /dev/null
> +++ b/drivers/net/wireless/ath/ath12k/hal_rx.h

snip

> +static inline u32 ath12k_he_ru_tones_to_nl80211_he_ru_alloc(u16 ru_tones)

why doesn't this function return enum nl80211_he_ru_alloc

> +{
> + u32 ret = 0;

shouldn't this be initialized to a enum nl80211_he_ru_alloc enumerator?
(0 is NL80211_RATE_INFO_HE_RU_ALLOC_26)

or perhaps remove the initializer and add a default:?

> +
> + switch (ru_tones) {
> + case RU_26:

add default: here?

> + ret = NL80211_RATE_INFO_HE_RU_ALLOC_26;
> + break;
> + case RU_52:
> + ret = NL80211_RATE_INFO_HE_RU_ALLOC_52;
> + break;
> + case RU_106:
> + ret = NL80211_RATE_INFO_HE_RU_ALLOC_106;
> + break;
> + case RU_242:
> + ret = NL80211_RATE_INFO_HE_RU_ALLOC_242;
> + break;
> + case RU_484:
> + ret = NL80211_RATE_INFO_HE_RU_ALLOC_484;
> + break;
> + case RU_996:
> + ret = NL80211_RATE_INFO_HE_RU_ALLOC_996;
> + break;
> + }
> + return ret;

snip