ath9k: Dump modal eeprom header
Debugfs file location: <debugfs_mnt>/ieee80211/phy#/ath9k/modal_eeprom Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
580f010f1b
commit
3f4c4bdd9d
1 changed files with 30 additions and 0 deletions
|
@ -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);
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue