aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-10-24 04:17:18 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-30 04:11:34 -0400
commitc8442118ad9cd05cfe3b993f058e70ab25b1009a (patch)
treee9d454ef6461e70cf99de76f9dda52952b665e44 /net/wireless/nl80211.c
parent71fe96bf9db8b117d28de6f9ced606cae2ad9661 (diff)
cfg80211: allow per interface TX power setting
The TX power setting is currently per wiphy (hardware device) but with multi-channel capabilities that doesn't make much sense any more. Allow drivers (and mac80211) to advertise support for per-interface TX power configuration. When the TX power is configured for the wiphy, the wdev will be NULL and the driver can still handle that, but when a wdev is given the TX power can be set only for that wdev now. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 879ca620fd6..87d4670ee53 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 }