diff mbox series

[RFC,v1,1/4] ath6kl: Do not allow deleting station in IBSS mode.

Message ID 20191209102808.12014-2-nicolas.cavallari@green-communications.fr (mailing list archive)
State RFC
Delegated to: Kalle Valo
Headers show
Series [RFC,v1,1/4] ath6kl: Do not allow deleting station in IBSS mode. | expand

Commit Message

Nicolas Cavallari Dec. 9, 2019, 10:28 a.m. UTC
In preparation of allowing userspace to explicitly reset station state
in IBSS mode, reject attempts to delete stations in IBSS mode with error
ENOTSUPP.

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
--
I do not know if the driver could possibly support this, so take the
safe route and reject it.
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 37cf602d8adf..c894b9756605 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2993,6 +2993,9 @@  static int ath6kl_del_station(struct wiphy *wiphy, struct net_device *dev,
 	struct ath6kl *ar = ath6kl_priv(dev);
 	struct ath6kl_vif *vif = netdev_priv(dev);
 	const u8 *addr = params->mac ? params->mac : bcast_addr;
+	if (vif->wdev.iftype != NL80211_IFTYPE_AP &&
+	    vif->wdev.iftype != NL80211_IFTYPE_P2P_GO)
+		return -ENOTSUPP;
 
 	return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, WMI_AP_DEAUTH,
 				      addr, WLAN_REASON_PREV_AUTH_NOT_VALID);