aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/net/cfg80211.h10
-rw-r--r--include/uapi/linux/nl80211.h2
2 files changed, 9 insertions, 3 deletions
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/**