Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66767
b: refs/heads/master
c: 643b252
h: refs/heads/master
i:
  66765: 99450ff
  66763: c0a6eb9
  66759: 8c2223d
  66751: f4e184b
v: v3
  • Loading branch information
Ivo van Doorn authored and David S. Miller committed Oct 10, 2007
1 parent 5a78421 commit 397ac6b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 066cb637b1b562bebd09d237bfaaca6724f247e5
refs/heads/master: 643b252123fab1a524449be3b79937f17e06a5ac
37 changes: 37 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ struct rt2x00debug_intf {
* - driver folder
* - driver file
* - chipset file
* - device flags file
* - register offset/value files
* - eeprom offset/value files
* - bbp offset/value files
Expand All @@ -65,6 +66,7 @@ struct rt2x00debug_intf {
struct dentry *driver_folder;
struct dentry *driver_entry;
struct dentry *chipset_entry;
struct dentry *dev_flags;
struct dentry *csr_off_entry;
struct dentry *csr_val_entry;
struct dentry *eeprom_off_entry;
Expand Down Expand Up @@ -193,6 +195,34 @@ RT2X00DEBUGFS_OPS(eeprom, "0x%.4x\n", u16);
RT2X00DEBUGFS_OPS(bbp, "0x%.2x\n", u8);
RT2X00DEBUGFS_OPS(rf, "0x%.8x\n", u32);

static ssize_t rt2x00debug_read_dev_flags(struct file *file,
char __user *buf,
size_t length,
loff_t *offset)
{
struct rt2x00debug_intf *intf = file->private_data;
char line[16];
size_t size;

if (*offset)
return 0;

size = sprintf(line, "0x%.8x\n", (unsigned int)intf->rt2x00dev->flags);

if (copy_to_user(buf, line, size))
return -EFAULT;

*offset += size;
return size;
}

static const struct file_operations rt2x00debug_fop_dev_flags = {
.owner = THIS_MODULE,
.read = rt2x00debug_read_dev_flags,
.open = rt2x00debug_file_open,
.release = rt2x00debug_file_release,
};

static struct dentry *rt2x00debug_create_file_driver(const char *name,
struct rt2x00debug_intf
*intf,
Expand Down Expand Up @@ -270,6 +300,12 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
if (IS_ERR(intf->chipset_entry))
goto exit;

intf->dev_flags = debugfs_create_file("dev_flags", S_IRUGO,
intf->driver_folder, intf,
&rt2x00debug_fop_dev_flags);
if (IS_ERR(intf->dev_flags))
goto exit;

#define RT2X00DEBUGFS_CREATE_ENTRY(__intf, __name) \
({ \
(__intf)->__name##_off_entry = \
Expand Down Expand Up @@ -320,6 +356,7 @@ void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev)
debugfs_remove(intf->eeprom_off_entry);
debugfs_remove(intf->csr_val_entry);
debugfs_remove(intf->csr_off_entry);
debugfs_remove(intf->dev_flags);
debugfs_remove(intf->chipset_entry);
debugfs_remove(intf->driver_entry);
debugfs_remove(intf->driver_folder);
Expand Down

0 comments on commit 397ac6b

Please sign in to comment.