linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mwifiex: start out with BSS type ANY, not STA
@ 2019-12-09 23:51 Brian Norris
  2019-12-10  0:41 ` Brian Norris
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Norris @ 2019-12-09 23:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, Ganapathi Bhat, Nishant Sarmukadam,
	Amitkumar Karwar, Xinming Hu, Brian Norris

mwifiex starts out by setting up 3 possible interfaces, but usually only
1 of them gets initialized later. Currently, we leave the
"uninitialized" interfaces with bss_type==0, which means
MWIFIEX_BSS_TYPE_STA. This gives misleading results for things like
mwifiex_get_intf_num(..., MWIFIEX_BSS_TYPE_STA), giving the answer "3"
even when we only have 1 initialized STA.

This bug doesn't affect functions like mwifiex_get_unused_bss_num(),
which are looking at the bss_mode field instead (to see
NL80211_IFTYPE_UNSPECIFIED, which happens to be 0...) for finding
uninitialized interfaces.

Let's make mwifiex_get_intf_num() give a proper answer, by making its
initial value the proper uninitialized value -- ANY.

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index a9657ae6d782..a9063411d243 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -97,6 +97,8 @@ static int mwifiex_register(void *card, struct device *dev,
 
 		adapter->priv[i]->adapter = adapter;
 		adapter->priv_num++;
+		/* Start out as uninitialized. */
+		adapter->priv[i]->bss_type = MWIFIEX_BSS_TYPE_ANY;
 	}
 	mwifiex_init_lock_list(adapter);
 
-- 
2.24.0.393.g34dc348eaf-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mwifiex: start out with BSS type ANY, not STA
  2019-12-09 23:51 [PATCH] mwifiex: start out with BSS type ANY, not STA Brian Norris
@ 2019-12-10  0:41 ` Brian Norris
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Norris @ 2019-12-10  0:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: Linux Kernel, Ganapathi Bhat, Nishant Sarmukadam,
	Amitkumar Karwar, Xinming Hu

On Mon, Dec 9, 2019 at 3:52 PM Brian Norris <briannorris@chromium.org> wrote:
> Let's make mwifiex_get_intf_num() give a proper answer, by making its
> initial value the proper uninitialized value -- ANY.

I should have noticed that this function was recently neutered in a
patch which actually fixes the bug I cared about anyway:
7afb94da3cd8 ("mwifiex: update set_mac_address logic")

So the following is probably a better patch now :)

[PATCH] mwifiex: delete unused mwifiex_get_intf_num()
https://lkml.kernel.org/linux-wireless/20191210003911.28066-1-briannorris@chromium.org/T/#u
https://patchwork.kernel.org/patch/11281155/

I'll mark $subject patch as Superseded in Patchwork.

Brian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-10  0:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 23:51 [PATCH] mwifiex: start out with BSS type ANY, not STA Brian Norris
2019-12-10  0:41 ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).