rt2x00: Fix max TX power settings
During initialization each driver reads the default TX power for each individual channel. However mac80211 only accepts the maximum value (which is also handled as default value). As a result, the TX power of the device was being limited to the default value, which is often quite low compared to the real maximum acceptable value. This patch allows each driver to set the maximum value on a per-channel basis which is forwarded to mac80211. The default value will be preserved for now, in case we want to update mac80211 to differentiate between the maximum and default txpower. This fixes bug complaining about limited TX power values like: https://bugzilla.kernel.org/show_bug.cgi?id=16358 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
46323e112c
commit
8d1331b37d
@ -2656,13 +2656,17 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
|
||||
spec->channels_info = info;
|
||||
|
||||
tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_G_START);
|
||||
for (i = 0; i < 14; i++)
|
||||
info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
|
||||
for (i = 0; i < 14; i++) {
|
||||
info[i].max_power = MAX_TXPOWER;
|
||||
info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
|
||||
}
|
||||
|
||||
if (spec->num_channels > 14) {
|
||||
tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START);
|
||||
for (i = 14; i < spec->num_channels; i++)
|
||||
info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
|
||||
for (i = 14; i < spec->num_channels; i++) {
|
||||
info[i].max_power = MAX_TXPOWER;
|
||||
info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user