| 1 | --- a/include/net/mac80211.h |
| 2 | +++ b/include/net/mac80211.h |
| 3 | @@ -1372,6 +1372,7 @@ struct ieee80211_hw { |
| 4 | u8 max_tx_aggregation_subframes; |
| 5 | u8 offchannel_tx_hw_queue; |
| 6 | u8 radiotap_mcs_details; |
| 7 | + s8 cur_power_level; |
| 8 | netdev_features_t netdev_features; |
| 9 | }; |
| 10 | |
| 11 | --- a/net/mac80211/cfg.c |
| 12 | +++ b/net/mac80211/cfg.c |
| 13 | @@ -1967,7 +1967,7 @@ static int ieee80211_get_tx_power(struct |
| 14 | { |
| 15 | struct ieee80211_local *local = wiphy_priv(wiphy); |
| 16 | |
| 17 | - *dbm = local->hw.conf.power_level; |
| 18 | + *dbm = local->hw.cur_power_level; |
| 19 | |
| 20 | return 0; |
| 21 | } |
| 22 | --- a/net/mac80211/main.c |
| 23 | +++ b/net/mac80211/main.c |
| 24 | @@ -165,6 +165,7 @@ int ieee80211_hw_config(struct ieee80211 |
| 25 | |
| 26 | if (local->hw.conf.power_level != power) { |
| 27 | changed |= IEEE80211_CONF_CHANGE_POWER; |
| 28 | + local->hw.cur_power_level = power; |
| 29 | local->hw.conf.power_level = power; |
| 30 | } |
| 31 | |
| 32 | |