rt2x00: Fix vgc_level_reg handling
Currently vgc_level_reg and vgc_level are equal to eachother, while the purpose of vgc_level_reg is the value last written to the register and is remembered through link tuning resets. The vgc_level is the currently active level, which is reset during link tuning resets. The usage of these variables depends on the drivers, some drivers need both, while others need only one of the two. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
d8147f9d9e
commit
223dcc2659
@@ -626,6 +626,7 @@ static inline void rt2500pci_set_vgc(struct rt2x00_dev *rt2x00dev,
|
||||
{
|
||||
if (qual->vgc_level_reg != vgc_level) {
|
||||
rt2500pci_bbp_write(rt2x00dev, 17, vgc_level);
|
||||
qual->vgc_level = vgc_level;
|
||||
qual->vgc_level_reg = vgc_level;
|
||||
}
|
||||
}
|
||||
@@ -700,13 +701,10 @@ dynamic_cca_tune:
|
||||
* R17 is inside the dynamic tuning range,
|
||||
* start tuning the link based on the false cca counter.
|
||||
*/
|
||||
if (qual->false_cca > 512 && qual->vgc_level_reg < 0x40) {
|
||||
if (qual->false_cca > 512 && qual->vgc_level_reg < 0x40)
|
||||
rt2500pci_set_vgc(rt2x00dev, qual, ++qual->vgc_level_reg);
|
||||
qual->vgc_level = qual->vgc_level_reg;
|
||||
} else if (qual->false_cca < 100 && qual->vgc_level_reg > 0x32) {
|
||||
else if (qual->false_cca < 100 && qual->vgc_level_reg > 0x32)
|
||||
rt2500pci_set_vgc(rt2x00dev, qual, --qual->vgc_level_reg);
|
||||
qual->vgc_level = qual->vgc_level_reg;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user