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.
Unified · Split
| @@ -2600,8 +2600,8 @@ static int mwifiex_cfg80211_set_coalesce(struct wiphy *wiphy, · 2599 unmodified lines | |||
| 2600 | static int | 2600 | static int |
| 2601 | mwifiex_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, | 2601 | mwifiex_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; |
| @@ -2465,7 +2465,8 @@ struct cfg80211_ops { · 2464 unmodified lines | |||
| 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 | ||
| @@ -1575,6 +1575,9 @@ enum nl80211_commands { · 1574 unmodified lines | |||
| 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 { · 327 unmodified lines | |||
| 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 { · 2160 unmodified lines | |||
| 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 | */ | ||
| 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 | |||
| 4077 | #endif /* __LINUX_NL80211_H */ | 4098 | #endif /* __LINUX_NL80211_H */ |
| @@ -3644,8 +3644,8 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev, · 3643 unmodified lines | |||
| 3644 | 3644 | ||
| 3645 | static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, | 3645 | static 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; |
| @@ -384,6 +384,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { · 383 unmodified lines | |||
| 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) · 6879 unmodified lines | |||
| 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) · 12 unmodified lines | |||
| 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 | } |
| @@ -769,13 +769,16 @@ static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev, · 768 unmodified lines | |||
| 769 | static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev, | 769 | static 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 | } |
| @@ -1468,9 +1468,10 @@ TRACE_EVENT(rdev_sched_scan_start, · 1467 unmodified lines | |||
| 1468 | TRACE_EVENT(rdev_tdls_mgmt, | 1468 | TRACE_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, · 1 unmodified line | |||
| 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, · 3 unmodified lines | |||
| 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 | ||
| 1499 | TRACE_EVENT(rdev_dump_survey, | 1503 | TRACE_EVENT(rdev_dump_survey, |