Re: [PATCH] wifi: mwifiex: fix parsing of more than two AKM suites

From: Kalle Valo
Date: Sat May 25 2024 - 05:15:34 EST


Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> writes:

> params->crypto.n_akm_suites seems to be limited to two AKM suites. Once
> there are more they will be passed as extra elements of type WLAN_EID_RSN
> or WLAN_EID_VENDOR_SPECIFIC.
>
> This takes some snippets from the downstream vendor driver to parse
> these elements and to set the correct protocol and key_mgmt bits to
> enable the desired key managements algorithms in the hardware.
>
> This patch is not a request for inclusion, more a heads up that there's
> something missing and the question if the approach taken is the right
> one or if there are other preferred ways to fix this issue.

Please mark patches like this as "[PATCH RFC]", that way we maintainers
know to drop them automatically.

> --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
> +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
> @@ -9,6 +9,112 @@
> #include "11ac.h"
> #include "11n.h"
>
> +struct wpa_suite_ucast {
> + /* count */
> + u16 count;
> + /** wpa_suite list */
> + __be32 suite[1];
> +} __packed;

The comments here are not adding any extra information, please remove.

In general having a some kind of prefix in the struct name would be
nice. I don't know what mwifiex uses (if any) but, for example, in
ath12k we use 'ath12k_'.

> +struct IEEEtypes_Rsn_t {

Lower case, no '_t' and also improve the naming.

> + /** Rsn : version */
> + u16 version;
> + /** Rsn : group cipher */
> + __be32 group_cipher;
> + /** Rsn : pairwise cipher */
> + struct wpa_suite_ucast pairwise_cipher;
> +} __packed;

Useless comments.

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches