mirror of https://gitee.com/openkylin/linux.git
ath9k: move base_eeprom debug code to ath9k_cmn_debug_base_eeprom
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
7e9bed7125
commit
29bf801e04
|
@ -51,3 +51,38 @@ void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
|
||||||
&fops_modal_eeprom);
|
&fops_modal_eeprom);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ath9k_cmn_debug_modal_eeprom);
|
EXPORT_SYMBOL(ath9k_cmn_debug_modal_eeprom);
|
||||||
|
|
||||||
|
static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
|
||||||
|
size_t count, loff_t *ppos)
|
||||||
|
{
|
||||||
|
struct ath_hw *ah = file->private_data;
|
||||||
|
u32 len = 0, size = 1500;
|
||||||
|
ssize_t retval = 0;
|
||||||
|
char *buf;
|
||||||
|
|
||||||
|
buf = kzalloc(size, GFP_KERNEL);
|
||||||
|
if (!buf)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
len = ah->eep_ops->dump_eeprom(ah, true, buf, len, size);
|
||||||
|
|
||||||
|
retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
|
||||||
|
kfree(buf);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct file_operations fops_base_eeprom = {
|
||||||
|
.read = read_file_base_eeprom,
|
||||||
|
.open = simple_open,
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.llseek = default_llseek,
|
||||||
|
};
|
||||||
|
|
||||||
|
void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy,
|
||||||
|
struct ath_hw *ah)
|
||||||
|
{
|
||||||
|
debugfs_create_file("base_eeprom", S_IRUSR, debugfs_phy, ah,
|
||||||
|
&fops_base_eeprom);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(ath9k_cmn_debug_base_eeprom);
|
||||||
|
|
|
@ -16,3 +16,5 @@
|
||||||
|
|
||||||
void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
|
void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
|
||||||
struct ath_hw *ah);
|
struct ath_hw *ah);
|
||||||
|
void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy,
|
||||||
|
struct ath_hw *ah);
|
||||||
|
|
|
@ -1268,34 +1268,6 @@ static const struct file_operations fops_dump_nfcal = {
|
||||||
.llseek = default_llseek,
|
.llseek = default_llseek,
|
||||||
};
|
};
|
||||||
|
|
||||||
static ssize_t read_file_base_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 = 1500;
|
|
||||||
ssize_t retval = 0;
|
|
||||||
char *buf;
|
|
||||||
|
|
||||||
buf = kzalloc(size, GFP_KERNEL);
|
|
||||||
if (!buf)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
len = ah->eep_ops->dump_eeprom(ah, true, buf, len, size);
|
|
||||||
|
|
||||||
retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
|
|
||||||
kfree(buf);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct file_operations fops_base_eeprom = {
|
|
||||||
.read = read_file_base_eeprom,
|
|
||||||
.open = simple_open,
|
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.llseek = default_llseek,
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
|
#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
|
||||||
static ssize_t read_file_btcoex(struct file *file, char __user *user_buf,
|
static ssize_t read_file_btcoex(struct file *file, char __user *user_buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
|
@ -1519,9 +1491,8 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||||
&fops_regdump);
|
&fops_regdump);
|
||||||
debugfs_create_file("dump_nfcal", S_IRUSR, sc->debug.debugfs_phy, sc,
|
debugfs_create_file("dump_nfcal", S_IRUSR, sc->debug.debugfs_phy, sc,
|
||||||
&fops_dump_nfcal);
|
&fops_dump_nfcal);
|
||||||
debugfs_create_file("base_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
|
|
||||||
&fops_base_eeprom);
|
|
||||||
|
|
||||||
|
ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
|
||||||
ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
|
ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
|
||||||
|
|
||||||
debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR,
|
debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR,
|
||||||
|
|
Loading…
Reference in New Issue