aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.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/rt2500usb.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/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 18b1f9145389..7d3e2828747a 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -535,7 +535,8 @@ static void rt2500usb_disable_led(struct rt2x00_dev *rt2x00dev)
535/* 535/*
536 * Link tuning 536 * Link tuning
537 */ 537 */
538static void rt2500usb_link_stats(struct rt2x00_dev *rt2x00dev) 538static void rt2500usb_link_stats(struct rt2x00_dev *rt2x00dev,
539 struct link_qual *qual)
539{ 540{
540 u16 reg; 541 u16 reg;
541 542
@@ -543,14 +544,13 @@ static void rt2500usb_link_stats(struct rt2x00_dev *rt2x00dev)
543 * Update FCS error count from register. 544 * Update FCS error count from register.
544 */ 545 */
545 rt2500usb_register_read(rt2x00dev, STA_CSR0, &reg); 546 rt2500usb_register_read(rt2x00dev, STA_CSR0, &reg);
546 rt2x00dev->link.rx_failed = rt2x00_get_field16(reg, STA_CSR0_FCS_ERROR); 547 qual->rx_failed = rt2x00_get_field16(reg, STA_CSR0_FCS_ERROR);
547 548
548 /* 549 /*
549 * Update False CCA count from register. 550 * Update False CCA count from register.
550 */ 551 */
551 rt2500usb_register_read(rt2x00dev, STA_CSR3, &reg); 552 rt2500usb_register_read(rt2x00dev, STA_CSR3, &reg);
552 rt2x00dev->link.false_cca = 553 qual->false_cca = rt2x00_get_field16(reg, STA_CSR3_FALSE_CCA_ERROR);
553 rt2x00_get_field16(reg, STA_CSR3_FALSE_CCA_ERROR);
554} 554}
555 555
556static void rt2500usb_reset_tuner(struct rt2x00_dev *rt2x00dev) 556static void rt2500usb_reset_tuner(struct rt2x00_dev *rt2x00dev)
@@ -673,10 +673,10 @@ static void rt2500usb_link_tuner(struct rt2x00_dev *rt2x00dev)
673 if (r17 > up_bound) { 673 if (r17 > up_bound) {
674 rt2500usb_bbp_write(rt2x00dev, 17, up_bound); 674 rt2500usb_bbp_write(rt2x00dev, 17, up_bound);
675 rt2x00dev->link.vgc_level = up_bound; 675 rt2x00dev->link.vgc_level = up_bound;
676 } else if (rt2x00dev->link.false_cca > 512 && r17 < up_bound) { 676 } else if (rt2x00dev->link.qual.false_cca > 512 && r17 < up_bound) {
677 rt2500usb_bbp_write(rt2x00dev, 17, ++r17); 677 rt2500usb_bbp_write(rt2x00dev, 17, ++r17);
678 rt2x00dev->link.vgc_level = r17; 678 rt2x00dev->link.vgc_level = r17;
679 } else if (rt2x00dev->link.false_cca < 100 && r17 > low_bound) { 679 } else if (rt2x00dev->link.qual.false_cca < 100 && r17 > low_bound) {
680 rt2500usb_bbp_write(rt2x00dev, 17, --r17); 680 rt2500usb_bbp_write(rt2x00dev, 17, --r17);
681 rt2x00dev->link.vgc_level = r17; 681 rt2x00dev->link.vgc_level = r17;
682 } 682 }