aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c9
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c6
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c1
-rw-r--r--drivers/net/wireless/rndis_wlan.c10
-rw-r--r--include/net/cfg80211.h10
-rw-r--r--include/uapi/linux/nl80211.h2
-rw-r--r--net/mac80211/cfg.c5
-rw-r--r--net/wireless/nl80211.c6
-rw-r--r--net/wireless/rdev-ops.h11
-rw-r--r--net/wireless/trace.h24
-rw-r--r--net/wireless/wext-compat.c4
11 files changed, 56 insertions, 32 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 277089963eb4..d615f9f7506a 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1384,11 +1384,8 @@ static int ath6kl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
1384 return 0; 1384 return 0;
1385} 1385}
1386 1386
1387/*
1388 * The type nl80211_tx_power_setting replaces the following
1389 * data type from 2.6.36 onwards
1390*/
1391static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy, 1387static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy,
1388 struct wireless_dev *wdev,
1392 enum nl80211_tx_power_setting type, 1389 enum nl80211_tx_power_setting type,
1393 int mbm) 1390 int mbm)
1394{ 1391{
@@ -1423,7 +1420,9 @@ static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy,
1423 return 0; 1420 return 0;
1424} 1421}
1425 1422
1426static int ath6kl_cfg80211_get_txpower(struct wiphy *wiphy, int *dbm) 1423static int ath6kl_cfg80211_get_txpower(struct wiphy *wiphy,
1424 struct wireless_dev *wdev,
1425 int *dbm)
1427{ 1426{
1428 struct ath6kl *ar = (struct ath6kl *)wiphy_priv(wiphy); 1427 struct ath6kl *ar = (struct ath6kl *)wiphy_priv(wiphy);
1429 struct ath6kl_vif *vif; 1428 struct ath6kl_vif *vif;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index cb30feaa565b..904c94121c13 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1721,7 +1721,7 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
1721} 1721}
1722 1722
1723static s32 1723static s32
1724brcmf_cfg80211_set_tx_power(struct wiphy *wiphy, 1724brcmf_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
1725 enum nl80211_tx_power_setting type, s32 mbm) 1725 enum nl80211_tx_power_setting type, s32 mbm)
1726{ 1726{
1727 1727
@@ -1770,7 +1770,9 @@ done:
1770 return err; 1770 return err;
1771} 1771}
1772 1772
1773static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm) 1773static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy,
1774 struct wireless_dev *wdev,
1775 s32 *dbm)
1774{ 1776{
1775 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 1777 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1776 struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); 1778 struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index fdb1eb861021..8e829b251d83 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -324,6 +324,7 @@ mwifiex_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
324 */ 324 */
325static int 325static int
326mwifiex_cfg80211_set_tx_power(struct wiphy *wiphy, 326mwifiex_cfg80211_set_tx_power(struct wiphy *wiphy,
327 struct wireless_dev *wdev,
327 enum nl80211_tx_power_setting type, 328 enum nl80211_tx_power_setting type,
328 int mbm) 329 int mbm)
329{ 330{
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index bd1f0cb56085..5390af36c064 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -490,9 +490,12 @@ static int rndis_scan(struct wiphy *wiphy,
490static int rndis_set_wiphy_params(struct wiphy *wiphy, u32 changed); 490static int rndis_set_wiphy_params(struct wiphy *wiphy, u32 changed);
491 491
492static int rndis_set_tx_power(struct wiphy *wiphy, 492static int rndis_set_tx_power(struct wiphy *wiphy,
493 struct wireless_dev *wdev,
493 enum nl80211_tx_power_setting type, 494 enum nl80211_tx_power_setting type,
494 int mbm); 495 int mbm);
495static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm); 496static int rndis_get_tx_power(struct wiphy *wiphy,
497 struct wireless_dev *wdev,
498 int *dbm);
496 499
497static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, 500static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
498 struct cfg80211_connect_params *sme); 501 struct cfg80211_connect_params *sme);
@@ -1903,6 +1906,7 @@ static int rndis_set_wiphy_params(struct wiphy *wiphy, u32 changed)
1903} 1906}
1904 1907
1905static int rndis_set_tx_power(struct wiphy *wiphy, 1908static int rndis_set_tx_power(struct wiphy *wiphy,
1909 struct wireless_dev *wdev,
1906 enum nl80211_tx_power_setting type, 1910 enum nl80211_tx_power_setting type,
1907 int mbm) 1911 int mbm)
1908{ 1912{
@@ -1930,7 +1934,9 @@ static int rndis_set_tx_power(struct wiphy *wiphy,
1930 return -ENOTSUPP; 1934 return -ENOTSUPP;
1931} 1935}
1932 1936
1933static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm) 1937static int rndis_get_tx_power(struct wiphy *wiphy,
1938 struct wireless_dev *wdev,
1939 int *dbm)
1934{ 1940{
1935 struct rndis_wlan_private *priv = wiphy_priv(wiphy); 1941 struct rndis_wlan_private *priv = wiphy_priv(wiphy);
1936 struct usbnet *usbdev = priv->usbdev; 1942 struct usbnet *usbdev = priv->usbdev;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index c6964572890f..8034a4268fcb 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1551,7 +1551,10 @@ struct cfg80211_gtk_rekey_data {
1551 * struct wiphy. If returning an error, no value should be changed. 1551 * struct wiphy. If returning an error, no value should be changed.
1552 * 1552 *
1553 * @set_tx_power: set the transmit power according to the parameters, 1553 * @set_tx_power: set the transmit power according to the parameters,
1554 * the power passed is in mBm, to get dBm use MBM_TO_DBM(). 1554 * the power passed is in mBm, to get dBm use MBM_TO_DBM(). The
1555 * wdev may be %NULL if power was set for the wiphy, and will
1556 * always be %NULL unless the driver supports per-vif TX power
1557 * (as advertised by the nl80211 feature flag.)
1555 * @get_tx_power: store the current TX power into the dbm variable; 1558 * @get_tx_power: store the current TX power into the dbm variable;
1556 * return 0 if successful 1559 * return 0 if successful
1557 * 1560 *
@@ -1748,9 +1751,10 @@ struct cfg80211_ops {
1748 1751
1749 int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); 1752 int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed);
1750 1753
1751 int (*set_tx_power)(struct wiphy *wiphy, 1754 int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
1752 enum nl80211_tx_power_setting type, int mbm); 1755 enum nl80211_tx_power_setting type, int mbm);
1753 int (*get_tx_power)(struct wiphy *wiphy, int *dbm); 1756 int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
1757 int *dbm);
1754 1758
1755 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, 1759 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
1756 const u8 *addr); 1760 const u8 *addr);
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 617d0fbfc96f..4c5f6748ed7d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -3051,6 +3051,7 @@ enum nl80211_ap_sme_features {
3051 * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan 3051 * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan
3052 * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported 3052 * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported
3053 * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif 3053 * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif
3054 * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting
3054 */ 3055 */
3055enum nl80211_feature_flags { 3056enum nl80211_feature_flags {
3056 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3057 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3062,6 +3063,7 @@ enum nl80211_feature_flags {
3062 NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6, 3063 NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
3063 NL80211_FEATURE_SCAN_FLUSH = 1 << 7, 3064 NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
3064 NL80211_FEATURE_AP_SCAN = 1 << 8, 3065 NL80211_FEATURE_AP_SCAN = 1 << 8,
3066 NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
3065}; 3067};
3066 3068
3067/** 3069/**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 34fd3eba3090..a352e4d22dd9 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1992,6 +1992,7 @@ static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
1992} 1992}
1993 1993
1994static int ieee80211_set_tx_power(struct wiphy *wiphy, 1994static int ieee80211_set_tx_power(struct wiphy *wiphy,
1995 struct wireless_dev *wdev,
1995 enum nl80211_tx_power_setting type, int mbm) 1996 enum nl80211_tx_power_setting type, int mbm)
1996{ 1997{
1997 struct ieee80211_local *local = wiphy_priv(wiphy); 1998 struct ieee80211_local *local = wiphy_priv(wiphy);
@@ -2026,7 +2027,9 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
2026 return 0; 2027 return 0;
2027} 2028}
2028 2029
2029static int ieee80211_get_tx_power(struct wiphy *wiphy, int *dbm) 2030static int ieee80211_get_tx_power(struct wiphy *wiphy,
2031 struct wireless_dev *wdev,
2032 int *dbm)
2030{ 2033{
2031 struct ieee80211_local *local = wiphy_priv(wiphy); 2034 struct ieee80211_local *local = wiphy_priv(wiphy);
2032 2035
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 879ca620fd6f..87d4670ee53a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1585,9 +1585,13 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
1585 } 1585 }
1586 1586
1587 if (info->attrs[NL80211_ATTR_WIPHY_TX_POWER_SETTING]) { 1587 if (info->attrs[NL80211_ATTR_WIPHY_TX_POWER_SETTING]) {
1588 struct wireless_dev *txp_wdev = wdev;
1588 enum nl80211_tx_power_setting type; 1589 enum nl80211_tx_power_setting type;
1589 int idx, mbm = 0; 1590 int idx, mbm = 0;
1590 1591
1592 if (!(rdev->wiphy.features & NL80211_FEATURE_VIF_TXPOWER))
1593 txp_wdev = NULL;
1594
1591 if (!rdev->ops->set_tx_power) { 1595 if (!rdev->ops->set_tx_power) {
1592 result = -EOPNOTSUPP; 1596 result = -EOPNOTSUPP;
1593 goto bad_res; 1597 goto bad_res;
@@ -1607,7 +1611,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
1607 mbm = nla_get_u32(info->attrs[idx]); 1611 mbm = nla_get_u32(info->attrs[idx]);
1608 } 1612 }
1609 1613
1610 result = rdev_set_tx_power(rdev, type, mbm); 1614 result = rdev_set_tx_power(rdev, txp_wdev, type, mbm);
1611 if (result) 1615 if (result)
1612 goto bad_res; 1616 goto bad_res;
1613 } 1617 }
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index eb5f8974e148..6e5fa659068d 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -476,21 +476,22 @@ rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
476} 476}
477 477
478static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev, 478static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
479 struct wireless_dev *wdev,
479 enum nl80211_tx_power_setting type, int mbm) 480 enum nl80211_tx_power_setting type, int mbm)
480{ 481{
481 int ret; 482 int ret;
482 trace_rdev_set_tx_power(&rdev->wiphy, type, mbm); 483 trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
483 ret = rdev->ops->set_tx_power(&rdev->wiphy, type, mbm); 484 ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
484 trace_rdev_return_int(&rdev->wiphy, ret); 485 trace_rdev_return_int(&rdev->wiphy, ret);
485 return ret; 486 return ret;
486} 487}
487 488
488static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev, 489static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
489 int *dbm) 490 struct wireless_dev *wdev, int *dbm)
490{ 491{
491 int ret; 492 int ret;
492 trace_rdev_get_tx_power(&rdev->wiphy); 493 trace_rdev_get_tx_power(&rdev->wiphy, wdev);
493 ret = rdev->ops->get_tx_power(&rdev->wiphy, dbm); 494 ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
494 trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm); 495 trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
495 return ret; 496 return ret;
496} 497}
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 0ca71caf85fb..8e03c6382a8a 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -26,7 +26,7 @@
26#define WIPHY_PR_ARG MAC_PR_ARG(wiphy_mac) 26#define WIPHY_PR_ARG MAC_PR_ARG(wiphy_mac)
27 27
28#define WDEV_ENTRY __field(u32, id) 28#define WDEV_ENTRY __field(u32, id)
29#define WDEV_ASSIGN (__entry->id) = (wdev->identifier) 29#define WDEV_ASSIGN (__entry->id) = (wdev ? wdev->identifier : 0)
30#define WDEV_PR_FMT ", wdev id: %u" 30#define WDEV_PR_FMT ", wdev id: %u"
31#define WDEV_PR_ARG (__entry->id) 31#define WDEV_PR_ARG (__entry->id)
32 32
@@ -260,11 +260,6 @@ DEFINE_EVENT(wiphy_only_evt, rdev_get_antenna,
260 TP_ARGS(wiphy) 260 TP_ARGS(wiphy)
261); 261);
262 262
263DEFINE_EVENT(wiphy_only_evt, rdev_get_tx_power,
264 TP_PROTO(struct wiphy *wiphy),
265 TP_ARGS(wiphy)
266);
267
268DEFINE_EVENT(wiphy_only_evt, rdev_rfkill_poll, 263DEFINE_EVENT(wiphy_only_evt, rdev_rfkill_poll,
269 TP_PROTO(struct wiphy *wiphy), 264 TP_PROTO(struct wiphy *wiphy),
270 TP_ARGS(wiphy) 265 TP_ARGS(wiphy)
@@ -1230,22 +1225,29 @@ TRACE_EVENT(rdev_set_wiphy_params,
1230 WIPHY_PR_ARG, __entry->changed) 1225 WIPHY_PR_ARG, __entry->changed)
1231); 1226);
1232 1227
1228DEFINE_EVENT(wiphy_wdev_evt, rdev_get_tx_power,
1229 TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1230 TP_ARGS(wiphy, wdev)
1231);
1232
1233TRACE_EVENT(rdev_set_tx_power, 1233TRACE_EVENT(rdev_set_tx_power,
1234 TP_PROTO(struct wiphy *wiphy, enum nl80211_tx_power_setting type, 1234 TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1235 int mbm), 1235 enum nl80211_tx_power_setting type, int mbm),
1236 TP_ARGS(wiphy, type, mbm), 1236 TP_ARGS(wiphy, wdev, type, mbm),
1237 TP_STRUCT__entry( 1237 TP_STRUCT__entry(
1238 WIPHY_ENTRY 1238 WIPHY_ENTRY
1239 WDEV_ENTRY
1239 __field(enum nl80211_tx_power_setting, type) 1240 __field(enum nl80211_tx_power_setting, type)
1240 __field(int, mbm) 1241 __field(int, mbm)
1241 ), 1242 ),
1242 TP_fast_assign( 1243 TP_fast_assign(
1243 WIPHY_ASSIGN; 1244 WIPHY_ASSIGN;
1245 WDEV_ASSIGN;
1244 __entry->type = type; 1246 __entry->type = type;
1245 __entry->mbm = mbm; 1247 __entry->mbm = mbm;
1246 ), 1248 ),
1247 TP_printk(WIPHY_PR_FMT ", type: %d, mbm: %d", 1249 TP_printk(WIPHY_PR_FMT WDEV_PR_FMT ", type: %d, mbm: %d",
1248 WIPHY_PR_ARG, __entry->type, __entry->mbm) 1250 WIPHY_PR_ARG, WDEV_PR_ARG,__entry->type, __entry->mbm)
1249); 1251);
1250 1252
1251TRACE_EVENT(rdev_return_int_int, 1253TRACE_EVENT(rdev_return_int_int,
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 6488d2dbc1d7..742ab6ec4c9d 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -895,7 +895,7 @@ static int cfg80211_wext_siwtxpower(struct net_device *dev,
895 return 0; 895 return 0;
896 } 896 }
897 897
898 return rdev_set_tx_power(rdev, type, DBM_TO_MBM(dbm)); 898 return rdev_set_tx_power(rdev, wdev, type, DBM_TO_MBM(dbm));
899} 899}
900 900
901static int cfg80211_wext_giwtxpower(struct net_device *dev, 901static int cfg80211_wext_giwtxpower(struct net_device *dev,
@@ -914,7 +914,7 @@ static int cfg80211_wext_giwtxpower(struct net_device *dev,
914 if (!rdev->ops->get_tx_power) 914 if (!rdev->ops->get_tx_power)
915 return -EOPNOTSUPP; 915 return -EOPNOTSUPP;
916 916
917 err = rdev_get_tx_power(rdev, &val); 917 err = rdev_get_tx_power(rdev, wdev, &val);
918 if (err) 918 if (err)
919 return err; 919 return err;
920 920