diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-10-22 16:26:56 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-10-22 16:26:56 +0000 |
commit | d9ea3d2aa8bfdd6665ad9caa7a9296cadb73662d (patch) | |
tree | 39461dde138991269ce60b85b5ad6439475b9992 /package/kernel/mac80211/patches/340-mac80211-add-support-for-driver-tx-power-reporting.patch | |
parent | c14e0807bd9a62e27d69d7894250d174ec9c403e (diff) | |
download | master-31e0f0ae-d9ea3d2aa8bfdd6665ad9caa7a9296cadb73662d.tar.gz master-31e0f0ae-d9ea3d2aa8bfdd6665ad9caa7a9296cadb73662d.tar.bz2 master-31e0f0ae-d9ea3d2aa8bfdd6665ad9caa7a9296cadb73662d.zip |
ath9k: fix tx power reporting
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 43032
Diffstat (limited to 'package/kernel/mac80211/patches/340-mac80211-add-support-for-driver-tx-power-reporting.patch')
-rw-r--r-- | package/kernel/mac80211/patches/340-mac80211-add-support-for-driver-tx-power-reporting.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/340-mac80211-add-support-for-driver-tx-power-reporting.patch b/package/kernel/mac80211/patches/340-mac80211-add-support-for-driver-tx-power-reporting.patch new file mode 100644 index 0000000000..6998584a59 --- /dev/null +++ b/package/kernel/mac80211/patches/340-mac80211-add-support-for-driver-tx-power-reporting.patch @@ -0,0 +1,43 @@ +From: Felix Fietkau <nbd@openwrt.org> +Date: Wed, 22 Oct 2014 17:55:50 +0200 +Subject: [PATCH] mac80211: add support for driver tx power reporting + +The configured tx power is often limited by hardware capabilities, +channel settings, antenna configuration, etc. + +Signed-off-by: Felix Fietkau <nbd@openwrt.org> +--- + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -2838,6 +2838,9 @@ enum ieee80211_roc_type { + * @get_expected_throughput: extract the expected throughput towards the + * specified station. The returned value is expressed in Kbps. It returns 0 + * if the RC algorithm does not have proper data to provide. ++ * ++ * @get_txpower: get current maximum tx power (in dBm) based on configuration ++ * and hardware limits. + */ + struct ieee80211_ops { + void (*tx)(struct ieee80211_hw *hw, +@@ -3039,6 +3042,8 @@ struct ieee80211_ops { + int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); + void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); + u32 (*get_expected_throughput)(struct ieee80211_sta *sta); ++ int (*get_txpower)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ++ int *dbm); + }; + + /** +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -2081,6 +2081,9 @@ static int ieee80211_get_tx_power(struct + struct ieee80211_local *local = wiphy_priv(wiphy); + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); + ++ if (local->ops->get_txpower) ++ return local->ops->get_txpower(&local->hw, &sdata->vif, dbm); ++ + if (!local->use_chanctx) + *dbm = local->hw.conf.power_level; + else |