1 /****************************************************************************** 2 * 3 * Copyright(c) 2007 - 2019 Realtek Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of version 2 of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * 9 * This program is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * more details. 13 * 14 *****************************************************************************/ 15 #ifndef __RTW_DEBUG_H__ 16 #define __RTW_DEBUG_H__ 17 18 /* driver log level*/ 19 enum { 20 _DRV_NONE_ = 0, 21 _DRV_ALWAYS_ = 1, 22 _DRV_ERR_ = 2, 23 _DRV_WARNING_ = 3, 24 _DRV_INFO_ = 4, 25 _DRV_DEBUG_ = 5, 26 _DRV_MAX_ = 6 27 }; 28 29 #define DRIVER_PREFIX "RTW: " 30 31 #ifdef PLATFORM_OS_CE 32 extern void rtl871x_cedbg(const char *fmt, ...); 33 #endif 34 35 #ifdef PLATFORM_WINDOWS 36 #define RTW_PRINT do {} while (0) 37 #define RTW_ERR do {} while (0) 38 #define RTW_WARN do {} while (0) 39 #define RTW_INFO do {} while (0) 40 #define RTW_DBG do {} while (0) 41 #define RTW_PRINT_SEL do {} while (0) 42 #define _RTW_PRINT do {} while (0) 43 #define _RTW_ERR do {} while (0) 44 #define _RTW_WARN do {} while (0) 45 #define _RTW_INFO do {} while (0) 46 #define _RTW_DBG do {} while (0) 47 #define _RTW_PRINT_SEL do {} while (0) 48 #else 49 #define RTW_PRINT(x, ...) do {} while (0) 50 #define RTW_ERR(x, ...) do {} while (0) 51 #define RTW_WARN(x,...) do {} while (0) 52 #define RTW_INFO(x,...) do {} while (0) 53 #define RTW_DBG(x,...) do {} while (0) 54 #define RTW_PRINT_SEL(x,...) do {} while (0) 55 #define _RTW_PRINT(x, ...) do {} while (0) 56 #define _RTW_ERR(x, ...) do {} while (0) 57 #define _RTW_WARN(x,...) do {} while (0) 58 #define _RTW_INFO(x,...) do {} while (0) 59 #define _RTW_DBG(x,...) do {} while (0) 60 #define _RTW_PRINT_SEL(x,...) do {} while (0) 61 #endif 62 63 #define RTW_INFO_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0) 64 #define RTW_DBG_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0) 65 #define RTW_PRINT_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0) 66 67 #define RTW_DBG_EXPR(EXPR) do {} while (0) 68 69 #define RTW_DBGDUMP 0 /* 'stream' for _dbgdump */ 70 71 72 73 #undef _dbgdump 74 #undef _seqdump 75 76 #if defined(PLATFORM_WINDOWS) && defined(PLATFORM_OS_XP) 77 #define _dbgdump DbgPrint 78 #define KERN_CONT 79 #define _seqdump(sel, fmt, arg...) _dbgdump(fmt, ##arg) 80 #elif defined(PLATFORM_WINDOWS) && defined(PLATFORM_OS_CE) 81 #define _dbgdump rtl871x_cedbg 82 #define KERN_CONT 83 #define _seqdump(sel, fmt, arg...) _dbgdump(fmt, ##arg) 84 #elif defined PLATFORM_LINUX 85 #define _dbgdump printk 86 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) 87 #define KERN_CONT 88 #endif 89 #define _seqdump seq_printf 90 #elif defined PLATFORM_FREEBSD 91 #define _dbgdump printf 92 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) 93 #define KERN_CONT 94 #endif 95 #define _seqdump(sel, fmt, arg...) _dbgdump(fmt, ##arg) 96 #endif 97 98 void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring, 99 bool _idx_show, const u8 *_hexdata, int _hexdatalen); 100 101 #ifdef CONFIG_RTW_DEBUG 102 103 #ifndef _OS_INTFS_C_ 104 extern uint rtw_drv_log_level; 105 #endif 106 107 #if defined(_dbgdump) 108 109 #ifdef PLATFORM_LINUX 110 #ifdef DBG_THREAD_PID 111 #define T_PID_FMT "(%5u) " 112 #define T_PID_ARG current->pid 113 #else /* !DBG_THREAD_PID */ 114 #define T_PID_FMT "%s" 115 #define T_PID_ARG "" 116 #endif /* !DBG_THREAD_PID */ 117 118 #ifdef DBG_CPU_INFO 119 #define CPU_INFO_FMT "[%u] " 120 #define CPU_INFO_ARG get_cpu() 121 #else /* !DBG_CPU_INFO */ 122 #define CPU_INFO_FMT "%s" 123 #define CPU_INFO_ARG "" 124 #endif /* !DBG_CPU_INFO */ 125 126 /* Extra information in prefix */ 127 #define EX_INFO_FMT T_PID_FMT CPU_INFO_FMT 128 #define EX_INFO_ARG T_PID_ARG, CPU_INFO_ARG 129 #else /* !PLATFORM_LINUX */ 130 #define EX_INFO_FMT "%s" 131 #define EX_INFO_ARG "" 132 #endif /* !PLATFORM_LINUX */ 133 134 #define DBG_PREFIX EX_INFO_FMT DRIVER_PREFIX 135 #define DBG_PREFIX_ARG EX_INFO_ARG 136 137 /* with driver-defined prefix */ 138 #undef RTW_PRINT 139 #define RTW_PRINT(fmt, arg...) \ 140 do {\ 141 if (_DRV_ALWAYS_ <= rtw_drv_log_level) {\ 142 _dbgdump(DBG_PREFIX fmt, DBG_PREFIX_ARG, ##arg);\ 143 } \ 144 } while (0) 145 146 #undef RTW_ERR 147 #define RTW_ERR(fmt, arg...) \ 148 do {\ 149 if (_DRV_ERR_ <= rtw_drv_log_level) {\ 150 _dbgdump(DBG_PREFIX "ERROR " fmt, \ 151 DBG_PREFIX_ARG, ##arg);\ 152 } \ 153 } while (0) 154 155 156 #undef RTW_WARN 157 #define RTW_WARN(fmt, arg...) \ 158 do {\ 159 if (_DRV_WARNING_ <= rtw_drv_log_level) {\ 160 _dbgdump(DBG_PREFIX "WARN " fmt, \ 161 DBG_PREFIX_ARG, ##arg);\ 162 } \ 163 } while (0) 164 165 #undef RTW_INFO 166 #define RTW_INFO(fmt, arg...) \ 167 do {\ 168 if (_DRV_INFO_ <= rtw_drv_log_level) {\ 169 _dbgdump(DBG_PREFIX fmt, DBG_PREFIX_ARG, ##arg);\ 170 } \ 171 } while (0) 172 173 174 #undef RTW_DBG 175 #define RTW_DBG(fmt, arg...) \ 176 do {\ 177 if (_DRV_DEBUG_ <= rtw_drv_log_level) {\ 178 _dbgdump(DBG_PREFIX fmt, DBG_PREFIX_ARG, ##arg);\ 179 } \ 180 } while (0) 181 182 #undef RTW_INFO_DUMP 183 #define RTW_INFO_DUMP(_TitleString, _HexData, _HexDataLen) \ 184 RTW_BUF_DUMP_SEL(_DRV_INFO_, RTW_DBGDUMP, _TitleString, _FALSE, _HexData, _HexDataLen) 185 186 #undef RTW_DBG_DUMP 187 #define RTW_DBG_DUMP(_TitleString, _HexData, _HexDataLen) \ 188 RTW_BUF_DUMP_SEL(_DRV_DEBUG_, RTW_DBGDUMP, _TitleString, _FALSE, _HexData, _HexDataLen) 189 190 191 #undef RTW_PRINT_DUMP 192 #define RTW_PRINT_DUMP(_TitleString, _HexData, _HexDataLen) \ 193 RTW_BUF_DUMP_SEL(_DRV_ALWAYS_, RTW_DBGDUMP, _TitleString, _FALSE, _HexData, _HexDataLen) 194 195 /* without driver-defined prefix */ 196 #undef _RTW_PRINT 197 #define _RTW_PRINT(fmt, arg...) \ 198 do {\ 199 if (_DRV_ALWAYS_ <= rtw_drv_log_level) {\ 200 _dbgdump(KERN_CONT fmt, ##arg);\ 201 } \ 202 } while (0) 203 204 #undef _RTW_ERR 205 #define _RTW_ERR(fmt, arg...) \ 206 do {\ 207 if (_DRV_ERR_ <= rtw_drv_log_level) {\ 208 _dbgdump(KERN_CONT fmt, ##arg);\ 209 } \ 210 } while (0) 211 212 213 #undef _RTW_WARN 214 #define _RTW_WARN(fmt, arg...) \ 215 do {\ 216 if (_DRV_WARNING_ <= rtw_drv_log_level) {\ 217 _dbgdump(KERN_CONT fmt, ##arg);\ 218 } \ 219 } while (0) 220 221 #undef _RTW_INFO 222 #define _RTW_INFO(fmt, arg...) \ 223 do {\ 224 if (_DRV_INFO_ <= rtw_drv_log_level) {\ 225 _dbgdump(KERN_CONT fmt, ##arg);\ 226 } \ 227 } while (0) 228 229 #undef _RTW_DBG 230 #define _RTW_DBG(fmt, arg...) \ 231 do {\ 232 if (_DRV_DEBUG_ <= rtw_drv_log_level) {\ 233 _dbgdump(KERN_CONT fmt, ##arg);\ 234 } \ 235 } while (0) 236 237 238 /* other debug APIs */ 239 #undef RTW_DBG_EXPR 240 #define RTW_DBG_EXPR(EXPR) do { if (_DRV_DEBUG_ <= rtw_drv_log_level) EXPR; } while (0) 241 242 #endif /* defined(_dbgdump) */ 243 #endif /* CONFIG_RTW_DEBUG */ 244 245 246 #if defined(_seqdump) 247 /* dump message to selected 'stream' with driver-defined prefix */ 248 #undef RTW_PRINT_SEL 249 #define RTW_PRINT_SEL(sel, fmt, arg...) \ 250 do {\ 251 if (sel == RTW_DBGDUMP)\ 252 RTW_PRINT(fmt, ##arg); \ 253 else {\ 254 _seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \ 255 } \ 256 } while (0) 257 258 /* dump message to selected 'stream' */ 259 #undef _RTW_PRINT_SEL 260 #define _RTW_PRINT_SEL(sel, fmt, arg...) \ 261 do {\ 262 if (sel == RTW_DBGDUMP)\ 263 _RTW_PRINT(fmt, ##arg); \ 264 else {\ 265 _seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \ 266 } \ 267 } while (0) 268 269 /* dump message to selected 'stream' */ 270 #undef RTW_DUMP_SEL 271 #define RTW_DUMP_SEL(sel, _HexData, _HexDataLen) \ 272 RTW_BUF_DUMP_SEL(_DRV_ALWAYS_, sel, NULL, _FALSE, _HexData, _HexDataLen) 273 274 #define RTW_MAP_DUMP_SEL(sel, _TitleString, _HexData, _HexDataLen) \ 275 RTW_BUF_DUMP_SEL(_DRV_ALWAYS_, sel, _TitleString, _TRUE, _HexData, _HexDataLen) 276 #endif /* defined(_seqdump) */ 277 278 279 #ifdef CONFIG_DBG_COUNTER 280 #define DBG_COUNTER(counter) counter++ 281 #else 282 #define DBG_COUNTER(counter) 283 #endif 284 285 void dump_drv_version(void *sel); 286 void dump_log_level(void *sel); 287 288 #ifdef CONFIG_SDIO_HCI 289 void sd_f0_reg_dump(void *sel, _adapter *adapter); 290 void sdio_local_reg_dump(void *sel, _adapter *adapter); 291 #endif /* CONFIG_SDIO_HCI */ 292 293 void mac_reg_dump(void *sel, _adapter *adapter); 294 void bb_reg_dump(void *sel, _adapter *adapter); 295 void bb_reg_dump_ex(void *sel, _adapter *adapter); 296 void rf_reg_dump(void *sel, _adapter *adapter); 297 298 void rtw_sink_rtp_seq_dbg(_adapter *adapter, u8 *ehdr_pos); 299 300 struct sta_info; 301 void sta_rx_reorder_ctl_dump(void *sel, struct sta_info *sta); 302 303 struct dvobj_priv; 304 void dump_tx_rate_bmp(void *sel, struct dvobj_priv *dvobj); 305 void dump_adapters_status(void *sel, struct dvobj_priv *dvobj); 306 307 struct sec_cam_ent; 308 #if defined(CONFIG_RTW_DEBUG) || defined(CONFIG_PROC_DEBUG) 309 void dump_sec_cam_ent(void *sel, struct sec_cam_ent *ent, int id); 310 void dump_sec_cam_ent_title(void *sel, u8 has_id); 311 #endif 312 void dump_sec_cam(void *sel, _adapter *adapter); 313 void dump_sec_cam_cache(void *sel, _adapter *adapter); 314 315 bool rtw_fwdl_test_trigger_chksum_fail(void); 316 bool rtw_fwdl_test_trigger_wintint_rdy_fail(void); 317 bool rtw_del_rx_ampdu_test_trigger_no_tx_fail(void); 318 u32 rtw_get_wait_hiq_empty_ms(void); 319 void rtw_sta_linking_test_set_start(void); 320 bool rtw_sta_linking_test_wait_done(void); 321 bool rtw_sta_linking_test_force_fail(void); 322 #ifdef CONFIG_AP_MODE 323 u16 rtw_ap_linking_test_force_auth_fail(void); 324 u16 rtw_ap_linking_test_force_asoc_fail(void); 325 #endif 326 327 #ifdef CONFIG_PROC_DEBUG 328 ssize_t proc_set_write_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 329 int proc_get_read_reg(struct seq_file *m, void *v); 330 ssize_t proc_set_read_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 331 void dump_drv_cfg(void *sel); 332 int proc_get_fwstate(struct seq_file *m, void *v); 333 int proc_get_sec_info(struct seq_file *m, void *v); 334 int proc_get_mlmext_state(struct seq_file *m, void *v); 335 #ifdef CONFIG_LAYER2_ROAMING 336 int proc_get_roam_flags(struct seq_file *m, void *v); 337 ssize_t proc_set_roam_flags(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 338 int proc_get_roam_param(struct seq_file *m, void *v); 339 ssize_t proc_set_roam_param(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 340 ssize_t proc_set_roam_tgt_addr(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 341 #endif /* CONFIG_LAYER2_ROAMING */ 342 int proc_get_qos_option(struct seq_file *m, void *v); 343 int proc_get_ht_option(struct seq_file *m, void *v); 344 int proc_get_rf_info(struct seq_file *m, void *v); 345 int proc_get_scan_param(struct seq_file *m, void *v); 346 ssize_t proc_set_scan_param(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 347 int proc_get_scan_abort(struct seq_file *m, void *v); 348 #ifdef CONFIG_RTW_REPEATER_SON 349 int proc_get_rson_data(struct seq_file *m, void *v); 350 ssize_t proc_set_rson_data(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 351 #endif 352 int proc_get_survey_info(struct seq_file *m, void *v); 353 ssize_t proc_set_survey_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 354 int proc_get_ap_info(struct seq_file *m, void *v); 355 #ifdef ROKU_PRIVATE 356 int proc_get_infra_ap(struct seq_file *m, void *v); 357 #endif /* ROKU_PRIVATE */ 358 ssize_t proc_reset_trx_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 359 int proc_get_trx_info(struct seq_file *m, void *v); 360 ssize_t proc_set_tx_power_offset(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 361 int proc_get_tx_power_offset(struct seq_file *m, void *v); 362 int proc_get_rate_ctl(struct seq_file *m, void *v); 363 int proc_get_wifi_spec(struct seq_file *m, void *v); 364 ssize_t proc_set_rate_ctl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 365 int proc_get_bw_ctl(struct seq_file *m, void *v); 366 ssize_t proc_set_bw_ctl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 367 #ifdef DBG_RX_COUNTER_DUMP 368 int proc_get_rx_cnt_dump(struct seq_file *m, void *v); 369 ssize_t proc_set_rx_cnt_dump(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 370 #endif 371 372 #ifdef CONFIG_AP_MODE 373 int proc_get_bmc_tx_rate(struct seq_file *m, void *v); 374 ssize_t proc_set_bmc_tx_rate(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 375 #endif /*CONFIG_AP_MODE*/ 376 377 int proc_get_ps_dbg_info(struct seq_file *m, void *v); 378 ssize_t proc_set_ps_dbg_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 379 380 ssize_t proc_set_fwdl_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 381 ssize_t proc_set_del_rx_ampdu_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 382 ssize_t proc_set_wait_hiq_empty(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 383 ssize_t proc_set_sta_linking_test(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 384 #ifdef CONFIG_AP_MODE 385 ssize_t proc_set_ap_linking_test(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 386 #endif 387 388 int proc_get_rx_stat(struct seq_file *m, void *v); 389 int proc_get_tx_stat(struct seq_file *m, void *v); 390 #ifdef CONFIG_AP_MODE 391 int proc_get_all_sta_info(struct seq_file *m, void *v); 392 #endif /* CONFIG_AP_MODE */ 393 394 #ifdef DBG_MEMORY_LEAK 395 int proc_get_malloc_cnt(struct seq_file *m, void *v); 396 #endif /* DBG_MEMORY_LEAK */ 397 398 #ifdef CONFIG_FIND_BEST_CHANNEL 399 int proc_get_best_channel(struct seq_file *m, void *v); 400 ssize_t proc_set_best_channel(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 401 #endif /* CONFIG_FIND_BEST_CHANNEL */ 402 403 int proc_get_trx_info_debug(struct seq_file *m, void *v); 404 405 #ifdef CONFIG_HUAWEI_PROC 406 int proc_get_huawei_trx_info(struct seq_file *m, void *v); 407 #endif 408 409 int proc_get_rx_signal(struct seq_file *m, void *v); 410 ssize_t proc_set_rx_signal(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 411 int proc_get_hw_status(struct seq_file *m, void *v); 412 ssize_t proc_set_hw_status(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 413 int proc_get_mac_rptbuf(struct seq_file *m, void *v); 414 415 #ifdef CONFIG_80211N_HT 416 int proc_get_ht_enable(struct seq_file *m, void *v); 417 ssize_t proc_set_ht_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 418 419 int proc_get_bw_mode(struct seq_file *m, void *v); 420 ssize_t proc_set_bw_mode(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 421 422 int proc_get_ampdu_enable(struct seq_file *m, void *v); 423 ssize_t proc_set_ampdu_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 424 425 void dump_regsty_rx_ampdu_size_limit(void *sel, _adapter *adapter); 426 int proc_get_rx_ampdu(struct seq_file *m, void *v); 427 ssize_t proc_set_rx_ampdu(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 428 429 void rtw_dump_dft_phy_cap(void *sel, _adapter *adapter); 430 void rtw_get_dft_phy_cap(void *sel, _adapter *adapter); 431 void rtw_dump_drv_phy_cap(void *sel, _adapter *adapter); 432 433 int proc_get_rx_stbc(struct seq_file *m, void *v); 434 ssize_t proc_set_rx_stbc(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 435 int proc_get_stbc_cap(struct seq_file *m, void *v); 436 ssize_t proc_set_stbc_cap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 437 int proc_get_ldpc_cap(struct seq_file *m, void *v); 438 ssize_t proc_set_ldpc_cap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 439 #ifdef CONFIG_BEAMFORMING 440 int proc_get_txbf_cap(struct seq_file *m, void *v); 441 ssize_t proc_set_txbf_cap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 442 #endif 443 #ifdef CONFIG_SDIO_TX_ENABLE_AVAL_INT 444 int proc_get_tx_aval_th(struct seq_file *m, void *v); 445 ssize_t proc_set_tx_aval_th(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 446 #endif /*CONFIG_SDIO_TX_ENABLE_AVAL_INT*/ 447 int proc_get_rx_ampdu_factor(struct seq_file *m, void *v); 448 ssize_t proc_set_rx_ampdu_factor(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 449 450 int proc_get_tx_max_agg_num(struct seq_file *m, void *v); 451 ssize_t proc_set_tx_max_agg_num(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 452 453 int proc_get_rx_ampdu_density(struct seq_file *m, void *v); 454 ssize_t proc_set_rx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 455 456 int proc_get_tx_ampdu_density(struct seq_file *m, void *v); 457 ssize_t proc_set_tx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 458 459 int proc_get_tx_quick_addba_req(struct seq_file *m, void *v); 460 ssize_t proc_set_tx_quick_addba_req(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 461 #ifdef CONFIG_TX_AMSDU 462 int proc_get_tx_amsdu(struct seq_file *m, void *v); 463 ssize_t proc_set_tx_amsdu(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 464 int proc_get_tx_amsdu_rate(struct seq_file *m, void *v); 465 ssize_t proc_set_tx_amsdu_rate(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 466 #endif 467 #endif /* CONFIG_80211N_HT */ 468 469 #ifdef CONFIG_80211AC_VHT 470 int proc_get_vht_24g_enable(struct seq_file *m, void *v); 471 ssize_t proc_set_vht_24g_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 472 #endif 473 474 ssize_t proc_set_dyn_rrsr(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 475 int proc_get_dyn_rrsr(struct seq_file *m, void *v); 476 477 int proc_get_en_fwps(struct seq_file *m, void *v); 478 ssize_t proc_set_en_fwps(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 479 480 #if 0 481 int proc_get_two_path_rssi(struct seq_file *m, void *v); 482 int proc_get_rssi_disp(struct seq_file *m, void *v); 483 ssize_t proc_set_rssi_disp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 484 #endif 485 486 #ifdef CONFIG_BT_COEXIST 487 int proc_get_btcoex_dbg(struct seq_file *m, void *v); 488 ssize_t proc_set_btcoex_dbg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 489 int proc_get_btcoex_info(struct seq_file *m, void *v); 490 #ifdef CONFIG_RF4CE_COEXIST 491 int proc_get_rf4ce_state(struct seq_file *m, void *v); 492 ssize_t proc_set_rf4ce_state(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 493 #endif 494 #endif /* CONFIG_BT_COEXIST */ 495 496 #if defined(DBG_CONFIG_ERROR_DETECT) 497 int proc_get_sreset(struct seq_file *m, void *v); 498 ssize_t proc_set_sreset(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 499 #endif /* DBG_CONFIG_ERROR_DETECT */ 500 501 int proc_get_odm_adaptivity(struct seq_file *m, void *v); 502 ssize_t proc_set_odm_adaptivity(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 503 504 #ifdef CONFIG_DBG_COUNTER 505 int proc_get_rx_logs(struct seq_file *m, void *v); 506 int proc_get_tx_logs(struct seq_file *m, void *v); 507 int proc_get_int_logs(struct seq_file *m, void *v); 508 #endif 509 510 #ifdef CONFIG_PCI_HCI 511 int proc_get_rx_ring(struct seq_file *m, void *v); 512 int proc_get_tx_ring(struct seq_file *m, void *v); 513 int proc_get_pci_aspm(struct seq_file *m, void *v); 514 int proc_get_pci_conf_space(struct seq_file *m, void *v); 515 ssize_t proc_set_pci_conf_space(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 516 517 int proc_get_pci_bridge_conf_space(struct seq_file *m, void *v); 518 ssize_t proc_set_pci_bridge_conf_space(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 519 520 521 #ifdef DBG_TXBD_DESC_DUMP 522 int proc_get_tx_ring_ext(struct seq_file *m, void *v); 523 ssize_t proc_set_tx_ring_ext(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 524 #endif 525 #endif 526 527 #ifdef CONFIG_WOWLAN 528 int proc_get_wow_enable(struct seq_file *m, void *v); 529 ssize_t proc_set_wow_enable(struct file *file, const char __user *buffer, 530 size_t count, loff_t *pos, void *data); 531 int proc_get_pattern_info(struct seq_file *m, void *v); 532 ssize_t proc_set_pattern_info(struct file *file, const char __user *buffer, 533 size_t count, loff_t *pos, void *data); 534 int proc_get_wakeup_event(struct seq_file *m, void *v); 535 ssize_t proc_set_wakeup_event(struct file *file, const char __user *buffer, 536 size_t count, loff_t *pos, void *data); 537 int proc_get_wakeup_reason(struct seq_file *m, void *v); 538 #ifdef CONFIG_WOW_KEEP_ALIVE_PATTERN 539 int proc_dump_wow_keep_alive_info(struct seq_file *m, void *v); 540 #endif /*CONFIG_WOW_KEEP_ALIVE_PATTERN*/ 541 #endif 542 543 #ifdef CONFIG_WAR_OFFLOAD 544 int proc_get_war_offload_enable(struct seq_file *m, void *v); 545 ssize_t proc_set_war_offload_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 546 int proc_get_war_offload_ipv4_addr(struct seq_file *m, void *v); 547 ssize_t proc_set_war_offload_ipv4_addr(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 548 int proc_get_war_offload_ipv6_addr(struct seq_file *m, void *v); 549 ssize_t proc_set_war_offload_ipv6_addr(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 550 int proc_get_war_offload_mdns_domain_name(struct seq_file *m, void *v); 551 ssize_t proc_set_war_offload_mdns_domain_name(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 552 int proc_get_war_offload_mdns_machine_name(struct seq_file *m, void *v); 553 ssize_t proc_set_war_offload_mdns_machine_name(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 554 int proc_get_war_offload_mdns_txt_rsp(struct seq_file *m, void *v); 555 ssize_t proc_set_war_offload_mdns_txt_rsp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 556 int proc_get_war_offload_mdns_service_info(struct seq_file *m, void *v); 557 ssize_t proc_set_war_offload_mdns_service_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 558 #endif /* CONFIG_WAR_OFFLOAD */ 559 560 561 #ifdef CONFIG_GPIO_WAKEUP 562 int proc_get_wowlan_gpio_info(struct seq_file *m, void *v); 563 ssize_t proc_set_wowlan_gpio_info(struct file *file, const char __user *buffer, 564 size_t count, loff_t *pos, void *data); 565 #endif /*CONFIG_GPIO_WAKEUP*/ 566 567 #ifdef CONFIG_P2P_WOWLAN 568 int proc_get_p2p_wowlan_info(struct seq_file *m, void *v); 569 #endif /* CONFIG_P2P_WOWLAN */ 570 571 int proc_get_new_bcn_max(struct seq_file *m, void *v); 572 ssize_t proc_set_new_bcn_max(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 573 574 #ifdef CONFIG_POWER_SAVING 575 int proc_get_ps_info(struct seq_file *m, void *v); 576 ssize_t proc_set_ps_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 577 #ifdef CONFIG_WMMPS_STA 578 int proc_get_wmmps_info(struct seq_file *m, void *v); 579 ssize_t proc_set_wmmps_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 580 #endif /* CONFIG_WMMPS_STA */ 581 #endif /* CONFIG_POWER_SAVING */ 582 583 #ifdef CONFIG_TDLS 584 int proc_get_tdls_enable(struct seq_file *m, void *v); 585 ssize_t proc_set_tdls_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 586 int proc_get_tdls_info(struct seq_file *m, void *v); 587 #endif 588 589 int proc_get_monitor(struct seq_file *m, void *v); 590 ssize_t proc_set_monitor(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 591 592 #ifdef RTW_SIMPLE_CONFIG 593 int proc_get_simple_config(struct seq_file *m, void *v); 594 ssize_t proc_set_simple_config(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 595 #endif 596 597 #ifdef DBG_XMIT_BLOCK 598 int proc_get_xmit_block(struct seq_file *m, void *v); 599 ssize_t proc_set_xmit_block(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 600 #endif 601 602 #ifdef CONFIG_PREALLOC_RX_SKB_BUFFER 603 int proc_get_rtkm_info(struct seq_file *m, void *v); 604 #endif /* CONFIG_PREALLOC_RX_SKB_BUFFER */ 605 606 #ifdef CONFIG_IEEE80211W 607 ssize_t proc_set_tx_sa_query(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 608 int proc_get_tx_sa_query(struct seq_file *m, void *v); 609 ssize_t proc_set_tx_deauth(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 610 int proc_get_tx_deauth(struct seq_file *m, void *v); 611 ssize_t proc_set_tx_auth(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 612 int proc_get_tx_auth(struct seq_file *m, void *v); 613 #endif /* CONFIG_IEEE80211W */ 614 615 #endif /* CONFIG_PROC_DEBUG */ 616 617 int proc_get_efuse_map(struct seq_file *m, void *v); 618 ssize_t proc_set_efuse_map(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 619 620 #ifdef CONFIG_CUSTOMER01_SMART_ANTENNA 621 int proc_get_pathb_phase(struct seq_file *m, void *v); 622 ssize_t proc_set_pathb_phase(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 623 #endif 624 625 #ifdef CONFIG_MCC_MODE 626 int proc_get_mcc_info(struct seq_file *m, void *v); 627 ssize_t proc_set_mcc_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 628 ssize_t proc_set_mcc_duration(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 629 #ifdef CONFIG_MCC_PHYDM_OFFLOAD 630 ssize_t proc_set_mcc_phydm_offload_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 631 #endif 632 ssize_t proc_set_mcc_single_tx_criteria(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 633 ssize_t proc_set_mcc_ap_bw20_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 634 ssize_t proc_set_mcc_ap_bw40_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 635 ssize_t proc_set_mcc_ap_bw80_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 636 ssize_t proc_set_mcc_sta_bw20_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 637 ssize_t proc_set_mcc_sta_bw40_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 638 ssize_t proc_set_mcc_sta_bw80_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 639 int proc_get_mcc_policy_table(struct seq_file *m, void *v); 640 #endif /* CONFIG_MCC_MODE */ 641 642 int proc_get_ack_timeout(struct seq_file *m, void *v); 643 ssize_t proc_set_ack_timeout(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 644 645 int proc_get_fw_offload(struct seq_file *m, void *v); 646 ssize_t proc_set_fw_offload(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 647 648 #ifdef CONFIG_FW_HANDLE_TXBCN 649 ssize_t proc_set_fw_tbtt_rpt(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 650 int proc_get_fw_tbtt_rpt(struct seq_file *m, void *v); 651 #endif 652 653 #ifdef CONFIG_DBG_RF_CAL 654 int proc_get_iqk_info(struct seq_file *m, void *v); 655 ssize_t proc_set_iqk(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 656 int proc_get_lck_info(struct seq_file *m, void *v); 657 ssize_t proc_set_lck(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 658 #endif /*CONFIG_DBG_RF_CAL*/ 659 660 #ifdef CONFIG_CTRL_TXSS_BY_TP 661 ssize_t proc_set_txss_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 662 int proc_get_txss_tp(struct seq_file *m, void *v); 663 #ifdef DBG_CTRL_TXSS 664 ssize_t proc_set_txss_ctrl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 665 int proc_get_txss_ctrl(struct seq_file *m, void *v); 666 #endif 667 #endif 668 669 #ifdef CONFIG_LPS_CHK_BY_TP 670 ssize_t proc_set_lps_chk_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 671 int proc_get_lps_chk_tp(struct seq_file *m, void *v); 672 #endif 673 674 #ifdef CONFIG_SUPPORT_STATIC_SMPS 675 ssize_t proc_set_smps(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 676 int proc_get_smps(struct seq_file *m, void *v); 677 #endif 678 679 int proc_get_defs_param(struct seq_file *m, void *v); 680 ssize_t proc_set_defs_param(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 681 682 #define _drv_always_ 1 683 #define _drv_emerg_ 2 684 #define _drv_alert_ 3 685 #define _drv_crit_ 4 686 #define _drv_err_ 5 687 #define _drv_warning_ 6 688 #define _drv_notice_ 7 689 #define _drv_info_ 8 690 #define _drv_dump_ 9 691 #define _drv_debug_ 10 692 693 #define _module_rtl871x_xmit_c_ BIT(0) 694 #define _module_xmit_osdep_c_ BIT(1) 695 #define _module_rtl871x_recv_c_ BIT(2) 696 #define _module_recv_osdep_c_ BIT(3) 697 #define _module_rtl871x_mlme_c_ BIT(4) 698 #define _module_mlme_osdep_c_ BIT(5) 699 #define _module_rtl871x_sta_mgt_c_ BIT(6) 700 #define _module_rtl871x_cmd_c_ BIT(7) 701 #define _module_cmd_osdep_c_ BIT(8) 702 #define _module_rtl871x_io_c_ BIT(9) 703 #define _module_io_osdep_c_ BIT(10) 704 #define _module_os_intfs_c_ BIT(11) 705 #define _module_rtl871x_security_c_ BIT(12) 706 #define _module_rtl871x_eeprom_c_ BIT(13) 707 #define _module_hal_init_c_ BIT(14) 708 #define _module_hci_hal_init_c_ BIT(15) 709 #define _module_rtl871x_ioctl_c_ BIT(16) 710 #define _module_rtl871x_ioctl_set_c_ BIT(17) 711 #define _module_rtl871x_ioctl_query_c_ BIT(18) 712 #define _module_rtl871x_pwrctrl_c_ BIT(19) 713 #define _module_hci_intfs_c_ BIT(20) 714 #define _module_hci_ops_c_ BIT(21) 715 #define _module_osdep_service_c_ BIT(22) 716 #define _module_mp_ BIT(23) 717 #define _module_hci_ops_os_c_ BIT(24) 718 #define _module_rtl871x_ioctl_os_c BIT(25) 719 #define _module_rtl8712_cmd_c_ BIT(26) 720 /* #define _module_efuse_ BIT(27) */ 721 #define _module_rtl8192c_xmit_c_ BIT(28) 722 #define _module_hal_xmit_c_ BIT(28) 723 #define _module_efuse_ BIT(29) 724 #define _module_rtl8712_recv_c_ BIT(30) 725 #define _module_rtl8712_led_c_ BIT(31) 726 727 #endif /* __RTW_DEBUG_H__ */ 728