2019-12-09 10:29:33

by Nicolas Cavallari

[permalink] [raw]
Subject: [RFC PATCH v1 1/4] ath6kl: Do not allow deleting station in IBSS mode.

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 <[email protected]>
--
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 --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);
--
2.24.0