From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Brian Norris <briannorris@chromium.org>,
Kalle Valo <kvalo@codeaurora.org>,
Sasha Levin <sashal@kernel.org>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 081/192] mwifiex: don't advertise IBSS features without FW support
Date: Wed, 27 Mar 2019 14:08:33 -0400 [thread overview]
Message-ID: <20190327181025.13507-81-sashal@kernel.org> (raw)
In-Reply-To: <20190327181025.13507-1-sashal@kernel.org>
From: Brian Norris <briannorris@chromium.org>
[ Upstream commit 6f21ab30469d670de620f758330aca9f3433f693 ]
As it is, doing something like
# iw phy phy0 interface add foobar type ibss
on a firmware that doesn't have ad-hoc support just yields failures of
HostCmd_CMD_SET_BSS_MODE, which happened to return a '-1' error code
(-EPERM? not really right...) and sometimes may even crash the firmware
along the way.
Let's parse the firmware capability flag while registering the wiphy, so
we don't allow attempting IBSS at all, and we get a proper -EOPNOTSUPP
from nl80211 instead.
Fixes: e267e71e68ae ("mwifiex: Disable adhoc feature based on firmware capability")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index adc88433faa8..2d87ebbfa4da 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4282,11 +4282,13 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
wiphy->mgmt_stypes = mwifiex_mgmt_stypes;
wiphy->max_remain_on_channel_duration = 5000;
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
- BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_P2P_CLIENT) |
BIT(NL80211_IFTYPE_P2P_GO) |
BIT(NL80211_IFTYPE_AP);
+ if (ISSUPP_ADHOC_ENABLED(adapter->fw_cap_info))
+ wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC);
+
wiphy->bands[NL80211_BAND_2GHZ] = &mwifiex_band_2ghz;
if (adapter->config_bands & BAND_A)
wiphy->bands[NL80211_BAND_5GHZ] = &mwifiex_band_5ghz;
@@ -4346,11 +4348,13 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
wiphy->available_antennas_tx = BIT(adapter->number_of_antenna) - 1;
wiphy->available_antennas_rx = BIT(adapter->number_of_antenna) - 1;
- wiphy->features |= NL80211_FEATURE_HT_IBSS |
- NL80211_FEATURE_INACTIVITY_TIMER |
+ wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER |
NL80211_FEATURE_LOW_PRIORITY_SCAN |
NL80211_FEATURE_NEED_OBSS_SCAN;
+ if (ISSUPP_ADHOC_ENABLED(adapter->fw_cap_info))
+ wiphy->features |= NL80211_FEATURE_HT_IBSS;
+
if (ISSUPP_RANDOM_MAC(adapter->fw_cap_info))
wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR |
NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR |
--
2.19.1
next prev parent reply other threads:[~2019-03-27 19:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190327181025.13507-1-sashal@kernel.org>
2019-03-27 18:07 ` [PATCH AUTOSEL 4.19 008/192] net/mlx5: Avoid panic when setting vport rate Sasha Levin
2019-03-27 18:07 ` [PATCH AUTOSEL 4.19 009/192] net/mlx5: Avoid panic when setting vport mac, getting vport config Sasha Levin
2019-03-27 18:07 ` [PATCH AUTOSEL 4.19 013/192] net: stmmac: Avoid sometimes uninitialized Clang warnings Sasha Levin
2019-03-27 18:07 ` [PATCH AUTOSEL 4.19 014/192] enic: fix build warning without CONFIG_CPUMASK_OFFSTACK Sasha Levin
2019-03-27 18:07 ` [PATCH AUTOSEL 4.19 015/192] libbpf: force fixdep compilation at the start of the build Sasha Levin
2019-03-27 18:07 ` [PATCH AUTOSEL 4.19 041/192] netfilter: nf_tables: check the result of dereferencing base_chain->stats Sasha Levin
2019-03-27 18:07 ` [PATCH AUTOSEL 4.19 042/192] netfilter: conntrack: tcp: only close if RST matches exact sequence Sasha Levin
2019-03-27 18:07 ` [PATCH AUTOSEL 4.19 047/192] wil6210: check null pointer in _wil_cfg80211_merge_extra_ies Sasha Levin
2019-03-27 18:08 ` [PATCH AUTOSEL 4.19 048/192] mt76: fix a leaked reference by adding a missing of_node_put Sasha Levin
2019-03-27 18:08 ` [PATCH AUTOSEL 4.19 063/192] net: dsa: mv88e6xxx: Add lockdep classes to fix false positive splat Sasha Levin
2019-03-27 18:08 ` [PATCH AUTOSEL 4.19 064/192] e1000e: Fix -Wformat-truncation warnings Sasha Levin
2019-03-27 18:08 ` [PATCH AUTOSEL 4.19 065/192] mlxsw: spectrum: Avoid " Sasha Levin
2019-03-27 18:08 ` Sasha Levin [this message]
2019-03-27 18:08 ` [PATCH AUTOSEL 4.19 091/192] mt76: usb: do not run mt76u_queues_deinit twice Sasha Levin
2019-03-27 18:08 ` [PATCH AUTOSEL 4.19 100/192] iwlwifi: pcie: fix emergency path Sasha Levin
2019-03-27 18:08 ` [PATCH AUTOSEL 4.19 103/192] selftests: skip seccomp get_metadata test if not real root Sasha Levin
2019-03-27 18:08 ` [PATCH AUTOSEL 4.19 106/192] netfilter: conntrack: fix cloned unconfirmed skb->_nfct race in __nf_conntrack_confirm Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 110/192] ath10k: fix shadow register implementation for WCN3990 Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 118/192] net: marvell: mvpp2: fix stuck in-band SGMII negotiation Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 120/192] net: phy: consider latched link-down status in polling mode Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 127/192] e1000e: fix cyclic resets at link up with active tx Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 128/192] e1000e: Exclude device from suspend direct complete optimization Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 132/192] iwlwifi: mvm: fix RFH config command with >=10 CPUs Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 142/192] mt7601u: bump supported EEPROM version Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 146/192] bpf: fix missing prototype warnings Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 147/192] selftests/bpf: skip verifier tests for unsupported program types Sasha Levin
2019-03-27 18:09 ` [PATCH AUTOSEL 4.19 163/192] Bluetooth: Verify that l2cap_get_conf_opt provides large enough buffer Sasha Levin
2019-03-27 18:10 ` [PATCH AUTOSEL 4.19 171/192] netfilter: physdev: relax br_netfilter dependency Sasha Levin
2019-03-27 18:10 ` [PATCH AUTOSEL 4.19 180/192] brcmfmac: Use firmware_request_nowarn for the clm_blob Sasha Levin
2019-03-27 18:10 ` [PATCH AUTOSEL 4.19 181/192] wlcore: Fix memory leak in case wl12xx_fetch_firmware failure Sasha Levin
2019-03-27 18:10 ` [PATCH AUTOSEL 4.19 190/192] net: stmmac: Avoid one more sometimes uninitialized Clang warning Sasha Levin
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=20190327181025.13507-81-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=briannorris@chromium.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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).