From: Brian Norris <briannorris@chromium.org>
To: linux-wireless@vger.kernel.org
Cc: <linux-kernel@vger.kernel.org>,
Ganapathi Bhat <ganapathi.bhat@nxp.com>,
Nishant Sarmukadam <nishants@marvell.com>,
Amitkumar Karwar <amitkarwar@gmail.com>,
Xinming Hu <huxinming820@gmail.com>,
Brian Norris <briannorris@chromium.org>
Subject: [PATCH] mwifiex: start out with BSS type ANY, not STA
Date: Mon, 9 Dec 2019 15:51:16 -0800 [thread overview]
Message-ID: <20191209235116.142692-1-briannorris@chromium.org> (raw)
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
next reply other threads:[~2019-12-09 23:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-09 23:51 Brian Norris [this message]
2019-12-10 0:41 ` [PATCH] mwifiex: start out with BSS type ANY, not STA Brian Norris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191209235116.142692-1-briannorris@chromium.org \
--to=briannorris@chromium.org \
--cc=amitkarwar@gmail.com \
--cc=ganapathi.bhat@nxp.com \
--cc=huxinming820@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nishants@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).