mwifiex: don't advertise IBSS features without FW support
authorBrian Norris <briannorris@chromium.org>
Fri, 15 Feb 2019 00:31:29 +0000 (16:31 -0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 19 Feb 2019 15:15:44 +0000 (17:15 +0200)
commit5d94d87062c24ec295742c5c2ce498ad8f07213f
treeae4352e52dccc855e9f9ac6325ecb3ae93e0d154
parentd2d68d47314850a25dcd0d829b0cfcdae768d442
mwifiex: don't advertise IBSS features without FW support

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: fca2bd9626fe ("mwifiex: Disable adhoc feature based on firmware capability")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/cfg80211.c