1 --- a/drivers/net/wireless/ath/ath9k/debug.c
2 +++ b/drivers/net/wireless/ath/ath9k/debug.c
3 @@ -1782,6 +1782,53 @@ void ath9k_deinit_debug(struct ath_softc
7 +static ssize_t read_file_eeprom(struct file *file, char __user *user_buf,
8 + size_t count, loff_t *ppos)
10 + struct ath_softc *sc = file->private_data;
11 + struct ath_hw *ah = sc->sc_ah;
12 + struct ath_common *common = ath9k_hw_common(ah);
19 + if (AR_SREV_9300_20_OR_LATER(ah))
25 + if (count > size - *ppos)
26 + count = size - *ppos;
28 + for (i = *ppos / 2; count > 0; count -= bytes, *ppos += bytes, i++) {
31 + if (!common->bus_ops->eeprom_read(common, i, &val))
37 + } else if (count == 1) {
42 + copy_to_user(user_buf, from, bytes);
48 +static const struct file_operations fops_eeprom = {
49 + .read = read_file_eeprom,
50 + .open = simple_open,
51 + .owner = THIS_MODULE
54 int ath9k_init_debug(struct ath_hw *ah)
56 struct ath_common *common = ath9k_hw_common(ah);
57 @@ -1800,6 +1847,8 @@ int ath9k_init_debug(struct ath_hw *ah)
58 ath9k_dfs_init_debug(sc);
59 ath9k_tx99_init_debug(sc);
61 + debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
63 debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
65 debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc,