~ubuntu-branches/ubuntu/jaunty/linux-backports-modules-2.6.28/jaunty-proposed

« back to all changes in this revision

Viewing changes to updates/compat-wireless-2.6/drivers/net/wireless/b43/debugfs.c

  • Committer: Bazaar Package Importer
  • Author(s): Tim Gardner, Tim Gardner
  • Date: 2009-02-09 17:48:22 UTC
  • Revision ID: james.westby@ubuntu.com-20090209174822-6chmiumgtavrmzgv
Tags: 2.6.28-7.5
[Tim Gardner]

* Update to master-2009-02-09
* Convert 'git-log' to 'git log'

Show diffs side-by-side

added added

removed removed

Lines of Context:
367
367
        return 0;
368
368
}
369
369
 
370
 
/* wl->irq_lock is locked */
371
 
static ssize_t tsf_read_file(struct b43_wldev *dev,
372
 
                             char *buf, size_t bufsize)
373
 
{
374
 
        ssize_t count = 0;
375
 
        u64 tsf;
376
 
 
377
 
        b43_tsf_read(dev, &tsf);
378
 
        fappend("0x%08x%08x\n",
379
 
                (unsigned int)((tsf & 0xFFFFFFFF00000000ULL) >> 32),
380
 
                (unsigned int)(tsf & 0xFFFFFFFFULL));
381
 
 
382
 
        return count;
383
 
}
384
 
 
385
 
/* wl->irq_lock is locked */
386
 
static int tsf_write_file(struct b43_wldev *dev,
387
 
                          const char *buf, size_t count)
388
 
{
389
 
        u64 tsf;
390
 
 
391
 
        if (sscanf(buf, "%llu", (unsigned long long *)(&tsf)) != 1)
392
 
                return -EINVAL;
393
 
        b43_tsf_write(dev, tsf);
394
 
 
395
 
        return 0;
396
 
}
397
 
 
398
370
static ssize_t txstat_read_file(struct b43_wldev *dev,
399
371
                                char *buf, size_t bufsize)
400
372
{
691
663
B43_DEBUGFS_FOPS(mmio16write, NULL, mmio16write__write_file, 1);
692
664
B43_DEBUGFS_FOPS(mmio32read, mmio32read__read_file, mmio32read__write_file, 1);
693
665
B43_DEBUGFS_FOPS(mmio32write, NULL, mmio32write__write_file, 1);
694
 
B43_DEBUGFS_FOPS(tsf, tsf_read_file, tsf_write_file, 1);
695
666
B43_DEBUGFS_FOPS(txstat, txstat_read_file, NULL, 0);
696
667
B43_DEBUGFS_FOPS(restart, NULL, restart_write_file, 1);
697
668
B43_DEBUGFS_FOPS(loctls, loctls_read_file, NULL, 0);
698
669
 
699
670
 
700
 
int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
 
671
bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
701
672
{
702
 
        return !!(dev->dfsentry && dev->dfsentry->dyn_debug[feature]);
 
673
        bool enabled;
 
674
 
 
675
        enabled = (dev->dfsentry && dev->dfsentry->dyn_debug[feature]);
 
676
        if (unlikely(enabled)) {
 
677
                /* Force full debugging messages, if the user enabled
 
678
                 * some dynamic debugging feature. */
 
679
                b43_modparam_verbose = B43_VERBOSITY_MAX;
 
680
        }
 
681
 
 
682
        return enabled;
703
683
}
704
684
 
705
685
static void b43_remove_dynamic_debug(struct b43_wldev *dev)
805
785
        ADD_FILE(mmio16write, 0200);
806
786
        ADD_FILE(mmio32read, 0600);
807
787
        ADD_FILE(mmio32write, 0200);
808
 
        ADD_FILE(tsf, 0600);
809
788
        ADD_FILE(txstat, 0400);
810
789
        ADD_FILE(restart, 0200);
811
790
        ADD_FILE(loctls, 0400);
834
813
        debugfs_remove(e->file_mmio16write.dentry);
835
814
        debugfs_remove(e->file_mmio32read.dentry);
836
815
        debugfs_remove(e->file_mmio32write.dentry);
837
 
        debugfs_remove(e->file_tsf.dentry);
838
816
        debugfs_remove(e->file_txstat.dentry);
839
817
        debugfs_remove(e->file_restart.dentry);
840
818
        debugfs_remove(e->file_loctls.dentry);