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