aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2013-01-18 00:48:45 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-25 12:36:44 -0500
commit77765eaf5cfb6b8dd98ec8b54b411d74ff6095f1 (patch)
tree2b32fca883ee0c5a149290b3df3d97b21cb85549 /include/net
parent6d45a74b1f2e42e41c9931bfb35cdb789d0bb3ea (diff)
cfg80211/nl80211: add API for MAC address ACLs
Add API to enable drivers to implement MAC address based access control in AP/P2P GO mode. Capable drivers advertise this capability by setting the maximum number of MAC addresses in such a list in wiphy->max_acl_mac_addrs. An initial ACL may be given to the NL80211_CMD_START_AP command and/or changed later with NL80211_CMD_SET_MAC_ACL. Black- and whitelists are supported, but not simultaneously. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> [rewrite commit log, many cleanups] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 183033789e69..36e076e374d2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -532,6 +532,22 @@ struct mac_address {
532}; 532};
533 533
534/** 534/**
535 * struct cfg80211_acl_data - Access control list data
536 *
537 * @acl_policy: ACL policy to be applied on the station's
538 entry specified by mac_addr
539 * @n_acl_entries: Number of MAC address entries passed
540 * @mac_addrs: List of MAC addresses of stations to be used for ACL
541 */
542struct cfg80211_acl_data {
543 enum nl80211_acl_policy acl_policy;
544 int n_acl_entries;
545
546 /* Keep it last */
547 struct mac_address mac_addrs[];
548};
549
550/**
535 * struct cfg80211_ap_settings - AP configuration 551 * struct cfg80211_ap_settings - AP configuration
536 * 552 *
537 * Used to configure an AP interface. 553 * Used to configure an AP interface.
@@ -550,6 +566,8 @@ struct mac_address {
550 * @inactivity_timeout: time in seconds to determine station's inactivity. 566 * @inactivity_timeout: time in seconds to determine station's inactivity.
551 * @p2p_ctwindow: P2P CT Window 567 * @p2p_ctwindow: P2P CT Window
552 * @p2p_opp_ps: P2P opportunistic PS 568 * @p2p_opp_ps: P2P opportunistic PS
569 * @acl: ACL configuration used by the drivers which has support for
570 * MAC address based access control
553 */ 571 */
554struct cfg80211_ap_settings { 572struct cfg80211_ap_settings {
555 struct cfg80211_chan_def chandef; 573 struct cfg80211_chan_def chandef;
@@ -566,6 +584,7 @@ struct cfg80211_ap_settings {
566 int inactivity_timeout; 584 int inactivity_timeout;
567 u8 p2p_ctwindow; 585 u8 p2p_ctwindow;
568 bool p2p_opp_ps; 586 bool p2p_opp_ps;
587 const struct cfg80211_acl_data *acl;
569}; 588};
570 589
571/** 590/**
@@ -1800,6 +1819,13 @@ struct cfg80211_gtk_rekey_data {
1800 * 1819 *
1801 * @start_p2p_device: Start the given P2P device. 1820 * @start_p2p_device: Start the given P2P device.
1802 * @stop_p2p_device: Stop the given P2P device. 1821 * @stop_p2p_device: Stop the given P2P device.
1822 *
1823 * @set_mac_acl: Sets MAC address control list in AP and P2P GO mode.
1824 * Parameters include ACL policy, an array of MAC address of stations
1825 * and the number of MAC addresses. If there is already a list in driver
1826 * this new list replaces the existing one. Driver has to clear its ACL
1827 * when number of MAC addresses entries is passed as 0. Drivers which
1828 * advertise the support for MAC based ACL have to implement this callback.
1803 */ 1829 */
1804struct cfg80211_ops { 1830struct cfg80211_ops {
1805 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 1831 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2020,6 +2046,9 @@ struct cfg80211_ops {
2020 struct wireless_dev *wdev); 2046 struct wireless_dev *wdev);
2021 void (*stop_p2p_device)(struct wiphy *wiphy, 2047 void (*stop_p2p_device)(struct wiphy *wiphy,
2022 struct wireless_dev *wdev); 2048 struct wireless_dev *wdev);
2049
2050 int (*set_mac_acl)(struct wiphy *wiphy, struct net_device *dev,
2051 const struct cfg80211_acl_data *params);
2023}; 2052};
2024 2053
2025/* 2054/*
@@ -2325,6 +2354,9 @@ struct wiphy_wowlan_support {
2325 * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features. 2354 * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features.
2326 * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden. 2355 * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden.
2327 * If null, then none can be over-ridden. 2356 * If null, then none can be over-ridden.
2357 *
2358 * @max_acl_mac_addrs: Maximum number of MAC addresses that the device
2359 * supports for ACL.
2328 */ 2360 */
2329struct wiphy { 2361struct wiphy {
2330 /* assign these fields before you register the wiphy */ 2362 /* assign these fields before you register the wiphy */
@@ -2346,6 +2378,8 @@ struct wiphy {
2346 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 2378 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
2347 u16 interface_modes; 2379 u16 interface_modes;
2348 2380
2381 u16 max_acl_mac_addrs;
2382
2349 u32 flags, features; 2383 u32 flags, features;
2350 2384
2351 u32 ap_sme_capa; 2385 u32 ap_sme_capa;