Search Linux Wireless

Re: [PATCH v2 14/22] mac80211: encode listen interval for S1G

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-09-18 03:51, Johannes Berg wrote:
On Mon, 2020-08-31 at 13:55 -0700, Thomas Pedersen wrote:

+static const int listen_int_usf[] = { 1, 10, 1000, 10000 };

That should probably be in some C file?

OTOH ... maybe it's small enough to duplicate everywhere? could make it
u16 at least :)

+__le16 ieee80211_encode_usf(int listen_interval)
+{
+	u16 ui, usf = 0;
+
+	/* find greatest USF */
+	while (usf < IEEE80211_MAX_USF) {
+		if (listen_interval % listen_int_usf[usf + 1])
+			break;
+		usf += 1;
+	}
+	ui = listen_interval / listen_int_usf[usf];

But you really only need it here in one place anyway.

OK better to keep it private to that file then.

--
thomas



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux