1 --- a/drivers/net/wireless/ath/ath9k/debug.c
2 +++ b/drivers/net/wireless/ath/ath9k/debug.c
3 @@ -1471,6 +1471,7 @@ int ath9k_init_debug(struct ath_hw *ah)
5 ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
6 ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
7 + ath9k_cmn_debug_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
9 debugfs_create_u32("gpio_mask", 0600,
10 sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);
11 --- a/drivers/net/wireless/ath/ath9k/common-debug.c
12 +++ b/drivers/net/wireless/ath/ath9k/common-debug.c
13 @@ -260,3 +260,58 @@ void ath9k_cmn_debug_phy_err(struct dent
16 EXPORT_SYMBOL(ath9k_cmn_debug_phy_err);
18 +static ssize_t read_file_eeprom(struct file *file, char __user *user_buf,
19 + size_t count, loff_t *ppos)
21 + struct ath_hw *ah = file->private_data;
22 + struct ath_common *common = ath9k_hw_common(ah);
29 + if (AR_SREV_9300_20_OR_LATER(ah))
35 + if (count > size - *ppos)
36 + count = size - *ppos;
38 + for (i = *ppos / 2; count > 0; count -= bytes, *ppos += bytes, i++) {
41 + if (!common->bus_ops->eeprom_read(common, i, &val))
47 + } else if (count == 1) {
52 + if (copy_to_user(user_buf, from, bytes))
59 +static const struct file_operations fops_eeprom = {
60 + .read = read_file_eeprom,
61 + .open = simple_open,
62 + .owner = THIS_MODULE
65 +void ath9k_cmn_debug_eeprom(struct dentry *debugfs_phy,
68 + debugfs_create_file("eeprom", S_IRUSR, debugfs_phy, ah,
71 +EXPORT_SYMBOL(ath9k_cmn_debug_eeprom);
72 --- a/drivers/net/wireless/ath/ath9k/common-debug.h
73 +++ b/drivers/net/wireless/ath/ath9k/common-debug.h
74 @@ -69,6 +69,8 @@ void ath9k_cmn_debug_modal_eeprom(struct
76 void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy,
78 +void ath9k_cmn_debug_eeprom(struct dentry *debugfs_phy,
80 void ath9k_cmn_debug_stat_rx(struct ath_rx_stats *rxstats,
81 struct ath_rx_status *rs);
82 void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
83 --- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
84 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
85 @@ -519,6 +519,7 @@ int ath9k_htc_init_debug(struct ath_hw *
87 ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah);
88 ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah);
89 + ath9k_cmn_debug_eeprom(priv->debug.debugfs_phy, priv->ah);