aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-10-13 10:26:12 -0400
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:02:49 -0500
commitebcf26dae9f10e247ea41ef66f89b336ba456097 (patch)
tree27913a0d00a754d37702ec29a979c3ce5d358524 /drivers/net/wireless/rt2x00/rt73usb.c
parent191df5737e3047de8b7d8ea4e17df241cf8eefca (diff)
[PATCH] rt2x00: Move quality statistics into seperate structure
Move all link quality statistics variables into the link_qual structure. This cleans up the link structure and allows us to use it for more then just statistics. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index c0671c2e6e73..e4ff106f588e 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -659,7 +659,8 @@ static void rt73usb_activity_led(struct rt2x00_dev *rt2x00dev, int rssi)
659/* 659/*
660 * Link tuning 660 * Link tuning
661 */ 661 */
662static void rt73usb_link_stats(struct rt2x00_dev *rt2x00dev) 662static void rt73usb_link_stats(struct rt2x00_dev *rt2x00dev,
663 struct link_qual *qual)
663{ 664{
664 u32 reg; 665 u32 reg;
665 666
@@ -667,15 +668,13 @@ static void rt73usb_link_stats(struct rt2x00_dev *rt2x00dev)
667 * Update FCS error count from register. 668 * Update FCS error count from register.
668 */ 669 */
669 rt73usb_register_read(rt2x00dev, STA_CSR0, &reg); 670 rt73usb_register_read(rt2x00dev, STA_CSR0, &reg);
670 rt2x00dev->link.rx_failed = rt2x00_get_field32(reg, STA_CSR0_FCS_ERROR); 671 qual->rx_failed = rt2x00_get_field32(reg, STA_CSR0_FCS_ERROR);
671 672
672 /* 673 /*
673 * Update False CCA count from register. 674 * Update False CCA count from register.
674 */ 675 */
675 rt73usb_register_read(rt2x00dev, STA_CSR1, &reg); 676 rt73usb_register_read(rt2x00dev, STA_CSR1, &reg);
676 reg = rt2x00_get_field32(reg, STA_CSR1_FALSE_CCA_ERROR); 677 qual->false_cca = rt2x00_get_field32(reg, STA_CSR1_FALSE_CCA_ERROR);
677 rt2x00dev->link.false_cca =
678 rt2x00_get_field32(reg, STA_CSR1_FALSE_CCA_ERROR);
679} 678}
680 679
681static void rt73usb_reset_tuner(struct rt2x00_dev *rt2x00dev) 680static void rt73usb_reset_tuner(struct rt2x00_dev *rt2x00dev)
@@ -781,12 +780,12 @@ static void rt73usb_link_tuner(struct rt2x00_dev *rt2x00dev)
781 * r17 does not yet exceed upper limit, continue and base 780 * r17 does not yet exceed upper limit, continue and base
782 * the r17 tuning on the false CCA count. 781 * the r17 tuning on the false CCA count.
783 */ 782 */
784 if (rt2x00dev->link.false_cca > 512 && r17 < up_bound) { 783 if (rt2x00dev->link.qual.false_cca > 512 && r17 < up_bound) {
785 r17 += 4; 784 r17 += 4;
786 if (r17 > up_bound) 785 if (r17 > up_bound)
787 r17 = up_bound; 786 r17 = up_bound;
788 rt73usb_bbp_write(rt2x00dev, 17, r17); 787 rt73usb_bbp_write(rt2x00dev, 17, r17);
789 } else if (rt2x00dev->link.false_cca < 100 && r17 > low_bound) { 788 } else if (rt2x00dev->link.qual.false_cca < 100 && r17 > low_bound) {
790 r17 -= 4; 789 r17 -= 4;
791 if (r17 < low_bound) 790 if (r17 < low_bound)
792 r17 = low_bound; 791 r17 = low_bound;