Commit 19f3fa24 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville
Browse files

rt2800: limit TX_PWR_CFG_ values to 0xc

Based on AsicAdjustTxPower function from vendor driver
limit per rate TX power values we program into TX_PWR_CFG_ registers.

Note that on some configurations (devices/rates) is allowed to use
bigger values than 0xc, but we use safe maximum value for now. Further
work need to be done to allow use bigger values than 0xc.
Signed-off-by: default avatarStanislaw Gruszka <>
Acked-by: default avatarGertjan van Wingerde <>
Acked-by: default avatarIvo van Doorn <>
Signed-off-by: default avatarJohn W. Linville <>
parent cee2c731
......@@ -2563,7 +2563,8 @@ static u8 rt2800_compensate_txpower(struct rt2x00_dev *rt2x00dev, int is_rate_b,
} else
reg_limit = 0;
return txpower + delta - reg_limit;
txpower = max(0, txpower + delta - reg_limit);
return min_t(u8, txpower, 0xc);
static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment