aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-12-09 13:58:59 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-13 15:23:28 -0500
commitdbd2fd656f2060abfd3a16257f8b51ec60f6d2ed (patch)
tree71e61430bd8593f2ad8f1c741b5a8a8be4a9d690 /include
parent897bed8b4320774e56f282cdc1cceb4d77442797 (diff)
cfg80211/nl80211: separate unicast/multicast default TX keys
Allow userspace to specify that a given key is default only for unicast and/or multicast transmissions. Only WEP keys are for both, WPA/RSN keys set here are GTKs for multicast only. For more future flexibility, allow to specify all combiations. Wireless extensions can only set both so use nl80211; WEP keys (connect keys) must be set as default for both (but 802.1X WEP is still possible). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h27
-rw-r--r--include/net/cfg80211.h5
2 files changed, 31 insertions, 1 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 380421253d1..b8fa25d741b 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -851,6 +851,10 @@ enum nl80211_commands {
851 * 851 *
852 * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16) 852 * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16)
853 * 853 *
854 * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
855 * attributes, specifying what a key should be set as default as.
856 * See &enum nl80211_key_default_types.
857 *
854 * @NL80211_ATTR_MAX: highest attribute number currently defined 858 * @NL80211_ATTR_MAX: highest attribute number currently defined
855 * @__NL80211_ATTR_AFTER_LAST: internal use 859 * @__NL80211_ATTR_AFTER_LAST: internal use
856 */ 860 */
@@ -1029,6 +1033,8 @@ enum nl80211_attrs {
1029 1033
1030 NL80211_ATTR_BSS_HT_OPMODE, 1034 NL80211_ATTR_BSS_HT_OPMODE,
1031 1035
1036 NL80211_ATTR_KEY_DEFAULT_TYPES,
1037
1032 /* add attributes here, update the policy in nl80211.c */ 1038 /* add attributes here, update the policy in nl80211.c */
1033 1039
1034 __NL80211_ATTR_AFTER_LAST, 1040 __NL80211_ATTR_AFTER_LAST,
@@ -1775,6 +1781,23 @@ enum nl80211_wpa_versions {
1775}; 1781};
1776 1782
1777/** 1783/**
1784 * enum nl80211_key_default_types - key default types
1785 * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid
1786 * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default
1787 * unicast key
1788 * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default
1789 * multicast key
1790 * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types
1791 */
1792enum nl80211_key_default_types {
1793 __NL80211_KEY_DEFAULT_TYPE_INVALID,
1794 NL80211_KEY_DEFAULT_TYPE_UNICAST,
1795 NL80211_KEY_DEFAULT_TYPE_MULTICAST,
1796
1797 NUM_NL80211_KEY_DEFAULT_TYPES
1798};
1799
1800/**
1778 * enum nl80211_key_attributes - key attributes 1801 * enum nl80211_key_attributes - key attributes
1779 * @__NL80211_KEY_INVALID: invalid 1802 * @__NL80211_KEY_INVALID: invalid
1780 * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of 1803 * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of
@@ -1790,6 +1813,9 @@ enum nl80211_wpa_versions {
1790 * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not 1813 * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
1791 * specified the default depends on whether a MAC address was 1814 * specified the default depends on whether a MAC address was
1792 * given with the command using the key or not (u32) 1815 * given with the command using the key or not (u32)
1816 * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
1817 * attributes, specifying what a key should be set as default as.
1818 * See &enum nl80211_key_default_types.
1793 * @__NL80211_KEY_AFTER_LAST: internal 1819 * @__NL80211_KEY_AFTER_LAST: internal
1794 * @NL80211_KEY_MAX: highest key attribute 1820 * @NL80211_KEY_MAX: highest key attribute
1795 */ 1821 */
@@ -1802,6 +1828,7 @@ enum nl80211_key_attributes {
1802 NL80211_KEY_DEFAULT, 1828 NL80211_KEY_DEFAULT,
1803 NL80211_KEY_DEFAULT_MGMT, 1829 NL80211_KEY_DEFAULT_MGMT,
1804 NL80211_KEY_TYPE, 1830 NL80211_KEY_TYPE,
1831 NL80211_KEY_DEFAULT_TYPES,
1805 1832
1806 /* keep last */ 1833 /* keep last */
1807 __NL80211_KEY_AFTER_LAST, 1834 __NL80211_KEY_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 4d5acb01363..22be7c625b7 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1211,7 +1211,7 @@ struct cfg80211_ops {
1211 u8 key_index, bool pairwise, const u8 *mac_addr); 1211 u8 key_index, bool pairwise, const u8 *mac_addr);
1212 int (*set_default_key)(struct wiphy *wiphy, 1212 int (*set_default_key)(struct wiphy *wiphy,
1213 struct net_device *netdev, 1213 struct net_device *netdev,
1214 u8 key_index); 1214 u8 key_index, bool unicast, bool multicast);
1215 int (*set_default_mgmt_key)(struct wiphy *wiphy, 1215 int (*set_default_mgmt_key)(struct wiphy *wiphy,
1216 struct net_device *netdev, 1216 struct net_device *netdev,
1217 u8 key_index); 1217 u8 key_index);
@@ -1393,6 +1393,8 @@ struct cfg80211_ops {
1393 * control port protocol ethertype. The device also honours the 1393 * control port protocol ethertype. The device also honours the
1394 * control_port_no_encrypt flag. 1394 * control_port_no_encrypt flag.
1395 * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. 1395 * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN.
1396 * @WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS: The device supports separate
1397 * unicast and multicast TX keys.
1396 */ 1398 */
1397enum wiphy_flags { 1399enum wiphy_flags {
1398 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 1400 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -1404,6 +1406,7 @@ enum wiphy_flags {
1404 WIPHY_FLAG_4ADDR_STATION = BIT(6), 1406 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1405 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), 1407 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7),
1406 WIPHY_FLAG_IBSS_RSN = BIT(8), 1408 WIPHY_FLAG_IBSS_RSN = BIT(8),
1409 WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS= BIT(9),
1407}; 1410};
1408 1411
1409struct mac_address { 1412struct mac_address {