diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2010-07-11 12:25:17 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-12 22:05:33 +0200 |
commit | 223dcc26591aa8e4a6bf623164b775b5bd89c9e1 (patch) | |
tree | c9d3da2954fe84248437434cbbc9c0d53490d22a /drivers/net/wireless/rt2x00/rt2400pci.c | |
parent | rt2x00: Disable link tuning while scanning (diff) | |
download | linux-223dcc26591aa8e4a6bf623164b775b5bd89c9e1.tar.xz linux-223dcc26591aa8e4a6bf623164b775b5bd89c9e1.zip |
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>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2400pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index d5f1fabe9faf..25e9dcf65c4e 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c @@ -586,9 +586,11 @@ static void rt2400pci_link_stats(struct rt2x00_dev *rt2x00dev, static inline void rt2400pci_set_vgc(struct rt2x00_dev *rt2x00dev, struct link_qual *qual, u8 vgc_level) { - rt2400pci_bbp_write(rt2x00dev, 13, vgc_level); - qual->vgc_level = vgc_level; - qual->vgc_level_reg = vgc_level; + if (qual->vgc_level_reg != vgc_level) { + rt2400pci_bbp_write(rt2x00dev, 13, vgc_level); + qual->vgc_level = vgc_level; + qual->vgc_level_reg = vgc_level; + } } static void rt2400pci_reset_tuner(struct rt2x00_dev *rt2x00dev, |