aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Dutt Undekari <usdutt@qti.qualcomm.com>2014-02-20 05:52:09 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-20 05:55:25 -0500
commitdf942e7ba70cd0a7aa9e0432b8a6a328de2c5574 (patch)
tree943599f26af1396618079dc1c789df49e7b1c654
parentbf5f48339a019c9b4b42284c3f45d58942cbda27 (diff)
cfg80211: Pass TDLS peer capability information in tdls_mgmt
While framing the TDLS Setup Confirmation frame, the driver needs to know if the TDLS peer is VHT/HT/WMM capable and thus shall construct the VHT/HT operation / WMM parameter elements accordingly. Supplicant determines if the TDLS peer is VHT/HT/WMM capable based on the presence of the respective IEs in the received TDLS Setup Response frame. The host driver should not need to parse the received TDLS Response frame and thus, should be able to rely on the supplicant to indicate the capability of the peer through additional flags while transmitting the TDLS Setup Confirmation frame through tdls_mgmt operations. Signed-off-by: Sunil Dutt Undekari <usdutt@qti.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c4
-rw-r--r--include/net/cfg80211.h3
-rw-r--r--include/uapi/linux/nl80211.h21
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/wireless/nl80211.c7
-rw-r--r--net/wireless/rdev-ops.h9
-rw-r--r--net/wireless/trace.h12
7 files changed, 47 insertions, 13 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 436ba437a4ba..6948a97af839 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2600,8 +2600,8 @@ static int mwifiex_cfg80211_set_coalesce(struct wiphy *wiphy,
2600static int 2600static int
2601mwifiex_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, 2601mwifiex_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
2602 u8 *peer, u8 action_code, u8 dialog_token, 2602 u8 *peer, u8 action_code, u8 dialog_token,
2603 u16 status_code, const u8 *extra_ies, 2603 u16 status_code, u32 peer_capability,
2604 size_t extra_ies_len) 2604 const u8 *extra_ies, size_t extra_ies_len)
2605{ 2605{
2606 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 2606 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
2607 int ret; 2607 int ret;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9f90554e88c4..c89a5b5bd103 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2465,7 +2465,8 @@ struct cfg80211_ops {
2465 2465
2466 int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev, 2466 int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev,
2467 u8 *peer, u8 action_code, u8 dialog_token, 2467 u8 *peer, u8 action_code, u8 dialog_token,
2468 u16 status_code, const u8 *buf, size_t len); 2468 u16 status_code, u32 peer_capability,
2469 const u8 *buf, size_t len);
2469 int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev, 2470 int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev,
2470 u8 *peer, enum nl80211_tdls_operation oper); 2471 u8 *peer, enum nl80211_tdls_operation oper);
2471 2472
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index ba1f7625625c..47d7087513e0 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1575,6 +1575,9 @@ enum nl80211_commands {
1575 * advertise values that cannot always be met. In such cases, an attempt 1575 * advertise values that cannot always be met. In such cases, an attempt
1576 * to add a new station entry with @NL80211_CMD_NEW_STATION may fail. 1576 * to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
1577 * 1577 *
1578 * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
1579 * As specified in the &enum nl80211_tdls_peer_capability.
1580 *
1578 * @NL80211_ATTR_MAX: highest attribute number currently defined 1581 * @NL80211_ATTR_MAX: highest attribute number currently defined
1579 * @__NL80211_ATTR_AFTER_LAST: internal use 1582 * @__NL80211_ATTR_AFTER_LAST: internal use
1580 */ 1583 */
@@ -1908,6 +1911,8 @@ enum nl80211_attrs {
1908 1911
1909 NL80211_ATTR_MAX_AP_ASSOC_STA, 1912 NL80211_ATTR_MAX_AP_ASSOC_STA,
1910 1913
1914 NL80211_ATTR_TDLS_PEER_CAPABILITY,
1915
1911 /* add attributes here, update the policy in nl80211.c */ 1916 /* add attributes here, update the policy in nl80211.c */
1912 1917
1913 __NL80211_ATTR_AFTER_LAST, 1918 __NL80211_ATTR_AFTER_LAST,
@@ -4074,4 +4079,20 @@ struct nl80211_vendor_cmd_info {
4074 __u32 subcmd; 4079 __u32 subcmd;
4075}; 4080};
4076 4081
4082/**
4083 * enum nl80211_tdls_peer_capability - TDLS peer flags.
4084 *
4085 * Used by tdls_mgmt() to determine which conditional elements need
4086 * to be added to TDLS Setup frames.
4087 *
4088 * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
4089 * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
4090 * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
4091 */
4092enum nl80211_tdls_peer_capability {
4093 NL80211_TDLS_PEER_HT = 1<<0,
4094 NL80211_TDLS_PEER_VHT = 1<<1,
4095 NL80211_TDLS_PEER_WMM = 1<<2,
4096};
4097
4077#endif /* __LINUX_NL80211_H */ 4098#endif /* __LINUX_NL80211_H */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 3849fd07a321..1acb29109b45 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3644,8 +3644,8 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev,
3644 3644
3645static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, 3645static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
3646 u8 *peer, u8 action_code, u8 dialog_token, 3646 u8 *peer, u8 action_code, u8 dialog_token,
3647 u16 status_code, const u8 *extra_ies, 3647 u16 status_code, u32 peer_capability,
3648 size_t extra_ies_len) 3648 const u8 *extra_ies, size_t extra_ies_len)
3649{ 3649{
3650 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 3650 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
3651 struct ieee80211_local *local = sdata->local; 3651 struct ieee80211_local *local = sdata->local;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 058aa0e1a462..be836098d342 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -384,6 +384,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
384 .len = IEEE80211_QOS_MAP_LEN_MAX }, 384 .len = IEEE80211_QOS_MAP_LEN_MAX },
385 [NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN }, 385 [NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN },
386 [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 }, 386 [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
387 [NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
387}; 388};
388 389
389/* policy for the key attributes */ 390/* policy for the key attributes */
@@ -7269,6 +7270,7 @@ static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info)
7269 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 7270 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7270 struct net_device *dev = info->user_ptr[1]; 7271 struct net_device *dev = info->user_ptr[1];
7271 u8 action_code, dialog_token; 7272 u8 action_code, dialog_token;
7273 u32 peer_capability = 0;
7272 u16 status_code; 7274 u16 status_code;
7273 u8 *peer; 7275 u8 *peer;
7274 7276
@@ -7287,9 +7289,12 @@ static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info)
7287 action_code = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_ACTION]); 7289 action_code = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_ACTION]);
7288 status_code = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]); 7290 status_code = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]);
7289 dialog_token = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN]); 7291 dialog_token = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN]);
7292 if (info->attrs[NL80211_ATTR_TDLS_PEER_CAPABILITY])
7293 peer_capability =
7294 nla_get_u32(info->attrs[NL80211_ATTR_TDLS_PEER_CAPABILITY]);
7290 7295
7291 return rdev_tdls_mgmt(rdev, dev, peer, action_code, 7296 return rdev_tdls_mgmt(rdev, dev, peer, action_code,
7292 dialog_token, status_code, 7297 dialog_token, status_code, peer_capability,
7293 nla_data(info->attrs[NL80211_ATTR_IE]), 7298 nla_data(info->attrs[NL80211_ATTR_IE]),
7294 nla_len(info->attrs[NL80211_ATTR_IE])); 7299 nla_len(info->attrs[NL80211_ATTR_IE]));
7295} 7300}
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index c8e225947adb..74d97d33c938 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -769,13 +769,16 @@ static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
769static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev, 769static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
770 struct net_device *dev, u8 *peer, 770 struct net_device *dev, u8 *peer,
771 u8 action_code, u8 dialog_token, 771 u8 action_code, u8 dialog_token,
772 u16 status_code, const u8 *buf, size_t len) 772 u16 status_code, u32 peer_capability,
773 const u8 *buf, size_t len)
773{ 774{
774 int ret; 775 int ret;
775 trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code, 776 trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
776 dialog_token, status_code, buf, len); 777 dialog_token, status_code, peer_capability,
778 buf, len);
777 ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code, 779 ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
778 dialog_token, status_code, buf, len); 780 dialog_token, status_code, peer_capability,
781 buf, len);
779 trace_rdev_return_int(&rdev->wiphy, ret); 782 trace_rdev_return_int(&rdev->wiphy, ret);
780 return ret; 783 return ret;
781} 784}
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 5eaeed59db07..aabccf13e07b 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1468,9 +1468,10 @@ TRACE_EVENT(rdev_sched_scan_start,
1468TRACE_EVENT(rdev_tdls_mgmt, 1468TRACE_EVENT(rdev_tdls_mgmt,
1469 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, 1469 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1470 u8 *peer, u8 action_code, u8 dialog_token, 1470 u8 *peer, u8 action_code, u8 dialog_token,
1471 u16 status_code, const u8 *buf, size_t len), 1471 u16 status_code, u32 peer_capability,
1472 const u8 *buf, size_t len),
1472 TP_ARGS(wiphy, netdev, peer, action_code, dialog_token, status_code, 1473 TP_ARGS(wiphy, netdev, peer, action_code, dialog_token, status_code,
1473 buf, len), 1474 peer_capability, buf, len),
1474 TP_STRUCT__entry( 1475 TP_STRUCT__entry(
1475 WIPHY_ENTRY 1476 WIPHY_ENTRY
1476 NETDEV_ENTRY 1477 NETDEV_ENTRY
@@ -1478,6 +1479,7 @@ TRACE_EVENT(rdev_tdls_mgmt,
1478 __field(u8, action_code) 1479 __field(u8, action_code)
1479 __field(u8, dialog_token) 1480 __field(u8, dialog_token)
1480 __field(u16, status_code) 1481 __field(u16, status_code)
1482 __field(u32, peer_capability)
1481 __dynamic_array(u8, buf, len) 1483 __dynamic_array(u8, buf, len)
1482 ), 1484 ),
1483 TP_fast_assign( 1485 TP_fast_assign(
@@ -1487,13 +1489,15 @@ TRACE_EVENT(rdev_tdls_mgmt,
1487 __entry->action_code = action_code; 1489 __entry->action_code = action_code;
1488 __entry->dialog_token = dialog_token; 1490 __entry->dialog_token = dialog_token;
1489 __entry->status_code = status_code; 1491 __entry->status_code = status_code;
1492 __entry->peer_capability = peer_capability;
1490 memcpy(__get_dynamic_array(buf), buf, len); 1493 memcpy(__get_dynamic_array(buf), buf, len);
1491 ), 1494 ),
1492 TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", action_code: %u, " 1495 TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", action_code: %u, "
1493 "dialog_token: %u, status_code: %u, buf: %#.2x ", 1496 "dialog_token: %u, status_code: %u, peer_capability: %u buf: %#.2x ",
1494 WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), 1497 WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
1495 __entry->action_code, __entry->dialog_token, 1498 __entry->action_code, __entry->dialog_token,
1496 __entry->status_code, ((u8 *)__get_dynamic_array(buf))[0]) 1499 __entry->status_code, __entry->peer_capability,
1500 ((u8 *)__get_dynamic_array(buf))[0])
1497); 1501);
1498 1502
1499TRACE_EVENT(rdev_dump_survey, 1503TRACE_EVENT(rdev_dump_survey,