Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a07c785b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cfg80211: Pass TDLS peer capability information in tdls_mgmt"

parents f68e1e9a 285c5221
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@

struct wiphy;

#define TDLS_MGMT_VERSION2 1

/*
 * wireless hardware capability structures
 */
@@ -2268,7 +2270,8 @@ struct cfg80211_ops {

	int	(*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev,
			     u8 *peer, u8 action_code,  u8 dialog_token,
			     u16 status_code, const u8 *buf, size_t len);
			     u16 status_code, u32 peer_capability,
			     const u8 *buf, size_t len);
	int	(*tdls_oper)(struct wiphy *wiphy, struct net_device *dev,
			     u8 *peer, enum nl80211_tdls_operation oper);

+21 −0
Original line number Diff line number Diff line
@@ -1532,6 +1532,9 @@ enum nl80211_commands {
 *	advertise values that cannot always be met. In such cases, an attempt
 *	to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
 *
 * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
 *	As specified in the &enum nl80211_tdls_peer_capability.
 *
 * @NL80211_ATTR_MAX: highest attribute number currently defined
 * @__NL80211_ATTR_AFTER_LAST: internal use
 */
@@ -1866,6 +1869,8 @@ enum nl80211_attrs {

	NL80211_ATTR_MAX_AP_ASSOC_STA,

	NL80211_ATTR_TDLS_PEER_CAPABILITY,

	/* add attributes here, update the policy in nl80211.c */

	__NL80211_ATTR_AFTER_LAST,
@@ -3914,4 +3919,20 @@ struct nl80211_vendor_cmd_info {
	__u32 subcmd;
};

/**
 * enum nl80211_tdls_peer_capability - TDLS peer flags.
 *
 * Used by tdls_mgmt() to determine which conditional elements need
 * to be added to TDLS Setup frames.
 *
 * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
 * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
 * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
 */
enum nl80211_tdls_peer_capability {
	NL80211_TDLS_PEER_HT = 1<<0,
	NL80211_TDLS_PEER_VHT = 1<<1,
	NL80211_TDLS_PEER_WMM = 1<<2,
};

#endif /* __LINUX_NL80211_H */
+2 −2
Original line number Diff line number Diff line
@@ -3138,8 +3138,8 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev,

static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
			       u8 *peer, u8 action_code, u8 dialog_token,
			       u16 status_code, const u8 *extra_ies,
			       size_t extra_ies_len)
			       u16 status_code, u32 peer_capability,
			       const u8 *extra_ies, size_t extra_ies_len)
{
	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
	struct ieee80211_local *local = sdata->local;
+6 −1
Original line number Diff line number Diff line
@@ -388,6 +388,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
				   .len = IEEE80211_QOS_MAP_LEN_MAX },
	[NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN },
	[NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
	[NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
};

/* policy for the key attributes */
@@ -7046,6 +7047,7 @@ static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info)
	struct cfg80211_registered_device *rdev = info->user_ptr[0];
	struct net_device *dev = info->user_ptr[1];
	u8 action_code, dialog_token;
	u32 peer_capability = 0;
	u16 status_code;
	u8 *peer;

@@ -7064,9 +7066,12 @@ static int nl80211_tdls_mgmt(struct sk_buff *skb, struct genl_info *info)
	action_code = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_ACTION]);
	status_code = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]);
	dialog_token = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN]);
	if (info->attrs[NL80211_ATTR_TDLS_PEER_CAPABILITY])
		peer_capability =
		    nla_get_u32(info->attrs[NL80211_ATTR_TDLS_PEER_CAPABILITY]);

	return rdev_tdls_mgmt(rdev, dev, peer, action_code,
			      dialog_token, status_code,
			      dialog_token, status_code, peer_capability,
			      nla_data(info->attrs[NL80211_ATTR_IE]),
			      nla_len(info->attrs[NL80211_ATTR_IE]));
}
+6 −3
Original line number Diff line number Diff line
@@ -771,13 +771,16 @@ static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
				 struct net_device *dev, u8 *peer,
				 u8 action_code, u8 dialog_token,
				 u16 status_code, const u8 *buf, size_t len)
				 u16 status_code, u32 peer_capability,
				 const u8 *buf, size_t len)
{
	int ret;
	trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
			     dialog_token, status_code, buf, len);
			     dialog_token, status_code, peer_capability,
			     buf, len);
	ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
				   dialog_token, status_code, buf, len);
				   dialog_token, status_code, peer_capability,
				   buf, len);
	trace_rdev_return_int(&rdev->wiphy, ret);
	return ret;
}
Loading