summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/cfg80211.h3
-rw-r--r--include/uapi/linux/nl80211.h14
-rw-r--r--net/wireless/nl80211.c26
3 files changed, 42 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index de2894a4ad10..0bd957b37208 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -647,6 +647,8 @@ struct survey_info {
647 * allowed through even on unauthorized ports 647 * allowed through even on unauthorized ports
648 * @control_port_no_encrypt: TRUE to prevent encryption of control port 648 * @control_port_no_encrypt: TRUE to prevent encryption of control port
649 * protocol frames. 649 * protocol frames.
650 * @control_port_over_nl80211: TRUE if userspace expects to exchange control
651 * port frames over NL80211 instead of the network interface.
650 * @wep_keys: static WEP keys, if not NULL points to an array of 652 * @wep_keys: static WEP keys, if not NULL points to an array of
651 * CFG80211_MAX_WEP_KEYS WEP keys 653 * CFG80211_MAX_WEP_KEYS WEP keys
652 * @wep_tx_key: key index (0..3) of the default TX static WEP key 654 * @wep_tx_key: key index (0..3) of the default TX static WEP key
@@ -662,6 +664,7 @@ struct cfg80211_crypto_settings {
662 bool control_port; 664 bool control_port;
663 __be16 control_port_ethertype; 665 __be16 control_port_ethertype;
664 bool control_port_no_encrypt; 666 bool control_port_no_encrypt;
667 bool control_port_over_nl80211;
665 struct key_params *wep_keys; 668 struct key_params *wep_keys;
666 int wep_tx_key; 669 int wep_tx_key;
667 const u8 *psk; 670 const u8 *psk;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 3167d6f7fc68..15daf5e2638d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -542,7 +542,8 @@
542 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP, 542 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP,
543 * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, 543 * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
544 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, 544 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
545 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, %NL80211_ATTR_MAC_HINT, and 545 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
546 * %NL80211_ATTR_CONTROL_PORT_OVER_NL80211, %NL80211_ATTR_MAC_HINT, and
546 * %NL80211_ATTR_WIPHY_FREQ_HINT. 547 * %NL80211_ATTR_WIPHY_FREQ_HINT.
547 * If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are 548 * If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are
548 * restrictions on BSS selection, i.e., they effectively prevent roaming 549 * restrictions on BSS selection, i.e., they effectively prevent roaming
@@ -1488,6 +1489,15 @@ enum nl80211_commands {
1488 * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with 1489 * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
1489 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom 1490 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
1490 * ethertype frames used for key negotiation must not be encrypted. 1491 * ethertype frames used for key negotiation must not be encrypted.
1492 * @NL80211_ATTR_CONTROL_PORT_OVER_NL80211: A flag indicating whether control
1493 * port frames (e.g. of type given in %NL80211_ATTR_CONTROL_PORT_ETHERTYPE)
1494 * will be sent directly to the network interface or sent via the NL80211
1495 * socket. If this attribute is missing, then legacy behavior of sending
1496 * control port frames directly to the network interface is used. If the
1497 * flag is included, then control port frames are sent over NL80211 instead
1498 * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is
1499 * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER
1500 * flag.
1491 * 1501 *
1492 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. 1502 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
1493 * We recommend using nested, driver-specific attributes within this. 1503 * We recommend using nested, driver-specific attributes within this.
@@ -2647,6 +2657,8 @@ enum nl80211_attrs {
2647 NL80211_ATTR_NSS, 2657 NL80211_ATTR_NSS,
2648 NL80211_ATTR_ACK_SIGNAL, 2658 NL80211_ATTR_ACK_SIGNAL,
2649 2659
2660 NL80211_ATTR_CONTROL_PORT_OVER_NL80211,
2661
2650 /* add attributes here, update the policy in nl80211.c */ 2662 /* add attributes here, update the policy in nl80211.c */
2651 2663
2652 __NL80211_ATTR_AFTER_LAST, 2664 __NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 6eb286784924..d3b14d9d002a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -287,6 +287,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
287 [NL80211_ATTR_CONTROL_PORT] = { .type = NLA_FLAG }, 287 [NL80211_ATTR_CONTROL_PORT] = { .type = NLA_FLAG },
288 [NL80211_ATTR_CONTROL_PORT_ETHERTYPE] = { .type = NLA_U16 }, 288 [NL80211_ATTR_CONTROL_PORT_ETHERTYPE] = { .type = NLA_U16 },
289 [NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT] = { .type = NLA_FLAG }, 289 [NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT] = { .type = NLA_FLAG },
290 [NL80211_ATTR_CONTROL_PORT_OVER_NL80211] = { .type = NLA_FLAG },
290 [NL80211_ATTR_PRIVACY] = { .type = NLA_FLAG }, 291 [NL80211_ATTR_PRIVACY] = { .type = NLA_FLAG },
291 [NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 }, 292 [NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 },
292 [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, 293 [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 },
@@ -8211,6 +8212,22 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
8211 return err; 8212 return err;
8212} 8213}
8213 8214
8215static int validate_pae_over_nl80211(struct cfg80211_registered_device *rdev,
8216 struct genl_info *info)
8217{
8218 if (!info->attrs[NL80211_ATTR_SOCKET_OWNER]) {
8219 GENL_SET_ERR_MSG(info, "SOCKET_OWNER not set");
8220 return -EINVAL;
8221 }
8222
8223 if (!rdev->ops->tx_control_port ||
8224 !wiphy_ext_feature_isset(&rdev->wiphy,
8225 NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211))
8226 return -EOPNOTSUPP;
8227
8228 return 0;
8229}
8230
8214static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev, 8231static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
8215 struct genl_info *info, 8232 struct genl_info *info,
8216 struct cfg80211_crypto_settings *settings, 8233 struct cfg80211_crypto_settings *settings,
@@ -8234,6 +8251,15 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
8234 } else 8251 } else
8235 settings->control_port_ethertype = cpu_to_be16(ETH_P_PAE); 8252 settings->control_port_ethertype = cpu_to_be16(ETH_P_PAE);
8236 8253
8254 if (info->attrs[NL80211_ATTR_CONTROL_PORT_OVER_NL80211]) {
8255 int r = validate_pae_over_nl80211(rdev, info);
8256
8257 if (r < 0)
8258 return r;
8259
8260 settings->control_port_over_nl80211 = true;
8261 }
8262
8237 if (info->attrs[NL80211_ATTR_CIPHER_SUITES_PAIRWISE]) { 8263 if (info->attrs[NL80211_ATTR_CIPHER_SUITES_PAIRWISE]) {
8238 void *data; 8264 void *data;
8239 int len, i; 8265 int len, i;