aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2014-06-11 10:18:25 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-06-23 08:28:17 -0400
commitc887f0d3a03283cb6fe2c32aae62229bebd3fa32 (patch)
tree36a9a27755c5d10048974e98c3a90ff53c3ea03b
parentdb67d661e82da22f751585a7f284a9251e8a2a51 (diff)
mac80211: add API to request TDLS operation from userspace
Write a mac80211 to the cfg80211 API for requesting a userspace TDLS operation. Define TDLS specific reason codes that can be used here. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/linux/ieee80211.h3
-rw-r--r--include/net/mac80211.h13
-rw-r--r--net/mac80211/tdls.c17
3 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 6bff13f74050..75d17e15da33 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1621,6 +1621,9 @@ enum ieee80211_reasoncode {
1621 WLAN_REASON_INVALID_RSN_IE_CAP = 22, 1621 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
1622 WLAN_REASON_IEEE8021X_FAILED = 23, 1622 WLAN_REASON_IEEE8021X_FAILED = 23,
1623 WLAN_REASON_CIPHER_SUITE_REJECTED = 24, 1623 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
1624 /* TDLS (802.11z) */
1625 WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE = 25,
1626 WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED = 26,
1624 /* 802.11e */ 1627 /* 802.11e */
1625 WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32, 1628 WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32,
1626 WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33, 1629 WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33,
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 421b6ecb4b2c..8d876dc8b299 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4815,4 +4815,17 @@ int ieee80211_parse_p2p_noa(const struct ieee80211_p2p_noa_attr *attr,
4815 */ 4815 */
4816void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf); 4816void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf);
4817 4817
4818/**
4819 * ieee80211_tdls_oper - request userspace to perform a TDLS operation
4820 * @vif: virtual interface
4821 * @peer: the peer's destination address
4822 * @oper: the requested TDLS operation
4823 * @reason_code: reason code for the operation, valid for TDLS teardown
4824 * @gfp: allocation flags
4825 *
4826 * See cfg80211_tdls_oper_request().
4827 */
4828void ieee80211_tdls_oper_request(struct ieee80211_vif *vif, const u8 *peer,
4829 enum nl80211_tdls_operation oper,
4830 u16 reason_code, gfp_t gfp);
4818#endif /* MAC80211_H */ 4831#endif /* MAC80211_H */
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index 0ba7e4c029c8..6f3a3ad0cb7c 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -8,6 +8,7 @@
8 */ 8 */
9 9
10#include <linux/ieee80211.h> 10#include <linux/ieee80211.h>
11#include <net/cfg80211.h>
11#include "ieee80211_i.h" 12#include "ieee80211_i.h"
12 13
13/* give usermode some time for retries in setting up the TDLS session */ 14/* give usermode some time for retries in setting up the TDLS session */
@@ -514,3 +515,19 @@ int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
514 mutex_unlock(&local->mtx); 515 mutex_unlock(&local->mtx);
515 return ret; 516 return ret;
516} 517}
518
519void ieee80211_tdls_oper_request(struct ieee80211_vif *vif, const u8 *peer,
520 enum nl80211_tdls_operation oper,
521 u16 reason_code, gfp_t gfp)
522{
523 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
524
525 if (vif->type != NL80211_IFTYPE_STATION || !vif->bss_conf.assoc) {
526 sdata_err(sdata, "Discarding TDLS oper %d - not STA or disconnected\n",
527 oper);
528 return;
529 }
530
531 cfg80211_tdls_oper_request(sdata->dev, peer, oper, reason_code, gfp);
532}
533EXPORT_SYMBOL(ieee80211_tdls_oper_request);