Thread (35 messages) 35 messages, 2 authors, 2021-08-13

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

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2021-07-23 09:29:52
Also in: ath11k

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help