Ticket #7552: 980-b43_debugwifidown.patch

File 980-b43_debugwifidown.patch, 2.5 KB (added by thommyj@…, 5 years ago)

showing number of interrupts for b43 in sysfs

  • drivers/net/wireless/b43/main.c

    old new  
    19881988        return IRQ_HANDLED; 
    19891989} 
    19901990 
     1991static unsigned long nr_interrupts=0; 
     1992static unsigned long nr_ch0interrupts=0; 
     1993static u32 ch0irqs = 0; 
     1994 
     1995ssize_t b43_attr_interrupts_show(struct device *dev,struct device_attribute *attr, char *buf){ 
     1996        return( snprintf(buf,PAGE_SIZE, 
     1997                         "total: %lu\nch0total: %lu\nmask: %0x%08X\n",nr_interrupts,nr_ch0interrupts,ch0irqs)); 
     1998} 
     1999 
     2000 
    19912001static irqreturn_t b43_do_interrupt(struct b43_wldev *dev) 
    19922002{ 
    19932003        u32 reason; 
     
    20012011        reason &= dev->irq_mask; 
    20022012        if (!reason) 
    20032013                return IRQ_NONE; 
     2014        nr_interrupts++; 
    20042015 
    2005         dev->dma_reason[0] = b43_read32(dev, B43_MMIO_DMA0_REASON) 
    2006             & 0x0001FC00; 
     2016        dev->dma_reason[0] = b43_read32(dev, B43_MMIO_DMA0_REASON); 
     2017           //& 0x0001FC00; 
    20072018        dev->dma_reason[1] = b43_read32(dev, B43_MMIO_DMA1_REASON) 
    20082019            & 0x0000DC00; 
    20092020        dev->dma_reason[2] = b43_read32(dev, B43_MMIO_DMA2_REASON) 
     
    20162027        dev->dma_reason[5] = b43_read32(dev, B43_MMIO_DMA5_REASON) 
    20172028            & 0x0000DC00; 
    20182029*/ 
     2030        if(dev->dma_reason[0] & 0x0001FC00) 
     2031           nr_ch0interrupts++; 
     2032 
     2033        ch0irqs |= dev->dma_reason[0]; 
    20192034 
    20202035        /* ACK the interrupt. */ 
    20212036        b43_write32(dev, B43_MMIO_GEN_IRQ_REASON, reason); 
     
    55325547#ifdef CONFIG_B43_SSB 
    55335548static DEVICE_ATTR(slot_usage, 0444,b43_attr_slotusage_show , NULL); 
    55345549static DEVICE_ATTR(discards,0444,b43_attr_discards_show, NULL); 
     5550static DEVICE_ATTR(interrupts,0444,b43_attr_interrupts_show,NULL); 
    55355551 
    55365552static 
    55375553int b43_ssb_probe(struct ssb_device *sdev, const struct ssb_device_id *id) 
     
    55735589           if( 0 > (err= device_create_file(dev->dev, &dev_attr_discards))){ 
    55745590              printk("b43: error creating discards sysfs entry"); 
    55755591           } 
     5592           if( 0 > (err= device_create_file(dev->dev, &dev_attr_interrupts))){ 
     5593              printk("b43: error creating interrupts sysfs entry"); 
     5594           } 
    55765595        } 
    55775596 
    55785597      out: 
     
    56145633 
    56155634        device_remove_file(dev->dev, &dev_attr_slot_usage); 
    56165635        device_remove_file(dev->dev, &dev_attr_discards); 
     5636        device_remove_file(dev->dev, &dev_attr_interrupts); 
    56175637} 
    56185638 
    56195639static struct ssb_driver b43_ssb_driver = {