Search Linux Wireless

[RFC] ath6kl: Use new del_station parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows user space (mainly, hostapd or wpa_supplicant in AP mode) to
specify whether to use Deauthentication or Disassociation frame and
which reason code to use in that frame when removing the station.

Signed-off-by: Jouni Malinen <jouni@xxxxxxxxxxxxxxxx>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

This uses the proposed del_station() changes that I just posted on
linux-wireless. Once those are accepted into cfg80211, the following
changes in ath6kl could be used to take the extensions into use. This is
sent as an RFC since I have not had any chance of testing this yet.


diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 7a53378..f787bc7 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2981,9 +2981,15 @@ 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;
-
-	return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, WMI_AP_DEAUTH,
-				      addr, WLAN_REASON_PREV_AUTH_NOT_VALID);
+	u8 cmd = WMI_AP_DEAUTH;
+	u16 reason = WLAN_REASON_PREV_AUTH_NOT_VALID;
+
+	if (params->subtype == IEEE80211_STYPE_DISASSOC >> 4)
+		cmd = WMI_AP_DISASSOC;
+	if (params->reason_code)
+		reason = params->reason_code;
+	return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, cmd, addr,
+				      reason);
 }
 
 static int ath6kl_change_station(struct wiphy *wiphy, struct net_device *dev,
-- 
1.9.1


-- 
Jouni Malinen                                            PGP id EFC895FA
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux