[PATCH 6/9] mac80211: add definition for transmit power envelope element

Johannes Berg johannes at sipsolutions.net
Fri Jul 23 02:29:44 PDT 2021


On Mon, 2021-05-17 at 16:19 -0400, Wen Gong wrote:
> 
> +#define TX_PWR_ENV_INFO_COUNT	GENMASK(2, 0)
> +#define TX_PWR_ENV_INFO_INTERPRET	GENMASK(5, 3)
> +#define TX_PWR_ENV_INFO_CATEGORY	GENMASK(7, 6)

Personally, I'm not a big fan of GENMASK(), seems more complicated to me
than
			0x0007
			0x0038
			0x00c0

but YMMV :)

We haven't really used GENMASK here anywhere else, have we?


> +#define GET_TX_PWR_ENV_COUNT(fv) FIELD_GET(TX_PWR_ENV_INFO_COUNT, fv)
> +#define GET_TX_PWR_ENV_INTERPRET(fv) FIELD_GET(TX_PWR_ENV_INFO_INTERPRET, fv)
> +#define GET_TX_PWR_ENV_CATEGORY(fv) FIELD_GET(TX_PWR_ENV_INFO_CATEGORY, fv)

I don't think we really need these, and we should be using u*_get_bits()
anyway rather than FIELD_GET.

johannes




More information about the ath11k mailing list