Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k: move phy_err to ath9k_cmn_debug_phy_err

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Oleksij Rempel and committed by
John W. Linville
e02912cd f14c17cc

+72 -63
+69
drivers/net/wireless/ath/ath9k/common-debug.c
··· 182 182 &fops_recv); 183 183 } 184 184 EXPORT_SYMBOL(ath9k_cmn_debug_recv); 185 + 186 + static ssize_t read_file_phy_err(struct file *file, char __user *user_buf, 187 + size_t count, loff_t *ppos) 188 + { 189 + #define PHY_ERR(s, p) \ 190 + len += scnprintf(buf + len, size - len, "%22s : %10u\n", s, \ 191 + rxstats->phy_err_stats[p]); 192 + 193 + struct ath_rx_stats *rxstats = file->private_data; 194 + char *buf; 195 + unsigned int len = 0, size = 1600; 196 + ssize_t retval = 0; 197 + 198 + buf = kzalloc(size, GFP_KERNEL); 199 + if (buf == NULL) 200 + return -ENOMEM; 201 + 202 + PHY_ERR("UNDERRUN ERR", ATH9K_PHYERR_UNDERRUN); 203 + PHY_ERR("TIMING ERR", ATH9K_PHYERR_TIMING); 204 + PHY_ERR("PARITY ERR", ATH9K_PHYERR_PARITY); 205 + PHY_ERR("RATE ERR", ATH9K_PHYERR_RATE); 206 + PHY_ERR("LENGTH ERR", ATH9K_PHYERR_LENGTH); 207 + PHY_ERR("RADAR ERR", ATH9K_PHYERR_RADAR); 208 + PHY_ERR("SERVICE ERR", ATH9K_PHYERR_SERVICE); 209 + PHY_ERR("TOR ERR", ATH9K_PHYERR_TOR); 210 + PHY_ERR("OFDM-TIMING ERR", ATH9K_PHYERR_OFDM_TIMING); 211 + PHY_ERR("OFDM-SIGNAL-PARITY ERR", ATH9K_PHYERR_OFDM_SIGNAL_PARITY); 212 + PHY_ERR("OFDM-RATE ERR", ATH9K_PHYERR_OFDM_RATE_ILLEGAL); 213 + PHY_ERR("OFDM-LENGTH ERR", ATH9K_PHYERR_OFDM_LENGTH_ILLEGAL); 214 + PHY_ERR("OFDM-POWER-DROP ERR", ATH9K_PHYERR_OFDM_POWER_DROP); 215 + PHY_ERR("OFDM-SERVICE ERR", ATH9K_PHYERR_OFDM_SERVICE); 216 + PHY_ERR("OFDM-RESTART ERR", ATH9K_PHYERR_OFDM_RESTART); 217 + PHY_ERR("FALSE-RADAR-EXT ERR", ATH9K_PHYERR_FALSE_RADAR_EXT); 218 + PHY_ERR("CCK-TIMING ERR", ATH9K_PHYERR_CCK_TIMING); 219 + PHY_ERR("CCK-HEADER-CRC ERR", ATH9K_PHYERR_CCK_HEADER_CRC); 220 + PHY_ERR("CCK-RATE ERR", ATH9K_PHYERR_CCK_RATE_ILLEGAL); 221 + PHY_ERR("CCK-SERVICE ERR", ATH9K_PHYERR_CCK_SERVICE); 222 + PHY_ERR("CCK-RESTART ERR", ATH9K_PHYERR_CCK_RESTART); 223 + PHY_ERR("CCK-LENGTH ERR", ATH9K_PHYERR_CCK_LENGTH_ILLEGAL); 224 + PHY_ERR("CCK-POWER-DROP ERR", ATH9K_PHYERR_CCK_POWER_DROP); 225 + PHY_ERR("HT-CRC ERR", ATH9K_PHYERR_HT_CRC_ERROR); 226 + PHY_ERR("HT-LENGTH ERR", ATH9K_PHYERR_HT_LENGTH_ILLEGAL); 227 + PHY_ERR("HT-RATE ERR", ATH9K_PHYERR_HT_RATE_ILLEGAL); 228 + 229 + if (len > size) 230 + len = size; 231 + 232 + retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); 233 + kfree(buf); 234 + 235 + return retval; 236 + 237 + #undef PHY_ERR 238 + } 239 + 240 + static const struct file_operations fops_phy_err = { 241 + .read = read_file_phy_err, 242 + .open = simple_open, 243 + .owner = THIS_MODULE, 244 + .llseek = default_llseek, 245 + }; 246 + 247 + void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, 248 + struct ath_rx_stats *rxstats) 249 + { 250 + debugfs_create_file("phy_err", S_IRUSR, debugfs_phy, rxstats, 251 + &fops_phy_err); 252 + } 253 + EXPORT_SYMBOL(ath9k_cmn_debug_phy_err);
+2
drivers/net/wireless/ath/ath9k/common-debug.h
··· 68 68 struct ath_rx_status *rs); 69 69 void ath9k_cmn_debug_recv(struct dentry *debugfs_phy, 70 70 struct ath_rx_stats *rxstats); 71 + void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, 72 + struct ath_rx_stats *rxstats);
+1 -63
drivers/net/wireless/ath/ath9k/debug.c
··· 953 953 ath9k_cmn_debug_stat_rx(&sc->debug.stats.rxstats, rs); 954 954 } 955 955 956 - static ssize_t read_file_phy_err(struct file *file, char __user *user_buf, 957 - size_t count, loff_t *ppos) 958 - { 959 - #define PHY_ERR(s, p) \ 960 - len += scnprintf(buf + len, size - len, "%22s : %10u\n", s, \ 961 - sc->debug.stats.rxstats.phy_err_stats[p]); 962 - 963 - struct ath_softc *sc = file->private_data; 964 - char *buf; 965 - unsigned int len = 0, size = 1600; 966 - ssize_t retval = 0; 967 - 968 - buf = kzalloc(size, GFP_KERNEL); 969 - if (buf == NULL) 970 - return -ENOMEM; 971 - 972 - PHY_ERR("UNDERRUN ERR", ATH9K_PHYERR_UNDERRUN); 973 - PHY_ERR("TIMING ERR", ATH9K_PHYERR_TIMING); 974 - PHY_ERR("PARITY ERR", ATH9K_PHYERR_PARITY); 975 - PHY_ERR("RATE ERR", ATH9K_PHYERR_RATE); 976 - PHY_ERR("LENGTH ERR", ATH9K_PHYERR_LENGTH); 977 - PHY_ERR("RADAR ERR", ATH9K_PHYERR_RADAR); 978 - PHY_ERR("SERVICE ERR", ATH9K_PHYERR_SERVICE); 979 - PHY_ERR("TOR ERR", ATH9K_PHYERR_TOR); 980 - PHY_ERR("OFDM-TIMING ERR", ATH9K_PHYERR_OFDM_TIMING); 981 - PHY_ERR("OFDM-SIGNAL-PARITY ERR", ATH9K_PHYERR_OFDM_SIGNAL_PARITY); 982 - PHY_ERR("OFDM-RATE ERR", ATH9K_PHYERR_OFDM_RATE_ILLEGAL); 983 - PHY_ERR("OFDM-LENGTH ERR", ATH9K_PHYERR_OFDM_LENGTH_ILLEGAL); 984 - PHY_ERR("OFDM-POWER-DROP ERR", ATH9K_PHYERR_OFDM_POWER_DROP); 985 - PHY_ERR("OFDM-SERVICE ERR", ATH9K_PHYERR_OFDM_SERVICE); 986 - PHY_ERR("OFDM-RESTART ERR", ATH9K_PHYERR_OFDM_RESTART); 987 - PHY_ERR("FALSE-RADAR-EXT ERR", ATH9K_PHYERR_FALSE_RADAR_EXT); 988 - PHY_ERR("CCK-TIMING ERR", ATH9K_PHYERR_CCK_TIMING); 989 - PHY_ERR("CCK-HEADER-CRC ERR", ATH9K_PHYERR_CCK_HEADER_CRC); 990 - PHY_ERR("CCK-RATE ERR", ATH9K_PHYERR_CCK_RATE_ILLEGAL); 991 - PHY_ERR("CCK-SERVICE ERR", ATH9K_PHYERR_CCK_SERVICE); 992 - PHY_ERR("CCK-RESTART ERR", ATH9K_PHYERR_CCK_RESTART); 993 - PHY_ERR("CCK-LENGTH ERR", ATH9K_PHYERR_CCK_LENGTH_ILLEGAL); 994 - PHY_ERR("CCK-POWER-DROP ERR", ATH9K_PHYERR_CCK_POWER_DROP); 995 - PHY_ERR("HT-CRC ERR", ATH9K_PHYERR_HT_CRC_ERROR); 996 - PHY_ERR("HT-LENGTH ERR", ATH9K_PHYERR_HT_LENGTH_ILLEGAL); 997 - PHY_ERR("HT-RATE ERR", ATH9K_PHYERR_HT_RATE_ILLEGAL); 998 - 999 - if (len > size) 1000 - len = size; 1001 - 1002 - retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); 1003 - kfree(buf); 1004 - 1005 - return retval; 1006 - 1007 - #undef PHY_ERR 1008 - } 1009 - 1010 - static const struct file_operations fops_phy_err = { 1011 - .read = read_file_phy_err, 1012 - .open = simple_open, 1013 - .owner = THIS_MODULE, 1014 - .llseek = default_llseek, 1015 - }; 1016 - 1017 956 static ssize_t read_file_regidx(struct file *file, char __user *user_buf, 1018 957 size_t count, loff_t *ppos) 1019 958 { ··· 1330 1391 &fops_reset); 1331 1392 1332 1393 ath9k_cmn_debug_recv(sc->debug.debugfs_phy, &sc->debug.stats.rxstats); 1394 + ath9k_cmn_debug_phy_err(sc->debug.debugfs_phy, &sc->debug.stats.rxstats); 1333 1395 1334 - debugfs_create_file("phy_err", S_IRUSR, sc->debug.debugfs_phy, sc, 1335 - &fops_phy_err); 1336 1396 debugfs_create_u8("rx_chainmask", S_IRUSR, sc->debug.debugfs_phy, 1337 1397 &ah->rxchainmask); 1338 1398 debugfs_create_u8("tx_chainmask", S_IRUSR, sc->debug.debugfs_phy,