aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2400pci.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/rt2400pci.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/rt2400pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 31c1dd271627..31bbb44611e5 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -542,7 +542,8 @@ static void rt2400pci_disable_led(struct rt2x00_dev *rt2x00dev)
542/* 542/*
543 * Link tuning 543 * Link tuning
544 */ 544 */
545static void rt2400pci_link_stats(struct rt2x00_dev *rt2x00dev) 545static void rt2400pci_link_stats(struct rt2x00_dev *rt2x00dev,
546 struct link_qual *qual)
546{ 547{
547 u32 reg; 548 u32 reg;
548 u8 bbp; 549 u8 bbp;
@@ -551,13 +552,13 @@ static void rt2400pci_link_stats(struct rt2x00_dev *rt2x00dev)
551 * Update FCS error count from register. 552 * Update FCS error count from register.
552 */ 553 */
553 rt2x00pci_register_read(rt2x00dev, CNT0, &reg); 554 rt2x00pci_register_read(rt2x00dev, CNT0, &reg);
554 rt2x00dev->link.rx_failed = rt2x00_get_field32(reg, CNT0_FCS_ERROR); 555 qual->rx_failed = rt2x00_get_field32(reg, CNT0_FCS_ERROR);
555 556
556 /* 557 /*
557 * Update False CCA count from register. 558 * Update False CCA count from register.
558 */ 559 */
559 rt2400pci_bbp_read(rt2x00dev, 39, &bbp); 560 rt2400pci_bbp_read(rt2x00dev, 39, &bbp);
560 rt2x00dev->link.false_cca = bbp; 561 qual->false_cca = bbp;
561} 562}
562 563
563static void rt2400pci_reset_tuner(struct rt2x00_dev *rt2x00dev) 564static void rt2400pci_reset_tuner(struct rt2x00_dev *rt2x00dev)
@@ -582,10 +583,10 @@ static void rt2400pci_link_tuner(struct rt2x00_dev *rt2x00dev)
582 */ 583 */
583 rt2400pci_bbp_read(rt2x00dev, 13, &reg); 584 rt2400pci_bbp_read(rt2x00dev, 13, &reg);
584 585
585 if (rt2x00dev->link.false_cca > 512 && reg < 0x20) { 586 if (rt2x00dev->link.qual.false_cca > 512 && reg < 0x20) {
586 rt2400pci_bbp_write(rt2x00dev, 13, ++reg); 587 rt2400pci_bbp_write(rt2x00dev, 13, ++reg);
587 rt2x00dev->link.vgc_level = reg; 588 rt2x00dev->link.vgc_level = reg;
588 } else if (rt2x00dev->link.false_cca < 100 && reg > 0x08) { 589 } else if (rt2x00dev->link.qual.false_cca < 100 && reg > 0x08) {
589 rt2400pci_bbp_write(rt2x00dev, 13, --reg); 590 rt2400pci_bbp_write(rt2x00dev, 13, --reg);
590 rt2x00dev->link.vgc_level = reg; 591 rt2x00dev->link.vgc_level = reg;
591 } 592 }