summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authortamizhr@codeaurora.org <tamizhr@codeaurora.org>2018-01-31 05:54:49 -0500
committerJohannes Berg <johannes.berg@intel.com>2018-01-31 06:57:44 -0500
commit466b9936bf93b7ec3bce1dcd493262ff0a8a4f44 (patch)
tree77ad5b4eade717ca3b790187501a235b22f96e7f /net/wireless
parent25b0ba7ebbc5ffa5a64d752b85af78e6e517e3b2 (diff)
cfg80211: Add support to notify station's opmode change to userspace
ht/vht action frames will be sent to AP from station to notify change of its ht/vht opmode(max bandwidth, smps mode or nss) modified values. Currently these valuse used by driver/firmware for rate control algorithm. This patch introduces NL80211_CMD_STA_OPMODE_CHANGED command to notify those modified/current supported values(max bandwidth, smps mode, max nss) to userspace application. This will be useful for the application like steering, which closely monitoring station's capability changes. Since the application has taken these values during station association. Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index bdb70fe74e3c..cc6ec5bab676 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -14950,6 +14950,61 @@ nl80211_radar_notify(struct cfg80211_registered_device *rdev,
14950 nlmsg_free(msg); 14950 nlmsg_free(msg);
14951} 14951}
14952 14952
14953void cfg80211_sta_opmode_change_notify(struct net_device *dev, const u8 *mac,
14954 struct sta_opmode_info *sta_opmode,
14955 gfp_t gfp)
14956{
14957 struct sk_buff *msg;
14958 struct wireless_dev *wdev = dev->ieee80211_ptr;
14959 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
14960 void *hdr;
14961
14962 if (WARN_ON(!mac))
14963 return;
14964
14965 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
14966 if (!msg)
14967 return;
14968
14969 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_STA_OPMODE_CHANGED);
14970 if (!hdr) {
14971 nlmsg_free(msg);
14972 return;
14973 }
14974
14975 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx))
14976 goto nla_put_failure;
14977
14978 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex))
14979 goto nla_put_failure;
14980
14981 if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac))
14982 goto nla_put_failure;
14983
14984 if ((sta_opmode->changed & STA_OPMODE_SMPS_MODE_CHANGED) &&
14985 nla_put_u8(msg, NL80211_ATTR_SMPS_MODE, sta_opmode->smps_mode))
14986 goto nla_put_failure;
14987
14988 if ((sta_opmode->changed & STA_OPMODE_MAX_BW_CHANGED) &&
14989 nla_put_u8(msg, NL80211_ATTR_CHANNEL_WIDTH, sta_opmode->bw))
14990 goto nla_put_failure;
14991
14992 if ((sta_opmode->changed & STA_OPMODE_N_SS_CHANGED) &&
14993 nla_put_u8(msg, NL80211_ATTR_NSS, sta_opmode->rx_nss))
14994 goto nla_put_failure;
14995
14996 genlmsg_end(msg, hdr);
14997
14998 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
14999 NL80211_MCGRP_MLME, gfp);
15000
15001 return;
15002
15003nla_put_failure:
15004 nlmsg_free(msg);
15005}
15006EXPORT_SYMBOL(cfg80211_sta_opmode_change_notify);
15007
14953void cfg80211_probe_status(struct net_device *dev, const u8 *addr, 15008void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
14954 u64 cookie, bool acked, gfp_t gfp) 15009 u64 cookie, bool acked, gfp_t gfp)
14955{ 15010{