History

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.

Sunil Dutt Undekari committed 12 years ago

Commit df942e71 parent bf5f4837 files · +47 −13Browse files

Unified · Split

7 files
  1. drivers/net/wireless/mwifiex/cfg80211.c +2 −2
  2. include/net/cfg80211.h +2 −1
  3. include/uapi/linux/nl80211.h +21 −0
  4. net/mac80211/cfg.c +2 −2
  5. net/wireless/nl80211.c +6 −1
  6. net/wireless/rdev-ops.h +6 −3
  7. net/wireless/trace.h +8 −4
drivers/net/wireless/mwifiex/cfg80211.c+2−2
@@ -2600,8 +2600,8 @@ static int mwifiex_cfg80211_set_coalesce(struct wiphy *wiphy, · 2599 unmodified lines
26002600 static int
26012601 mwifiex_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
26022602 u8 *peer, u8 action_code, u8 dialog_token,
2603− u16 status_code, const u8 *extra_ies,
2604− size_t extra_ies_len)
2603+ u16 status_code, u32 peer_capability,
2604+ const u8 *extra_ies, size_t extra_ies_len)
26052605 {
26062606 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
26072607 int ret;
include/net/cfg80211.h+2−1
@@ -2465,7 +2465,8 @@ struct cfg80211_ops { · 2464 unmodified lines
24652465
24662466 int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev,
24672467 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);
24692470 int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev,
24702471 u8 *peer, enum nl80211_tdls_operation oper);
24712472
include/uapi/linux/nl80211.h+21−0
@@ -1575,6 +1575,9 @@ enum nl80211_commands { · 1574 unmodified lines
15751575 * advertise values that cannot always be met. In such cases, an attempt
15761576 * to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
15771577 *
1578+ * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
1579+ * As specified in the &enum nl80211_tdls_peer_capability.
1580+ *
15781581 * @NL80211_ATTR_MAX: highest attribute number currently defined
15791582 * @__NL80211_ATTR_AFTER_LAST: internal use
15801583 */
@@ -1908,6 +1911,8 @@ enum nl80211_attrs { · 327 unmodified lines
19081911
19091912 NL80211_ATTR_MAX_AP_ASSOC_STA,
19101913
1914+ NL80211_ATTR_TDLS_PEER_CAPABILITY,
1915+
19111916 /* add attributes here, update the policy in nl80211.c */
19121917
19131918 __NL80211_ATTR_AFTER_LAST,
@@ -4074,4 +4079,20 @@ struct nl80211_vendor_cmd_info { · 2160 unmodified lines
40744079 __u32 subcmd;
40754080 };
40764081
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+ */
4092+enum 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+
40774098 #endif /* __LINUX_NL80211_H */
net/mac80211/cfg.c+2−2
@@ -3644,8 +3644,8 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev, · 3643 unmodified lines
36443644
36453645 static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
36463646 u8 *peer, u8 action_code, u8 dialog_token,
3647− u16 status_code, const u8 *extra_ies,
3648− size_t extra_ies_len)
3647+ u16 status_code, u32 peer_capability,
3648+ const u8 *extra_ies, size_t extra_ies_len)
36493649 {
36503650 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
36513651 struct ieee80211_local *local = sdata->local;
net/wireless/nl80211.c+6−1
@@ -384,6 +384,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { · 383 unmodified lines
384384 .len = IEEE80211_QOS_MAP_LEN_MAX },
385385 [NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN },
386386 [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
387+ [NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
387388 };
388389
389390 /* policy for the key attributes */
@@ -7269,6 +7270,7 @@ static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info) · 6879 unmodified lines
72697270 struct cfg80211_registered_device *rdev = info->user_ptr[0];
72707271 struct net_device *dev = info->user_ptr[1];
72717272 u8 action_code, dialog_token;
7273+ u32 peer_capability = 0;
72727274 u16 status_code;
72737275 u8 *peer;
72747276
@@ -7287,9 +7289,12 @@ static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info) · 12 unmodified lines
72877289 action_code = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_ACTION]);
72887290 status_code = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]);
72897291 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]);
72907295
72917296 return rdev_tdls_mgmt(rdev, dev, peer, action_code,
7292− dialog_token, status_code,
7297+ dialog_token, status_code, peer_capability,
72937298 nla_data(info->attrs[NL80211_ATTR_IE]),
72947299 nla_len(info->attrs[NL80211_ATTR_IE]));
72957300 }
net/wireless/rdev-ops.h+6−3
@@ -769,13 +769,16 @@ static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev, · 768 unmodified lines
769769 static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
770770 struct net_device *dev, u8 *peer,
771771 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)
773774 {
774775 int ret;
775776 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);
777779 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);
779782 trace_rdev_return_int(&rdev->wiphy, ret);
780783 return ret;
781784 }
net/wireless/trace.h+8−4
@@ -1468,9 +1468,10 @@ TRACE_EVENT(rdev_sched_scan_start, · 1467 unmodified lines
14681468 TRACE_EVENT(rdev_tdls_mgmt,
14691469 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
14701470 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),
14721473 TP_ARGS(wiphy, netdev, peer, action_code, dialog_token, status_code,
1473− buf, len),
1474+ peer_capability, buf, len),
14741475 TP_STRUCT__entry(
14751476 WIPHY_ENTRY
14761477 NETDEV_ENTRY
@@ -1478,6 +1479,7 @@ TRACE_EVENT(rdev_tdls_mgmt, · 1 unmodified line
14781479 __field(u8, action_code)
14791480 __field(u8, dialog_token)
14801481 __field(u16, status_code)
1482+ __field(u32, peer_capability)
14811483 __dynamic_array(u8, buf, len)
14821484 ),
14831485 TP_fast_assign(
@@ -1487,13 +1489,15 @@ TRACE_EVENT(rdev_tdls_mgmt, · 3 unmodified lines
14871489 __entry->action_code = action_code;
14881490 __entry->dialog_token = dialog_token;
14891491 __entry->status_code = status_code;
1492+ __entry->peer_capability = peer_capability;
14901493 memcpy(__get_dynamic_array(buf), buf, len);
14911494 ),
14921495 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 ",
14941497 WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
14951498 __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])
14971501 );
14981502
14991503 TRACE_EVENT(rdev_dump_survey,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t