carl9170: allow users to lower output power level

This patch implements a simple way of reducing the
output power of the device by a configurable upper
limit.

Requested-by: Harshal Chhaya <harshal@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Christian Lamparter
2012-01-21 16:59:10 +01:00
committed by John W. Linville
parent 94f9065648
commit 67e43de6db
5 changed files with 50 additions and 35 deletions

View File

@@ -853,11 +853,6 @@ static int carl9170_op_config(struct ieee80211_hw *hw, u32 changed)
goto out;
}
if (changed & IEEE80211_CONF_CHANGE_POWER) {
/* TODO */
err = 0;
}
if (changed & IEEE80211_CONF_CHANGE_SMPS) {
/* TODO */
err = 0;
@@ -891,6 +886,12 @@ static int carl9170_op_config(struct ieee80211_hw *hw, u32 changed)
goto out;
}
if (changed & IEEE80211_CONF_CHANGE_POWER) {
err = carl9170_set_mac_tpc(ar, ar->hw->conf.channel);
if (err)
goto out;
}
out:
mutex_unlock(&ar->mutex);
return err;