forked from ivanovborislav/rtl8812au
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rtw_debug.c
8350 lines (6930 loc) · 243 KB
/
rtw_debug.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/******************************************************************************
*
* Copyright(c) 2007 - 2019 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*****************************************************************************/
#define _RTW_DEBUG_C_
#include <drv_types.h>
#include <hal_data.h>
#ifdef CONFIG_RTW_DEBUG
const char *rtw_log_level_str[] = {
"_DRV_NONE_ = 0",
"_DRV_ALWAYS_ = 1",
"_DRV_ERR_ = 2",
"_DRV_WARNING_ = 3",
"_DRV_INFO_ = 4",
"_DRV_DEBUG_ = 5",
"_DRV_MAX_ = 6",
};
#endif
#ifdef CONFIG_DEBUG_RTL871X
u64 GlobalDebugComponents = 0;
#endif /* CONFIG_DEBUG_RTL871X */
#include <rtw_version.h>
#ifdef CONFIG_TDLS
#define TDLS_DBG_INFO_SPACE_BTWN_ITEM_AND_VALUE 41
#endif
void dump_drv_version(void *sel)
{
RTW_PRINT_SEL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION);
RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__);
}
#ifdef CONFIG_PROC_DEBUG
void dump_drv_cfg(void *sel)
{
extern uint rtw_recvbuf_nr;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
char *kernel_version = utsname()->release;
RTW_PRINT_SEL(sel, "\nKernel Version: %s\n", kernel_version);
#endif
#ifdef CONFIG_RTW_ANDROID
RTW_PRINT_SEL(sel, "Android Driver: %d\n", CONFIG_RTW_ANDROID);
#else
RTW_PRINT_SEL(sel, "Linux Driver: \n");
#endif /* CONFIG_RTW_ANDROID */
RTW_PRINT_SEL(sel, "Driver Version: %s\n", DRIVERVERSION);
RTW_PRINT_SEL(sel, "------------------------------------------------\n");
#ifdef CONFIG_IOCTL_CFG80211
RTW_PRINT_SEL(sel, "CFG80211\n");
#ifdef RTW_USE_CFG80211_STA_EVENT
RTW_PRINT_SEL(sel, "RTW_USE_CFG80211_STA_EVENT\n");
#endif
#ifdef CONFIG_RADIO_WORK
RTW_PRINT_SEL(sel, "CONFIG_RADIO_WORK\n");
#endif
#else
RTW_PRINT_SEL(sel, "WEXT\n");
#endif
RTW_PRINT_SEL(sel, "DBG:%d\n", DBG);
#ifdef CONFIG_RTW_DEBUG
RTW_PRINT_SEL(sel, "CONFIG_RTW_DEBUG\n");
#endif
#ifdef CONFIG_CONCURRENT_MODE
RTW_PRINT_SEL(sel, "CONFIG_CONCURRENT_MODE\n");
#endif
#ifdef CONFIG_POWER_SAVING
RTW_PRINT_SEL(sel, "CONFIG_POWER_SAVING\n");
#ifdef CONFIG_IPS
RTW_PRINT_SEL(sel, "CONFIG_IPS\n");
#endif
#ifdef CONFIG_LPS
RTW_PRINT_SEL(sel, "CONFIG_LPS\n");
#ifdef CONFIG_LPS_LCLK
RTW_PRINT_SEL(sel, "CONFIG_LPS_LCLK\n");
#ifdef CONFIG_DETECT_CPWM_BY_POLLING
RTW_PRINT_SEL(sel, "CONFIG_DETECT_CPWM_BY_POLLING\n");
#endif
#endif /*CONFIG_LPS_LCLK*/
#ifdef CONFIG_LPS_CHK_BY_TP
RTW_PRINT_SEL(sel, "CONFIG_LPS_CHK_BY_TP\n");
#endif
#ifdef CONFIG_LPS_ACK
RTW_PRINT_SEL(sel, "CONFIG_LPS_ACK\n");
#endif
#endif/*CONFIG_LPS*/
#endif
#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE
RTW_PRINT_SEL(sel, "LOAD_PHY_PARA_FROM_FILE - REALTEK_CONFIG_PATH=%s\n", REALTEK_CONFIG_PATH);
#if defined(CONFIG_MULTIDRV) || defined(REALTEK_CONFIG_PATH_WITH_IC_NAME_FOLDER)
RTW_PRINT_SEL(sel, "LOAD_PHY_PARA_FROM_FILE - REALTEK_CONFIG_PATH_WITH_IC_NAME_FOLDER\n");
#endif
/* configurations about TX power */
#ifdef CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY
RTW_PRINT_SEL(sel, "CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY\n");
#endif
#ifdef CONFIG_CALIBRATE_TX_POWER_TO_MAX
RTW_PRINT_SEL(sel, "CONFIG_CALIBRATE_TX_POWER_TO_MAX\n");
#endif
#endif
RTW_PRINT_SEL(sel, "RTW_DEF_MODULE_REGULATORY_CERT=0x%02x\n", RTW_DEF_MODULE_REGULATORY_CERT);
RTW_PRINT_SEL(sel, "CONFIG_TXPWR_BY_RATE=%d\n", CONFIG_TXPWR_BY_RATE);
RTW_PRINT_SEL(sel, "CONFIG_TXPWR_BY_RATE_EN=%d\n", CONFIG_TXPWR_BY_RATE_EN);
RTW_PRINT_SEL(sel, "CONFIG_TXPWR_LIMIT=%d\n", CONFIG_TXPWR_LIMIT);
RTW_PRINT_SEL(sel, "CONFIG_TXPWR_LIMIT_EN=%d\n", CONFIG_TXPWR_LIMIT_EN);
#ifdef CONFIG_DISABLE_ODM
RTW_PRINT_SEL(sel, "CONFIG_DISABLE_ODM\n");
#endif
#ifdef CONFIG_MINIMAL_MEMORY_USAGE
RTW_PRINT_SEL(sel, "CONFIG_MINIMAL_MEMORY_USAGE\n");
#endif
RTW_PRINT_SEL(sel, "CONFIG_RTW_ADAPTIVITY_EN = %d\n", CONFIG_RTW_ADAPTIVITY_EN);
RTW_PRINT_SEL(sel, "CONFIG_RTW_ADAPTIVITY_MODE = %d\n", CONFIG_RTW_ADAPTIVITY_MODE);
#ifdef CONFIG_WOWLAN
RTW_PRINT_SEL(sel, "CONFIG_WOWLAN - ");
#ifdef CONFIG_GPIO_WAKEUP
RTW_PRINT_SEL(sel, "CONFIG_GPIO_WAKEUP - WAKEUP_GPIO_IDX:%d\n", WAKEUP_GPIO_IDX);
#endif
#endif
#ifdef CONFIG_TDLS
RTW_PRINT_SEL(sel, "CONFIG_TDLS\n");
#endif
#ifdef CONFIG_RTW_80211R
RTW_PRINT_SEL(sel, "CONFIG_RTW_80211R\n");
#endif
#ifdef CONFIG_RTW_NETIF_SG
RTW_PRINT_SEL(sel, "CONFIG_RTW_NETIF_SG\n");
#endif
#ifdef CONFIG_RTW_WIFI_HAL
RTW_PRINT_SEL(sel, "CONFIG_RTW_WIFI_HAL\n");
#endif
#ifdef RTW_BUSY_DENY_SCAN
RTW_PRINT_SEL(sel, "RTW_BUSY_DENY_SCAN\n");
RTW_PRINT_SEL(sel, "BUSY_TRAFFIC_SCAN_DENY_PERIOD = %u ms\n", \
BUSY_TRAFFIC_SCAN_DENY_PERIOD);
#endif
#ifdef CONFIG_RTW_TPT_MODE
RTW_PRINT_SEL(sel, "CONFIG_RTW_TPT_MODE\n");
#endif
#ifdef CONFIG_USB_HCI
#ifdef CONFIG_SUPPORT_USB_INT
RTW_PRINT_SEL(sel, "CONFIG_SUPPORT_USB_INT\n");
#endif
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
RTW_PRINT_SEL(sel, "CONFIG_USB_INTERRUPT_IN_PIPE\n");
#endif
#ifdef CONFIG_USB_TX_AGGREGATION
RTW_PRINT_SEL(sel, "CONFIG_USB_TX_AGGREGATION\n");
#endif
#ifdef CONFIG_USB_RX_AGGREGATION
RTW_PRINT_SEL(sel, "CONFIG_USB_RX_AGGREGATION\n");
#endif
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_TX
RTW_PRINT_SEL(sel, "CONFIG_USE_USB_BUFFER_ALLOC_TX\n");
#endif
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
RTW_PRINT_SEL(sel, "CONFIG_USE_USB_BUFFER_ALLOC_RX\n");
#endif
#ifdef CONFIG_PREALLOC_RECV_SKB
RTW_PRINT_SEL(sel, "CONFIG_PREALLOC_RECV_SKB\n");
#endif
#ifdef CONFIG_FIX_NR_BULKIN_BUFFER
RTW_PRINT_SEL(sel, "CONFIG_FIX_NR_BULKIN_BUFFER\n");
#endif
#endif /*CONFIG_USB_HCI*/
#ifdef CONFIG_SDIO_HCI
#ifdef CONFIG_TX_AGGREGATION
RTW_PRINT_SEL(sel, "CONFIG_TX_AGGREGATION\n");
#endif
#ifdef CONFIG_RX_AGGREGATION
RTW_PRINT_SEL(sel, "CONFIG_RX_AGGREGATION\n");
#endif
#ifdef RTW_XMIT_THREAD_HIGH_PRIORITY
RTW_PRINT_SEL(sel, "RTW_XMIT_THREAD_HIGH_PRIORITY\n");
#endif
#ifdef RTW_XMIT_THREAD_HIGH_PRIORITY_AGG
RTW_PRINT_SEL(sel, "RTW_XMIT_THREAD_HIGH_PRIORITY_AGG\n");
#endif
#ifdef DBG_SDIO
RTW_PRINT_SEL(sel, "DBG_SDIO = %d\n", DBG_SDIO);
#endif
#endif /*CONFIG_SDIO_HCI*/
#ifdef CONFIG_PCI_HCI
#endif
RTW_PRINT_SEL(sel, "CONFIG_IFACE_NUMBER = %d\n", CONFIG_IFACE_NUMBER);
#ifdef CONFIG_MI_WITH_MBSSID_CAM
RTW_PRINT_SEL(sel, "CONFIG_MI_WITH_MBSSID_CAM\n");
#endif
#ifdef CONFIG_SWTIMER_BASED_TXBCN
RTW_PRINT_SEL(sel, "CONFIG_SWTIMER_BASED_TXBCN\n");
#endif
#ifdef CONFIG_FW_HANDLE_TXBCN
RTW_PRINT_SEL(sel, "CONFIG_FW_HANDLE_TXBCN\n");
RTW_PRINT_SEL(sel, "CONFIG_LIMITED_AP_NUM = %d\n", CONFIG_LIMITED_AP_NUM);
#endif
#ifdef CONFIG_CLIENT_PORT_CFG
RTW_PRINT_SEL(sel, "CONFIG_CLIENT_PORT_CFG\n");
#endif
#ifdef CONFIG_PCI_TX_POLLING
RTW_PRINT_SEL(sel, "CONFIG_PCI_TX_POLLING\n");
#endif
RTW_PRINT_SEL(sel, "CONFIG_RTW_UP_MAPPING_RULE = %s\n", (CONFIG_RTW_UP_MAPPING_RULE == 1) ? "dscp" : "tos");
RTW_PRINT_SEL(sel, "\n=== XMIT-INFO ===\n");
RTW_PRINT_SEL(sel, "NR_XMITFRAME = %d\n", NR_XMITFRAME);
RTW_PRINT_SEL(sel, "NR_XMITBUFF = %d\n", NR_XMITBUFF);
RTW_PRINT_SEL(sel, "MAX_XMITBUF_SZ = %d\n", MAX_XMITBUF_SZ);
RTW_PRINT_SEL(sel, "NR_XMIT_EXTBUFF = %d\n", NR_XMIT_EXTBUFF);
RTW_PRINT_SEL(sel, "MAX_XMIT_EXTBUF_SZ = %d\n", MAX_XMIT_EXTBUF_SZ);
RTW_PRINT_SEL(sel, "MAX_CMDBUF_SZ = %d\n", MAX_CMDBUF_SZ);
RTW_PRINT_SEL(sel, "\n=== RECV-INFO ===\n");
RTW_PRINT_SEL(sel, "NR_RECVFRAME = %d\n", NR_RECVFRAME);
RTW_PRINT_SEL(sel, "NR_RECVBUFF = %d, rtw_recvbuf_nr = %d\n", NR_RECVBUFF, rtw_recvbuf_nr);
RTW_PRINT_SEL(sel, "MAX_RECVBUF_SZ = %d\n", MAX_RECVBUF_SZ);
}
#endif /* CONFIG_PROC_DEBUG */
void dump_log_level(void *sel)
{
#ifdef CONFIG_RTW_DEBUG
int i;
RTW_PRINT_SEL(sel, "drv_log_level:%d\n", rtw_drv_log_level);
for (i = 0; i <= _DRV_MAX_; i++) {
if (rtw_log_level_str[i])
RTW_PRINT_SEL(sel, "%c %s = %d\n",
(rtw_drv_log_level == i) ? '+' : ' ', rtw_log_level_str[i], i);
}
#else
RTW_PRINT_SEL(sel, "CONFIG_RTW_DEBUG is disabled\n");
#endif
}
#ifdef CONFIG_SDIO_HCI
void sd_f0_reg_dump(void *sel, _adapter *adapter)
{
int i;
for (i = 0x0; i <= 0xff; i++) {
if (i % 16 == 0)
RTW_PRINT_SEL(sel, "0x%02x ", i);
_RTW_PRINT_SEL(sel, "%02x ", rtw_sd_f0_read8(adapter, i));
if (i % 16 == 15)
_RTW_PRINT_SEL(sel, "\n");
else if (i % 8 == 7)
_RTW_PRINT_SEL(sel, "\t");
}
}
void sdio_local_reg_dump(void *sel, _adapter *adapter)
{
int i, j = 1;
for (i = 0x0; i < 0x100; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%02x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, (0x1025 << 16) | i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
}
#endif /* CONFIG_SDIO_HCI */
void mac_reg_dump(void *sel, _adapter *adapter)
{
int i, j = 1;
RTW_PRINT_SEL(sel, "======= MAC REG =======\n");
for (i = 0x0; i < 0x800; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
#ifdef CONFIG_RTL8814A
{
for (i = 0x1000; i < 0x1650; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
}
#endif /* CONFIG_RTL8814A */
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B) \
|| defined(CONFIG_RTL8723F)
for (i = 0x1000; i < 0x1800; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
#endif /* CONFIG_RTL8822B or 8821c*/
#if defined(CONFIG_RTL8192F)
for (i = 0x1000; i < 0x1100; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
for (i = 0x1300; i < 0x1360; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
#endif
#if defined(CONFIG_RTL8814B)
for (i = 0x2000; i < 0x2800; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
for (i = 0x3000; i < 0x3800; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
#endif
}
void bb_reg_dump(void *sel, _adapter *adapter)
{
int i, j = 1;
RTW_PRINT_SEL(sel, "======= BB REG =======\n");
for (i = 0x800; i < 0x1000; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B) \
|| defined(CONFIG_RTL8723F)
for (i = 0x1800; i < 0x2000; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
#endif /* CONFIG_RTL8822B */
#if defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B) || defined(CONFIG_RTL8723F)
for (i = 0x2c00; i < 0x2c60; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
for (i = 0x2d00; i < 0x2df0; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
for (i = 0x4000; i < 0x4060; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
for (i = 0x4100; i < 0x4200; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
#endif /* CONFIG_RTL8822C || CONFIG_RTL8814B || CONFIG_8723F */
#if defined(CONFIG_RTL8814B)
for (i = 0x5200; i < 0x5400; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
#endif /* CONFIG_RTL8814B */
#if defined(CONFIG_RTL8723F)
/* TSSI related */
for (i = 0x4300; i < 0x43C0; i += 4) {
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
#endif /* CONFIG_RTL8723F */
}
void bb_reg_dump_ex(void *sel, _adapter *adapter)
{
int i;
RTW_PRINT_SEL(sel, "======= BB REG =======\n");
for (i = 0x800; i < 0x1000; i += 4) {
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
_RTW_PRINT_SEL(sel, "\n");
}
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B)
for (i = 0x1800; i < 0x2000; i += 4) {
RTW_PRINT_SEL(sel, "0x%04x", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
_RTW_PRINT_SEL(sel, "\n");
}
#endif /* CONFIG_RTL8822B */
}
void rf_reg_dump(void *sel, _adapter *adapter)
{
struct hal_spec_t *hal_spec = GET_HAL_SPEC(adapter);
int i, j = 1, path;
u32 value;
u8 path_nums = hal_spec->rf_reg_path_num;
RTW_PRINT_SEL(sel, "======= RF REG =======\n");
for (path = 0; path < path_nums; path++) {
RTW_PRINT_SEL(sel, "RF_Path(%x)\n", path);
for (i = 0; i < 0x100; i++) {
value = rtw_hal_read_rfreg(adapter, path, i, 0xffffffff);
if (j % 4 == 1)
RTW_PRINT_SEL(sel, "0x%02x ", i);
_RTW_PRINT_SEL(sel, " 0x%08x ", value);
if ((j++) % 4 == 0)
_RTW_PRINT_SEL(sel, "\n");
}
}
}
void rtw_sink_rtp_seq_dbg(_adapter *adapter, u8 *ehdr_pos)
{
struct recv_priv *precvpriv = &(adapter->recvpriv);
if (precvpriv->sink_udpport > 0) {
if (*((u16 *)(ehdr_pos + 0x24)) == cpu_to_be16(precvpriv->sink_udpport)) {
precvpriv->pre_rtp_rxseq = precvpriv->cur_rtp_rxseq;
precvpriv->cur_rtp_rxseq = be16_to_cpu(*((u16 *)(ehdr_pos + 0x2C)));
if (precvpriv->pre_rtp_rxseq + 1 != precvpriv->cur_rtp_rxseq) {
if(precvpriv->pre_rtp_rxseq == 65535 ) {
if( precvpriv->cur_rtp_rxseq != 0) {
RTW_INFO("%s : RTP Seq num from %d to %d\n", __FUNCTION__, precvpriv->pre_rtp_rxseq, precvpriv->cur_rtp_rxseq);
}
} else {
RTW_INFO("%s : RTP Seq num from %d to %d\n", __FUNCTION__, precvpriv->pre_rtp_rxseq, precvpriv->cur_rtp_rxseq);
}
}
}
}
}
void sta_rx_reorder_ctl_dump(void *sel, struct sta_info *sta)
{
struct recv_reorder_ctrl *reorder_ctl;
int i;
for (i = 0; i < 16; i++) {
reorder_ctl = &sta->recvreorder_ctrl[i];
if (reorder_ctl->ampdu_size != RX_AMPDU_SIZE_INVALID || reorder_ctl->indicate_seq != 0xFFFF) {
RTW_PRINT_SEL(sel, "tid=%d, enable=%d, ampdu_size=%u, indicate_seq=%u\n"
, i, reorder_ctl->enable, reorder_ctl->ampdu_size, reorder_ctl->indicate_seq
);
}
}
}
void dump_tx_rate_bmp(void *sel, struct dvobj_priv *dvobj)
{
_adapter *adapter = dvobj_get_primary_adapter(dvobj);
struct rf_ctl_t *rfctl = dvobj_to_rfctl(dvobj);
u8 bw;
RTW_PRINT_SEL(sel, "%-6s", "bw");
if (hal_chk_proto_cap(adapter, PROTO_CAP_11AC))
_RTW_PRINT_SEL(sel, " %-15s", "vht");
_RTW_PRINT_SEL(sel, " %-11s %-4s %-3s\n", "ht", "ofdm", "cck");
for (bw = CHANNEL_WIDTH_20; bw <= CHANNEL_WIDTH_160; bw++) {
if (!hal_is_bw_support(adapter, bw))
continue;
RTW_PRINT_SEL(sel, "%6s", ch_width_str(bw));
if (hal_chk_proto_cap(adapter, PROTO_CAP_11AC)) {
_RTW_PRINT_SEL(sel, " %03x %03x %03x %03x"
, RATE_BMP_GET_VHT_4SS(rfctl->rate_bmp_vht_by_bw[bw])
, RATE_BMP_GET_VHT_3SS(rfctl->rate_bmp_vht_by_bw[bw])
, RATE_BMP_GET_VHT_2SS(rfctl->rate_bmp_vht_by_bw[bw])
, RATE_BMP_GET_VHT_1SS(rfctl->rate_bmp_vht_by_bw[bw])
);
}
_RTW_PRINT_SEL(sel, " %02x %02x %02x %02x"
, bw <= CHANNEL_WIDTH_40 ? RATE_BMP_GET_HT_4SS(rfctl->rate_bmp_ht_by_bw[bw]) : 0
, bw <= CHANNEL_WIDTH_40 ? RATE_BMP_GET_HT_3SS(rfctl->rate_bmp_ht_by_bw[bw]) : 0
, bw <= CHANNEL_WIDTH_40 ? RATE_BMP_GET_HT_2SS(rfctl->rate_bmp_ht_by_bw[bw]) : 0
, bw <= CHANNEL_WIDTH_40 ? RATE_BMP_GET_HT_1SS(rfctl->rate_bmp_ht_by_bw[bw]) : 0
);
_RTW_PRINT_SEL(sel, " %03x %01x\n"
, bw <= CHANNEL_WIDTH_20 ? RATE_BMP_GET_OFDM(rfctl->rate_bmp_cck_ofdm) : 0
, bw <= CHANNEL_WIDTH_20 ? RATE_BMP_GET_CCK(rfctl->rate_bmp_cck_ofdm) : 0
);
}
}
void dump_adapters_status(void *sel, struct dvobj_priv *dvobj)
{
#if defined(CONFIG_RTW_DEBUG) || defined(CONFIG_PROC_DEBUG)
struct rf_ctl_t *rfctl = dvobj_to_rfctl(dvobj);
int i;
_adapter *iface;
u8 u_ch, u_bw, u_offset;
#if (defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN)) || defined(CONFIG_CLIENT_PORT_CFG)
char str_val[64] = {'\0'};
#endif
dump_mi_status(sel, dvobj);
#if defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN)
RTW_PRINT_SEL(sel, "[AP] LIMITED_AP_NUM:%d\n", CONFIG_LIMITED_AP_NUM);
RTW_PRINT_SEL(sel, "[AP] vap_map:0x%02x\n", dvobj->vap_map);
#endif
#ifdef CONFIG_HW_P0_TSF_SYNC
RTW_PRINT_SEL(sel, "[AP] p0 tsf sync port = %d\n", dvobj->p0_tsf.sync_port);
RTW_PRINT_SEL(sel, "[AP] p0 tsf timer offset = %d\n", dvobj->p0_tsf.offset);
#endif
#ifdef CONFIG_CLIENT_PORT_CFG
RTW_PRINT_SEL(sel, "[CLT] clt_num = %d\n", dvobj->clt_port.num);
RTW_PRINT_SEL(sel, "[CLT] clt_map = 0x%02x\n", dvobj->clt_port.bmp);
#endif
#ifdef CONFIG_FW_MULTI_PORT_SUPPORT
RTW_PRINT_SEL(sel, "[MI] default port id:%d\n\n", dvobj->dft.port_id);
#endif /* CONFIG_FW_MULTI_PORT_SUPPORT */
RTW_PRINT_SEL(sel, "dev status:%s%s\n\n"
, dev_is_surprise_removed(dvobj) ? " SR" : ""
, dev_is_drv_stopped(dvobj) ? " DS" : ""
);
#ifdef CONFIG_P2P
#define P2P_INFO_TITLE_FMT " %-3s %-4s"
#define P2P_INFO_TITLE_ARG , "lch", "p2ps"
#ifdef CONFIG_IOCTL_CFG80211
#define P2P_INFO_VALUE_FMT " %3u %c%3u"
#define P2P_INFO_VALUE_ARG , iface->wdinfo.listen_channel, iface->wdev_data.p2p_enabled ? 'e' : ' ', rtw_p2p_state(&iface->wdinfo)
#else
#define P2P_INFO_VALUE_FMT " %3u %4u"
#define P2P_INFO_VALUE_ARG , iface->wdinfo.listen_channel, rtw_p2p_state(&iface->wdinfo)
#endif
#define P2P_INFO_DASH "---------"
#else
#define P2P_INFO_TITLE_FMT ""
#define P2P_INFO_TITLE_ARG
#define P2P_INFO_VALUE_FMT ""
#define P2P_INFO_VALUE_ARG
#define P2P_INFO_DASH
#endif
#ifdef DBG_TSF_UPDATE
#define TSF_PAUSE_TIME_TITLE_FMT " %-5s"
#define TSF_PAUSE_TIME_TITLE_ARG , "tsfup"
#define TSF_PAUSE_TIME_VALUE_FMT " %5d"
#define TSF_PAUSE_TIME_VALUE_ARG , ((iface->mlmeextpriv.tsf_update_required && iface->mlmeextpriv.tsf_update_pause_stime) ? (rtw_get_passing_time_ms(iface->mlmeextpriv.tsf_update_pause_stime) > 99999 ? 99999 : rtw_get_passing_time_ms(iface->mlmeextpriv.tsf_update_pause_stime)) : 0)
#else
#define TSF_PAUSE_TIME_TITLE_FMT ""
#define TSF_PAUSE_TIME_TITLE_ARG
#define TSF_PAUSE_TIME_VALUE_FMT ""
#define TSF_PAUSE_TIME_VALUE_ARG
#endif
#if (defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN)) || defined(CONFIG_CLIENT_PORT_CFG)
#define INFO_FMT " %-4s"
#define INFO_ARG , "info"
#define INFO_CNT_FMT " %-20s"
#define INFO_CNT_ARG , str_val
#else
#define INFO_FMT ""
#define INFO_ARG
#define INFO_CNT_FMT ""
#define INFO_CNT_ARG
#endif
RTW_PRINT_SEL(sel, "%-2s %-15s %c %-3s %-3s %-3s %-17s %-4s %-7s %-5s"
P2P_INFO_TITLE_FMT
TSF_PAUSE_TIME_TITLE_FMT
" %s"INFO_FMT"\n"
, "id", "ifname", ' ', "bup", "nup", "ncd", "macaddr", "port", "ch", "class"
P2P_INFO_TITLE_ARG
TSF_PAUSE_TIME_TITLE_ARG
, "status"INFO_ARG);
RTW_PRINT_SEL(sel, "---------------------------------------------------------------"
P2P_INFO_DASH
"-------\n");
for (i = 0; i < dvobj->iface_nums; i++) {
iface = dvobj->padapters[i];
if (iface) {
#if (defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN)) || defined(CONFIG_CLIENT_PORT_CFG)
_rtw_memset(&str_val, '\0', sizeof(str_val));
#endif
#if defined(CONFIG_AP_MODE) && defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN)
if (MLME_IS_AP(iface) || MLME_IS_MESH(iface)) {
u8 len;
char *p = str_val;
char tmp_str[10] = {'\0'};
len = snprintf(tmp_str, sizeof(tmp_str), "%s", "ap_id:");
strncpy(p, tmp_str, len);
p += len;
_rtw_memset(&tmp_str, '\0', sizeof(tmp_str));
#ifdef DBG_HW_PORT
len = snprintf(tmp_str, sizeof(tmp_str), "%d (%d,%d)", iface->vap_id, iface->hw_port, iface->client_port);
#else
len = snprintf(tmp_str, sizeof(tmp_str), "%d", iface->vap_id);
#endif
strncpy(p, tmp_str, len);
}
#endif
#ifdef CONFIG_CLIENT_PORT_CFG
if (MLME_IS_STA(iface)) {
u8 len;
char *p = str_val;
char tmp_str[10] = {'\0'};
len = snprintf(tmp_str, sizeof(tmp_str), "%s", "c_pid:");
strncpy(p, tmp_str, len);
p += len;
_rtw_memset(&tmp_str, '\0', sizeof(tmp_str));
#ifdef DBG_HW_PORT
len = snprintf(tmp_str, sizeof(tmp_str), "%d (%d,%d)", iface->client_port, iface->hw_port, iface->client_port);
#else
len = snprintf(tmp_str, sizeof(tmp_str), "%d", iface->client_port);
#endif
strncpy(p, tmp_str, len);
}
#endif
RTW_PRINT_SEL(sel, "%2d %-15s %c %3u %3u %3u "MAC_FMT" %4hhu %3u,%u,%u %5u"
P2P_INFO_VALUE_FMT
TSF_PAUSE_TIME_VALUE_FMT
" "MLME_STATE_FMT" " INFO_CNT_FMT"\n"
, i, iface->registered ? ADPT_ARG(iface) : NULL
, iface->registered ? 'R' : ' '
, iface->bup
, iface->netif_up
, iface->net_closed
, MAC_ARG(adapter_mac_addr(iface))
, rtw_hal_get_port(iface)
, iface->mlmeextpriv.cur_channel
, iface->mlmeextpriv.cur_bwmode
, iface->mlmeextpriv.cur_ch_offset
, rtw_get_op_class_by_chbw(iface->mlmeextpriv.cur_channel
, iface->mlmeextpriv.cur_bwmode
, iface->mlmeextpriv.cur_ch_offset)
P2P_INFO_VALUE_ARG
TSF_PAUSE_TIME_VALUE_ARG
, MLME_STATE_ARG(iface)
INFO_CNT_ARG
);
}
}
RTW_PRINT_SEL(sel, "---------------------------------------------------------------"
P2P_INFO_DASH
"-------\n");
if (rtw_mi_get_ch_setting_union(dvobj_get_primary_adapter(dvobj), &u_ch, &u_bw, &u_offset))
RTW_PRINT_SEL(sel, "%55s %3u,%u,%u %5u\n"
, "union:"
, u_ch, u_bw, u_offset, rtw_get_op_class_by_chbw(u_ch, u_bw, u_offset));
RTW_PRINT_SEL(sel, "%55s %3u,%u,%u offch_state:%d\n"
, "oper:"
, dvobj->oper_channel
, dvobj->oper_bwmode
, dvobj->oper_ch_offset
, rfctl->offch_state
);
#ifdef CONFIG_DFS_MASTER
if (rfctl->radar_detect_ch != 0) {
RTW_PRINT_SEL(sel, "%55s %3u,%u,%u"
, "radar_detect:"
, rfctl->radar_detect_ch
, rfctl->radar_detect_bw
, rfctl->radar_detect_offset
);
if (rfctl->radar_detect_by_others)
_RTW_PRINT_SEL(sel, ", by AP of STA link");
else {
u32 non_ocp_ms;
u32 cac_ms;
u8 dfs_domain = rtw_rfctl_get_dfs_domain(rfctl);
_RTW_PRINT_SEL(sel, ", domain:%s(%u)", rtw_dfs_regd_str(dfs_domain), dfs_domain);
rtw_get_ch_waiting_ms(rfctl
, rfctl->radar_detect_ch
, rfctl->radar_detect_bw
, rfctl->radar_detect_offset
, &non_ocp_ms
, &cac_ms
);
if (non_ocp_ms)
_RTW_PRINT_SEL(sel, ", non_ocp:%d", non_ocp_ms);
if (cac_ms)
_RTW_PRINT_SEL(sel, ", cac:%d", cac_ms);
}
_RTW_PRINT_SEL(sel, "\n");
}
#endif /* CONFIG_DFS_MASTER */
#endif /* CONFIG_RTW_DEBUG || CONFIG_PROC_DEBUG */
}
#if defined(CONFIG_RTW_DEBUG) || defined(CONFIG_PROC_DEBUG)
#define SEC_CAM_ENT_ID_TITLE_FMT "%-2s"
#define SEC_CAM_ENT_ID_TITLE_ARG "id"
#define SEC_CAM_ENT_ID_VALUE_FMT "%2u"
#define SEC_CAM_ENT_ID_VALUE_ARG(id) (id)
#define SEC_CAM_ENT_TITLE_FMT "%-6s %-17s %-32s %-3s %-8s %-2s %-2s %-5s"
#define SEC_CAM_ENT_TITLE_ARG "ctrl", "addr", "key", "kid", "type", "MK", "GK", "valid"
#define SEC_CAM_ENT_VALUE_FMT "0x%04x "MAC_FMT" "KEY_FMT" %3u %-8s %2u %2u %5u"
#define SEC_CAM_ENT_VALUE_ARG(ent) \
(ent)->ctrl \
, MAC_ARG((ent)->mac) \
, KEY_ARG((ent)->key) \
, ((ent)->ctrl) & 0x03 \
, (((ent)->ctrl) & 0x200) ? \
security_type_str((((ent)->ctrl) >> 2 & 0x7) | _SEC_TYPE_256_) : \
security_type_str(((ent)->ctrl) >> 2 & 0x7) \
, (((ent)->ctrl) >> 5) & 0x01 \
, (((ent)->ctrl) >> 6) & 0x01 \
, (((ent)->ctrl) >> 15) & 0x01
void dump_sec_cam_ent(void *sel, struct sec_cam_ent *ent, int id)
{
if (id >= 0) {
RTW_PRINT_SEL(sel, SEC_CAM_ENT_ID_VALUE_FMT " " SEC_CAM_ENT_VALUE_FMT"\n"
, SEC_CAM_ENT_ID_VALUE_ARG(id), SEC_CAM_ENT_VALUE_ARG(ent));
} else
RTW_PRINT_SEL(sel, SEC_CAM_ENT_VALUE_FMT"\n", SEC_CAM_ENT_VALUE_ARG(ent));
}
void dump_sec_cam_ent_title(void *sel, u8 has_id)
{
if (has_id) {
RTW_PRINT_SEL(sel, SEC_CAM_ENT_ID_TITLE_FMT " " SEC_CAM_ENT_TITLE_FMT"\n"
, SEC_CAM_ENT_ID_TITLE_ARG, SEC_CAM_ENT_TITLE_ARG);
} else
RTW_PRINT_SEL(sel, SEC_CAM_ENT_TITLE_FMT"\n", SEC_CAM_ENT_TITLE_ARG);
}
#endif
void dump_sec_cam(void *sel, _adapter *adapter)
{
#if defined(CONFIG_RTW_DEBUG) || defined(CONFIG_PROC_DEBUG)
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
struct sec_cam_ent ent;
int i;
RTW_PRINT_SEL(sel, "HW sec cam:\n");
dump_sec_cam_ent_title(sel, 1);
for (i = 0; i < cam_ctl->num; i++) {
rtw_sec_read_cam_ent(adapter, i, (u8 *)(&ent.ctrl), ent.mac, ent.key);
dump_sec_cam_ent(sel , &ent, i);
}
#endif
}
void dump_sec_cam_cache(void *sel, _adapter *adapter)
{
#if defined(CONFIG_RTW_DEBUG) || defined(CONFIG_PROC_DEBUG)
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
int i;
RTW_PRINT_SEL(sel, "SW sec cam cache:\n");
dump_sec_cam_ent_title(sel, 1);
for (i = 0; i < cam_ctl->num; i++) {
if (dvobj->cam_cache[i].ctrl != 0)
dump_sec_cam_ent(sel, &dvobj->cam_cache[i], i);
}
#endif
}
static u8 fwdl_test_chksum_fail = 0;
static u8 fwdl_test_wintint_rdy_fail = 0;
bool rtw_fwdl_test_trigger_chksum_fail(void)
{
if (fwdl_test_chksum_fail) {
RTW_PRINT("fwdl test case: trigger chksum_fail\n");
fwdl_test_chksum_fail--;
return _TRUE;
}
return _FALSE;
}
bool rtw_fwdl_test_trigger_wintint_rdy_fail(void)
{
if (fwdl_test_wintint_rdy_fail) {
RTW_PRINT("fwdl test case: trigger wintint_rdy_fail\n");
fwdl_test_wintint_rdy_fail--;
return _TRUE;
}
return _FALSE;
}
static u8 del_rx_ampdu_test_no_tx_fail = 0;
bool rtw_del_rx_ampdu_test_trigger_no_tx_fail(void)
{
if (del_rx_ampdu_test_no_tx_fail) {
RTW_PRINT("del_rx_ampdu test case: trigger no_tx_fail\n");
del_rx_ampdu_test_no_tx_fail--;
return _TRUE;
}
return _FALSE;
}
static u32 g_wait_hiq_empty_ms = 0;
u32 rtw_get_wait_hiq_empty_ms(void)
{
return g_wait_hiq_empty_ms;
}
static systime sta_linking_test_start_time = 0;
static u32 sta_linking_test_wait_ms = 0;
static u8 sta_linking_test_force_fail = 0;
void rtw_sta_linking_test_set_start(void)
{
sta_linking_test_start_time = rtw_get_current_time();
}
bool rtw_sta_linking_test_wait_done(void)
{
return rtw_get_passing_time_ms(sta_linking_test_start_time) >= sta_linking_test_wait_ms;
}
bool rtw_sta_linking_test_force_fail(void)
{
return sta_linking_test_force_fail;
}
#ifdef CONFIG_AP_MODE
static u16 ap_linking_test_force_auth_fail = 0;
static u16 ap_linking_test_force_asoc_fail = 0;
u16 rtw_ap_linking_test_force_auth_fail(void)
{
return ap_linking_test_force_auth_fail;
}
u16 rtw_ap_linking_test_force_asoc_fail(void)
{
return ap_linking_test_force_asoc_fail;
}
#endif
#ifdef CONFIG_PROC_DEBUG
int proc_get_defs_param(struct seq_file *m, void *v)
{
struct net_device *dev = m->private;
_adapter *adapter = (_adapter *)rtw_netdev_priv(dev);
struct mlme_priv *mlme = &adapter->mlmepriv;
RTW_PRINT_SEL(m, "%s %15s\n", "lmt_sta", "lmt_time");
RTW_PRINT_SEL(m, "%-15u %-15u\n"
, mlme->defs_lmt_sta
, mlme->defs_lmt_time
);
return 0;
}
ssize_t proc_set_defs_param(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
{
struct net_device *dev = data;
_adapter *adapter = (_adapter *)rtw_netdev_priv(dev);
struct mlme_priv *mlme = &adapter->mlmepriv;
char tmp[32];
u32 defs_lmt_sta;
u32 defs_lmt_time;
if (count < 1)
return -EFAULT;
if (count > sizeof(tmp)) {
rtw_warn_on(1);
return -EFAULT;
}
if (buffer && !copy_from_user(tmp, buffer, count)) {
int num = sscanf(tmp, "%u %u", &defs_lmt_sta, &defs_lmt_time);
if (num >= 1)
mlme->defs_lmt_sta = defs_lmt_sta;
if (num >= 2)
mlme->defs_lmt_time = defs_lmt_time;
}
return count;
}
ssize_t proc_set_write_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
{
struct net_device *dev = data;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
char tmp[32];
u32 addr, val, len;
if (count < 3) {
RTW_INFO("argument size is less than 3\n");