Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265424
b: refs/heads/master
c: 3f4c4bd
h: refs/heads/master
v: v3
  • Loading branch information
Rajkumar Manoharan authored and John W. Linville committed Aug 9, 2011
1 parent 9b76812 commit 36349d4
Show file tree
Hide file tree
Showing 2 changed files with 31 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: 580f010f1bd7ac0e83f77f4b3035e78417d3c2e2
refs/heads/master: 3f4c4bdd9d4d069e3d5e6154bfdd809f7923a90b
30 changes: 30 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,34 @@ static const struct file_operations fops_base_eeprom = {
.llseek = default_llseek,
};

static ssize_t read_file_modal_eeprom(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;
struct ath_hw *ah = sc->sc_ah;
u32 len = 0, size = 6000;
char *buf;
size_t retval;

buf = kzalloc(size, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;

len = ah->eep_ops->dump_eeprom(ah, false, buf, len, size);

retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
kfree(buf);

return retval;
}

static const struct file_operations fops_modal_eeprom = {
.read = read_file_modal_eeprom,
.open = ath9k_debugfs_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};

int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
Expand Down Expand Up @@ -1236,6 +1264,8 @@ int ath9k_init_debug(struct ath_hw *ah)
&fops_regdump);
debugfs_create_file("base_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_base_eeprom);
debugfs_create_file("modal_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_modal_eeprom);

debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);
Expand Down

0 comments on commit 36349d4

Please sign in to comment.