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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
|
/*
* Handle routines for proc file system
*
* $Id: 8192cd_proc.c,v 1.34.2.15 2011/01/06 07:50:09 button Exp $
*
* Copyright (c) 2009 Realtek Semiconductor Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#define _8192CD_PROC_C_
#ifdef __KERNEL__
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/netdevice.h>
#include <linux/compiler.h>
#include <linux/init.h>
#endif
#include "./8192cd_cfg.h"
#include "./8192cd.h"
#ifdef __KERNEL__
#include "./ieee802_mib.h"
#elif defined(__ECOS)
#include <cyg/io/eth/rltk/819x/wlan/ieee802_mib.h>
#include <cyg/io/eth/rltk/819x/wrapper/wrapper.h>
#endif
#include "./8192cd_headers.h"
#if defined(CONFIG_WLAN_HAL)
#include "./WlanHAL/HalHeader/HalComReg.h"
#endif
#ifdef CONFIG_RTK_MESH
#include "../mesh_ext/mesh_route.h"
#include "../mesh_ext/mesh_util.h"
#endif // CONFIG_RTK_MESH
#if defined(_INCLUDE_PROC_FS_) || defined(__ECOS)
#ifdef __KERNEL__
#include <asm/uaccess.h>
#endif
/*
* Note : These define someone copy to ./mesh_ext/mesh_proc.c !!
*/
#ifdef __ECOS
typedef void pr_fun(char *fmt, ...);
extern pr_fun *ecos_pr_fun;
#define PRINT_ONE(val, format, line_end) { \
ecos_pr_fun(format, val); \
if (line_end) \
ecos_pr_fun("\n"); \
}
#define PRINT_ARRAY(val, format, len, line_end) { \
int index; \
for (index=0; index<len; index++) \
ecos_pr_fun(format, val[index]); \
if (line_end) \
ecos_pr_fun("\n"); \
}
#else
#define PRINT_ONE(val, format, line_end) { \
pos += sprintf(&buf[pos], format, val); \
if (line_end) \
strcat(&buf[pos++], "\n"); \
}
#define PRINT_ARRAY(val, format, len, line_end) { \
int index; \
for (index=0; index<len; index++) \
pos += sprintf(&buf[pos], format, val[index]); \
if (line_end) \
strcat(&buf[pos++], "\n"); \
\
}
#endif
#define PRINT_SINGL_ARG(name, para, format) { \
PRINT_ONE(name, "%s", 0); \
PRINT_ONE(para, format, 1); \
}
#define PRINT_ARRAY_ARG(name, para, format, len) { \
PRINT_ONE(name, "%s", 0); \
PRINT_ARRAY(para, format, len, 1); \
}
#ifdef __ECOS
#define CHECK_LEN do {} while(0)
#else
#define CHECK_LEN { \
len += size; \
pos = begin + len; \
if (pos < offset) { \
len = 0; \
begin = pos; \
} else { \
if (len == size) { \
len -= (offset-begin); \
memcpy(buf, &buf[offset-begin], len); \
begin = offset; \
} \
if (len > length) \
goto _ret; \
} \
}
#endif
#ifdef __ECOS
const char* MCS_DATA_RATEStr[2][2][16] =
#else
const unsigned char* MCS_DATA_RATEStr[2][2][16] =
#endif
{
{{"6.5", "13", "19.5", "26", "39", "52", "58.5", "65", "13", "26", "39" ,"52", "78", "104", "117", "130"}, // Long GI, 20MHz
{"7.2", "14.4", "21.7", "28.9", "43.3", "57.8", "65", "72.2", "14.4", "28.9", "43.3", "57.8", "86.7", "115.6", "130", "144.5"}}, // Short GI, 20MHz
{{"13.5", "27", "40.5", "54", "81", "108", "121.5", "135", "27", "54", "81", "108", "162", "216", "243", "270"}, // Long GI, 40MHz
{"15", "30", "45", "60", "90", "120", "135", "150", "30", "60", "90", "120", "180", "240", "270", "300"}} // Short GI, 40MHz
};
#if defined(CONFIG_RTL_8812_SUPPORT) || defined(CONFIG_WLAN_HAL_8881A)
extern const u2Byte VHT_MCS_DATA_RATE[3][2][20];
int query_vht_rate(struct stat_info *pstat)
{
int txrate = pstat->current_tx_rate;
if(is_MCS_rate(txrate)) {
unsigned char sg = (pstat->ht_current_tx_info & TX_USE_SHORT_GI) ? 1 : 0;
if(is_VHT_rate(txrate)) {
txrate = VHT_MCS_DATA_RATE[MIN_NUM(pstat->tx_bw, 2)][sg][(pstat->current_tx_rate - 0x90)];
} else {
char index = pstat->current_tx_rate&0xf;
txrate= VHT_MCS_DATA_RATE[MIN_NUM(pstat->tx_bw, 1)][sg][(index <8) ? index :(index+2)];
}
}
return (txrate>>1);
}
#endif
static int rtl8192cd_proc_mib_staconfig(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0, i;
#ifdef __ECOS
char tmpbuf[100];
#else
unsigned char tmpbuf[100];
#endif
PRINT_ONE(" Dot11StationConfigEntry...", "%s", 1);
PRINT_ARRAY_ARG(" dot11Bssid: ",
priv->pmib->dot11StationConfigEntry.dot11Bssid, "%02x", 6);
memcpy(tmpbuf, priv->pmib->dot11StationConfigEntry.dot11DesiredSSID, priv->pmib->dot11StationConfigEntry.dot11DesiredSSIDLen);
tmpbuf[priv->pmib->dot11StationConfigEntry.dot11DesiredSSIDLen] = '\0';
PRINT_ONE(" dot11DesiredSSID:(Len ", "%s", 0);
PRINT_ONE(priv->pmib->dot11StationConfigEntry.dot11DesiredSSIDLen, "%d) ", 0);
PRINT_ONE(tmpbuf, "%s", 1);
memcpy(tmpbuf, priv->pmib->dot11StationConfigEntry.dot11DefaultSSID, priv->pmib->dot11StationConfigEntry.dot11DefaultSSIDLen);
tmpbuf[priv->pmib->dot11StationConfigEntry.dot11DefaultSSIDLen] = '\0';
PRINT_ONE(" dot11DefaultSSID:(Len ", "%s", 0);
PRINT_ONE(priv->pmib->dot11StationConfigEntry.dot11DefaultSSIDLen, "%d) ", 0);
PRINT_ONE(tmpbuf, "%s", 1);
memcpy(tmpbuf, priv->pmib->dot11StationConfigEntry.dot11SSIDtoScan, priv->pmib->dot11StationConfigEntry.dot11SSIDtoScanLen);
tmpbuf[priv->pmib->dot11StationConfigEntry.dot11SSIDtoScanLen] = '\0';
PRINT_ONE(" dot11SSIDtoScan:(Len ", "%s", 0);
PRINT_ONE(priv->pmib->dot11StationConfigEntry.dot11SSIDtoScanLen, "%d) ", 0);
PRINT_ONE(tmpbuf, "%s", 1);
PRINT_ARRAY_ARG(" dot11DesiredBssid: ",
priv->pmib->dot11StationConfigEntry.dot11DesiredBssid, "%02x", 6);
PRINT_ARRAY_ARG(" dot11OperationalRateSet: ",
priv->pmib->dot11StationConfigEntry.dot11OperationalRateSet, "%02x",
priv->pmib->dot11StationConfigEntry.dot11OperationalRateSetLen);
PRINT_SINGL_ARG(" dot11OperationalRateSetLen: ",
priv->pmib->dot11StationConfigEntry.dot11OperationalRateSetLen, "%d");
PRINT_SINGL_ARG(" dot11BeaconPeriod: ",
priv->pmib->dot11StationConfigEntry.dot11BeaconPeriod, "%d");
PRINT_SINGL_ARG(" dot11DTIMPeriod: ",
priv->pmib->dot11StationConfigEntry.dot11DTIMPeriod, "%d");
PRINT_SINGL_ARG(" dot11swcrypto: ",
priv->pmib->dot11StationConfigEntry.dot11swcrypto, "%d");
PRINT_SINGL_ARG(" dot11AclMode: ",
priv->pmib->dot11StationConfigEntry.dot11AclMode, "%d");
PRINT_SINGL_ARG(" dot11AclNum: ",
priv->pmib->dot11StationConfigEntry.dot11AclNum, "%d");
for (i=0; i<priv->pmib->dot11StationConfigEntry.dot11AclNum; i++) {
sprintf(tmpbuf, " dot11AclAddr[%d]: ", i);
PRINT_ARRAY_ARG(tmpbuf, priv->pmib->dot11StationConfigEntry.dot11AclAddr[i], "%02x", 6);
}
PRINT_SINGL_ARG(" dot11SupportedRates: ",
priv->pmib->dot11StationConfigEntry.dot11SupportedRates, "0x%x");
PRINT_SINGL_ARG(" dot11BasicRates: ",
priv->pmib->dot11StationConfigEntry.dot11BasicRates, "0x%x");
PRINT_SINGL_ARG(" dot11RegDomain: ",
priv->pmib->dot11StationConfigEntry.dot11RegDomain, "%d");
PRINT_SINGL_ARG(" autoRate: ",
priv->pmib->dot11StationConfigEntry.autoRate, "%d");
PRINT_SINGL_ARG(" fixedTxRate: ",
priv->pmib->dot11StationConfigEntry.fixedTxRate, "0x%x");
#ifdef RTK_AC_SUPPORT //vht rate
PRINT_SINGL_ARG(" dot11Supported VHT Rates: ",
priv->pmib->dot11acConfigEntry.dot11SupportedVHT, "%x");
PRINT_SINGL_ARG(" dot11 VHT tx rate map: ",
priv->pmib->dot11acConfigEntry.dot11VHT_TxMap, "%x");
#endif
PRINT_SINGL_ARG(" swTkipMic: ",
priv->pmib->dot11StationConfigEntry.swTkipMic, "%d");
PRINT_SINGL_ARG(" protectionDisabled: ",
priv->pmib->dot11StationConfigEntry.protectionDisabled, "%d");
PRINT_SINGL_ARG(" olbcDetectDisabled: ",
priv->pmib->dot11StationConfigEntry.olbcDetectDisabled, "%d");
PRINT_SINGL_ARG(" nmlscDetectDisabled: ",
priv->pmib->dot11StationConfigEntry.nmlscDetectDisabled, "%d");
PRINT_SINGL_ARG(" legacySTADeny: ",
priv->pmib->dot11StationConfigEntry.legacySTADeny, "%d");
#ifdef CLIENT_MODE
PRINT_SINGL_ARG(" fastRoaming: ",
priv->pmib->dot11StationConfigEntry.fastRoaming, "%d");
#endif
PRINT_SINGL_ARG(" lowestMlcstRate: ",
priv->pmib->dot11StationConfigEntry.lowestMlcstRate, "%d");
PRINT_SINGL_ARG(" supportedStaNum: ",
priv->pmib->dot11StationConfigEntry.supportedStaNum, "%d");
return pos;
}
static int rtl8192cd_proc_mib_auth(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" Dot1180211AuthEntry...", "%s", 1);
PRINT_SINGL_ARG(" dot11AuthAlgrthm: ",
priv->pmib->dot1180211AuthEntry.dot11AuthAlgrthm, "%d");
PRINT_SINGL_ARG(" dot11PrivacyAlgrthm: ",
priv->pmib->dot1180211AuthEntry.dot11PrivacyAlgrthm, "%d");
PRINT_SINGL_ARG(" dot11PrivacyKeyIndex: ",
priv->pmib->dot1180211AuthEntry.dot11PrivacyKeyIndex, "%d");
PRINT_SINGL_ARG(" dot11PrivacyKeyLen: ",
priv->pmib->dot1180211AuthEntry.dot11PrivacyKeyLen, "%d");
#if defined(INCLUDE_WPA_PSK) || defined(WIFI_HAPD) || defined(RTK_NL80211)
PRINT_SINGL_ARG(" dot11EnablePSK: ",
priv->pmib->dot1180211AuthEntry.dot11EnablePSK, "%d");
PRINT_SINGL_ARG(" dot11WPACipher: ",
priv->pmib->dot1180211AuthEntry.dot11WPACipher, "%d");
#ifdef RTL_WPA2
PRINT_SINGL_ARG(" dot11WPA2Cipher: ",
priv->pmib->dot1180211AuthEntry.dot11WPA2Cipher, "%d");
#endif
PRINT_SINGL_ARG(" dot11PassPhrase: ",
priv->pmib->dot1180211AuthEntry.dot11PassPhrase, "%s");
PRINT_SINGL_ARG(" dot11PassPhraseGuest: ",
priv->pmib->dot1180211AuthEntry.dot11PassPhraseGuest, "%s");
PRINT_SINGL_ARG(" dot11GKRekeyTime: ",
priv->pmib->dot1180211AuthEntry.dot11GKRekeyTime, "%ld");
#endif
PRINT_ONE(" Dot118021xAuthEntry...", "%s", 1);
PRINT_SINGL_ARG(" dot118021xAlgrthm: ",
priv->pmib->dot118021xAuthEntry.dot118021xAlgrthm, "%d");
PRINT_SINGL_ARG(" dot118021xDefaultPort: ",
priv->pmib->dot118021xAuthEntry.dot118021xDefaultPort, "%d");
PRINT_SINGL_ARG(" dot118021xcontrolport: ",
priv->pmib->dot118021xAuthEntry.dot118021xcontrolport, "%d");
PRINT_ONE(" RADIUS Accounting...", "%s", 1);
PRINT_SINGL_ARG(" Enabled: ",priv->pmib->dot118021xAuthEntry.acct_enabled, "%d");
PRINT_SINGL_ARG(" Idle period to leave STA: ",priv->pmib->dot118021xAuthEntry.acct_timeout_period, "%ld min(s)");
PRINT_SINGL_ARG(" Idle throughput to leave STA: ", priv->pmib->dot118021xAuthEntry.acct_timeout_throughput, "%d Kbpm");
PRINT_ONE(" Dot11RsnIE...", "%s", 1);
PRINT_ARRAY_ARG(" rsnie: ",
priv->pmib->dot11RsnIE.rsnie, "%02x", priv->pmib->dot11RsnIE.rsnielen);
PRINT_SINGL_ARG(" rsnielen: ", priv->pmib->dot11RsnIE.rsnielen, "%d");
#ifdef CONFIG_RTL_WAPI_SUPPORT
PRINT_ONE(" Dot1180211WAPIEntry...", "%s", 1);
PRINT_SINGL_ARG(" dot11EnableWAPI: ",
priv->pmib->wapiInfo.wapiType, "%d");
#ifdef WAPI_SUPPORT_MULTI_ENCRYPT
PRINT_SINGL_ARG(" dot11wapiUCastEncodeType: ",
priv->pmib->wapiInfo.wapiUCastEncodeType, "%d");
PRINT_SINGL_ARG(" dot11wapiMCastEncodeType: ",
priv->pmib->wapiInfo.wapiMCastEncodeType, "%d");
#endif
PRINT_ARRAY_ARG(" dot11wapiPsk: ",
priv->pmib->wapiInfo.wapiPsk.octet, "%02x", WAPI_PSK_LEN);
PRINT_SINGL_ARG(" dot11wapiwapiPsklen: ",
priv->pmib->wapiInfo.wapiPsk.len, "%d");
PRINT_SINGL_ARG(" dot11wapiUpdateUCastKeyType: ",
priv->pmib->wapiInfo.wapiUpdateUCastKeyType, "%u");
PRINT_SINGL_ARG(" dot11wapiUpdateUCastKeyTimeout: ",
(unsigned int)priv->pmib->wapiInfo.wapiUpdateUCastKeyTimeout, "%u");
PRINT_SINGL_ARG(" dot11wapiUpdateUCastKeyPktNum: ",
(unsigned int)priv->pmib->wapiInfo.wapiUpdateUCastKeyPktNum, "%u");
PRINT_SINGL_ARG(" dot11wapiUpdateMCastKeyType: ",
priv->pmib->wapiInfo.wapiUpdateMCastKeyType, "%u");
PRINT_SINGL_ARG(" dot11wapiUpdateMCastKeyTimeout: ",
(unsigned int)priv->pmib->wapiInfo.wapiUpdateMCastKeyTimeout, "%u");
PRINT_SINGL_ARG(" dot11wapiUpdateMCastKeyPktNum: ",
(unsigned int)priv->pmib->wapiInfo.wapiUpdateMCastKeyPktNum, "%u");
PRINT_ARRAY_ARG(" dot11wapiTimeout: ",
priv->pmib->wapiInfo.wapiTimeout, "%08x", wapiTimeoutTotalNum);
#endif
return pos;
}
static int rtl8192cd_proc_mib_dkeytbl(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" Dot11DefaultKeysTable...", "%s", 1);
PRINT_ARRAY_ARG(" keytype[0].skey: ",
priv->pmib->dot11DefaultKeysTable.keytype[0].skey, "%02x", 16);
PRINT_ARRAY_ARG(" keytype[1].skey: ",
priv->pmib->dot11DefaultKeysTable.keytype[1].skey, "%02x", 16);
PRINT_ARRAY_ARG(" keytype[2].skey: ",
priv->pmib->dot11DefaultKeysTable.keytype[2].skey, "%02x", 16);
PRINT_ARRAY_ARG(" keytype[3].skey: ",
priv->pmib->dot11DefaultKeysTable.keytype[3].skey, "%02x", 16);
return pos;
}
static int rtl8192cd_proc_mib_gkeytbl(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
unsigned char *ptr;
PRINT_ONE(" Dot11GroupKeysTable...", "%s", 1);
#ifdef CONFIG_RTL_WAPI_SUPPORT
if (priv->pmib->wapiInfo.wapiType!=wapiDisable)
{
PRINT_SINGL_ARG(" dot11Privacy: ",
priv->pmib->wapiInfo.wapiType, "%d");
PRINT_SINGL_ARG(" WAPI Multicast Encrypt Algorithm: ",
priv->pmib->wapiInfo.wapiMCastEncodeType, "%d");
PRINT_SINGL_ARG(" keyInCam: ", (priv->pmib->dot11GroupKeysTable.keyInCam? "yes" : "no"), "%s");
PRINT_SINGL_ARG(" WAPI Multicast Data KeyLen: ",
WAPI_KEY_LEN, "%d");
PRINT_SINGL_ARG(" WAPI Multicast Mic KeyLen: ",
WAPI_KEY_LEN, "%d");
PRINT_SINGL_ARG(" WAPI Multicast Key Index: ",
priv->wapiMCastKeyId, "%d");
PRINT_ARRAY_ARG(" WAPI Multicast Data Key: ",
priv->wapiMCastKey[priv->wapiMCastKeyId].dataKey, "%02x", WAPI_KEY_LEN);
PRINT_ARRAY_ARG(" WAPI Multicast Mic Key: ",
priv->wapiMCastKey[priv->wapiMCastKeyId].micKey, "%02x", WAPI_KEY_LEN);
}
else
#endif
{
PRINT_SINGL_ARG(" dot11Privacy: ",
priv->pmib->dot11GroupKeysTable.dot11Privacy, "%d");
PRINT_SINGL_ARG(" keyInCam: ", (priv->pmib->dot11GroupKeysTable.keyInCam? "yes" : "no"), "%s");
PRINT_SINGL_ARG(" dot11EncryptKey.dot11TTKeyLen: ",
priv->pmib->dot11GroupKeysTable.dot11EncryptKey.dot11TTKeyLen, "%d");
PRINT_SINGL_ARG(" dot11EncryptKey.dot11TMicKeyLen: ",
priv->pmib->dot11GroupKeysTable.dot11EncryptKey.dot11TMicKeyLen, "%d");
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11TTKey.skey: ",
priv->pmib->dot11GroupKeysTable.dot11EncryptKey.dot11TTKey.skey, "%02x", 16);
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11TMicKey1.skey: ",
priv->pmib->dot11GroupKeysTable.dot11EncryptKey.dot11TMicKey1.skey, "%02x", 16);
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11TMicKey2.skey: ",
priv->pmib->dot11GroupKeysTable.dot11EncryptKey.dot11TMicKey2.skey, "%02x", 16);
ptr = (unsigned char *)&priv->pmib->dot11GroupKeysTable.dot11EncryptKey.dot11TXPN48.val48;
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11TXPN48.val48: ", ptr, "%02x", 8);
ptr = (unsigned char *)&priv->pmib->dot11GroupKeysTable.dot11EncryptKey.dot11RXPN48.val48;
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11RXPN48.val48: ", ptr, "%02x", 8);
}
return pos;
}
static int rtl8192cd_proc_mib_operation(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
char tmpbuf[20];
int idx = 0;
PRINT_ONE(" Dot11OperationEntry...", "%s", 1);
PRINT_ARRAY_ARG(" hwaddr: ", priv->pmib->dot11OperationEntry.hwaddr, "%02x", 6);
PRINT_SINGL_ARG(" opmode: ", priv->pmib->dot11OperationEntry.opmode, "0x%x");
PRINT_SINGL_ARG(" hiddenAP: ", priv->pmib->dot11OperationEntry.hiddenAP, "%d");
PRINT_SINGL_ARG(" dot11RTSThreshold: ", priv->pmib->dot11OperationEntry.dot11RTSThreshold, "%d");
PRINT_SINGL_ARG(" dot11FragmentationThreshold: ", priv->pmib->dot11OperationEntry.dot11FragmentationThreshold, "%d");
PRINT_SINGL_ARG(" dot11ShortRetryLimit: ", priv->pmib->dot11OperationEntry.dot11ShortRetryLimit, "%d");
PRINT_SINGL_ARG(" dot11LongRetryLimit: ", priv->pmib->dot11OperationEntry.dot11LongRetryLimit, "%d");
PRINT_SINGL_ARG(" expiretime: ", priv->pmib->dot11OperationEntry.expiretime, "%d");
PRINT_SINGL_ARG(" led_type: ", priv->pmib->dot11OperationEntry.ledtype, "%d");
#ifdef RTL8190_SWGPIO_LED
PRINT_SINGL_ARG(" led_route: ", priv->pmib->dot11OperationEntry.ledroute, "0x%x");
#endif
PRINT_SINGL_ARG(" iapp_enable: ", priv->pmib->dot11OperationEntry.iapp_enable, "%d");
PRINT_SINGL_ARG(" block_relay: ", priv->pmib->dot11OperationEntry.block_relay, "%d");
PRINT_SINGL_ARG(" deny_any: ", priv->pmib->dot11OperationEntry.deny_any, "%d");
PRINT_SINGL_ARG(" crc_log: ", priv->pmib->dot11OperationEntry.crc_log, "%d");
PRINT_SINGL_ARG(" wifi_specific: ", priv->pmib->dot11OperationEntry.wifi_specific, "%d");
#ifdef WIFI_WMM
PRINT_SINGL_ARG(" qos_enable: ", priv->pmib->dot11QosEntry.dot11QosEnable, "%d");
#ifdef WMM_APSD
PRINT_SINGL_ARG(" apsd_enable: ", priv->pmib->dot11QosEntry.dot11QosAPSD, "%d");
#ifdef CLIENT_MODE
if ((OPMODE & WIFI_STATION_STATE) && QOS_ENABLE && APSD_ENABLE) {
PRINT_SINGL_ARG(" uapsd_assoc: ", priv->uapsd_assoc, "%d");
PRINT_SINGL_ARG(" UAPSD_AC_VO: ", priv->pmib->dot11QosEntry.UAPSD_AC_VO, "%d");
PRINT_SINGL_ARG(" UAPSD_AC_VI: ", priv->pmib->dot11QosEntry.UAPSD_AC_VI, "%d");
PRINT_SINGL_ARG(" UAPSD_AC_BE: ", priv->pmib->dot11QosEntry.UAPSD_AC_BE, "%d");
PRINT_SINGL_ARG(" UAPSD_AC_BK: ", priv->pmib->dot11QosEntry.UAPSD_AC_BK, "%d");
}
#endif
#endif
#endif
if (priv->pmib->dot11BssType.net_work_type & WIRELESS_11A)
tmpbuf[idx++] = 'A';
if (priv->pmib->dot11BssType.net_work_type & WIRELESS_11B)
tmpbuf[idx++] = 'B';
if (priv->pmib->dot11BssType.net_work_type & WIRELESS_11G)
tmpbuf[idx++] = 'G';
if (priv->pmib->dot11BssType.net_work_type & WIRELESS_11N)
tmpbuf[idx++] = 'N';
#if defined(CONFIG_RTL_8812_SUPPORT) || defined(CONFIG_WLAN_HAL_8881A)
if (priv->pmib->dot11BssType.net_work_type & WIRELESS_11AC) {
tmpbuf[idx++] = 'A';
tmpbuf[idx++] = 'C';
}
#endif
tmpbuf[idx] = '\0';
PRINT_SINGL_ARG(" net_work_type: ", tmpbuf, "%s");
#ifdef TX_SHORTCUT
PRINT_SINGL_ARG(" disable_txsc: ", priv->pmib->dot11OperationEntry.disable_txsc, "%d");
#endif
#ifdef RX_SHORTCUT
PRINT_SINGL_ARG(" disable_rxsc: ", priv->pmib->dot11OperationEntry.disable_rxsc, "%d");
#endif
#ifdef BR_SHORTCUT
PRINT_SINGL_ARG(" disable_brsc: ", priv->pmib->dot11OperationEntry.disable_brsc, "%d");
#endif
PRINT_SINGL_ARG(" guest_access: ", priv->pmib->dot11OperationEntry.guest_access, "%d");
return pos;
}
#ifdef DFS
static int rtl8192cd_proc_mib_DFS(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" Dot11DFSEntry...", "%s", 1);
PRINT_SINGL_ARG(" DFS version: ", get_DFS_version(), "%s");
PRINT_SINGL_ARG(" disable_DFS: ", priv->pmib->dot11DFSEntry.disable_DFS, "%d");
PRINT_SINGL_ARG(" DFS_timeout: ", priv->pmib->dot11DFSEntry.DFS_timeout, "%d");
PRINT_SINGL_ARG(" DFS_detected: ", priv->pmib->dot11DFSEntry.DFS_detected, "%d");
PRINT_SINGL_ARG(" NOP_timeout: ", priv->pmib->dot11DFSEntry.NOP_timeout, "%d");
PRINT_SINGL_ARG(" DFS_TXPAUSE_timeout: ", priv->pmib->dot11DFSEntry.DFS_TXPAUSE_timeout, "%d");
PRINT_SINGL_ARG(" disable_tx: ", priv->pmib->dot11DFSEntry.disable_tx, "%d");
PRINT_SINGL_ARG(" CAC_enable: ", priv->pmib->dot11DFSEntry.CAC_enable, "%d");
return pos;
}
#endif
#if defined(CONFIG_RTL_8812_SUPPORT) || defined(CONFIG_WLAN_HAL_8881A) //FOR_8812_MP
static int rtl8192cd_proc_mib_rf_ac(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" Dot11ACEntry...", "%s", 1);
PRINT_ARRAY_ARG(" pwrdiff_5G_20BW1S_OFDM1T_A: ", priv->pmib->dot11RFEntry.pwrdiff_5G_20BW1S_OFDM1T_A, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_5G_40BW2S_20BW2S_A: ", priv->pmib->dot11RFEntry.pwrdiff_5G_40BW2S_20BW2S_A, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_5G_80BW1S_160BW1S_A: ", priv->pmib->dot11RFEntry.pwrdiff_5G_80BW1S_160BW1S_A, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_5G_80BW2S_160BW2S_A: ", priv->pmib->dot11RFEntry.pwrdiff_5G_80BW2S_160BW2S_A, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_5G_20BW1S_OFDM1T_B: ", priv->pmib->dot11RFEntry.pwrdiff_5G_20BW1S_OFDM1T_B, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_5G_40BW2S_20BW2S_B: ", priv->pmib->dot11RFEntry.pwrdiff_5G_40BW2S_20BW2S_B, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_5G_80BW1S_160BW1S_B: ", priv->pmib->dot11RFEntry.pwrdiff_5G_80BW1S_160BW1S_B, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_5G_80BW2S_160BW2S_B: ", priv->pmib->dot11RFEntry.pwrdiff_5G_80BW2S_160BW2S_B, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_20BW1S_OFDM1T_A: ", priv->pmib->dot11RFEntry.pwrdiff_20BW1S_OFDM1T_A, "%02x", MAX_2G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_40BW2S_20BW2S_A: ", priv->pmib->dot11RFEntry.pwrdiff_40BW2S_20BW2S_A, "%02x", MAX_2G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_20BW1S_OFDM1T_B: ", priv->pmib->dot11RFEntry.pwrdiff_20BW1S_OFDM1T_B, "%02x", MAX_2G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff_40BW2S_20BW2S_B: ", priv->pmib->dot11RFEntry.pwrdiff_40BW2S_20BW2S_B, "%02x", MAX_2G_CHANNEL_NUM);
return pos;
}
#endif
static int rtl8192cd_proc_mib_rf(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
#ifdef __ECOS
char tmpbuf[16];
#else
unsigned char tmpbuf[16];
#endif
PRINT_ONE(" Dot11RFEntry...", "%s", 1);
PRINT_SINGL_ARG(" dot11channel: ", priv->pmib->dot11RFEntry.dot11channel, "%d");
PRINT_SINGL_ARG(" dot11ch_low: ", priv->pmib->dot11RFEntry.dot11ch_low, "%d");
PRINT_SINGL_ARG(" dot11ch_hi: ", priv->pmib->dot11RFEntry.dot11ch_hi, "%d");
#if defined(CONFIG_RTL_92D_SUPPORT) || defined(CONFIG_RTL_8812_SUPPORT) || defined(CONFIG_WLAN_HAL_8881A) //FOR_8812_MP
// if ((GET_CHIP_VER(priv)==VERSION_8192D) && (priv->pmib->dot11RFEntry.phyBandSelect & PHY_BAND_5G)) {
if ((GET_CHIP_VER(priv)==VERSION_8192D)||(GET_CHIP_VER(priv)==VERSION_8812E)||(GET_CHIP_VER(priv)==VERSION_8881A)){
PRINT_ARRAY_ARG(" pwrlevel5GHT40_1S_A: ", priv->pmib->dot11RFEntry.pwrlevel5GHT40_1S_A, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrlevel5GHT40_1S_B: ", priv->pmib->dot11RFEntry.pwrlevel5GHT40_1S_B, "%02x", MAX_5G_CHANNEL_NUM);
if(GET_CHIP_VER(priv)!=VERSION_8812E) {
PRINT_ARRAY_ARG(" pwrdiff5GHT40_2S: ", priv->pmib->dot11RFEntry.pwrdiff5GHT40_2S, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff5GHT20: ", priv->pmib->dot11RFEntry.pwrdiff5GHT20, "%02x", MAX_5G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiff5GOFDM: ", priv->pmib->dot11RFEntry.pwrdiff5GOFDM, "%02x", MAX_5G_CHANNEL_NUM);
}
}
//} else
#endif
{
PRINT_ARRAY_ARG(" pwrlevelCCK_A: ", priv->pmib->dot11RFEntry.pwrlevelCCK_A, "%02x", MAX_2G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrlevelCCK_B: ", priv->pmib->dot11RFEntry.pwrlevelCCK_B, "%02x", MAX_2G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrlevelHT40_1S_A: ", priv->pmib->dot11RFEntry.pwrlevelHT40_1S_A, "%02x", MAX_2G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrlevelHT40_1S_B: ", priv->pmib->dot11RFEntry.pwrlevelHT40_1S_B, "%02x", MAX_2G_CHANNEL_NUM);
if(GET_CHIP_VER(priv)!=VERSION_8812E) {
PRINT_ARRAY_ARG(" pwrdiffHT40_2S: ", priv->pmib->dot11RFEntry.pwrdiffHT40_2S, "%02x", MAX_2G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiffHT20: ", priv->pmib->dot11RFEntry.pwrdiffHT20, "%02x", MAX_2G_CHANNEL_NUM);
PRINT_ARRAY_ARG(" pwrdiffOFDM: ", priv->pmib->dot11RFEntry.pwrdiffOFDM, "%02x", MAX_2G_CHANNEL_NUM);
}
}
#ifdef TXPWR_LMT
PRINT_SINGL_ARG(" disable_txpwrlmt : ", (priv->pshare->rf_ft_var.disable_txpwrlmt), "%d");
PRINT_SINGL_ARG(" txpwr_lmt_CCK : ", (priv->pshare->txpwr_lmt_CCK), "%d");
PRINT_SINGL_ARG(" txpwr_lmt_OFDM : ", (priv->pshare->txpwr_lmt_OFDM), "%d");
PRINT_SINGL_ARG(" txpwr_lmt_HT1S : ", (priv->pshare->txpwr_lmt_HT1S), "%d");
PRINT_SINGL_ARG(" txpwr_lmt_HT2S : ", (priv->pshare->txpwr_lmt_HT2S), "%d");
#ifdef TXPWR_LMT_NEWFILE
if((GET_CHIP_VER(priv)== VERSION_8812E) ||
(GET_CHIP_VER(priv)== VERSION_8188E) ||
(GET_CHIP_VER(priv)== VERSION_8192E) ||
(GET_CHIP_VER(priv)== VERSION_8881A)){
#if defined(TXPWR_LMT_8812) || defined(TXPWR_LMT_8881A)
PRINT_SINGL_ARG(" txpwr_lmt_VHT1S : ", (priv->pshare->txpwr_lmt_VHT1S), "%d");
PRINT_SINGL_ARG(" txpwr_lmt_VHT2S : ", (priv->pshare->txpwr_lmt_VHT2S), "%d");
#endif
PRINT_ARRAY_ARG(" tgpwr_CCK_new : ", (priv->pshare->tgpwr_CCK_new), "%d ", 2);
PRINT_ARRAY_ARG(" tgpwr_OFDM_new : ", (priv->pshare->tgpwr_OFDM_new), "%d ", 2);
PRINT_ARRAY_ARG(" tgpwr_HT1S_new : ", (priv->pshare->tgpwr_HT1S_new), "%d ", 2);
PRINT_ARRAY_ARG(" tgpwr_HT2S_new : ", (priv->pshare->tgpwr_HT2S_new), "%d ", 2);
#if defined(TXPWR_LMT_8812) || defined(TXPWR_LMT_8881A)
PRINT_ARRAY_ARG(" tgpwr_VHT1S_new : ", (priv->pshare->tgpwr_VHT1S_new), "%d ", 2);
PRINT_ARRAY_ARG(" tgpwr_VHT2S_new : ", (priv->pshare->tgpwr_VHT2S_new), "%d ", 2);
#endif
} else
#endif
{
PRINT_SINGL_ARG(" target_CCK : ", (priv->pshare->tgpwr_CCK), "%d");
PRINT_SINGL_ARG(" target_OFDM : ", (priv->pshare->tgpwr_OFDM), "%d");
PRINT_SINGL_ARG(" target_HT1S : ", (priv->pshare->tgpwr_HT1S), "%d");
PRINT_SINGL_ARG(" target_HT2S : ", (priv->pshare->tgpwr_HT2S), "%d");
}
#endif
#ifdef POWER_PERCENT_ADJUSTMENT
PRINT_SINGL_ARG(" power_percent: ", priv->pmib->dot11RFEntry.power_percent, "%d");
#endif
PRINT_SINGL_ARG(" shortpreamble: ", priv->pmib->dot11RFEntry.shortpreamble, "%d");
PRINT_SINGL_ARG(" trswitch: ", priv->pmib->dot11RFEntry.trswitch, "%d");
PRINT_SINGL_ARG(" disable_ch14_ofdm: ", priv->pmib->dot11RFEntry.disable_ch14_ofdm, "%d");
PRINT_SINGL_ARG(" xcap: ", priv->pmib->dot11RFEntry.xcap, "%d");
PRINT_SINGL_ARG(" tssi1: ", priv->pmib->dot11RFEntry.tssi1, "%d");
PRINT_SINGL_ARG(" tssi2: ", priv->pmib->dot11RFEntry.tssi2, "%d");
PRINT_SINGL_ARG(" ther: ", priv->pmib->dot11RFEntry.ther, "%d");
switch (priv->pshare->phw->MIMO_TR_hw_support) {
case MIMO_1T2R:
sprintf(tmpbuf, "1T2R");
break;
case MIMO_1T1R:
sprintf(tmpbuf, "1T1R");
break;
case MIMO_2T2R:
sprintf(tmpbuf, "2T2R");
break;
default:
sprintf(tmpbuf, "2T4R");
break;
}
PRINT_SINGL_ARG(" MIMO_TR_hw_support: ", tmpbuf, "%s");
switch (priv->pmib->dot11RFEntry.MIMO_TR_mode) {
case MIMO_1T2R:
sprintf(tmpbuf, "1T2R");
break;
case MIMO_1T1R:
sprintf(tmpbuf, "1T1R");
break;
case MIMO_2T2R:
sprintf(tmpbuf, "2T2R");
break;
default:
sprintf(tmpbuf, "2T4R");
break;
}
PRINT_SINGL_ARG(" MIMO_TR_mode: ", tmpbuf, "%s");
#ifdef CONFIG_RTL_92D_SUPPORT
if (GET_CHIP_VER(priv) == VERSION_8192D) {
PRINT_SINGL_ARG(" phyBandSelect: ", priv->pmib->dot11RFEntry.phyBandSelect, "%d");
switch (priv->pmib->dot11RFEntry.macPhyMode) {
case SINGLEMAC_SINGLEPHY:
sprintf(tmpbuf, "SMSP");
break;
case DUALMAC_SINGLEPHY:
sprintf(tmpbuf, "DMSP");
break;
case DUALMAC_DUALPHY:
sprintf(tmpbuf, "DMDP");
break;
default:
sprintf(tmpbuf, "unknown");
break;
}
PRINT_SINGL_ARG(" macPhyMode: ", tmpbuf, "%s");
}
#endif
#ifdef CONFIG_RTL_92C_SUPPORT
if (GET_CHIP_VER(priv) == VERSION_8188C) {
if(IS_UMC_B_CUT_88C(priv))
sprintf(tmpbuf, "RTL6195B");
else if(IS_88RE(priv))
sprintf(tmpbuf, "RTL8188R");
else
sprintf(tmpbuf, "RTL8188C");
} else if (GET_CHIP_VER(priv) == VERSION_8192C){
sprintf(tmpbuf, "RTL8192C");
}
if ((GET_CHIP_VER(priv)==VERSION_8192C) || (GET_CHIP_VER(priv)==VERSION_8188C)) {
if (IS_TEST_CHIP(priv))
strcat(tmpbuf, "t");
else
strcat(tmpbuf, "n");
}
#endif
#ifdef CONFIG_RTL_92D_SUPPORT
if (GET_CHIP_VER(priv) == VERSION_8192D)
sprintf(tmpbuf, "RTL8192D");
#endif
#ifdef CONFIG_RTL_88E_SUPPORT
if (GET_CHIP_VER(priv) == VERSION_8188E) {
sprintf(tmpbuf, "RTL8188E");
#ifdef SUPPORT_RTL8188E_TC
if (IS_TEST_CHIP(priv))
strcat(tmpbuf, "t");
#endif
}
#endif
#ifdef CONFIG_RTL_8812_SUPPORT
if (GET_CHIP_VER(priv) == VERSION_8812E) {
#ifdef CONFIG_RTL_8812AR_VN_SUPPORT
sprintf(tmpbuf, "RTL8812AR-VN");
#else
sprintf(tmpbuf, "RTL8812");
#endif
if (IS_TEST_CHIP(priv))
strcat(tmpbuf, "t");
else if (IS_C_CUT_8812(priv))
strcat(tmpbuf, "c");
}
#endif
#ifdef CONFIG_WLAN_HAL_8881A
if (GET_CHIP_VER(priv) == VERSION_8881A) {
sprintf(tmpbuf, "RTL8881A");
if (get_bonding_type_8881A() == BOND_8881AB)
strcat(tmpbuf, "B");
else if (get_bonding_type_8881A() == BOND_8881AM)
strcat(tmpbuf, "M");
}
#endif
#if defined(CONFIG_WLAN_HAL_8192EE)
if (GET_CHIP_VER(priv) == VERSION_8192E) {
sprintf(tmpbuf, "RTL8192E");
if(_GET_HAL_DATA(priv)->cutVersion == ODM_CUT_B)
strcat(tmpbuf, "b");
else if(_GET_HAL_DATA(priv)->cutVersion == ODM_CUT_C)
strcat(tmpbuf, "c");
}
#endif
if(IS_UMC_A_CUT(priv))
strcat(tmpbuf, "u");
PRINT_SINGL_ARG(" chipVersion: ", tmpbuf, "%s");
#ifdef EN_EFUSE
if(priv->pmib->efuseEntry.enable_efuse) {
int k;
PRINT_SINGL_ARG(" autoload fail: ", priv->AutoloadFailFlag, "%d");
PRINT_SINGL_ARG(" efuse used bytes: ", priv->EfuseUsedBytes, "%d");
PRINT_ONE("efuse init map...", "%s", 1);
for(k=0; k<EFUSE_MAP_LEN; k+=16)
PRINT_ARRAY_ARG(" ", (priv->EfuseMap[EFUSE_INIT_MAP]+k), "%02x", 16);
PRINT_ONE("efuse modify map...", "%s", 1);
for(k=0; k<EFUSE_MAP_LEN; k+=16)
PRINT_ARRAY_ARG(" ", (priv->EfuseMap[EFUSE_MODIFY_MAP]+k), "%02x", 16);
}
#endif
#ifdef SW_ANT_SWITCH
PRINT_SINGL_ARG(" SW Ant switch enable: ", (SW_DIV_ENABLE ? "enable" : "disable"), "%s");
PRINT_SINGL_ARG(" SW Diversity Antenna : ", priv->pshare->DM_SWAT_Table.CurAntenna, "%d");
#endif
#if defined (HW_ANT_SWITCH) &&( defined(CONFIG_RTL_92C_SUPPORT) || defined(CONFIG_RTL_92D_SUPPORT))
PRINT_SINGL_ARG(" HW Ant switch enable: ", (HW_DIV_ENABLE ? "enable" : "disable"), "%s");
PRINT_SINGL_ARG(" RxIdle Antenna : ", (priv->pshare->rf_ft_var.CurAntenna==0 ? 2 : 1), "%d");
#endif
PRINT_SINGL_ARG(" tx2path: ", priv->pmib->dot11RFEntry.tx2path, "%d");
PRINT_SINGL_ARG(" txbf: ", priv->pmib->dot11RFEntry.txbf, "%d");
#ifdef RTL8192D_INT_PA
PRINT_SINGL_ARG(" use_intpa92d: ", priv->pshare->rf_ft_var.use_intpa92d, "%d");
#endif
PRINT_SINGL_ARG(" pa_type: ", priv->pmib->dot11RFEntry.pa_type, "%d");
return pos;
}
static int rtl8192cd_proc_mib_bssdesc(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
unsigned char tmpbuf[33];
PRINT_ONE(" bss_desc...", "%s", 1);
PRINT_ARRAY_ARG(" bssid: ", priv->pmib->dot11Bss.bssid, "%02x", MACADDRLEN);
memcpy(tmpbuf, priv->pmib->dot11Bss.ssid, priv->pmib->dot11Bss.ssidlen);
tmpbuf[priv->pmib->dot11Bss.ssidlen] = '\0';
PRINT_SINGL_ARG(" ssid: ", tmpbuf, "%s");
PRINT_SINGL_ARG(" ssidlen: ", priv->pmib->dot11Bss.ssidlen, "%d");
PRINT_SINGL_ARG(" bsstype: ", priv->pmib->dot11Bss.bsstype, "%x");
PRINT_SINGL_ARG(" beacon_prd: ", priv->pmib->dot11Bss.beacon_prd, "%d");
PRINT_SINGL_ARG(" dtim_prd: ", priv->pmib->dot11Bss.dtim_prd, "%d");
#ifdef CLIENT_MODE
if (OPMODE & WIFI_STATION_STATE)
PRINT_SINGL_ARG(" client mode aid: ", priv->aid, "%d");
#endif
PRINT_ARRAY_ARG(" t_stamp(hex): ", priv->pmib->dot11Bss.t_stamp, "%08x", 2);
PRINT_SINGL_ARG(" ibss_par.atim_win: ", priv->pmib->dot11Bss.ibss_par.atim_win, "%d");
PRINT_SINGL_ARG(" capability(hex): ", priv->pmib->dot11Bss.capability, "%02x");
PRINT_SINGL_ARG(" channel: ", priv->pmib->dot11Bss.channel, "%d");
PRINT_SINGL_ARG(" basicrate(hex): ", priv->pmib->dot11Bss.basicrate, "%x");
PRINT_SINGL_ARG(" supportrate(hex): ", priv->pmib->dot11Bss.supportrate, "%x");
PRINT_ARRAY_ARG(" bdsa: ", priv->pmib->dot11Bss.bdsa, "%02x", MACADDRLEN);
PRINT_SINGL_ARG(" rssi: ", priv->pmib->dot11Bss.rssi, "%d");
PRINT_SINGL_ARG(" sq: ", priv->pmib->dot11Bss.sq, "%d");
return pos;
}
static int rtl8192cd_proc_mib_erp(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" ERP info...", "%s", 1);
PRINT_SINGL_ARG(" protection: ", priv->pmib->dot11ErpInfo.protection, "%d");
PRINT_SINGL_ARG(" nonErpStaNum: ", priv->pmib->dot11ErpInfo.nonErpStaNum, "%d");
PRINT_SINGL_ARG(" olbcDetected: ", priv->pmib->dot11ErpInfo.olbcDetected, "%d");
PRINT_SINGL_ARG(" olbcExpired: ", priv->pmib->dot11ErpInfo.olbcExpired, "%d");
PRINT_SINGL_ARG(" shortSlot: ", priv->pmib->dot11ErpInfo.shortSlot, "%d");
PRINT_SINGL_ARG(" ctsToSelf: ", priv->pmib->dot11ErpInfo.ctsToSelf, "%d");
PRINT_SINGL_ARG(" longPreambleStaNum: ", priv->pmib->dot11ErpInfo.longPreambleStaNum, "%d");
return pos;
}
static int rtl8192cd_proc_cam_info(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0, i;
unsigned char TempOutputMac[6];
unsigned char TempOutputKey[16];
unsigned short TempOutputCfg=0;
if (!(priv->drv_state & DRV_STATE_OPEN))
return 0;
PRINT_ONE(" CAM info...", "%s", 1);
PRINT_ONE(" CAM occupied: ", "%s", 0);
PRINT_ONE(priv->pshare->CamEntryOccupied, "%d", 1);
for (i=0; i<32; i++)
{
PRINT_ONE(" Entry", "%s", 0);
PRINT_ONE(i, " %2d:", 0);
CAM_read_entry(priv,i,TempOutputMac,TempOutputKey,&TempOutputCfg);
PRINT_ARRAY_ARG(" MAC addr: ", TempOutputMac, "%02x", 6);
PRINT_SINGL_ARG(" Config: ", TempOutputCfg, "%x");
PRINT_ARRAY_ARG(" Key: ", TempOutputKey, "%02x", 16);
}
return pos;
}
#ifdef WDS
static int rtl8192cd_proc_mib_wds(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0, i;
#ifdef __ECOS
char tmpbuf[100];
#else
unsigned char tmpbuf[100];
#endif
PRINT_ONE(" WDS info...", "%s", 1);
PRINT_SINGL_ARG(" wdsEnabled: ", priv->pmib->dot11WdsInfo.wdsEnabled, "%d");
PRINT_SINGL_ARG(" wdsPure: ", priv->pmib->dot11WdsInfo.wdsPure, "%d");
PRINT_SINGL_ARG(" wdsPriority: ", priv->pmib->dot11WdsInfo.wdsPriority, "%d");
PRINT_SINGL_ARG(" wdsNum: ", priv->pmib->dot11WdsInfo.wdsNum, "%d");
for (i=0; i<priv->pmib->dot11WdsInfo.wdsNum; i++) {
sprintf(tmpbuf, " wdsMacAddr[%d]: ", i);
PRINT_ARRAY_ARG(tmpbuf, priv->pmib->dot11WdsInfo.entry[i].macAddr, "%02x", 6);
PRINT_SINGL_ARG(" wdsTxRate: ", priv->pmib->dot11WdsInfo.entry[i].txRate, "0x%x");
}
PRINT_SINGL_ARG(" wdsPrivacy: ", priv->pmib->dot11WdsInfo.wdsPrivacy, "%d");
PRINT_ARRAY_ARG(" wdsWepKey: ",
priv->pmib->dot11WdsInfo.wdsWepKey, "%02x", 16);
#if defined(INCLUDE_WPA_PSK) || defined(WIFI_HAPD) || defined(RTK_NL80211)
PRINT_SINGL_ARG(" wds_passphrase: ",
priv->pmib->dot11WdsInfo.wdsPskPassPhrase, "%s");
#endif
return pos;
}
#endif // WDS
#ifdef RTK_BR_EXT
static int rtl8192cd_proc_mib_brext(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" BR Ext info...", "%s", 1);
PRINT_SINGL_ARG(" nat25_disable: ", priv->pmib->ethBrExtInfo.nat25_disable, "%d");
PRINT_SINGL_ARG(" macclone_enable: ", priv->pmib->ethBrExtInfo.macclone_enable, "%d");
PRINT_SINGL_ARG(" dhcp_bcst_disable: ", priv->pmib->ethBrExtInfo.dhcp_bcst_disable, "%d");
PRINT_SINGL_ARG(" addPPPoETag: ", priv->pmib->ethBrExtInfo.addPPPoETag, "%d");
PRINT_SINGL_ARG(" nat25sc_disable: ", priv->pmib->ethBrExtInfo.nat25sc_disable, "%d");
PRINT_ARRAY_ARG(" ukpro_mac: ", priv->ukpro_mac, "%02x", MACADDRLEN);
return pos;
}
#endif
static int rtl8192cd_proc_txdesc_info(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
struct rtl8192cd_hw *phw;
unsigned long *txdescptr;
unsigned int q_num = priv->txdesc_num;
int i, len = 0;
#ifdef __KERNEL__
off_t begin = 0;
off_t pos = 0;
int size;
#endif
phw = GET_HW(priv);
#ifdef __ECOS
ecos_pr_fun(" Tx queue %d descriptor ..........\n", q_num);
#else
size = sprintf(buf, " Tx queue %d descriptor ..........\n", q_num);
CHECK_LEN;
#endif
#ifdef CONFIG_WLAN_HAL
if (IS_HAL_CHIP(priv)) {
GET_HAL_INTERFACE(priv)->DumpTxBDescTestHandler(priv, q_num);
} else if(CONFIG_WLAN_NOT_HAL_EXIST)
#endif
{//not HAL
if (get_txdesc(phw, q_num)) {
#ifdef __ECOS
ecos_pr_fun(" tx_desc%d/physical: 0x%.8lx/0x%.8lx\n", q_num, (unsigned long)get_txdesc(phw, q_num),
*(unsigned long *)(((unsigned long)&phw->tx_ring0_addr)+sizeof(unsigned long)*q_num));
ecos_pr_fun(" head/tail: %3d/%-3d DW0 DW1 DW2 DW3 DW4 DW5\n",
get_txhead(phw, q_num), get_txtail(phw, q_num));
#else
size = sprintf(buf+len, " tx_desc%d/physical: 0x%.8lx/0x%.8lx\n", q_num, (unsigned long)get_txdesc(phw, q_num),
*(unsigned long *)(((unsigned long)&phw->tx_ring0_addr)+sizeof(unsigned long)*q_num));
CHECK_LEN;
size = sprintf(buf+len, " head/tail: %3d/%-3d DW0 DW1 DW2 DW3 DW4 DW5\n",
get_txhead(phw, q_num), get_txtail(phw, q_num));
CHECK_LEN;
#endif
for (i=0; i<CURRENT_NUM_TX_DESC; i++) {
txdescptr = (unsigned long *)(get_txdesc(phw, q_num) + i);
#ifdef __ECOS
ecos_pr_fun("%d[%3d]: %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n", q_num, i,
(UINT)get_desc(txdescptr[0]), (UINT)get_desc(txdescptr[1]),
(UINT)get_desc(txdescptr[2]), (UINT)get_desc(txdescptr[3]),
(UINT)get_desc(txdescptr[4]), (UINT)get_desc(txdescptr[5]),
(UINT)get_desc(txdescptr[6]), (UINT)get_desc(txdescptr[7]),
(UINT)get_desc(txdescptr[8]), (UINT)get_desc(txdescptr[9])
);
#else
size = sprintf(buf+len, "%d[%3d]: %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n", q_num, i,
(UINT)get_desc(txdescptr[0]), (UINT)get_desc(txdescptr[1]),
(UINT)get_desc(txdescptr[2]), (UINT)get_desc(txdescptr[3]),
(UINT)get_desc(txdescptr[4]), (UINT)get_desc(txdescptr[5]),
(UINT)get_desc(txdescptr[6]), (UINT)get_desc(txdescptr[7]),
(UINT)get_desc(txdescptr[8]), (UINT)get_desc(txdescptr[9])
);
CHECK_LEN;
#endif
}
}
}
#ifdef __KERNEL__
*eof = 1;
_ret:
*start = buf + (offset - begin); /* Start of wanted data */
len -= (offset - begin); /* Start slop */
if (len > length)
len = length; /* Ending slop */
#endif
return len;
}
#ifdef CONFIG_RTL_KERNEL_MIPS16_WLAN
__NOMIPS16
#endif
#ifdef __ECOS
void rtl8192cd_proc_txdesc_info_write(int txdesc_num, void *data)
#else
static int rtl8192cd_proc_txdesc_info_write(struct file *file, const char *buffer,
unsigned long count, void *data)
#endif
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
#ifdef __KERNEL__
char tmp[32];
#endif
#ifdef __ECOS
priv->txdesc_num = txdesc_num;
if (priv->txdesc_num > 5) {
ecos_pr_fun("Invalid tx desc number!\n");
priv->txdesc_num = 0;
}
else
ecos_pr_fun("Ready to dump tx desc %d\n", priv->txdesc_num);
#else
if (count < 2)
return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, 32)) {
int num = sscanf(tmp, "%d", &priv->txdesc_num);
if (num != 1)
panic_printk("Invalid tx desc number!\n");
else if (priv->txdesc_num > 5) {
panic_printk("Invalid tx desc number!\n");
priv->txdesc_num = 0;
}
else
panic_printk("Ready to dump tx desc %d\n", priv->txdesc_num);
}
return count;
#endif
}
static int rtl8192cd_proc_rxdesc_info(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
struct rtl8192cd_hw *phw;
unsigned long *rxdescptr;
int i, len = 0;
#ifdef __KERNEL__
off_t begin = 0;
off_t pos = 0;
int size;
#endif
#ifdef CONFIG_WLAN_HAL
if (IS_HAL_CHIP(priv)) {
DumpRxBDesc88XX(priv, 0);
return 0;
} else
#endif
{
phw = GET_HW(priv);
#ifdef __ECOS
ecos_pr_fun(" Rx queue descriptor ..........\n");
#else
size = sprintf(buf+len, " Rx queue descriptor ..........\n");
CHECK_LEN;
#endif
if(phw->rx_descL){
#ifdef __ECOS
ecos_pr_fun(" rx_descL/physical: 0x%.8lx/0x%.8lx\n", (unsigned long)phw->rx_descL, phw->rx_ring_addr);
#ifdef DELAY_REFILL_RX_BUF
ecos_pr_fun(" cur_rx/cur_rx_refill: %d/%d\n", phw->cur_rx, phw->cur_rx_refill);
#else
ecos_pr_fun(" cur_rx: %d\n", phw->cur_rx);
#endif
#else
size = sprintf(buf+len, " rx_descL/physical: 0x%.8lx/0x%.8lx\n", (unsigned long)phw->rx_descL, phw->rx_ring_addr);
CHECK_LEN;
#ifdef DELAY_REFILL_RX_BUF
size = sprintf(buf+len, " cur_rx/cur_rx_refill: %d/%d\n", phw->cur_rx, phw->cur_rx_refill);
#else
size = sprintf(buf+len, " cur_rx: %d\n", phw->cur_rx);
#endif
CHECK_LEN;
#endif
for(i=0; i<NUM_RX_DESC; i++) {
rxdescptr = (unsigned long *)(phw->rx_descL+i);
#ifdef __ECOS
ecos_pr_fun(" rxdesc[%02d]: 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x\n", i,
(UINT)get_desc(rxdescptr[0]), (UINT)get_desc(rxdescptr[1]),
(UINT)get_desc(rxdescptr[2]), (UINT)get_desc(rxdescptr[3]),
(UINT)get_desc(rxdescptr[4]), (UINT)get_desc(rxdescptr[5]),
(UINT)get_desc(rxdescptr[6]), (UINT)get_desc(rxdescptr[7]));
#else
size = sprintf(buf+len, " rxdesc[%02d]: 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x\n", i,
(UINT)get_desc(rxdescptr[0]), (UINT)get_desc(rxdescptr[1]),
(UINT)get_desc(rxdescptr[2]), (UINT)get_desc(rxdescptr[3]),
(UINT)get_desc(rxdescptr[4]), (UINT)get_desc(rxdescptr[5]),
(UINT)get_desc(rxdescptr[6]), (UINT)get_desc(rxdescptr[7]));
CHECK_LEN;
#endif
}
}
#ifdef __KERNEL__
*eof = 1;
_ret:
*start = buf + (offset - begin); /* Start of wanted data */
len -= (offset - begin); /* Start slop */
if (len > length)
len = length; /* Ending slop */
#endif
return len;
}
}
static int rtl8192cd_proc_desc_info(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
struct rtl8192cd_hw *phw = GET_HW(priv);
int pos = 0;
#ifdef CONFIG_WLAN_HAL
if (IS_HAL_CHIP(priv)) {
PHCI_RX_DMA_MANAGER_88XX prx_dma = (PHCI_RX_DMA_MANAGER_88XX)(_GET_HAL_DATA(priv)->PRxDMA88XX);
PHCI_TX_DMA_MANAGER_88XX ptx_dma = (PHCI_TX_DMA_MANAGER_88XX)(_GET_HAL_DATA(priv)->PTxDMA88XX);
PHCI_RX_DMA_QUEUE_STRUCT_88XX rx_q = &(prx_dma->rx_queue[0]);
PHCI_RX_DMA_QUEUE_STRUCT_88XX tx_q = &(ptx_dma->tx_queue[MGNT_QUEUE]);
PRINT_ONE(" descriptor info...", "%s", 1);
PRINT_ONE(" RX queue:", "%s", 1);
PRINT_ONE(" RDSAR: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(RX_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)rx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)rx_q->host_idx, "%d", 1);
PRINT_ONE(" queue 0:", "%s", 1);
PRINT_ONE(" TMGDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_MGQ_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[BK_QUEUE]);
PRINT_ONE(" queue 1:", "%s", 1);
PRINT_ONE(" TBKDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_BKQ_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[BE_QUEUE]);
PRINT_ONE(" queue 2:", "%s", 1);
PRINT_ONE(" TBEDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_BEQ_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[VI_QUEUE]);
PRINT_ONE(" queue 3:", "%s", 1);
PRINT_ONE(" TVIDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_VIQ_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[VO_QUEUE]);
PRINT_ONE(" queue 4:", "%s", 1);
PRINT_ONE(" TVODA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_VOQ_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[HIGH_QUEUE]);
PRINT_ONE(" queue 5:", "%s", 1);
PRINT_ONE(" TH0DA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_HI0Q_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[HIGH_QUEUE1]);
PRINT_ONE(" queue 6:", "%s", 1);
PRINT_ONE(" TH1DA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_HI1Q_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[HIGH_QUEUE2]);
PRINT_ONE(" queue 7:", "%s", 1);
PRINT_ONE(" TH2DA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_HI2Q_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[HIGH_QUEUE3]);
PRINT_ONE(" queue 8:", "%s", 1);
PRINT_ONE(" TH3DA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_HI3Q_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[HIGH_QUEUE4]);
PRINT_ONE(" queue 9:", "%s", 1);
PRINT_ONE(" TH4DA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_HI4Q_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[HIGH_QUEUE5]);
PRINT_ONE(" queue 10:", "%s", 1);
PRINT_ONE(" TH5DA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_HI5Q_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[HIGH_QUEUE6]);
PRINT_ONE(" queue 11:", "%s", 1);
PRINT_ONE(" TH6DA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_HI6Q_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
tx_q = &(ptx_dma->tx_queue[HIGH_QUEUE7]);
PRINT_ONE(" queue 12:", "%s", 1);
PRINT_ONE(" TH7DA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(REG_HI7Q_TXBD_DESA), "0x%.8x", 0);
PRINT_ONE(" hwIdx/hostIdx: ", "%s", 0);
PRINT_ONE((UINT)tx_q->hw_idx, "%d/", 0);
PRINT_ONE((UINT)tx_q->host_idx, "%d", 1);
} else if(CONFIG_WLAN_NOT_HAL_EXIST)
#endif
{//not HAL
PRINT_ONE(" descriptor info...", "%s", 1);
PRINT_ONE(" RX queue:", "%s", 1);
PRINT_ONE(" rx_descL/physical: ", "%s", 0);
PRINT_ONE((unsigned long)phw->rx_descL, "0x%.8lx/", 0);
PRINT_ONE(phw->rx_ring_addr, "0x%.8lx", 1);
PRINT_ONE(" RDSAR: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(RX_DESA), "0x%.8x", 0);
#ifdef DELAY_REFILL_RX_BUF
PRINT_ONE(" cur_rx/cur_rx_refill: ", "%s", 0);
PRINT_ONE((UINT)phw->cur_rx, "%d/", 0);
PRINT_ONE((UINT)phw->cur_rx_refill, "%d", 1);
#else
PRINT_ONE(" cur_rx: ", "%s", 0);
PRINT_ONE((UINT)phw->cur_rx, "%d", 1);
#endif
PRINT_ONE(" queue 0:", "%s", 1);
PRINT_ONE(" tx_desc0/physical: ", "%s", 0);
PRINT_ONE((unsigned long)phw->tx_desc0, "0x%.8lx/", 0);
PRINT_ONE(phw->tx_ring0_addr, "0x%.8lx", 1);
PRINT_ONE(" TMGDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(MGQ_DESA), "0x%.8x", 0);
PRINT_ONE(" head/tail: ", "%s", 0);
PRINT_ONE((UINT)phw->txhead0, "%d/", 0);
PRINT_ONE((UINT)phw->txtail0, "%d", 1);
PRINT_ONE(" queue 1:", "%s", 1);
PRINT_ONE(" tx_desc1/physical: ", "%s", 0);
PRINT_ONE((unsigned long)phw->tx_desc1, "0x%.8lx/", 0);
PRINT_ONE(phw->tx_ring1_addr, "0x%.8lx", 1);
PRINT_ONE(" TBKDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(BKQ_DESA), "0x%.8x", 0);
PRINT_ONE(" head/tail: ", "%s", 0);
PRINT_ONE((UINT)phw->txhead1, "%d/", 0);
PRINT_ONE((UINT)phw->txtail1, "%d", 1);
PRINT_ONE(" queue 2:", "%s", 1);
PRINT_ONE(" tx_desc2/physical: ", "%s", 0);
PRINT_ONE((unsigned long)phw->tx_desc2, "0x%.8lx/", 0);
PRINT_ONE(phw->tx_ring2_addr, "0x%.8lx", 1);
PRINT_ONE(" TBEDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(BEQ_DESA), "0x%.8x", 0);
PRINT_ONE(" head/tail: ", "%s", 0);
PRINT_ONE((UINT)phw->txhead2, "%d/", 0);
PRINT_ONE((UINT)phw->txtail2, "%d", 1);
PRINT_ONE(" queue 3:", "%s", 1);
PRINT_ONE(" tx_desc3/physical: ", "%s", 0);
PRINT_ONE((unsigned long)phw->tx_desc3, "0x%.8lx/", 0);
PRINT_ONE(phw->tx_ring3_addr, "0x%.8lx", 1);
PRINT_ONE(" TLPDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(VIQ_DESA), "0x%.8x", 0);
PRINT_ONE(" head/tail: ", "%s", 0);
PRINT_ONE((UINT)phw->txhead3, "%d/", 0);
PRINT_ONE((UINT)phw->txtail3, "%d", 1);
PRINT_ONE(" queue 4:", "%s", 1);
PRINT_ONE(" tx_desc4/physical: ", "%s", 0);
PRINT_ONE((unsigned long)phw->tx_desc4, "0x%.8lx/", 0);
PRINT_ONE(phw->tx_ring4_addr, "0x%.8lx", 1);
PRINT_ONE(" TNPDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(VOQ_DESA), "0x%.8x", 0);
PRINT_ONE(" head/tail: ", "%s", 0);
PRINT_ONE((UINT)phw->txhead4, "%d/", 0);
PRINT_ONE((UINT)phw->txtail4, "%d", 1);
PRINT_ONE(" queue 5:", "%s", 1);
PRINT_ONE(" tx_desc5/physical: ", "%s", 0);
PRINT_ONE((unsigned long)phw->tx_desc5, "0x%.8lx/", 0);
PRINT_ONE(phw->tx_ring5_addr, "0x%.8lx", 1);
PRINT_ONE(" THPDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(HQ_DESA), "0x%.8x", 0);
PRINT_ONE(" head/tail: ", "%s", 0);
PRINT_ONE((UINT)phw->txhead5, "%d/", 0);
PRINT_ONE((UINT)phw->txtail5, "%d", 1);
}
#if 0
PRINT_ONE(" RX cmd queue:", "%s", 1);
PRINT_ONE(" rxcmd_desc/physical: ", "%s", 0);
PRINT_ONE((UINT)phw->rxcmd_desc, "0x%.8x/", 0);
PRINT_ONE((UINT)phw->rxcmd_ring_addr, "0x%.8x", 1);
PRINT_ONE(" RCDSA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(_RCDSA_), "0x%.8x", 0);
PRINT_ONE(" cur_rx: ", "%s", 0);
PRINT_ONE((UINT)phw->cur_rxcmd, "%d", 1);
PRINT_ONE(" TX cmd queue:", "%s", 1);
PRINT_ONE(" txcmd_desc/physical: ", "%s", 0);
PRINT_ONE((UINT)phw->txcmd_desc, "0x%.8x/", 0);
PRINT_ONE((UINT)phw->txcmd_ring_addr, "0x%.8x", 1);
PRINT_ONE(" TCDA: ", "%s", 0);
PRINT_ONE((UINT)RTL_R32(_TCDA_), "0x%.8x", 0);
PRINT_ONE(" head/tail: ", "%s", 0);
PRINT_ONE((UINT)phw->txcmdhead, "%d/", 0);
PRINT_ONE((UINT)phw->txcmdtail, "%d", 1);
#endif
return pos;
}
static int rtl8192cd_proc_buf_info(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" buf info...", "%s", 1);
PRINT_ONE(" hdr poll:", "%s", 1);
PRINT_ONE(" head: ", "%s", 0);
PRINT_ONE((unsigned long)&priv->pshare->wlan_hdrlist, "0x%.8lx", 0);
PRINT_ONE(" count: ", "%s", 0);
PRINT_ONE(priv->pshare->pwlan_hdr_poll->count, "%d", 1);
PRINT_ONE(" hdrllc poll:", "%s", 1);
PRINT_ONE(" head: ", "%s", 0);
PRINT_ONE((unsigned long)&priv->pshare->wlanllc_hdrlist, "0x%.8lx", 0);
PRINT_ONE(" count: ", "%s", 0);
PRINT_ONE(priv->pshare->pwlanllc_hdr_poll->count, "%d", 1);
PRINT_ONE(" mgmtbuf poll:", "%s", 1);
PRINT_ONE(" head: ", "%s", 0);
PRINT_ONE((unsigned long)&priv->pshare->wlanbuf_list, "0x%.8lx", 0);
PRINT_ONE(" count: ", "%s", 0);
PRINT_ONE(priv->pshare->pwlanbuf_poll->count, "%d", 1);
PRINT_ONE(" icv poll:", "%s", 1);
PRINT_ONE(" head: ", "%s", 0);
PRINT_ONE((unsigned long)&priv->pshare->wlanicv_list, "0x%.8lx", 0);
PRINT_ONE(" count: ", "%s", 0);
PRINT_ONE(priv->pshare->pwlanicv_poll->count, "%d", 1);
PRINT_ONE(" mic poll:", "%s", 1);
PRINT_ONE(" head: ", "%s", 0);
PRINT_ONE((unsigned long)&priv->pshare->wlanmic_list, "0x%.8lx", 0);
PRINT_ONE(" count: ", "%s", 0);
PRINT_ONE(priv->pshare->pwlanmic_poll->count, "%d", 1);
return pos;
}
#ifdef ENABLE_RTL_SKB_STATS
static int rtl8192cd_proc_skb_info(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" skb counter...", "%s", 1);
PRINT_SINGL_ARG(" skb_tx_cnt: ", rtl_atomic_read(&priv->rtl_tx_skb_cnt) , "%d");
PRINT_SINGL_ARG(" skb_rx_cnt: ", rtl_atomic_read(&priv->rtl_rx_skb_cnt) , "%d");
return pos;
}
#endif
static int rtl8192cd_proc_mib_11n(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" dot11nConfigEntry...", "%s", 1);
PRINT_SINGL_ARG(" supportedmcs: ", get_supported_mcs(priv), "%08x");
PRINT_SINGL_ARG(" basicmcs: ", priv->pmib->dot11nConfigEntry.dot11nBasicMCS, "%08x");
PRINT_SINGL_ARG(" use40M: ", priv->pmib->dot11nConfigEntry.dot11nUse40M, "%d");
PRINT_SINGL_ARG(" currBW: ", (!priv->pshare->is_40m_bw) ? 20 :(priv->pshare->is_40m_bw*40), "%dM");
PRINT_ONE(" 2ndchoffset: ", "%s", 0);
switch (priv->pshare->offset_2nd_chan) {
case HT_2NDCH_OFFSET_BELOW:
PRINT_ONE("below", "%s", 1);
break;
case HT_2NDCH_OFFSET_ABOVE:
PRINT_ONE("above", "%s", 1);
break;
default:
PRINT_ONE("dontcare", "%s", 1);
break;
}
#ifdef FOR_VHT5G_PF
PRINT_SINGL_ARG(" useOutSrc: ", priv->pshare->use_outsrc, "%d");
PRINT_SINGL_ARG(" CCA: ", priv->pshare->rf_ft_var.use_cca, "%d");
#endif
PRINT_SINGL_ARG(" shortGI20M: ", priv->pmib->dot11nConfigEntry.dot11nShortGIfor20M, "%d");
PRINT_SINGL_ARG(" shortGI40M: ", priv->pmib->dot11nConfigEntry.dot11nShortGIfor40M, "%d");
PRINT_SINGL_ARG(" stbc: ", priv->pmib->dot11nConfigEntry.dot11nSTBC, "%d");
PRINT_SINGL_ARG(" ldpc: ", priv->pmib->dot11nConfigEntry.dot11nLDPC, "%d");
PRINT_SINGL_ARG(" ampdu: ", priv->pmib->dot11nConfigEntry.dot11nAMPDU, "%d");
PRINT_SINGL_ARG(" amsdu: ", priv->pmib->dot11nConfigEntry.dot11nAMSDU, "%d");
PRINT_SINGL_ARG(" ampduSndSz: ", priv->pmib->dot11nConfigEntry.dot11nAMPDUSendSz, "%d");
PRINT_SINGL_ARG(" amsduMax: ", priv->pmib->dot11nConfigEntry.dot11nAMSDURecvMax, "%d");
PRINT_SINGL_ARG(" amsduTimeout: ", priv->pmib->dot11nConfigEntry.dot11nAMSDUSendTimeout, "%d");
PRINT_SINGL_ARG(" amsduNum: ", priv->pmib->dot11nConfigEntry.dot11nAMSDUSendNum, "%d");
PRINT_SINGL_ARG(" lgyEncRstrct: ", priv->pmib->dot11nConfigEntry.dot11nLgyEncRstrct, "%d");
#ifdef WIFI_11N_2040_COEXIST
PRINT_SINGL_ARG(" coexist: ", priv->pmib->dot11nConfigEntry.dot11nCoexist, "%d");
if (priv->pmib->dot11nConfigEntry.dot11nCoexist) {
#ifdef CLIENT_MODE
if (OPMODE & WIFI_STATION_STATE)
PRINT_SINGL_ARG(" coexist_connection: ", priv->coexist_connection, "%d");
if ((OPMODE & WIFI_AP_STATE) ||
((OPMODE & WIFI_STATION_STATE) && priv->coexist_connection))
#endif
PRINT_SINGL_ARG(" bg_ap_timeout: ", priv->bg_ap_timeout, "%d");
#ifdef CLIENT_MODE
if ((OPMODE & WIFI_STATION_STATE) && priv->coexist_connection) {
if (priv->bg_ap_timeout)
PRINT_ARRAY_ARG(" bg_ap_timeout_ch: ", priv->bg_ap_timeout_ch, "%d ", 14);
PRINT_SINGL_ARG(" intolerant_timeout: ", priv->intolerant_timeout, "%d");
} else
#endif
if (OPMODE & WIFI_AP_STATE) {
PRINT_SINGL_ARG(" force_20_sta: ", priv->force_20_sta, "0x%08x");
#ifdef CONFIG_RTL_88E_SUPPORT
if (GET_CHIP_VER(priv) == VERSION_8188E)
PRINT_SINGL_ARG(" force_20_sta_88e_hw_ext: ", priv->force_20_sta_88e_hw_ext, "0x%08x");
#endif
#ifdef STA_EXT
PRINT_SINGL_ARG(" force_20_sta_ext: ", priv->force_20_sta_ext, "0x%08x");
#endif
PRINT_SINGL_ARG(" switch_20_sta: ", priv->switch_20_sta, "0x%08x");
#ifdef CONFIG_RTL_88E_SUPPORT
if (GET_CHIP_VER(priv) == VERSION_8188E)
PRINT_SINGL_ARG(" switch_20_sta_88e_hw_ext: ", priv->switch_20_sta_88e_hw_ext, "0x%08x");
#endif
#ifdef STA_EXT
PRINT_SINGL_ARG(" switch_20_sta_ext: ", priv->switch_20_sta_ext, "0x%08x");
#endif
}
}
#endif
PRINT_SINGL_ARG(" txnoack: ", priv->pmib->dot11nConfigEntry.dot11nTxNoAck, "%d");
if (priv->ht_cap_len) {
unsigned char *pbuf = (unsigned char *)&priv->ht_cap_buf;
PRINT_ARRAY_ARG(" ht_cap: ", pbuf, "%02x", priv->ht_cap_len);
}
else {
PRINT_ONE(" ht_cap: none", "%s", 1);
}
if (priv->ht_ie_len) {
unsigned char *pbuf = (unsigned char *)&priv->ht_ie_buf;
PRINT_ARRAY_ARG(" ht_ie: ", pbuf, "%02x", priv->ht_ie_len);
}
else {
PRINT_ONE(" ht_ie: none", "%s", 1);
}
PRINT_SINGL_ARG(" legacy_obss_to: ", priv->ht_legacy_obss_to, "%d");
PRINT_SINGL_ARG(" nomember_legacy_sta_to: ", priv->ht_nomember_legacy_sta_to, "%d");
PRINT_SINGL_ARG(" legacy_sta_num: ", priv->ht_legacy_sta_num, "%d");
PRINT_SINGL_ARG(" 11nProtection: ", priv->ht_protection, "%d");
// PRINT_SINGL_ARG(" has_2r_sta: ", priv->pshare->has_2r_sta, "0x%08x");
return pos;
}
#ifdef CONFIG_RTL_92C_SUPPORT //#ifndef CONFIG_RTL_92D_SUPPORT
#ifndef __ECOS
static int rtl8192cd_proc_phypara_file_read(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int len=0;
if ((GET_CHIP_VER(priv) == VERSION_8192C)||(GET_CHIP_VER(priv) == VERSION_8188C)) {
if (priv->phypara_file_end <= (priv->phypara_file_start + offset + length)) {
*eof = 1;
len = priv->phypara_file_end - priv->phypara_file_start - offset;
}
else
len = length;
memcpy(buf, &priv->phypara_file_start[offset], len);
*start = buf;
return len;
}
return 0;
}
#ifdef CONFIG_RTL_KERNEL_MIPS16_WLAN
__NOMIPS16
#endif
static int rtl8192cd_proc_phypara_file_write(struct file *file, const char *buffer,
unsigned long count, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
char tmp[64];
if (count < 2)
return -EFAULT;
if (count > sizeof(tmp))
return -EINVAL;
if (buffer && !copy_from_user(tmp, buffer, count)) {
tmp[count-1] = '\0';
#ifdef TESTCHIP_SUPPORT
if (!strcmp(tmp, "AGC_TAB.txt")) {
priv->phypara_file_start = data_AGC_TAB_start;
priv->phypara_file_end = data_AGC_TAB_end;
}
else if (!strcmp(tmp, "PHY_REG_1T.txt")) {
priv->phypara_file_start = data_PHY_REG_1T_start;
priv->phypara_file_end = data_PHY_REG_1T_end;
}
else if (!strcmp(tmp, "PHY_REG_2T.txt")) {
priv->phypara_file_start = data_PHY_REG_2T_start;
priv->phypara_file_end = data_PHY_REG_2T_end;
}
else if (!strcmp(tmp, "radio_a_1T.txt")) {
priv->phypara_file_start = data_radio_a_1T_start;
priv->phypara_file_end = data_radio_a_1T_end;
}
else if (!strcmp(tmp, "radio_a_2T.txt")) {
priv->phypara_file_start = data_radio_a_2T_start;
priv->phypara_file_end = data_radio_a_2T_end;
}
else if (!strcmp(tmp, "radio_b_2T.txt")) {
priv->phypara_file_start = data_radio_b_2T_start;
priv->phypara_file_end = data_radio_b_2T_end;
}
else
#endif
if (!strcmp(tmp, "AGC_TAB_n.txt")) {
priv->phypara_file_start = data_AGC_TAB_n_92C_start;
priv->phypara_file_end = data_AGC_TAB_n_92C_end;
}
else if (!strcmp(tmp, "PHY_REG_1T_n.txt")) {
priv->phypara_file_start = data_PHY_REG_1T_n_start;
priv->phypara_file_end = data_PHY_REG_1T_n_end;
}
else if (!strcmp(tmp, "PHY_REG_2T_n.txt")) {
priv->phypara_file_start = data_PHY_REG_2T_n_start;
priv->phypara_file_end = data_PHY_REG_2T_n_end;
}
else if (!strcmp(tmp, "radio_a_2T_n.txt")) {
priv->phypara_file_start = data_radio_a_2T_n_start;
priv->phypara_file_end = data_radio_a_2T_n_end;
}
else if (!strcmp(tmp, "radio_b_2T_n.txt")) {
priv->phypara_file_start = data_radio_b_2T_n_start;
priv->phypara_file_end = data_radio_b_2T_n_end;
}
else if (!strcmp(tmp, "radio_a_1T_n.txt")) {
priv->phypara_file_start = data_radio_a_1T_n_start;
priv->phypara_file_end = data_radio_a_1T_n_end;
}
else if (!strcmp(tmp, "PHY_REG_PG.txt")) {
priv->phypara_file_start = data_PHY_REG_PG_92C_start;
priv->phypara_file_end = data_PHY_REG_PG_92C_end;
}
else if (!strcmp(tmp, "MACPHY_REG_92C.txt")) {
priv->phypara_file_start = data_MACPHY_REG_92C_start;//data_MACPHY_REG_92C_start
priv->phypara_file_end = data_MACPHY_REG_92C_end;
}
else if (!strcmp(tmp, "PHY_REG_MP_n.txt")) {
priv->phypara_file_start = data_PHY_REG_MP_n_92C_start;
priv->phypara_file_end = data_PHY_REG_MP_n_92C_end;
}
#ifdef HIGH_POWER_EXT_PA
else if (!strcmp(tmp, "AGC_TAB_n_hp.txt")) {
priv->phypara_file_start = data_AGC_TAB_n_hp_start;
priv->phypara_file_end = data_AGC_TAB_n_hp_end;
}
else if (!strcmp(tmp, "PHY_REG_2T_n_hp.txt")) {
priv->phypara_file_start = data_PHY_REG_2T_n_hp_start;
priv->phypara_file_end = data_PHY_REG_2T_n_hp_end;
}
#endif
#ifdef HIGH_POWER_EXT_PA
else if (!strcmp(tmp, "radio_a_2T_n_lna.txt")) {
priv->phypara_file_start = data_radio_a_2T_n_lna_start;
priv->phypara_file_end = data_radio_a_2T_n_lna_end;
}
else if (!strcmp(tmp, "radio_b_2T_n_lna.txt")) {
priv->phypara_file_start = data_radio_b_2T_n_lna_start;
priv->phypara_file_end = data_radio_b_2T_n_lna_end;
}
#endif
#ifdef HIGH_POWER_EXT_PA
else if (!strcmp(tmp, "radio_a_2T_n_hp.txt")) {
priv->phypara_file_start = data_radio_a_2T_n_hp_start;
priv->phypara_file_end = data_radio_a_2T_n_hp_end;
}
else if (!strcmp(tmp, "radio_b_2T_n_hp.txt")) {
priv->phypara_file_start = data_radio_b_2T_n_hp_start;
priv->phypara_file_end = data_radio_b_2T_n_hp_end;
}
else if (!strcmp(tmp, "PHY_REG_PG_hp.txt")) {
priv->phypara_file_start = data_PHY_REG_PG_hp_start;
priv->phypara_file_end = data_PHY_REG_PG_hp_end;
}
#endif
else {
panic_printk("No file of \"%s\"\n", tmp);
panic_printk("PHY parameter file name list:\n"
#ifdef TESTCHIP_SUPPORT
"\tAGC_TAB.txt\n"
"\tPHY_REG_1T.txt\n"
"\tPHY_REG_2T.txt\n"
"\tradio_a_1T.txt\n"
"\tradio_a_2T.txt\n"
"\tradio_b_2T.txt\n"
#endif
"\tAGC_TAB_n_92C.txt\n"
"\tPHY_REG_1T_n.txt\n"
"\tPHY_REG_2T_n.txt\n"
"\tradio_a_2T_n.txt\n"
"\tradio_b_2T_n.txt\n"
"\tradio_a_1T_n.txt\n"
"\tPHY_REG_PG.txt\n"
"\tMACPHY_REG_92C.txt\n"
"\tPHY_REG_MP_n.txt\n"
"\tAGC_TAB_n_hp.txt\n"
"\tPHY_REG_2T_n_hp.txt\n"
"\tradio_a_2T_n_lna.txt\n"
"\tradio_b_2T_n_lna.txt\n"
#ifdef HIGH_POWER_EXT_PA
"\tradio_a_2T_n_hp.txt\n"
"\tradio_b_2T_n_hp.txt\n"
"\tPHY_REG_PG_hp.txt\n"
#endif
);
return count;
}
}
panic_printk("Ready to dump \"%s\"\n", tmp);
return count;
}
#endif
#endif
#ifdef AUTO_TEST_SUPPORT
static int rtl8192cd_proc_SSR_read(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int len = 0;
off_t begin = 0;
off_t pos = 0, base;
int size;
int i1;
unsigned char tmp[6];
//wait SiteSurvey completed
if(priv->ss_req_ongoing) {
PRINT_ONE("waitting", "%s", 1);
len = pos;
}else{
PRINT_ONE(" SiteSurvey result : ", "%s", 1);
PRINT_ONE(" ====================", "%s", 1);
if(priv->site_survey.count_backup==0){
PRINT_ONE("none", "%s", 1);
len = pos;
}else{
len = pos;
for(i1=0; i1<priv->site_survey.count_backup ;i1++){
base = pos;
memcpy(tmp,priv->site_survey.bss_backup[i1].bssid,MACADDRLEN);
/*
panic_printk("Mac=%02X%02X%02X:%02X%02X%02X ;Channel=%02d ;SSID:%s \n",
tmp[0],tmp[1],tmp[2],tmp[3],tmp[4],tmp[5]
,priv->site_survey.bss_backup[i1].channel
,priv->site_survey.bss_backup[i1].ssid
);
*/
PRINT_ARRAY_ARG(" HwAddr: ", tmp, "%02x", MACADDRLEN);
PRINT_SINGL_ARG(" Channel: ", priv->site_survey.bss_backup[i1].channel, "%d");
PRINT_SINGL_ARG(" SSID: ", priv->site_survey.bss_backup[i1].ssid, "%s");
PRINT_SINGL_ARG(" Type: ", ((priv->site_survey.bss_backup[i1].bsstype == 16) ? "AP" : "Ad-Hoc"), "%s");
//PRINT_SINGL_ARG(" Type: ", priv->site_survey.bss_backup[i1].bsstype, "%d");
PRINT_ONE(" ====================", "%s", 1);
size = pos - base;
CHECK_LEN;
pos = len;
}
}
}
*eof = 1;
_ret:
*start = buf + (offset - begin); /* Start of wanted data */
len -= (offset - begin); /* Start slop */
if (len > length)
len = length; /* Ending slop */
return len;
}
#endif
#ifdef CLIENT_MODE
static int rtl8192cd_proc_up_read(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int len = 0;
#ifdef __ECOS
ecos_pr_fun("%d\n",priv->up_flag);
#else
len=sprintf(buf,"%d",priv->up_flag);
#endif
return len;
}
#ifdef __ECOS
void rtl8192cd_proc_up_write(char *tmp, void *data)
#else
static int rtl8192cd_proc_up_write(struct file *file, const char *buffer,
unsigned long count, void *data)
#endif
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
#ifdef __KERNEL__
char tmp[4];
#endif
#ifdef __ECOS
if(0 == (tmp[0]-'0'))
priv->up_flag = 0;
#else
if (buffer && !copy_from_user(tmp, buffer, 4)) {
if(0 == (tmp[0]-'0'))
priv->up_flag = 0;
}
return count;
#endif
}
#endif
#ifdef CONFIG_RTK_VLAN_SUPPORT
static int rtl8192cd_proc_vlan_read(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" vlan setting...", "%s", 1);
PRINT_SINGL_ARG(" global_vlan: ", priv->pmib->vlan.global_vlan, "%d");
PRINT_SINGL_ARG(" is_lan: ", priv->pmib->vlan.is_lan, "%d");
PRINT_SINGL_ARG(" vlan_enable: ", priv->pmib->vlan.vlan_enable, "%d");
PRINT_SINGL_ARG(" vlan_tag: ", priv->pmib->vlan.vlan_tag, "%d");
PRINT_SINGL_ARG(" vlan_id: ", priv->pmib->vlan.vlan_id, "%d");
PRINT_SINGL_ARG(" vlan_pri: ", priv->pmib->vlan.vlan_pri, "%d");
PRINT_SINGL_ARG(" vlan_cfi: ", priv->pmib->vlan.vlan_cfi, "%d");
#if defined(CONFIG_RTK_VLAN_NEW_FEATURE)
PRINT_SINGL_ARG(" vlan_forwarding_rule: ", priv->pmib->vlan.forwarding_rule, "%d");
#endif
return pos;
}
#ifdef CONFIG_RTL_KERNEL_MIPS16_WLAN
__NOMIPS16
#endif
static int rtl8192cd_proc_vlan_write(struct file *file, const char *buffer,
unsigned long count, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
char tmp[128];
if (count < 2)
return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, 128)) {
#if defined(CONFIG_RTK_VLAN_NEW_FEATURE)
int num = sscanf(tmp, "%d %d %d %d %d %d %d %d",
#else
int num = sscanf(tmp, "%d %d %d %d %d %d %d",
#endif
&priv->pmib->vlan.global_vlan, &priv->pmib->vlan.is_lan,
&priv->pmib->vlan.vlan_enable, &priv->pmib->vlan.vlan_tag,
&priv->pmib->vlan.vlan_id, &priv->pmib->vlan.vlan_pri,
&priv->pmib->vlan.vlan_cfi
#if defined(CONFIG_RTK_VLAN_NEW_FEATURE)
, &priv->pmib->vlan.forwarding_rule
#endif
);
#if defined(CONFIG_RTK_VLAN_NEW_FEATURE)
if (num != 8)
#else
if (num != 7)
#endif
{
panic_printk("invalid vlan parameter!\n");
}
}
#if defined(CONFIG_RTK_VLAN_NEW_FEATURE)
rtl_add_vlan_info((struct vlan_info *)&priv->pmib->vlan, dev);
#endif
return count;
}
#endif // CONFIG_RTK_VLAN_SUPPORT
#ifdef SUPPORT_MULTI_PROFILE
static int rtl8192cd_proc_mib_ap_profile(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0, i;
unsigned char tmpbuf[100];
PRINT_ONE(" Client Profile...", "%s", 1);
PRINT_SINGL_ARG(" enable_profile: ", priv->pmib->ap_profile.enable_profile, "%d");
PRINT_SINGL_ARG(" profile_num: ", priv->pmib->ap_profile.profile_num, "%d");
PRINT_SINGL_ARG(" in_use_profile: ", ((priv->profile_idx == 0) ? (priv->pmib->ap_profile.profile_num-1) : (priv->profile_idx-1)), "%d");
for (i=0; i<priv->pmib->ap_profile.profile_num && i<PROFILE_NUM; i++) {
sprintf(tmpbuf, " profile[%d]...", i);
PRINT_ONE(tmpbuf, "%s", 1);
PRINT_SINGL_ARG(" ssid: ", priv->pmib->ap_profile.profile[i].ssid, "%s");
PRINT_SINGL_ARG(" encryption: ", priv->pmib->ap_profile.profile[i].encryption, "%d");
PRINT_SINGL_ARG(" auth_type: ", priv->pmib->ap_profile.profile[i].auth_type, "%d");
if (priv->pmib->ap_profile.profile[i].encryption == 1 || priv->pmib->ap_profile.profile[i].encryption == 2) {
PRINT_SINGL_ARG(" wep_default_key: ", priv->pmib->ap_profile.profile[i].wep_default_key, "%d");
if (priv->pmib->ap_profile.profile[i].encryption == 1) {
PRINT_ARRAY_ARG(" wep_key1: ", priv->pmib->ap_profile.profile[i].wep_key1, "%02x", 5);
PRINT_ARRAY_ARG(" wep_key2: ", priv->pmib->ap_profile.profile[i].wep_key2, "%02x", 5);
PRINT_ARRAY_ARG(" wep_key3: ", priv->pmib->ap_profile.profile[i].wep_key3, "%02x", 5);
PRINT_ARRAY_ARG(" wep_key4: ", priv->pmib->ap_profile.profile[i].wep_key4, "%02x", 5);
}
else {
PRINT_ARRAY_ARG(" wep_key1: ", priv->pmib->ap_profile.profile[i].wep_key1, "%02x", 13);
PRINT_ARRAY_ARG(" wep_key2: ", priv->pmib->ap_profile.profile[i].wep_key2, "%02x", 13);
PRINT_ARRAY_ARG(" wep_key3: ", priv->pmib->ap_profile.profile[i].wep_key3, "%02x", 13);
PRINT_ARRAY_ARG(" wep_key4: ", priv->pmib->ap_profile.profile[i].wep_key4, "%02x", 13);
}
}
else if (priv->pmib->ap_profile.profile[i].encryption == 3 || priv->pmib->ap_profile.profile[i].encryption == 4) {
PRINT_SINGL_ARG(" wpa_cipher: ", priv->pmib->ap_profile.profile[i].wpa_cipher, "%d");
PRINT_SINGL_ARG(" wpa_psk: ", priv->pmib->ap_profile.profile[i].wpa_psk, "%s");
}
}
return pos;
}
#endif // SUPPORT_MULTI_PROFILE
static int rtl8192cd_proc_mib_misc(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" miscEntry...", "%s", 1);
PRINT_SINGL_ARG(" show_hidden_bss: ", priv->pmib->miscEntry.show_hidden_bss, "%d");
PRINT_SINGL_ARG(" ack_timeout: ", (unsigned char)priv->pmib->miscEntry.ack_timeout, "%d");
PRINT_ARRAY_ARG(" private_ie: ", priv->pmib->miscEntry.private_ie, "%02x", priv->pmib->miscEntry.private_ie_len);
PRINT_SINGL_ARG(" rxInt: ", priv->pmib->miscEntry.rxInt_thrd, "%d");
#ifdef DRVMAC_LB
PRINT_SINGL_ARG(" dmlb: ", priv->pmib->miscEntry.drvmac_lb, "%d");
PRINT_ARRAY_ARG(" lb_da: ", priv->pmib->miscEntry.lb_da, "%02x", MACADDRLEN);
PRINT_SINGL_ARG(" lb_tps: ", priv->pmib->miscEntry.lb_tps, "%d");
#endif
PRINT_SINGL_ARG(" groupID: ", priv->pmib->miscEntry.groupID, "%d");
PRINT_SINGL_ARG(" rc_enable: ", priv->pmib->reorderCtrlEntry.ReorderCtrlEnable, "%d");
PRINT_SINGL_ARG(" rc_winsz: ", priv->pmib->reorderCtrlEntry.ReorderCtrlWinSz, "%d");
PRINT_SINGL_ARG(" rc_timeout: ", priv->pmib->reorderCtrlEntry.ReorderCtrlTimeout, "%d");
PRINT_SINGL_ARG(" vap_enable: ", priv->pmib->miscEntry.vap_enable, "%d");
#if defined(RESERVE_TXDESC_FOR_EACH_IF) && (defined(UNIVERSAL_REPEATER) || defined(MBSSID))
PRINT_SINGL_ARG(" rsv_txdesc: ", GET_ROOT(priv)->pmib->miscEntry.rsv_txdesc, "%d");
#endif
#ifdef USE_TXQUEUE
PRINT_SINGL_ARG(" use_txq: ", GET_ROOT(priv)->pmib->miscEntry.use_txq, "%d");
#endif
PRINT_SINGL_ARG(" func_off: ", priv->pmib->miscEntry.func_off, "%d");
#ifdef TX_EARLY_MODE
PRINT_SINGL_ARG(" em_waitq_on: ", GET_ROOT(priv)->pshare->em_waitq_on, "%d");
#endif
#if defined(WIFI_11N_2040_COEXIST_EXT)
PRINT_SINGL_ARG(" 40M map: ", priv->pshare->_40m_staMap, "%x");
#ifdef STA_EXT
PRINT_SINGL_ARG(" 40M map_ext: ", priv->pshare->_40m_staMap_ext, "%x");
#endif
PRINT_SINGL_ARG(" bws: ", priv->pshare->bws_triggered, "%d");
#endif
#ifdef CONFIG_WLAN_HAL
PRINT_SINGL_ARG(" H2C full ctr: ", priv->pshare->h2c_box_full, "%d");
#endif
return pos;
}
#ifdef WIFI_SIMPLE_CONFIG
static int rtl8192cd_proc_mib_wsc(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
PRINT_ONE(" wscEntry...", "%s", 1);
PRINT_SINGL_ARG(" wsc_enable: ", priv->pmib->wscEntry.wsc_enable, "%d");
PRINT_ARRAY_ARG(" beacon_ie: ",
priv->pmib->wscEntry.beacon_ie, "%02x", priv->pmib->wscEntry.beacon_ielen);
PRINT_SINGL_ARG(" beacon_ielen: ", priv->pmib->wscEntry.beacon_ielen, "%d");
PRINT_ARRAY_ARG(" probe_rsp_ie: ",
priv->pmib->wscEntry.probe_rsp_ie, "%02x", priv->pmib->wscEntry.probe_rsp_ielen);
PRINT_SINGL_ARG(" probe_rsp_ielen: ", priv->pmib->wscEntry.probe_rsp_ielen, "%d");
PRINT_ARRAY_ARG(" probe_req_ie: ",
priv->pmib->wscEntry.probe_req_ie, "%02x", priv->pmib->wscEntry.probe_req_ielen);
PRINT_SINGL_ARG(" probe_req_ielen: ", priv->pmib->wscEntry.probe_req_ielen, "%d");
PRINT_ARRAY_ARG(" assoc_ie: ",
priv->pmib->wscEntry.assoc_ie, "%02x", priv->pmib->wscEntry.assoc_ielen);
PRINT_SINGL_ARG(" assoc_ielen: ", priv->pmib->wscEntry.assoc_ielen, "%d");
return pos;
}
#endif
static int rtl8192cd_proc_mib_all(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int len = 0;
#ifdef __KERNEL__
off_t begin = 0;
off_t pos = 0;
#endif
int size;
#ifdef __ECOS
ecos_pr_fun(" Make info: v%d.%d (%s)\n", DRV_VERSION_H, DRV_VERSION_L, DRV_RELDATE);
#else
size = sprintf(buf, " Make info: v%d.%d (%s)\n", DRV_VERSION_H, DRV_VERSION_L, DRV_RELDATE);
CHECK_LEN;
#endif
#ifdef CONFIG_RTL_88E_SUPPORT
if (GET_CHIP_VER(priv) != VERSION_8188E)
#endif
{
#ifdef __ECOS
ecos_pr_fun(" RTL8192 firmware version: %d.%d, built time: %02x-%02x %02x:%02x\n", priv->pshare->fw_version,
priv->pshare->fw_sub_version, priv->pshare->fw_date_month, priv->pshare->fw_date_day,
priv->pshare->fw_date_hour, priv->pshare->fw_date_minute);
#else
size = sprintf(buf+len, " RTL8192 firmware version: %d.%d, built time: %02x-%02x %02x:%02x\n", priv->pshare->fw_version,
priv->pshare->fw_sub_version, priv->pshare->fw_date_month, priv->pshare->fw_date_day,
priv->pshare->fw_date_hour, priv->pshare->fw_date_minute);
CHECK_LEN;
#endif
}
size = rtl8192cd_proc_mib_rf(buf+len, start, offset, length, eof, data);
CHECK_LEN;
size = rtl8192cd_proc_mib_operation(buf+len, start, offset, length, eof, data);
CHECK_LEN;
size = rtl8192cd_proc_mib_staconfig(buf+len, start, offset, length, eof, data);
CHECK_LEN;
size = rtl8192cd_proc_mib_dkeytbl(buf+len, start, offset, length, eof, data);
CHECK_LEN;
size = rtl8192cd_proc_mib_auth(buf+len, start, offset, length, eof, data);
CHECK_LEN;
size = rtl8192cd_proc_mib_gkeytbl(buf+len, start, offset, length, eof, data);
CHECK_LEN;
size = rtl8192cd_proc_mib_bssdesc(buf+len, start, offset, length, eof, data);
CHECK_LEN;
size = rtl8192cd_proc_mib_erp(buf+len, start, offset, length, eof, data);
CHECK_LEN;
size = rtl8192cd_proc_mib_misc(buf+len, start, offset, length, eof, data);
CHECK_LEN;
size = rtl8192cd_proc_mib_wsc(buf+len, start, offset, length, eof, data);
CHECK_LEN;
#ifdef WDS
size = rtl8192cd_proc_mib_wds(buf+len, start, offset, length, eof, data);
CHECK_LEN;
#endif
#ifdef RTK_BR_EXT
size = rtl8192cd_proc_mib_brext(buf+len, start, offset, length, eof, data);
CHECK_LEN;
#endif
#ifdef DFS
size = rtl8192cd_proc_mib_DFS(buf+len, start, offset, length, eof, data);
CHECK_LEN;
#endif
#if defined(CONFIG_RTL_8812_SUPPORT) || defined(CONFIG_WLAN_HAL_8881A)
size = rtl8192cd_proc_mib_rf_ac(buf+len, start, offset, length, eof, data);
CHECK_LEN;
#endif
size = rtl8192cd_proc_mib_11n(buf+len, start, offset, length, eof, data);
CHECK_LEN;
#ifdef CONFIG_RTK_VLAN_SUPPORT
size = rtl8192cd_proc_vlan_read(buf+len, start, offset, length, eof, data);
CHECK_LEN;
#endif
#ifdef SUPPORT_MULTI_PROFILE
size = rtl8192cd_proc_mib_ap_profile(buf+len, start, offset, length, eof, data);
CHECK_LEN;
#endif
#ifdef __KERNEL__
*eof = 1;
_ret:
*start = buf + (offset - begin); /* Start of wanted data */
len -= (offset - begin); /* Start slop */
if (len > length)
len = length; /* Ending slop */
#endif
return len;
}
#ifdef __ECOS
#define CHECK_LEN_B do {} while(0)
#else
#define MAX_CHAR_IN_A_LINE 80
// macro "CHECK_LEN_B" is used in dump_one_stainfo() only
#define CHECK_LEN_B { \
if (pos > (remained_len - MAX_CHAR_IN_A_LINE)) {\
return pos; \
} \
}
#endif
//static int dump_one_stainfo(int num, struct stat_info *pstat, char *buf, char **start,
// off_t offset, int length, int *eof, void *data)
static int dump_one_stainfo(int num, struct rtl8192cd_priv *priv, struct stat_info *pstat, char *buf,
off_t offset, int length, int remained_len, int *rc)
{
int pos = 0, idx = 0;
unsigned int m, n;
char tmp[32];
//unsigned short rate;
unsigned char tmpbuf[16];
unsigned char *rate;
PRINT_ONE(num, " %d: stat_info...", 1);
CHECK_LEN_B;
PRINT_SINGL_ARG(" state: ", pstat->state, "%x");
CHECK_LEN_B;
PRINT_SINGL_ARG(" AuthAlgrthm: ", pstat->AuthAlgrthm, "%d");
CHECK_LEN_B;
PRINT_SINGL_ARG(" ieee8021x_ctrlport: ", pstat->ieee8021x_ctrlport, "%d");
CHECK_LEN_B;
PRINT_ARRAY_ARG(" hwaddr: ", pstat->hwaddr, "%02x", MACADDRLEN);
CHECK_LEN_B;
PRINT_ARRAY_ARG(" bssrateset: ", pstat->bssrateset, "%02x", pstat->bssratelen);
CHECK_LEN_B;
PRINT_SINGL_ARG(" aid: ", pstat->aid, "%d");
CHECK_LEN_B;
PRINT_SINGL_ARG(" tx_bytes: ", pstat->tx_bytes, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" rx_bytes: ", pstat->rx_bytes, "%u");
CHECK_LEN_B;
#ifdef RADIUS_ACCOUNTING
PRINT_SINGL_ARG(" tx_bytes per minute: ", pstat->tx_bytes_1m, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" rx_bytes per minute: ", pstat->rx_bytes_1m, "%u");
CHECK_LEN_B;
#endif
PRINT_SINGL_ARG(" tx_pkts: ", pstat->tx_pkts, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" rx_pkts: ", pstat->rx_pkts, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" tx_fail: ", pstat->tx_fail, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" tx_avarage: ", pstat->tx_avarage, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" rx_avarage: ", pstat->rx_avarage, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" dz_queue_len: ", skb_queue_len(&pstat->dz_queue), "%u");
CHECK_LEN_B;
#ifdef SW_TX_QUEUE
//for debug
#if 0
PRINT_SINGL_ARG(" tx_av: ", pstat->tx_avarage, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" tx_agn: ", pstat->aggn_cnt, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" tx_be_tout: ", pstat->be_timeout_cnt, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" tx_bk_tout: ", pstat->bk_timeout_cnt, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" tx_vi_tout: ", pstat->vi_timeout_cnt, "%u");
CHECK_LEN_B;
PRINT_SINGL_ARG(" tx_vo_tout: ", pstat->vo_timeout_cnt, "%u");
CHECK_LEN_B;
#endif
#endif
PRINT_ONE(" rssi: ", "%s", 0);
PRINT_ONE(pstat->rssi, "%u", 0);
PRINT_ONE(pstat->rf_info.mimorssi[0], " (%u", 0);
PRINT_ONE(pstat->rf_info.mimorssi[1], " %u", 0);
PRINT_ONE(")", "%s", 1);
CHECK_LEN_B;
#ifdef WDS
if (pstat->state & WIFI_WDS
#ifdef LAZY_WDS
&& !(pstat->state & WIFI_WDS_LAZY)
#endif
) {
PRINT_SINGL_ARG(" idle_time: ", pstat->idle_time, "%d");
CHECK_LEN_B;
}
else
#endif
{
PRINT_SINGL_ARG(" expired_time: ", pstat->expire_to, "%d");
CHECK_LEN_B;
}
PRINT_SINGL_ARG(" sleep: ", (!list_empty(&pstat->sleep_list) ? "yes" : "no"), "%s");
CHECK_LEN_B;
#ifdef STA_EXT
PRINT_SINGL_ARG(" sta_in_firmware_mem: ",(pstat->sta_in_firmware == -1 ? "removed" : ((pstat->sta_in_firmware) == 0 ? "no":"yes")), "%s" );
CHECK_LEN_B;
PRINT_SINGL_ARG(" remapped_aid: ", pstat->remapped_aid, "%d");
CHECK_LEN_B;
#endif
#ifdef RTK_AC_SUPPORT //vht rate , todo, dump vht rates in Mbps
if(pstat->current_tx_rate >= 0x90){
int rate = query_vht_rate(pstat);
PRINT_ONE(" current_tx_rate: VHT ", "%s", 0);
PRINT_ONE(pstat->current_tx_rate, "0x%x", 0);
PRINT_ONE(rate, " %d", 1);
CHECK_LEN_B;
}
else
#endif
if (is_MCS_rate(pstat->current_tx_rate)) {
PRINT_ONE(" current_tx_rate: MCS", "%s", 0);
// PRINT_ONE(pstat->current_tx_rate&0x7f, "%d", 0);
PRINT_ONE(pstat->current_tx_rate&0xf, "%d", 0);
// rate = (unsigned char *)MCS_DATA_RATEStr[(pstat->ht_current_tx_info&BIT(0))?1:0][(pstat->ht_current_tx_info&BIT(1))?1:0][pstat->current_tx_rate&0x7f];
rate = (unsigned char *)MCS_DATA_RATEStr[(pstat->ht_current_tx_info&BIT(0))?1:0][(pstat->ht_current_tx_info&BIT(1))?1:0][pstat->current_tx_rate&0xf];
PRINT_ONE(rate, " %s", 1);
CHECK_LEN_B;
}
else
{
PRINT_SINGL_ARG(" current_tx_rate: ", pstat->current_tx_rate/2, "%d");
CHECK_LEN_B;
}
#ifdef RTK_AC_SUPPORT //vht rate , todo, dump vht rates in Mbps
if(pstat->rx_rate >= 0x90){
PRINT_ONE(" rx_rate: VHT ", "%s", 0);
PRINT_ONE(pstat->rx_rate, "0x%x", 1);
CHECK_LEN_B;
}
else
#endif
if (is_MCS_rate(pstat->rx_rate)) {
PRINT_ONE(" current_rx_rate: MCS", "%s", 0);
// PRINT_ONE(pstat->rx_rate&0x7f, "%d", 0);
PRINT_ONE(pstat->rx_rate&0xf, "%d", 0);
// rate = (unsigned char *)MCS_DATA_RATEStr[pstat->rx_bw][pstat->rx_splcp][pstat->rx_rate&0x7f];
rate = (unsigned char *)MCS_DATA_RATEStr[pstat->rx_bw&0x01][pstat->rx_splcp&0x01][pstat->rx_rate&0xf];
PRINT_ONE(rate, " %s", 1);
CHECK_LEN_B;
}
else
{
PRINT_SINGL_ARG(" current_rx_rate: ", pstat->rx_rate/2, "%d");
CHECK_LEN_B;
}
//8812_client tx_bw rx_bw ??
PRINT_SINGL_ARG(" rx_bw: ", (0x1<<(pstat->rx_bw))*20, "%dM");
CHECK_LEN_B;
PRINT_SINGL_ARG(" tx_bw: ", (pstat->tx_bw ? (pstat->tx_bw*40) : 20), "%dM");
//PRINT_SINGL_ARG(" tx_bw: ", (0x1<<(pstat->tx_bw))*20, "%dM");
CHECK_LEN_B;
#ifdef RTK_AC_SUPPORT
PRINT_SINGL_ARG(" nss: ", (pstat->nss), "%d");
CHECK_LEN_B;
PRINT_SINGL_ARG(" support_mcs: ", cpu_to_le32(pstat->vht_cap_buf.vht_support_mcs[0]), "%x");
CHECK_LEN_B;
#endif
PRINT_SINGL_ARG(" hp_level: ", pstat->hp_level, "%d");
CHECK_LEN_B;
#ifdef WIFI_WMM
PRINT_SINGL_ARG(" QoS Enable: ", pstat->QosEnabled, "%d");
CHECK_LEN_B;
#ifdef WMM_APSD
PRINT_SINGL_ARG(" APSD bitmap: ", pstat->apsd_bitmap, "0x%01x");
CHECK_LEN_B;
#endif
#endif
PRINT_SINGL_ARG(" tx_ra_bitmap: ", pstat->tx_ra_bitmap, "0x%08x");
if (pstat->is_realtek_sta)
sprintf((char *)tmpbuf, "Realtek");
else if (pstat->IOTPeer==HT_IOT_PEER_BROADCOM)
sprintf((char *)tmpbuf, "Broadcom");
else if (pstat->IOTPeer==HT_IOT_PEER_MARVELL)
sprintf((char *)tmpbuf, "Marvell");
else if (pstat->IOTPeer==HT_IOT_PEER_INTEL)
sprintf((char *)tmpbuf, "Intel");
else if (pstat->IOTPeer==HT_IOT_PEER_RALINK)
sprintf((char *)tmpbuf, "Ralink");
else
sprintf((char *)tmpbuf, "--");
PRINT_SINGL_ARG(" Chip Vendor: ", tmpbuf, "%s");
CHECK_LEN_B;
#ifdef RTK_WOW
if (pstat->is_realtek_sta) {
PRINT_SINGL_ARG(" is_rtk_wow_sta: ", (pstat->is_rtk_wow_sta? "yes":"no"), "%s");
CHECK_LEN_B;
}
#endif
m = pstat->link_time / 86400;
n = pstat->link_time % 86400;
if (m) idx += sprintf(tmp, "%d day ", m);
m = n / 3600;
n = n % 3600;
if (m) idx += sprintf(tmp+idx, "%d hr ", m);
m = n / 60;
n = n % 60;
if (m) idx += sprintf(tmp+idx, "%d min ", m);
idx += sprintf(tmp+idx, "%d sec ", n);
PRINT_SINGL_ARG(" link_time: ", tmp, "%s");
CHECK_LEN_B;
if (pstat->private_ie_len) {
PRINT_ARRAY_ARG(" private_ie: ", pstat->private_ie, "%02x", pstat->private_ie_len);
CHECK_LEN_B;
}
if (pstat->ht_cap_len) {
unsigned char *pbuf = (unsigned char *)&pstat->ht_cap_buf;
PRINT_ARRAY_ARG(" ht_cap: ", pbuf, "%02x", pstat->ht_cap_len);
CHECK_LEN_B;
PRINT_ONE(" 11n MIMO ps: ", "%s", 0);
if (!(pstat->MIMO_ps)) {
PRINT_ONE("no limit", "%s", 1);
}
else {
PRINT_ONE(((pstat->MIMO_ps&BIT(0))?"static":"dynamic"), "%s", 1);
}
CHECK_LEN_B;
PRINT_SINGL_ARG(" Is_8K_AMSDU: ", pstat->is_8k_amsdu, "%d");
CHECK_LEN_B;
PRINT_SINGL_ARG(" amsdu_level: ", pstat->amsdu_level, "%d");
CHECK_LEN_B;
PRINT_SINGL_ARG(" diffAmpduSz: 0x", pstat->diffAmpduSz, "%x");
CHECK_LEN_B;
switch (pstat->aggre_mthd) {
case AGGRE_MTHD_MPDU:
sprintf(tmp, "AMPDU");
break;
case AGGRE_MTHD_MSDU:
sprintf(tmp, "AMSDU");
break;
case AGGRE_MTHD_MPDU_AMSDU:
sprintf(tmp, "AMPDU_AMSDU");
break;
default:
sprintf(tmp, "None");
break;
}
PRINT_SINGL_ARG(" aggre mthd: ", tmp, "%s");
CHECK_LEN_B;
#ifdef _DEBUG_RTL8192CD_
PRINT_ONE(" ch_width: ", "%s", 0);
PRINT_ONE((pstat->ht_cap_buf.ht_cap_info & cpu_to_le16(_HTCAP_SUPPORT_CH_WDTH_))?"40M":"20M", "%s", 1);
CHECK_LEN_B;
PRINT_ONE(" ampdu_mf: ", "%s", 0);
PRINT_ONE(pstat->ht_cap_buf.ampdu_para & 0x03, "%d", 1);
CHECK_LEN_B;
PRINT_ONE(" ampdu_amd: ", "%s", 0);
PRINT_ONE((pstat->ht_cap_buf.ampdu_para & _HTCAP_AMPDU_SPC_MASK_) >> _HTCAP_AMPDU_SPC_SHIFT_, "%d", 1);
CHECK_LEN_B;
#endif
}
else {
PRINT_ONE(" ht_cap: none", "%s", 1);
CHECK_LEN_B;
}
#ifdef SUPPORT_TX_MCAST2UNI
PRINT_SINGL_ARG(" ipmc_num: ", pstat->ipmc_num, "%d");
CHECK_LEN_B;
for (idx=0; idx<MAX_IP_MC_ENTRY; idx++) {
if (pstat->ipmc[idx].used) {
PRINT_ARRAY_ARG(" mcmac: ", pstat->ipmc[idx].mcmac, "%02x", MACADDRLEN);
CHECK_LEN_B;
}
}
#endif
#ifdef CLIENT_MODE
if (pstat->ht_ie_len) {
unsigned char *pbuf = (unsigned char *)&pstat->ht_ie_buf;
PRINT_ARRAY_ARG(" ht_ie: ", pbuf, "%02x", pstat->ht_ie_len);
CHECK_LEN_B;
}
else {
PRINT_ONE(" ht_ie: none", "%s", 1);
CHECK_LEN_B;
}
//8812_client
#ifdef RTK_AC_SUPPORT
if (pstat->vht_cap_len) {
unsigned char *pbuf = (unsigned char *)&pstat->vht_cap_buf;
PRINT_ARRAY_ARG(" vht_cap_ie: ", pbuf, "%02x", pstat->vht_cap_len);
CHECK_LEN_B;
}
else {
PRINT_ONE(" vht_cap_ie: none", "%s", 1);
CHECK_LEN_B;
}
if (pstat->vht_oper_len) {
unsigned char *pbuf = (unsigned char *)&pstat->vht_oper_buf;
PRINT_ARRAY_ARG(" vht_oper_ie: ", pbuf, "%02x", pstat->vht_oper_len);
CHECK_LEN_B;
}
else {
PRINT_ONE(" vht_oper_ie: none", "%s", 1);
CHECK_LEN_B;
}
#endif
#endif
PRINT_ONE("", "%s", 1);
*rc = 1; //finished, assign okay to return code.
return pos;
}
#ifdef __KERNEL__
static int read_sta_info_down;
#endif
static int rtl8192cd_proc_stainfo(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int len = 0, rc=1;
off_t begin = 0;
#ifdef __KERNEL__
off_t pos = 0;
#endif
int size, num=1;
struct list_head *phead, *plist;
struct stat_info *pstat;
unsigned long flags=0;
#ifdef __KERNEL__
if (offset == 0) // first calling, reset read_sta_info_down variable
read_sta_info_down = 0;
// first, kernel call me with length=3072; second, kernel call me with length=1024,
// third, , kernel call me with length < 1024, I just return 0 when length < 1024 to avoid wasting time.
if (length < 1024) {
return 0;
}
// do not waste time again
// I sent *eof=1 last time, I do not know why the kernel will call me again.
if (read_sta_info_down) {
*eof = 1;
return 0;
}
#endif
SAVE_INT_AND_CLI(flags);
// !!! it REALLY waste the cpu time ==> it will do from beginning when kernel call rtl8192cd_proc_stainfo() function again and again.
#ifdef __ECOS
ecos_pr_fun("-- STA info table -- (active: %d)\n", priv->assoc_num);
#else
size = sprintf(buf, "-- STA info table -- (active: %d)\n", priv->assoc_num);
CHECK_LEN;
#endif
phead = &priv->asoc_list;
if (!netif_running(dev) || list_empty(phead)) {
*eof = 1;
goto _ret;
}
plist = phead->next;
while (plist != phead) {
pstat = list_entry(plist, struct stat_info, asoc_list);
#ifdef __KERNEL__
// (length - len) : the remained length can be used.
if ((length - len) < MAX_CHAR_IN_A_LINE)
goto _ret;
rc = 0; // return code, assume error by default
#endif
//size = dump_one_stainfo(num++, pstat, buf+len, start, offset, length, eof, data);
size = dump_one_stainfo(num++, priv, pstat, buf+len, offset, length, (length - len), &rc);
CHECK_LEN;
#ifdef CONFIG_RTK_MESH
if (rc == 0)
break;
// 3 line for Throughput statistics (sounder)
size = dump_mesh_one_mpflow_sta(num, pstat, buf+len, start, offset, length,
eof, data);
CHECK_LEN;
#endif
plist = plist->next;
}
#ifdef __KERNEL__
if (rc == 1) { // return code is okay. if return code is 0, it means the dump_one_stainfo() is not finished.
read_sta_info_down = 1;
*eof = 1;
}
#endif
_ret:
#ifdef __KERNEL__
*start = buf + (offset - begin); /* Start of wanted data */
len -= (offset - begin); /* Start slop */
if (len > length)
len = length; /* Ending slop */
#endif
RESTORE_INT(flags);
return len;
}
#ifdef CONFIG_RTL_KERNEL_MIPS16_WLAN
__NOMIPS16
#endif
static int dump_one_sta_keyinfo(int num, struct stat_info *pstat, char *buf, char **start,
off_t offset, int length, int *eof, void *data)
{
int pos = 0;
unsigned char *ptr;
PRINT_ONE(num, " %d: stat_keyinfo...", 1);
PRINT_ARRAY_ARG(" hwaddr: ", pstat->hwaddr, "%02x", MACADDRLEN);
PRINT_SINGL_ARG(" keyInCam: ", (pstat->dot11KeyMapping.keyInCam? "yes" : "no"), "%s");
PRINT_SINGL_ARG(" dot11Privacy: ",
pstat->dot11KeyMapping.dot11Privacy, "%d");
PRINT_SINGL_ARG(" dot11EncryptKey.dot11TTKeyLen: ",
pstat->dot11KeyMapping.dot11EncryptKey.dot11TTKeyLen, "%d");
PRINT_SINGL_ARG(" dot11EncryptKey.dot11TMicKeyLen: ",
pstat->dot11KeyMapping.dot11EncryptKey.dot11TMicKeyLen, "%d");
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11TTKey.skey: ",
pstat->dot11KeyMapping.dot11EncryptKey.dot11TTKey.skey, "%02x", 16);
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11TMicKey1.skey: ",
pstat->dot11KeyMapping.dot11EncryptKey.dot11TMicKey1.skey, "%02x", 16);
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11TMicKey2.skey: ",
pstat->dot11KeyMapping.dot11EncryptKey.dot11TMicKey2.skey, "%02x", 16);
ptr = (unsigned char *)&pstat->dot11KeyMapping.dot11EncryptKey.dot11TXPN48.val48;
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11TXPN48.val48: ", ptr, "%02x", 8);
ptr = (unsigned char *)&pstat->dot11KeyMapping.dot11EncryptKey.dot11RXPN48.val48;
PRINT_ARRAY_ARG(" dot11EncryptKey.dot11RXPN48.val48: ", ptr, "%02x", 8);
PRINT_ONE("", "%s", 1);
return pos;
}
#ifdef CONFIG_RTL_KERNEL_MIPS16_WLAN
__NOMIPS16
#endif
static int rtl8192cd_proc_sta_keyinfo(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int len = 0;
#ifdef __KERNEL__
off_t begin = 0;
off_t pos = 0;
#endif
int size, num=1;
struct list_head *phead, *plist;
struct stat_info *pstat;
unsigned long flags=0;
SAVE_INT_AND_CLI(flags);
#ifdef __ECOS
ecos_pr_fun("-- STA key info table --\n");
#else
strcpy(buf, "-- STA key info table --\n");
size = strlen(buf);
CHECK_LEN;
#endif
phead = &priv->asoc_list;
if (!netif_running(dev) || list_empty(phead))
goto _ret;
plist = phead->next;
while (plist != phead) {
pstat = list_entry(plist, struct stat_info, asoc_list);
size = dump_one_sta_keyinfo(num++, pstat, buf+len, start, offset, length,
eof, data);
CHECK_LEN;
plist = plist->next;
}
*eof = 1;
_ret:
#ifdef __KERNEL__
*start = buf + (offset - begin); /* Start of wanted data */
len -= (offset - begin); /* Start slop */
if (len > length)
len = length; /* Ending slop */
#endif
RESTORE_INT(flags);
return len;
}
static int dump_one_sta_dbginfo(int num, struct stat_info *pstat, char *buf, char **start,
off_t offset, int length, int *eof, void *data)
{
int pos = 0;
PRINT_ARRAY_ARG(" hwaddr: ", pstat->hwaddr, "%02x", MACADDRLEN);
PRINT_SINGL_ARG(" tx_sc_pkts_lv1: ", pstat->tx_sc_pkts_lv1, "%d");
PRINT_SINGL_ARG(" tx_sc_pkts_lv2: ", pstat->tx_sc_pkts_lv2, "%d");
PRINT_SINGL_ARG(" tx_sc_pkts_slow: ", pstat->tx_sc_pkts_slow, "%u");
PRINT_SINGL_ARG(" rx_sc_pkts: ", pstat->rx_sc_pkts, "%d");
PRINT_SINGL_ARG(" rx_sc_pkts_slow: ", pstat->rx_sc_pkts_slow, "%u");
PRINT_SINGL_ARG(" dz_queue_len: ", skb_queue_len(&pstat->dz_queue), "%u");
PRINT_SINGL_ARG(" hp_level: ", pstat->hp_level, "%d");
#ifdef _DEBUG_RTL8192CD_
PRINT_ONE(" ch_width: ", "%s", 0);
PRINT_ONE((pstat->ht_cap_buf.ht_cap_info & cpu_to_le16(_HTCAP_SUPPORT_CH_WDTH_))?"40M":"20M", "%s", 1);
PRINT_ONE(" ampdu_mf: ", "%s", 0);
PRINT_ONE(pstat->ht_cap_buf.ampdu_para & 0x03, "%d", 1);
PRINT_ONE(" ampdu_amd: ", "%s", 0);
PRINT_ONE((pstat->ht_cap_buf.ampdu_para & _HTCAP_AMPDU_SPC_MASK_) >> _HTCAP_AMPDU_SPC_SHIFT_, "%d", 1);
#endif
#if defined(HW_ANT_SWITCH)&&( defined(CONFIG_RTL_92C_SUPPORT) || defined(CONFIG_RTL_92D_SUPPORT))
PRINT_SINGL_ARG(" Ant 1 packet count: ", pstat->hwRxAntSel[1], "%u");
PRINT_SINGL_ARG(" Ant 2 packet count: ", pstat->hwRxAntSel[0], "%u");
PRINT_SINGL_ARG(" Antenna select : ", (pstat->CurAntenna==0 ? 2 : 1), "%u");
#endif
#ifdef _DEBUG_RTL8192CD_
PRINT_SINGL_ARG(" amsdu err: ", pstat->rx_amsdu_err, "%u");
PRINT_SINGL_ARG(" amsdu 1pkt: ", pstat->rx_amsdu_1pkt, "%u");
PRINT_SINGL_ARG(" amsdu 2pkt: ", pstat->rx_amsdu_2pkt, "%u");
PRINT_SINGL_ARG(" amsdu 3pkt: ", pstat->rx_amsdu_3pkt, "%u");
PRINT_SINGL_ARG(" amsdu 4pkt: ", pstat->rx_amsdu_4pkt, "%u");
PRINT_SINGL_ARG(" amsdu 5pkt: ", pstat->rx_amsdu_5pkt, "%u");
PRINT_SINGL_ARG(" amsdu gt 5pkt: ", pstat->rx_amsdu_gt5pkt, "%u");
PRINT_SINGL_ARG(" rc drop1: ", pstat->rx_rc_drop1, "%u");
PRINT_SINGL_ARG(" rc passup2: ", pstat->rx_rc_passup2, "%u");
PRINT_SINGL_ARG(" rc drop3: ", pstat->rx_rc_drop3, "%u");
PRINT_SINGL_ARG(" rc reorder3: ", pstat->rx_rc_reorder3, "%u");
PRINT_SINGL_ARG(" rc passup3: ", pstat->rx_rc_passup3, "%u");
PRINT_SINGL_ARG(" rc drop4: ", pstat->rx_rc_drop4, "%u");
PRINT_SINGL_ARG(" rc reorder4: ", pstat->rx_rc_reorder4, "%u");
PRINT_SINGL_ARG(" rc passup4: ", pstat->rx_rc_passup4, "%u");
PRINT_SINGL_ARG(" rc passupi: ", pstat->rx_rc_passupi, "%u");
#endif
#ifdef SW_TX_QUEUE
PRINT_SINGL_ARG(" bk aggnum: ", pstat->swq.q_aggnum[BK_QUEUE], "%d");
PRINT_SINGL_ARG(" be aggnum: ", pstat->swq.q_aggnum[BE_QUEUE], "%d");
PRINT_SINGL_ARG(" vi aggnum: ", pstat->swq.q_aggnum[VI_QUEUE], "%d");
PRINT_SINGL_ARG(" vo aggnum: ", pstat->swq.q_aggnum[VO_QUEUE], "%d");
PRINT_SINGL_ARG(" bk backtime: ", pstat->swq.q_aggnumIncSlow[BK_QUEUE], "%d");
PRINT_SINGL_ARG(" be backtime: ", pstat->swq.q_aggnumIncSlow[BE_QUEUE], "%d");
PRINT_SINGL_ARG(" vi backtime: ", pstat->swq.q_aggnumIncSlow[VI_QUEUE], "%d");
PRINT_SINGL_ARG(" vo backtime: ", pstat->swq.q_aggnumIncSlow[VO_QUEUE], "%d");
#endif
PRINT_ONE("", "%s", 1);
return pos;
}
static int rtl8192cd_proc_sta_dbginfo(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int len = 0;
#ifdef __KERNEL__
off_t begin = 0;
off_t pos = 0;
#endif
int size, num=1;
struct list_head *phead, *plist;
struct stat_info *pstat;
unsigned long flags=0;
SAVE_INT_AND_CLI(flags);
#ifdef __ECOS
ecos_pr_fun("-- STA dbg info table --\n");
#else
strcpy(buf, "-- STA dbg info table --\n");
size = strlen(buf);
CHECK_LEN;
#endif
phead = &priv->asoc_list;
if (!netif_running(dev) || list_empty(phead))
goto _ret;
plist = phead->next;
while (plist != phead) {
pstat = list_entry(plist, struct stat_info, asoc_list);
size = dump_one_sta_dbginfo(num++, pstat, buf+len, start, offset, length,
eof, data);
CHECK_LEN;
plist = plist->next;
}
*eof = 1;
_ret:
#ifdef __KERNEL__
*start = buf + (offset - begin); /* Start of wanted data */
len -= (offset - begin); /* Start slop */
if (len > length)
len = length; /* Ending slop */
#endif
RESTORE_INT(flags);
return len;
}
#ifdef PCIE_POWER_SAVING
char pwr_state_str[][20] = {"L0", "L1", "L2", "ASPM_L0s_L1" };
#endif
static int rtl8192cd_proc_stats(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0, idx = 0;
unsigned int m, n, print=0;
char tmp[32];
unsigned char *rate;
unsigned long flags=0;
#ifdef __ECOS
Rltk819x_t *info = dev->info;
#endif
SAVE_INT_AND_CLI(flags);
PRINT_ONE(" Statistics...", "%s", 1);
m = priv->up_time / 86400;
n = priv->up_time % 86400;
if (m) {
idx += sprintf(tmp, "%d day ", m);
print = 1;
}
m = n / 3600;
n = n % 3600;
if (m || print) {
idx += sprintf(tmp+idx, "%d hr ", m);
print = 1;
}
m = n / 60;
n = n % 60;
if (m || print) {
idx += sprintf(tmp+idx, "%d min ", m);
print = 1;
}
idx += sprintf(tmp+idx, "%d sec ", n);
PRINT_SINGL_ARG(" up_time: ", tmp, "%s");
PRINT_SINGL_ARG(" tx_packets: ", priv->net_stats.tx_packets, "%lu");
PRINT_SINGL_ARG(" tx_bytes: ", priv->net_stats.tx_bytes, "%lu");
PRINT_SINGL_ARG(" tx_retrys: ", priv->ext_stats.tx_retrys, "%lu");
PRINT_SINGL_ARG(" tx_fails: ", priv->net_stats.tx_errors, "%lu");
PRINT_SINGL_ARG(" tx_drops: ", priv->ext_stats.tx_drops, "%lu");
PRINT_SINGL_ARG(" tx_dma_err: ", priv->ext_stats.tx_dma_err, "%lu");
PRINT_SINGL_ARG(" rx_dma_err: ", priv->ext_stats.rx_dma_err, "%lu");
PRINT_SINGL_ARG(" rx_packets: ", priv->net_stats.rx_packets, "%lu");
PRINT_SINGL_ARG(" rx_bytes: ", priv->net_stats.rx_bytes, "%lu");
PRINT_SINGL_ARG(" rx_retrys: ", priv->ext_stats.rx_retrys, "%lu");
PRINT_SINGL_ARG(" rx_crc_errors: ", priv->net_stats.rx_crc_errors, "%lu");
PRINT_SINGL_ARG(" rx_errors: ", priv->net_stats.rx_errors, "%lu");
PRINT_SINGL_ARG(" rx_data_drops: ", priv->ext_stats.rx_data_drops, "%lu");
PRINT_SINGL_ARG(" rx_decache: ", priv->ext_stats.rx_decache, "%lu");
PRINT_SINGL_ARG(" rx_fifoO: ", priv->ext_stats.rx_fifoO, "%lu");
PRINT_SINGL_ARG(" rx_rdu: ", priv->ext_stats.rx_rdu, "%lu");
PRINT_SINGL_ARG(" rx_reuse: ", priv->ext_stats.rx_reuse, "%lu");
PRINT_SINGL_ARG(" beacon_ok: ", priv->ext_stats.beacon_ok, "%lu");
PRINT_SINGL_ARG(" beacon_er: ", priv->ext_stats.beacon_er, "%lu");
PRINT_SINGL_ARG(" freeskb_err: ", priv->ext_stats.freeskb_err, "%lu");
PRINT_SINGL_ARG(" dz_queue_len: ", CIRC_CNT(priv->dz_queue.head, priv->dz_queue.tail, NUM_TXPKT_QUEUE), "%d");
#ifdef CHECK_HANGUP
#if defined(UNIVERSAL_REPEATER) || defined(MBSSID)
if (IS_ROOT_INTERFACE(priv))
#endif
{
#ifdef CHECK_TX_HANGUP
PRINT_SINGL_ARG(" check_cnt_tx: ", priv->check_cnt_tx, "%d");
#endif
#if defined(CHECK_RX_HANGUP) || defined(CHECK_RX_DMA_ERROR)
PRINT_SINGL_ARG(" check_cnt_rx: ", priv->check_cnt_rx, "%d");
#endif
#ifdef CHECK_BEACON_HANGUP
PRINT_SINGL_ARG(" check_cnt_bcn: ", priv->check_cnt_bcn, "%d");
#endif
#ifdef CHECK_AFTER_RESET
PRINT_SINGL_ARG(" check_cnt_rst: ", priv->check_cnt_rst, "%d");
#endif
}
#endif
#if defined(CONFIG_RTL_92D_SUPPORT) && defined(CONFIG_RTL_NOISE_CONTROL)
if (GET_CHIP_VER(priv) == VERSION_8192D){
#ifdef _DEBUG_RTL8192CD_
PRINT_SINGL_ARG(" Reg 0xc50: ", RTL_R8(0xc50), "0x%02x");
PRINT_SINGL_ARG(" Reg 0xc58: ", RTL_R8(0xc58), "0x%02x");
PRINT_SINGL_ARG(" cck_FA_cnt: ", priv->pshare->cck_FA_cnt, "%d");
PRINT_SINGL_ARG(" ofdm_FA_cnt1: ", priv->pshare->ofdm_FA_cnt1, "%d");
PRINT_SINGL_ARG(" ofdm_FA_cnt2: ", priv->pshare->ofdm_FA_cnt2, "%d");
PRINT_SINGL_ARG(" ofdm_FA_cnt3: ", priv->pshare->ofdm_FA_cnt3, "%d");
PRINT_SINGL_ARG(" ofdm_FA_cnt4: ", priv->pshare->ofdm_FA_cnt4, "%d");
PRINT_SINGL_ARG(" FA_total_cnt: ", priv->pshare->FA_total_cnt, "%d");
//PRINT_SINGL_ARG(" f90[31:16]: ", priv->pshare->F90_cnt, "%d");
PRINT_SINGL_ARG(" f94[31:16]: ", priv->pshare->F94_cnt, "%d");
PRINT_SINGL_ARG(" f94OK[15:0]: ", priv->pshare->F94_cntOK, "%d");
PRINT_SINGL_ARG(" 664[19:0]: ", priv->pshare->Reg664_cnt, "%d");
PRINT_SINGL_ARG(" 664OK[19:0]: ", priv->pshare->Reg664_cntOK, "%d");
#endif
PRINT_SINGL_ARG(" DNC_on: ", priv->pshare->DNC_on, "%d");
PRINT_SINGL_ARG(" tp_avg_pre: ", priv->ext_stats.tp_average_pre, "%lu");
}
#endif
#if defined(CONFIG_RTL_92C_SUPPORT) && defined(CONFIG_RTL_NOISE_CONTROL_92C)
if ((GET_CHIP_VER(priv) == VERSION_8192C)||(GET_CHIP_VER(priv) == VERSION_8188C)){
PRINT_SINGL_ARG(" FA_total_cnt: ", priv->pshare->FA_total_cnt, "%d");
PRINT_SINGL_ARG(" DNC_on: ", (priv->pshare->DNC_on ? 1 : 0), "%d");
PRINT_SINGL_ARG(" tp_avg_pre: ", priv->ext_stats.tp_average_pre, "%lu");
}
#endif
PRINT_SINGL_ARG(" reused_skb: ", priv->ext_stats.reused_skb, "%lu");
#ifdef CONFIG_RTL8190_PRIV_SKB
{
#ifdef CONCURRENT_MODE
extern int skb_free_num[];
PRINT_SINGL_ARG(" skb_free_num: ", skb_free_num[priv->pshare->wlandev_idx]+priv->pshare->skb_queue.qlen, "%d");
#else
extern int skb_free_num;
PRINT_SINGL_ARG(" skb_free_num: ", skb_free_num+priv->pshare->skb_queue.qlen, "%d");
#endif
}
#else
PRINT_SINGL_ARG(" skb_free_num: ", priv->pshare->skb_queue.qlen, "%d");
#endif
#ifdef __ECOS
#ifdef TX_PKT_FREE_QUEUE
PRINT_SINGL_ARG(" tx_queue: ", info->tx_queue.qlen, "%d");
#endif
#endif
PRINT_SINGL_ARG(" tx_avarage: ", priv->ext_stats.tx_avarage, "%lu");
PRINT_SINGL_ARG(" rx_avarage: ", priv->ext_stats.rx_avarage, "%lu");
#if defined(CONFIG_RTL8196B_TR) || defined(CONFIG_RTL865X_AC) || defined(CONFIG_RTL865X_KLD) || defined(CONFIG_RTL8196B_KLD) || defined(CONFIG_RTL8196C_KLD) || defined(CONFIG_RTL8196C_EC)
PRINT_SINGL_ARG(" tx_peak: ", priv->ext_stats.tx_peak, "%lu");
PRINT_SINGL_ARG(" rx_peak: ", priv->ext_stats.rx_peak, "%lu");
#endif
#ifdef RTK_AC_SUPPORT //vht rate , todo, dump vht rates in Mbps
if(priv->pshare->current_tx_rate >= 0x90){
PRINT_ONE(" cur_tx_rate: VHT ", "%s", 0);
PRINT_ONE(priv->pshare->current_tx_rate, "0x%x", 1);
}
else
#endif
if (is_MCS_rate(priv->pshare->current_tx_rate)) {
PRINT_ONE(" cur_tx_rate: MCS", "%s", 0);
PRINT_ONE(priv->pshare->current_tx_rate&0x7f, "%d", 0);
rate = (unsigned char *)MCS_DATA_RATEStr[(priv->pshare->ht_current_tx_info&BIT(0))?1:0][(priv->pshare->ht_current_tx_info&BIT(1))?1:0][priv->pshare->current_tx_rate&0x7f];
PRINT_ONE(rate, " %s", 1);
}
else
{
PRINT_SINGL_ARG(" cur_tx_rate: ", priv->pshare->current_tx_rate/2, "%d");
}
#ifdef PCIE_POWER_SAVING
PRINT_SINGL_ARG(" pcie pwr state: ", pwr_state_str[priv->pwr_state], "%s");
#endif
#if defined(RESERVE_TXDESC_FOR_EACH_IF) && (defined(UNIVERSAL_REPEATER) || defined(MBSSID))
if (GET_ROOT(priv)->pmib->miscEntry.rsv_txdesc) {
PRINT_SINGL_ARG(" bkq_used_desc: ", (UINT)priv->use_txdesc_cnt[BK_QUEUE], "%d");
PRINT_SINGL_ARG(" beq_used_desc: ", (UINT)priv->use_txdesc_cnt[BE_QUEUE], "%d");
PRINT_SINGL_ARG(" viq_used_desc: ", (UINT)priv->use_txdesc_cnt[VI_QUEUE], "%d");
PRINT_SINGL_ARG(" voq_used_desc: ", (UINT)priv->use_txdesc_cnt[VO_QUEUE], "%d");
}
#endif
#ifdef USE_TXQUEUE
if (GET_ROOT(priv)->pmib->miscEntry.use_txq) {
PRINT_SINGL_ARG(" txq_bk_num: ", (UINT)txq_len(&priv->pshare->txq_list[BK_QUEUE]), "%d");
PRINT_SINGL_ARG(" txq_be_num: ", (UINT)txq_len(&priv->pshare->txq_list[BE_QUEUE]), "%d");
PRINT_SINGL_ARG(" txq_vi_num: ", (UINT)txq_len(&priv->pshare->txq_list[VI_QUEUE]), "%d");
PRINT_SINGL_ARG(" txq_vo_num: ", (UINT)txq_len(&priv->pshare->txq_list[VO_QUEUE]), "%d");
}
#endif
#ifdef SW_TX_QUEUE
PRINT_SINGL_ARG(" swq enable: ", priv->swq_en, "%d");
#endif
#ifdef CONFIG_WLAN_HAL
PRINT_SINGL_ARG(" use hal: ", priv->pshare->use_hal, "%d");
#endif
#ifdef USE_OUT_SRC
PRINT_SINGL_ARG(" use outsrc: ", priv->pshare->use_outsrc, "%d");
#endif
if(RTL_R8(0x1f)==0){
PRINT_SINGL_ARG(" rf_lock: ", "true", "%s");
}else{
PRINT_SINGL_ARG(" rf_lock: ", "false", "%s");
}
RESTORE_INT(flags);
return pos;
}
#ifdef __ECOS
void rtl8192cd_proc_stats_clear(void *data)
#else
static int rtl8192cd_proc_stats_clear(struct file *file, const char *buffer,
unsigned long count, void *data)
#endif
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
memset(&priv->net_stats, 0, sizeof(struct net_device_stats));
memset(&priv->ext_stats, 0, sizeof(struct extra_stats));
#ifdef CONFIG_RTK_MESH
memset(&priv->mesh_stats, 0, sizeof(struct net_device_stats));
#endif
#ifdef _11s_TEST_MODE_
memset(priv->rvTestPacket, 0, 3000);
#endif
#ifdef __KERNEL__
return count;
#endif
}
#ifdef RF_FINETUNE
static int rtl8192cd_proc_rfft(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
#ifdef SUPPORT_TX_MCAST2UNI
int i;
int tmpbuf[64];
#endif
PRINT_ONE(" RF fine tune variables...", "%s", 1);
PRINT_SINGL_ARG(" rssi: ", priv->pshare->rf_ft_var.rssi_dump, "%d");
PRINT_SINGL_ARG(" rxfifoO: ", priv->pshare->rf_ft_var.rxfifoO, "%x");
PRINT_SINGL_ARG(" raGoDownUpper: ", priv->pshare->rf_ft_var.raGoDownUpper, "%d");
PRINT_SINGL_ARG(" raGoDown20MLower: ", priv->pshare->rf_ft_var.raGoDown20MLower, "%d");
PRINT_SINGL_ARG(" raGoDown40MLower: ", priv->pshare->rf_ft_var.raGoDown40MLower, "%d");
PRINT_SINGL_ARG(" raGoUpUpper: ", priv->pshare->rf_ft_var.raGoUpUpper, "%d");
PRINT_SINGL_ARG(" raGoUp20MLower: ", priv->pshare->rf_ft_var.raGoUp20MLower, "%d");
PRINT_SINGL_ARG(" raGoUp40MLower: ", priv->pshare->rf_ft_var.raGoUp40MLower, "%d");
PRINT_SINGL_ARG(" dig_enable: ", priv->pshare->rf_ft_var.dig_enable, "%d");
PRINT_SINGL_ARG(" digGoLowerLevel: ", priv->pshare->rf_ft_var.digGoLowerLevel, "%d");
PRINT_SINGL_ARG(" digGoUpperLevel: ", priv->pshare->rf_ft_var.digGoUpperLevel, "%d");
PRINT_SINGL_ARG(" rssiTx20MUpper: ", priv->pshare->rf_ft_var.rssiTx20MUpper, "%d");
PRINT_SINGL_ARG(" rssiTx20MLower: ", priv->pshare->rf_ft_var.rssiTx20MLower, "%d");
PRINT_SINGL_ARG(" rssi_expire_to: ", priv->pshare->rf_ft_var.rssi_expire_to, "%d");
PRINT_SINGL_ARG(" cck_pwr_max: ", priv->pshare->rf_ft_var.cck_pwr_max, "%d");
PRINT_SINGL_ARG(" cck_tx_pathB: ", priv->pshare->rf_ft_var.cck_tx_pathB, "%d");
PRINT_SINGL_ARG(" tx_pwr_ctrl: ", priv->pshare->rf_ft_var.tx_pwr_ctrl, "%d");
// 11n ap AES debug
PRINT_SINGL_ARG(" aes_check_th: ", priv->pshare->rf_ft_var.aes_check_th, "%d KB");
// Tx power tracking
PRINT_SINGL_ARG(" tpt_period: ", priv->pshare->rf_ft_var.tpt_period, "%d");
// TXOP enlarge
PRINT_SINGL_ARG(" txop_enlarge_upper: ", priv->pshare->rf_ft_var.txop_enlarge_upper, "%d");
PRINT_SINGL_ARG(" txop_enlarge_lower: ", priv->pshare->rf_ft_var.txop_enlarge_lower, "%d");
// 2.3G support
PRINT_SINGL_ARG(" frq_2_3G: ", priv->pshare->rf_ft_var.use_frq_2_3G, "%d");
//Support IP multicast->unicast
#ifdef SUPPORT_TX_MCAST2UNI
PRINT_SINGL_ARG(" mc2u_disable: ", priv->pshare->rf_ft_var.mc2u_disable, "%d");
PRINT_SINGL_ARG(" mc2u_drop_unknown: ", priv->pshare->rf_ft_var.mc2u_drop_unknown, "%d");
PRINT_SINGL_ARG(" mc2u_flood_ctrl: ", priv->pshare->rf_ft_var.mc2u_flood_ctrl, "%d");
if(priv->pshare->rf_ft_var.mc2u_flood_ctrl)
{
PRINT_SINGL_ARG(" mc2u_flood_mac_num: ", priv->pshare->rf_ft_var.mc2u_flood_mac_num, "%d");
for (i=0; i< priv->pshare->rf_ft_var.mc2u_flood_mac_num; i++) {
sprintf(tmpbuf, " mc2u_flood_mac[%d]: ", i);
PRINT_ARRAY_ARG(tmpbuf, priv->pshare->rf_ft_var.mc2u_flood_mac[i].macAddr, "%02x", 6);
}
}
#endif
#ifdef HIGH_POWER_EXT_PA
PRINT_SINGL_ARG(" use_ext_pa: ", priv->pshare->rf_ft_var.use_ext_pa, "%d");
#endif
PRINT_SINGL_ARG(" use_ext_lna: ", priv->pshare->rf_ft_var.use_ext_lna, "%d");
PRINT_SINGL_ARG(" NDSi_support: ", priv->pshare->rf_ft_var.NDSi_support, "%d");
PRINT_SINGL_ARG(" EDCCA threshold: ", priv->pshare->rf_ft_var.edcca_thd, "%d");
PRINT_SINGL_ARG(" 1rcca: ", priv->pshare->rf_ft_var.one_path_cca, "%d");
return pos;
}
#endif
#ifdef GBWC
static int rtl8192cd_proc_mib_gbwc(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0, i;
PRINT_ONE(" miscGBWC...", "%s", 1);
PRINT_SINGL_ARG(" GBWCMode: ", priv->pmib->gbwcEntry.GBWCMode, "%d");
PRINT_SINGL_ARG(" GBWCThrd_tx: ", priv->pmib->gbwcEntry.GBWCThrd_tx, "%d kbps");
PRINT_SINGL_ARG(" GBWCThrd_rx: ", priv->pmib->gbwcEntry.GBWCThrd_rx, "%d kbps");
PRINT_ONE(" Address List:", "%s", 1);
for (i=0; i<priv->pmib->gbwcEntry.GBWCNum; i++) {
PRINT_ARRAY_ARG(" ", priv->pmib->gbwcEntry.GBWCAddr[i], "%02x", MACADDRLEN);
}
return pos;
}
#endif
#ifdef CONFIG_RTL_KERNEL_MIPS16_WLAN
__NOMIPS16
#endif
#ifdef __ECOS
void rtl8192cd_proc_led(int flag, void *data)
#else
static int rtl8192cd_proc_led(struct file *file, const char *buffer,
unsigned long count, void *data)
#endif
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
#ifdef __KERNEL__
char tmpbuf[100];
int flag;
#endif
#ifdef __ECOS
if (flag == 0) // disable
control_wireless_led(priv, 0);
else if (flag == 1) // enable
control_wireless_led(priv, 1);
else if (flag == 2) // restore
control_wireless_led(priv, 2);
else
ecos_pr_fun("flag [%d] not supported!\n", flag);
#else
if (buffer && !copy_from_user(tmpbuf, buffer, count)) {
sscanf(tmpbuf, "%d", &flag);
if (flag == 0) // disable
control_wireless_led(priv, 0);
else if (flag == 1) // enable
control_wireless_led(priv, 1);
else if (flag == 2) // restore
control_wireless_led(priv, 2);
else
printk("flag [%d] not supported!\n", flag);
}
return count;
#endif
}
#ifdef RTL_MANUAL_EDCA
static int rtl8192cd_proc_mib_edca(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
char *queue[] = {"", "BK", "BE", "VI", "VO"};
PRINT_SINGL_ARG(" Manually config EDCA : ", priv->pmib->dot11QosEntry.ManualEDCA, "%d");
PRINT_ONE(" EDCA for AP...", "%s", 1);
PRINT_SINGL_ARG(" [BE]slot number (AIFS): ", priv->pmib->dot11QosEntry.AP_manualEDCA[BE].AIFSN, "%d");
PRINT_SINGL_ARG(" Maximal contention window period: ", priv->pmib->dot11QosEntry.AP_manualEDCA[BE].ECWmax, "%d");
PRINT_SINGL_ARG(" Minimal contention window period: ", priv->pmib->dot11QosEntry.AP_manualEDCA[BE].ECWmin, "%d");
PRINT_SINGL_ARG(" TXOP limit: ", priv->pmib->dot11QosEntry.AP_manualEDCA[BE].TXOPlimit, "%d");
PRINT_SINGL_ARG(" [BK]slot number (AIFS): ", priv->pmib->dot11QosEntry.AP_manualEDCA[BK].AIFSN, "%d");
PRINT_SINGL_ARG(" Maximal contention window period: ", priv->pmib->dot11QosEntry.AP_manualEDCA[BK].ECWmax, "%d");
PRINT_SINGL_ARG(" Minimal contention window period: ", priv->pmib->dot11QosEntry.AP_manualEDCA[BK].ECWmin, "%d");
PRINT_SINGL_ARG(" TXOP limit: ", priv->pmib->dot11QosEntry.AP_manualEDCA[BK].TXOPlimit, "%d");
PRINT_SINGL_ARG(" [VI]slot number (AIFS)= ", priv->pmib->dot11QosEntry.AP_manualEDCA[VI].AIFSN, "%d");
PRINT_SINGL_ARG(" Maximal contention window period: ", priv->pmib->dot11QosEntry.AP_manualEDCA[VI].ECWmax, "%d");
PRINT_SINGL_ARG(" Minimal contention window period: ", priv->pmib->dot11QosEntry.AP_manualEDCA[VI].ECWmin, "%d");
PRINT_SINGL_ARG(" TXOP limit: ", priv->pmib->dot11QosEntry.AP_manualEDCA[VI].TXOPlimit, "%d");
PRINT_SINGL_ARG(" [VO]slot number (AIFS): ", priv->pmib->dot11QosEntry.AP_manualEDCA[VO].AIFSN, "%d");
PRINT_SINGL_ARG(" Maximal contention window period: ", priv->pmib->dot11QosEntry.AP_manualEDCA[VO].ECWmax, "%d");
PRINT_SINGL_ARG(" Minimal contention window period: ", priv->pmib->dot11QosEntry.AP_manualEDCA[VO].ECWmin, "%d");
PRINT_SINGL_ARG(" TXOP limit: ", priv->pmib->dot11QosEntry.AP_manualEDCA[VO].TXOPlimit, "%d");
PRINT_ONE(" EDCA for Wireless client...", "%s", 1);
PRINT_SINGL_ARG(" [BE]ACM: ", priv->pmib->dot11QosEntry.STA_manualEDCA[BE].ACM, "%d");
PRINT_SINGL_ARG(" slot number (AIFS): ", priv->pmib->dot11QosEntry.STA_manualEDCA[BE].AIFSN, "%d");
PRINT_SINGL_ARG(" Maximal contention window period: ", priv->pmib->dot11QosEntry.STA_manualEDCA[BE].ECWmax, "%d");
PRINT_SINGL_ARG(" Minimal contention window period: ", priv->pmib->dot11QosEntry.STA_manualEDCA[BE].ECWmin, "%d");
PRINT_SINGL_ARG(" TXOP limit: ", priv->pmib->dot11QosEntry.STA_manualEDCA[BE].TXOPlimit, "%d");
PRINT_SINGL_ARG(" [BK]ACM:", priv->pmib->dot11QosEntry.STA_manualEDCA[BK].ACM, "%d");
PRINT_SINGL_ARG(" slot number (AIFS): ", priv->pmib->dot11QosEntry.STA_manualEDCA[BK].AIFSN, "%d");
PRINT_SINGL_ARG(" Maximal contention window period: ", priv->pmib->dot11QosEntry.STA_manualEDCA[BK].ECWmax, "%d");
PRINT_SINGL_ARG(" Minimal contention window period: ", priv->pmib->dot11QosEntry.STA_manualEDCA[BK].ECWmin, "%d");
PRINT_SINGL_ARG(" TXOP limit: ", priv->pmib->dot11QosEntry.STA_manualEDCA[BK].TXOPlimit, "%d");
PRINT_SINGL_ARG(" [VI]ACM: ", priv->pmib->dot11QosEntry.STA_manualEDCA[VI].ACM, "%d");
PRINT_SINGL_ARG(" slot number (AIFS): ", priv->pmib->dot11QosEntry.STA_manualEDCA[VI].AIFSN, "%d");
PRINT_SINGL_ARG(" Maximal contention window period: ", priv->pmib->dot11QosEntry.STA_manualEDCA[VI].ECWmax, "%d");
PRINT_SINGL_ARG(" Minimal contention window period: ", priv->pmib->dot11QosEntry.STA_manualEDCA[VI].ECWmin, "%d");
PRINT_SINGL_ARG(" TXOP limit:", priv->pmib->dot11QosEntry.STA_manualEDCA[VI].TXOPlimit, "%d");
PRINT_SINGL_ARG(" [VO]ACM: ", priv->pmib->dot11QosEntry.STA_manualEDCA[VO].ACM, "%d");
PRINT_SINGL_ARG(" slot number (AIFS): ", priv->pmib->dot11QosEntry.STA_manualEDCA[VO].AIFSN, "%d");
PRINT_SINGL_ARG(" Maximal contention window period: ", priv->pmib->dot11QosEntry.STA_manualEDCA[VO].ECWmax, "%d");
PRINT_SINGL_ARG(" Minimal contention window period: ", priv->pmib->dot11QosEntry.STA_manualEDCA[VO].ECWmin, "%d");
PRINT_SINGL_ARG(" TXOP limit: ", priv->pmib->dot11QosEntry.STA_manualEDCA[VO].TXOPlimit, "%d");
PRINT_SINGL_ARG(" TID0 mapping: ", queue[priv->pmib->dot11QosEntry.TID_mapping[0]], "%s");
PRINT_SINGL_ARG(" TID1 mapping: ", queue[priv->pmib->dot11QosEntry.TID_mapping[1]], "%s");
PRINT_SINGL_ARG(" TID2 mapping: ", queue[priv->pmib->dot11QosEntry.TID_mapping[2]], "%s");
PRINT_SINGL_ARG(" TID3 mapping: ", queue[priv->pmib->dot11QosEntry.TID_mapping[3]], "%s");
PRINT_SINGL_ARG(" TID4 mapping: ", queue[priv->pmib->dot11QosEntry.TID_mapping[4]], "%s");
PRINT_SINGL_ARG(" TID5 mapping: ", queue[priv->pmib->dot11QosEntry.TID_mapping[5]], "%s");
PRINT_SINGL_ARG(" TID6 mapping: ", queue[priv->pmib->dot11QosEntry.TID_mapping[6]], "%s");
PRINT_SINGL_ARG(" TID7 mapping: ", queue[priv->pmib->dot11QosEntry.TID_mapping[7]], "%s");
return pos;
}
#endif //RTL_MANUAL_EDCA
#ifdef TLN_STATS
static int proc_wifi_conn_stats(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
int pos = 0;
PRINT_ONE(" Wifi Connection Stats...", "%s", 1);
PRINT_SINGL_ARG(" Time Interval: ", priv->pshare->rf_ft_var.stats_time_interval, "%d");
PRINT_SINGL_ARG(" Connected Clients: ", priv->wifi_stats.connected_sta, "%d");
PRINT_SINGL_ARG(" MAX Clients: ", priv->wifi_stats.max_sta, "%d");
PRINT_SINGL_ARG(" MAX Clients Timestamp: ", priv->wifi_stats.max_sta_timestamp, "%d");
PRINT_SINGL_ARG(" Rejected clients: ", priv->wifi_stats.rejected_sta, "%d");
return pos;
}
static int proc_wifi_conn_stats_clear(struct file *file, const char *buffer,
unsigned long count, void *data)
{
struct net_device *dev = (struct net_device *)data;
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
memset(&priv->wifi_stats, 0, sizeof(struct tln_wifi_stats));
return count;
}
static int proc_ext_wifi_conn_stats(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
int pos = 0;
PRINT_ONE(" Extended WiFi Connection Stats...", "%s", 1);
PRINT_ONE(" Reject Reason/Status: Reject Count", "%s", 1);
PRINT_ONE(" =====================================================", "%s", 1);
PRINT_SINGL_ARG(" Unspecified reason: ", priv->ext_wifi_stats.rson_UNSPECIFIED_1, "%d");
PRINT_SINGL_ARG(" Previous auth no longer valid: ", priv->ext_wifi_stats.rson_AUTH_INVALID_2, "%d");
PRINT_SINGL_ARG(" Deauth because of leaving (or has left): ", priv->ext_wifi_stats.rson_DEAUTH_STA_LEAVING_3, "%d");
PRINT_SINGL_ARG(" Disassoc due to inactivity: ", priv->ext_wifi_stats.rson_INACTIVITY_4, "%d");
PRINT_SINGL_ARG(" Disassoc because AP cannot handle: ", priv->ext_wifi_stats.rson_RESOURCE_INSUFFICIENT_5, "%d");
PRINT_SINGL_ARG(" Class 2 frame from non-auth STA: ", priv->ext_wifi_stats.rson_UNAUTH_CLS2FRAME_6, "%d");
PRINT_SINGL_ARG(" Class 3 frame from non-assoc STA: ", priv->ext_wifi_stats.rson_UNAUTH_CLS3FRAME_7, "%d");
PRINT_SINGL_ARG(" Disassoc because leaving (or has left): ", priv->ext_wifi_stats.rson_DISASSOC_STA_LEAVING_8, "%d");
PRINT_SINGL_ARG(" STA request (re)assoc did not auth: ", priv->ext_wifi_stats.rson_ASSOC_BEFORE_AUTH_9, "%d");
PRINT_SINGL_ARG(" Invalid IE: ", priv->ext_wifi_stats.rson_INVALID_IE_13, "%d");
PRINT_SINGL_ARG(" MIC failure: ", priv->ext_wifi_stats.rson_MIC_FAILURE_14, "%d");
PRINT_SINGL_ARG(" 4-Way Handshake timeout: ", priv->ext_wifi_stats.rson_4WAY_TIMEOUT_15, "%d");
PRINT_SINGL_ARG(" Group Key Handshake timeout: ", priv->ext_wifi_stats.rson_GROUP_KEY_TIMEOUT_16, "%d");
PRINT_SINGL_ARG(" IE in 4-Way Handshake different: ", priv->ext_wifi_stats.rson_DIFF_IE_17, "%d");
PRINT_SINGL_ARG(" Invalid group cipher: ", priv->ext_wifi_stats.rson_MCAST_CIPHER_INVALID_18, "%d");
PRINT_SINGL_ARG(" Invalid pairwise cipher: ", priv->ext_wifi_stats.rson_UCAST_CIPHER_INVALID_19, "%d");
PRINT_SINGL_ARG(" Invalid AKMP: ", priv->ext_wifi_stats.rson_AKMP_INVALID_20, "%d");
PRINT_SINGL_ARG(" Unsupported RSNIE version: ", priv->ext_wifi_stats.rson_UNSUPPORT_RSNIE_VER_21, "%d");
PRINT_SINGL_ARG(" Invalid RSNIE capabilities: ", priv->ext_wifi_stats.rson_RSNIE_CAP_INVALID_22, "%d");
PRINT_SINGL_ARG(" IEEE 802.1X auth failed: ", priv->ext_wifi_stats.rson_802_1X_AUTH_FAIL_23, "%d");
PRINT_SINGL_ARG(" Reason out of scope of the device: ", priv->ext_wifi_stats.rson_OUT_OF_SCOPE, "%d");
PRINT_SINGL_ARG(" Unspecified failure: ", priv->ext_wifi_stats.status_FAILURE_1, "%d");
PRINT_SINGL_ARG(" Cannot support all capabilities: ", priv->ext_wifi_stats.status_CAP_FAIL_10, "%d");
PRINT_SINGL_ARG(" Reassoc denied due to cannot confirm assoc exists: ", priv->ext_wifi_stats.status_NO_ASSOC_11, "%d");
PRINT_SINGL_ARG(" Assoc denied due to reason beyond: ", priv->ext_wifi_stats.status_OTHER_12, "%d");
PRINT_SINGL_ARG(" Not support specified auth alg: ", priv->ext_wifi_stats.status_NOT_SUPPORT_ALG_13, "%d");
PRINT_SINGL_ARG(" Auth seq out of expected: ", priv->ext_wifi_stats.status_OUT_OF_AUTH_SEQ_14, "%d");
PRINT_SINGL_ARG(" Challenge failure: ", priv->ext_wifi_stats.status_CHALLENGE_FAIL_15, "%d");
PRINT_SINGL_ARG(" Auth timeout: ", priv->ext_wifi_stats.status_AUTH_TIMEOUT_16, "%d");
PRINT_SINGL_ARG(" Denied because AP cannot handle: ", priv->ext_wifi_stats.status_RESOURCE_INSUFFICIENT_17, "%d");
PRINT_SINGL_ARG(" Denied because STA not support all rates: ", priv->ext_wifi_stats.status_RATE_FAIL_18, "%d");
PRINT_SINGL_ARG(" Status out of scope of the device: ", priv->ext_wifi_stats.status_OUT_OF_SCOPE, "%d");
return pos;
}
static int proc_ext_wifi_conn_stats_clear(struct file *file, const char *buffer,
unsigned long count, void *data)
{
struct net_device *dev = (struct net_device *)data;
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
memset(&priv->ext_wifi_stats, 0, sizeof(struct tln_ext_wifi_stats));
return count;
}
#endif
#if defined(RTLWIFINIC_GPIO_CONTROL)
static int rtl8192cd_proc_gpio_ctrl_read(char *buf, char **start, off_t offset,
int length, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
int pos = 0;
int i;
char tmp[16];
for (i=0; i<12; i++) {
if (priv->pshare->phw->GPIO_dir[i] == 0x01) {
sprintf(tmp, "GPIO%d %d", i, RTLWIFINIC_GPIO_read(i));
PRINT_ONE(tmp, "%s", 1);
}
}
return pos;
}
#ifdef __ECOS
int rtl8192cd_proc_gpio_ctrl_write(char *command, int gpio_num, char *action, void *data)
#else
static int rtl8192cd_proc_gpio_ctrl_write(struct file *file, const char *buffer,
unsigned long count, void *data)
#endif
{
struct net_device *dev = (struct net_device *)data;
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = (struct rtl8192cd_priv *)dev->priv;
#endif
#ifdef __ECOS
int direction, value, count=0;
#else
char tmp[32], command[8], action[4];
unsigned int num, gpio_num, direction, value;
#endif
#ifdef __ECOS
ecos_pr_fun("Command: [%s] gpio: [%d] action: [%s]\n", command, gpio_num, action);
#else
if (buffer && !copy_from_user(tmp, buffer, 32)) {
num = sscanf(tmp, "%s %d %s", command, &gpio_num, action);
if (num != 3) {
panic_printk("Invalid gpio parameter! Failed!\n");
return num;
}
}
panic_printk("Command: [%s] gpio: [%d] action: [%s]\n", command, gpio_num, action);
#endif
if (!memcmp(command, "config", 6)) {
if (!memcmp(action, "r", 1))
direction = 0x01;
else if (!memcmp(action, "w", 1))
direction = 0x10;
else {
#ifdef __ECOS
ecos_pr_fun("Action not supported!\n");
#else
panic_printk("Action not supported!\n");
#endif
return count;
}
if ((gpio_num >= 0) && (gpio_num <= 11))
priv->pshare->phw->GPIO_dir[gpio_num] = direction;
else {
#ifdef __ECOS
ecos_pr_fun("GPIO pin not supported!\n");
#else
panic_printk("GPIO pin not supported!\n");
#endif
return count;
}
RTLWIFINIC_GPIO_config(gpio_num, direction);
}
else if (!memcmp(command, "set", 3)) {
if (!memcmp(action, "0", 1))
value = 0;
else if (!memcmp(action, "1", 1))
value = 1;
else {
#ifdef __ECOS
ecos_pr_fun("Action not supported!\n");
#else
panic_printk("Action not supported!\n");
#endif
return count;
}
if (((gpio_num >= 0) && (gpio_num <= 11)) && (priv->pshare->phw->GPIO_dir[gpio_num] == 0x10))
RTLWIFINIC_GPIO_write(gpio_num, value);
else {
#ifdef __ECOS
ecos_pr_fun("GPIO pin not supported!\n");
#else
panic_printk("GPIO pin not supported!\n");
#endif
return count;
}
}
else {
#ifdef __ECOS
ecos_pr_fun("Command not supported!\n");
#else
panic_printk("Command not supported!\n");
#endif
}
return count;
}
#endif
#ifdef __KERNEL__
void MDL_DEVINIT rtl8192cd_proc_init(struct net_device *dev)
{
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = dev->priv;
#endif
struct proc_dir_entry *rtl8192cd_proc_root = NULL ;
struct proc_dir_entry *res;
rtl8192cd_proc_root = proc_mkdir(dev->name, NULL);
priv->proc_root = rtl8192cd_proc_root ;
if (rtl8192cd_proc_root == NULL) {
printk("create proc root failed!\n");
return;
}
if ( create_proc_read_entry ("mib_all", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_all, (void *)dev) == NULL ) {
printk("create proc mib_all failed!\n");
return;
}
if ( create_proc_read_entry ("mib_rf", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_rf, (void *)dev) == NULL ) {
printk("create proc mib_rf failed!\n");
return;
}
if ( create_proc_read_entry ("mib_operation", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_operation, (void *)dev) == NULL ) {
printk("create proc mib_operation failed!\n");
return;
}
if ( create_proc_read_entry ("mib_staconfig", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_staconfig, (void *)dev) == NULL ) {
printk("create proc mib_staconfig failed!\n");
return;
}
if ( create_proc_read_entry ("mib_dkeytbl", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_dkeytbl, (void *)dev) == NULL ) {
printk("create proc mib_dkeytbl failed!\n");
return;
}
if ( create_proc_read_entry ("mib_auth", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_auth, (void *)dev) == NULL ) {
printk("create proc mib_auth failed!\n");
return;
}
if ( create_proc_read_entry ("mib_gkeytbl", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_gkeytbl, (void *)dev) == NULL ) {
printk("create proc mib_gkeytbl failed!\n");
return;
}
if ( create_proc_read_entry ("mib_bssdesc", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_bssdesc, (void *)dev) == NULL ) {
printk("create proc mib_bssdesc failed!\n");
return;
}
if ( create_proc_read_entry ("sta_info", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_stainfo, (void *)dev) == NULL ) {
printk("create proc sta_info failed!\n");
return;
}
if ( create_proc_read_entry ("sta_keyinfo", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_sta_keyinfo, (void *)dev) == NULL ) {
printk("create proc sta_keyinfo failed!\n");
return;
}
if ( create_proc_read_entry ("sta_dbginfo", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_sta_dbginfo, (void *)dev) == NULL ) {
printk("create proc sta_dbginfo failed!\n");
return;
}
if ( (res = create_proc_read_entry ("stats", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_stats, (void *)dev)) == NULL ) {
printk("create proc stats failed!\n");
return;
}
res->write_proc = rtl8192cd_proc_stats_clear;
if ( create_proc_read_entry ("mib_erp", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_erp, (void *)dev) == NULL ) {
printk("create proc mib_erp failed!\n");
return;
}
#ifdef WDS
if ( create_proc_read_entry ("mib_wds", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_wds, (void *)dev) == NULL ) {
printk("create proc mib_wds failed!\n");
return;
}
#endif
#ifdef RTK_BR_EXT
if ( create_proc_read_entry ("mib_brext", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_brext, (void *)dev) == NULL ) {
printk("create proc mib_brext failed!\n");
return;
}
#endif
#ifdef DFS
if ( create_proc_read_entry ("mib_dfs", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_DFS, (void *)dev) == NULL ) {
printk("create proc mib_dfs failed!\n");
return;
}
#endif
#if defined(CONFIG_RTL_8812_SUPPORT) || defined(CONFIG_WLAN_HAL_8881A)
if ( create_proc_read_entry ("mib_rf_ac", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_rf_ac, (void *)dev) == NULL ) {
printk("create proc mib_rf_ac failed!\n");
return;
}
#endif
if ( create_proc_read_entry ("mib_misc", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_misc, (void *)dev) == NULL ) {
printk("create proc mib_misc failed!\n");
return;
}
#ifdef WIFI_SIMPLE_CONFIG
if ( create_proc_read_entry ("mib_wsc", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_wsc, (void *)dev) == NULL ) {
printk("create proc mib_wsc failed!\n");
return;
}
#endif
#ifdef GBWC
if ( create_proc_read_entry ("mib_gbwc", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_gbwc, (void *)dev) == NULL ) {
printk("create proc mib_gbwc failed!\n");
return;
}
#endif
if ( create_proc_read_entry ("mib_11n", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_11n, (void *)dev) == NULL ) {
printk("create proc mib_11n failed!\n");
return;
}
#ifdef RTL_MANUAL_EDCA
if ( create_proc_read_entry ("mib_EDCA", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_edca, (void *)dev) == NULL ) {
printk("create proc mib_EDCA failed!\n");
return;
}
#endif
#ifdef CONFIG_RTK_VLAN_SUPPORT
if ( (res = create_proc_read_entry("mib_vlan", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_vlan_read, (void *)dev)) == NULL) {
printk("create_proc mib_vlan failed!\n");
return;
}
res->write_proc = rtl8192cd_proc_vlan_write;
#endif
#ifdef TLN_STATS
if ((res = create_proc_read_entry ("wifi_conn_stats", 0644, rtl8192cd_proc_root,
proc_wifi_conn_stats, (void *)dev)) == NULL ) {
printk("create proc wifi_conn_stats failed!\n");
return;
}
res->write_proc = proc_wifi_conn_stats_clear;
if ((res = create_proc_read_entry ("ext_wifi_conn_stats", 0644, rtl8192cd_proc_root,
proc_ext_wifi_conn_stats, (void *)dev)) == NULL ) {
printk("create proc ext_wifi_conn_stats failed!\n");
return;
}
res->write_proc = proc_ext_wifi_conn_stats_clear;
#endif
#ifdef SUPPORT_MULTI_PROFILE
if ( create_proc_read_entry ("mib_ap_profile", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_mib_ap_profile, (void *)dev) == NULL ) {
printk("create proc mib_ap_profile failed!\n");
return;
}
#endif
#if defined(UNIVERSAL_REPEATER) || defined(MBSSID)
if (GET_ROOT_PRIV(priv) == NULL) // is root interface
#endif
{
if ( (res = create_proc_read_entry ("txdesc", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_txdesc_info, (void *)dev)) == NULL ) {
printk("create proc txdesc failed!\n");
return;
}
res->write_proc = rtl8192cd_proc_txdesc_info_write;
#ifdef CLIENT_MODE
if ((res = create_proc_read_entry("up_flag", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_up_read, (void *)dev)) == NULL ) {
printk("create_proc up_flag failed!\n");
return;
}
res->write_proc = rtl8192cd_proc_up_write;
#endif
if ( create_proc_read_entry ("rxdesc", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_rxdesc_info, (void *)dev) == NULL ) {
printk("create proc rxdesc failed!\n");
return;
}
if ( create_proc_read_entry ("desc_info", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_desc_info, (void *)dev) == NULL ) {
printk("create proc desc_info failed!\n");
return;
}
if ( create_proc_read_entry ("buf_info", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_buf_info, (void *)dev) == NULL ) {
printk("create proc buf_info failed!\n");
return;
}
if ( create_proc_read_entry ("cam_info", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_cam_info, (void *)dev) == NULL ) {
printk("create proc cam_info failed!\n");
return;
}
#ifdef ENABLE_RTL_SKB_STATS
if ( create_proc_read_entry ("skb_info", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_skb_info, (void *)dev) == NULL ) {
printk("create proc skb_info failed!\n");
return;
}
#endif
#ifdef RF_FINETUNE
if ( create_proc_read_entry ("rf_finetune", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_rfft, (void *)dev) == NULL ) {
printk("create proc rf_finetune failed!\n");
return;
}
#endif
#ifdef CONFIG_RTL_92C_SUPPORT
if ((GET_CHIP_VER(priv) == VERSION_8192C) || (GET_CHIP_VER(priv) == VERSION_8188C)) {
if ( (res = create_proc_read_entry ("phypara_file", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_phypara_file_read, (void *)dev)) == NULL ) {
printk("create proc stats failed!\n");
return;
}
res->write_proc = rtl8192cd_proc_phypara_file_write;
}
#endif // CONFIG_RTL_92C_SUPPORT
if ( (res = create_proc_entry("led", 0644, rtl8192cd_proc_root)) == NULL ) {
printk("create proc led failed!\n");
return;
}
res->write_proc = rtl8192cd_proc_led;
res->data = (void *)dev;
#ifdef AUTO_TEST_SUPPORT
if ( create_proc_read_entry("SS_Result", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_SSR_read, (void *)dev) == NULL ) {
printk("create_proc SS_Result failed!\n");
return;
}
#endif
#if defined(RTLWIFINIC_GPIO_CONTROL)
if ( (res = create_proc_read_entry ("gpio_ctrl", 0644, rtl8192cd_proc_root,
rtl8192cd_proc_gpio_ctrl_read, (void *)dev)) == NULL ) {
printk("create proc gpio_ctrl failed!\n");
return;
}
res->write_proc = rtl8192cd_proc_gpio_ctrl_write;
RTLWIFINIC_GPIO_init_priv(priv);
#endif
}
#ifdef CONFIG_RTK_MESH
#ifdef MESH_BOOTSEQ_AUTH
if ( create_proc_read_entry ("mesh_auth_mpinfo", 0644, rtl8192cd_proc_root,
mesh_auth_mpinfo, (void *)dev) == NULL ) {
printk("create proc mesh_auth_mpinfo failed!\n");
return;
}
#endif
if ( create_proc_read_entry ("mesh_unestablish_mpinfo", 0644, rtl8192cd_proc_root,
mesh_unEstablish_mpinfo, (void *)dev) == NULL ) {
printk("create proc mesh_unestablish_mpinfo failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_assoc_mpinfo", 0644, rtl8192cd_proc_root,
mesh_assoc_mpinfo, (void *)dev) == NULL ) {
printk("create proc mesh_assoc_mpinfo failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_stats", 0644, rtl8192cd_proc_root,
mesh_stats, (void *)dev) == NULL ) {
printk("create proc mesh_stats failed!\n");
return;
}
// 6 line for Throughput statistics (sounder)
if ( (res = create_proc_read_entry ("flow_stats", 0644, rtl8192cd_proc_root,
mesh_proc_flow_stats, (void *)dev)) == NULL ) {
printk("create proc flow_stats failed!\n");
return;
}
res->write_proc = mesh_proc_flow_stats_write;
if ( create_proc_read_entry ("mesh_pathsel_routetable", 0644, rtl8192cd_proc_root,
mesh_pathsel_routetable_info, (void *)dev) == NULL ) {
printk("create proc mesh_pathsel_routetable failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_proxy_table", 0644, rtl8192cd_proc_root,
mesh_proxy_table_info, (void *)dev) == NULL ) {
printk("create proc mesh_proxy_table failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_portal_table", 0644, rtl8192cd_proc_root,
mesh_portal_table_info, (void *)dev) == NULL ) {
printk("create proc mesh_portal_table failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_root_info", 0644, rtl8192cd_proc_root,
mesh_root_info, (void *)dev) == NULL ) {
printk("create proc mesh_root_info failed!\n");
return;
}
#ifdef MESH_USE_METRICOP
{ // change metric method
struct proc_dir_entry *proc_file1;
proc_file1 = create_proc_entry( "mesh_metric", 0644, rtl8192cd_proc_root);
if(proc_file1 == NULL) {
printk("can't create proc: %s\r\n", "mesh_metric");
return;
}
proc_file1->write_proc = mesh_metric_w;
proc_file1->read_proc = mesh_metric_r;
proc_file1->data = (void *)dev;
}
#endif
#if DBG_NCTU_MESH
if ( create_proc_read_entry ("mesh_skb", 0644, rtl8192cd_proc_root,
mesh_showAllSkbs, (void *)dev) == NULL ) {
printk("create proc mesh_skb failed!\n");
return;
}
{
struct proc_dir_entry *proc_file1;
proc_file1 = create_proc_entry("mesh_dbg", 0644, rtl8192cd_proc_root);
if(proc_file1 == NULL) {
printk("can't create proc: %s\r\n", "mesh_dbg");
return;
}
proc_file1->write_proc = mesh_setDebugLevel;
}
#endif
#ifdef _MESH_DEBUG_
if ( create_proc_read_entry ("mesh_clearalltable", 0644, rtl8192cd_proc_root,
mesh_proc_clear_table, (void *)dev) == NULL ) {
printk("create proc mesh_clearalltable failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_issueauthreq", 0644, rtl8192cd_proc_root,
mesh_proc_issueAuthReq, (void *)dev) == NULL ) {
printk("create proc mesh_issueauthreq failed!\n");
return;
}
#ifdef MESH_BOOTSEQ_AUTH
if ( create_proc_read_entry ("mesh_issueauthrsp", 0644, rtl8192cd_proc_root,
mesh_proc_issueAuthRsp, (void *)dev) == NULL ) {
printk("create proc mesh_issueauthrsp failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_issuedeauth", 0644, rtl8192cd_proc_root,
mesh_proc_issueDeAuth, (void *)dev) == NULL ) {
printk("create proc mesh_issuedeauth failed!\n");
return;
}
#endif
if ( create_proc_read_entry ("mesh_openconnect", 0644, rtl8192cd_proc_root,
mesh_proc_openConnect, (void *)dev) == NULL ) {
printk("create proc mesh_openconnect failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_issueopen", 0644, rtl8192cd_proc_root,
mesh_proc_issueOpen, (void *)dev) == NULL ) {
printk("create proc mesh_issueopen failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_issueconfirm", 0644, rtl8192cd_proc_root,
mesh_proc_issueConfirm, (void *)dev) == NULL ) {
printk("create proc mesh_issueconfirm failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_issueclose", 0644, rtl8192cd_proc_root,
mesh_proc_issueClose, (void *)dev) == NULL ) {
printk("create proc mesh_issueclose failed!\n");
return;
}
if ( create_proc_read_entry ("mesh_closeconnect", 0644, rtl8192cd_proc_root,
mesh_proc_closeConnect, (void *)dev) == NULL ) {
printk("create proc mesh_closeconnect failed!\n");
return;
}
{
struct proc_dir_entry *proc_file1;
proc_file1 = create_proc_entry("mesh_setmacaddr", 0644, rtl8192cd_proc_root);
if(proc_file1 == NULL) {
printk("can't create proc: %s\r\n", "mesh_setmacaddr");
return;
}
proc_file1->write_proc = mesh_setMACAddr;
}
#if (MESH_DBG_LV & MESH_DBG_COMPLEX)
{
struct proc_dir_entry *proc_file;
proc_file = create_proc_entry(MESH_PROC_SME_TEST_FILENAME, 0644, rtl8192cd_proc_root);
if(proc_file == NULL) {
printk("can't create proc: %s\r\n", MESH_PROC_SME_TEST_FILENAME);
return;
}
proc_file->read_proc = mesh_test_sme_proc_read;
proc_file->write_proc = mesh_test_sme_proc_write;
}
/*{
struct proc_dir_entry *proc_file;
proc_file = create_proc_entry(MESH_PROC_FILENAME, 0644, rtl8192cd_proc_root);
if(proc_file == NULL) {
printk("can't create proc: %s\r\n", MESH_PROC_FILENAME);
return;
}
proc_file->read_proc = mesh_proc_read;
proc_file->write_proc = mesh_proc_write;
}*/
#endif // (MESH_DBG_LV & MESH_DBG_COMPLEX)
#endif // _MESH_DEBUG_
#endif // CONFIG_RTK_MESH
}
void /*__devexit*/MDL_EXIT rtl8192cd_proc_remove (struct net_device *dev)
{
#ifdef NETDEV_NO_PRIV
struct rtl8192cd_priv *priv = ((struct rtl8192cd_priv *)netdev_priv(dev))->wlan_priv;
#else
struct rtl8192cd_priv *priv = dev->priv;
#endif
struct proc_dir_entry *rtl8192cd_proc_root = priv->proc_root;
if (rtl8192cd_proc_root != NULL) {
remove_proc_entry( "mib_all", rtl8192cd_proc_root );
remove_proc_entry( "mib_rf", rtl8192cd_proc_root );
remove_proc_entry( "mib_operation", rtl8192cd_proc_root );
remove_proc_entry( "mib_staconfig", rtl8192cd_proc_root );
remove_proc_entry( "mib_dkeytbl", rtl8192cd_proc_root );
remove_proc_entry( "mib_auth", rtl8192cd_proc_root );
remove_proc_entry( "mib_gkeytbl", rtl8192cd_proc_root );
remove_proc_entry( "mib_bssdesc", rtl8192cd_proc_root );
remove_proc_entry( "sta_info", rtl8192cd_proc_root );
remove_proc_entry( "sta_keyinfo", rtl8192cd_proc_root );
remove_proc_entry( "sta_dbginfo", rtl8192cd_proc_root );
remove_proc_entry( "stats", rtl8192cd_proc_root );
remove_proc_entry( "mib_erp", rtl8192cd_proc_root );
#ifdef WDS
remove_proc_entry( "mib_wds", rtl8192cd_proc_root );
#endif
#ifdef RTK_BR_EXT
remove_proc_entry( "mib_brext", rtl8192cd_proc_root );
#endif
#ifdef DFS
remove_proc_entry( "mib_dfs", rtl8192cd_proc_root );
#endif
#if defined(CONFIG_RTL_8812_SUPPORT) || defined(CONFIG_WLAN_HAL_8881A)
remove_proc_entry( "mib_rf_ac", rtl8192cd_proc_root );
#endif
remove_proc_entry( "mib_misc", rtl8192cd_proc_root );
#ifdef WIFI_SIMPLE_CONFIG
remove_proc_entry( "mib_wsc", rtl8192cd_proc_root );
#endif
#ifdef GBWC
remove_proc_entry( "mib_gbwc", rtl8192cd_proc_root );
#endif
remove_proc_entry( "mib_11n", rtl8192cd_proc_root );
#ifdef RTL_MANUAL_EDCA
remove_proc_entry( "mib_EDCA", rtl8192cd_proc_root );
#endif
#ifdef CONFIG_RTK_VLAN_SUPPORT
remove_proc_entry( "mib_vlan", rtl8192cd_proc_root );
#endif
#ifdef TLN_STATS
remove_proc_entry( "wifi_conn_stats", rtl8192cd_proc_root );
remove_proc_entry( "ext_wifi_conn_stats", rtl8192cd_proc_root );
#endif
#ifdef SUPPORT_MULTI_PROFILE
remove_proc_entry( "mib_ap_profile", rtl8192cd_proc_root );
#endif
#if defined(UNIVERSAL_REPEATER) || defined(MBSSID)
if (GET_ROOT_PRIV(priv) == NULL) // is root interface
#endif
{
remove_proc_entry( "txdesc", rtl8192cd_proc_root );
remove_proc_entry( "rxdesc", rtl8192cd_proc_root );
remove_proc_entry( "desc_info", rtl8192cd_proc_root );
remove_proc_entry( "buf_info", rtl8192cd_proc_root );
remove_proc_entry( "cam_info", rtl8192cd_proc_root );
#ifdef ENABLE_RTL_SKB_STATS
remove_proc_entry( "skb_info", rtl8192cd_proc_root );
#endif
#ifdef RF_FINETUNE
remove_proc_entry( "rf_finetune", rtl8192cd_proc_root );
#endif
#ifdef CLIENT_MODE
remove_proc_entry( "up_flag", rtl8192cd_proc_root );
#endif
#ifdef CONFIG_RTL_92C_SUPPORT
if ((GET_CHIP_VER(priv) == VERSION_8192C) || (GET_CHIP_VER(priv) == VERSION_8188C)) {
remove_proc_entry( "phypara_file", rtl8192cd_proc_root );
}
#endif
remove_proc_entry( "led", rtl8192cd_proc_root );
#ifdef AUTO_TEST_SUPPORT
remove_proc_entry( "SS_Result", rtl8192cd_proc_root );
#endif
#ifdef RTLWIFINIC_GPIO_CONTROL
remove_proc_entry( "gpio_ctrl", rtl8192cd_proc_root );
#endif
}
#ifdef CONFIG_RTK_MESH
#ifdef MESH_BOOTSEQ_AUTH
remove_proc_entry( "mesh_auth_mpinfo", rtl8192cd_proc_root );
#endif
remove_proc_entry( "mesh_unestablish_mpinfo", rtl8192cd_proc_root );
remove_proc_entry( "mesh_assoc_mpinfo", rtl8192cd_proc_root );
remove_proc_entry( "mesh_stats", rtl8192cd_proc_root );
remove_proc_entry( "flow_stats", rtl8192cd_proc_root );
remove_proc_entry( "mesh_pathsel_routetable", rtl8192cd_proc_root );
remove_proc_entry( "mesh_proxy_table", rtl8192cd_proc_root );
remove_proc_entry( "mesh_root_info", rtl8192cd_proc_root );
remove_proc_entry( "mesh_portal_table", rtl8192cd_proc_root );
#ifdef MESH_USE_METRICOP // remove proc file
remove_proc_entry( "mesh_metric", rtl8192cd_proc_root );
#endif
#if DBG_NCTU_MESH
remove_proc_entry( "mesh_skb", rtl8192cd_proc_root );
remove_proc_entry( "mesh_dbg", rtl8192cd_proc_root );
#endif
#ifdef _MESH_DEBUG_
remove_proc_entry( "mesh_clearalltable", rtl8192cd_proc_root );
remove_proc_entry( "mesh_setmacaddr", rtl8192cd_proc_root );
remove_proc_entry( "mesh_issueauthreq", rtl8192cd_proc_root );
#ifdef MESH_BOOTSEQ_AUTH
remove_proc_entry( "mesh_issueauthrsp", rtl8192cd_proc_root );
remove_proc_entry( "mesh_issuedeauth", rtl8192cd_proc_root );
#endif
remove_proc_entry( "mesh_openconnect", rtl8192cd_proc_root );
remove_proc_entry( "mesh_issueopen", rtl8192cd_proc_root );
remove_proc_entry( "mesh_issueconfirm", rtl8192cd_proc_root );
remove_proc_entry( "mesh_issueclose", rtl8192cd_proc_root );
remove_proc_entry( "mesh_closeconnect", rtl8192cd_proc_root );
#if (MESH_DBG_LV & MESH_DBG_COMPLEX)
remove_proc_entry( MESH_PROC_SME_TEST_FILENAME, rtl8192cd_proc_root );
#endif
#endif // _MESH_DEBUG_
#endif // CONFIG_RTK_MESH
remove_proc_entry( dev->name, NULL );
rtl8192cd_proc_root = NULL;
}
}
#endif
#if defined(_SINUX_) || !defined(__KERNEL__)
struct _proc_table_
{
char *cmd;
int (*func)(char *buf, char **start, off_t offset,
int length, int *eof, void *data);
};
static struct _proc_table_ proc_table[] =
{
{"mib_all", rtl8192cd_proc_mib_all},
{"mib_rf", rtl8192cd_proc_mib_rf},
{"mib_operation", rtl8192cd_proc_mib_operation},
{"mib_staconfig", rtl8192cd_proc_mib_staconfig},
{"mib_dkeytbl", rtl8192cd_proc_mib_dkeytbl},
{"mib_auth", rtl8192cd_proc_mib_auth},
{"mib_gkeytbl", rtl8192cd_proc_mib_gkeytbl},
{"mib_bssdesc", rtl8192cd_proc_mib_bssdesc},
{"sta_info", rtl8192cd_proc_stainfo},
{"sta_keyinfo", rtl8192cd_proc_sta_keyinfo},
{"sta_dbginfo", rtl8192cd_proc_sta_dbginfo},
{"txdesc", rtl8192cd_proc_txdesc_info},
{"rxdesc", rtl8192cd_proc_rxdesc_info},
{"desc_info", rtl8192cd_proc_desc_info},
{"buf_info", rtl8192cd_proc_buf_info},
{"stats", rtl8192cd_proc_stats},
{"mib_erp", rtl8192cd_proc_mib_erp},
{"cam_info", rtl8192cd_proc_cam_info},
#ifdef WDS
{"mib_wds", rtl8192cd_proc_mib_wds},
#endif
#ifdef RTK_BR_EXT
{"mib_brext", rtl8192cd_proc_mib_brext},
#endif
#ifdef ENABLE_RTL_SKB_STATS
{"skb_info", rtl8192cd_proc_skb_info},
#endif
#ifdef DFS
{"mib_dfs", rtl8192cd_proc_mib_DFS},
#endif
#if defined(CONFIG_RTL_8812_SUPPORT) || defined(CONFIG_WLAN_HAL_8881A)
{"mib_rf_ac", rtl8192cd_proc_mib_rf_ac},
#endif
{"mib_misc", rtl8192cd_proc_mib_misc},
#ifdef WIFI_SIMPLE_CONFIG
{"mib_wsc", rtl8192cd_proc_mib_wsc},
#endif
#ifdef GBWC
{"mib_gbwc", rtl8192cd_proc_mib_gbwc},
#endif
#ifdef RTL_MANUAL_EDCA
{"mib_EDCA", rtl8192cd_proc_mib_edca},
#endif
#ifdef CLIENT_MODE
{"up_flag", rtl8192cd_proc_up_read},
#endif
#if defined(RTLWIFINIC_GPIO_CONTROL)
{"gpio_ctrl", rtl8192cd_proc_gpio_ctrl_read},
#endif
#ifdef TLN_STATS
{"wifi_conn_stats", proc_wifi_conn_stats},
{"ext_wifi_conn_stats", proc_ext_wifi_conn_stats},
#endif
#ifdef AUTO_TEST_SUPPORT
{"SS_Result", rtl8192cd_proc_SSR_read},
#endif
#ifdef _MESH_DEBUG_ // 802.11s output debug information
{"mesh_unestablish_mpinfo", mesh_unEstablish_mpinfo},
{"mesh_assoc_mpinfo", mesh_assoc_mpinfo},
{"mesh_stats", mesh_stats}
#endif // _MESH_DEBUG_
};
#define NUM_CMD_TABLE_ENTRY (sizeof(proc_table) / sizeof(struct _proc_table_))
#ifdef __ECOS
void rtl8192cd_proc_help(char *name)
{
int i;
for (i=0; i<NUM_CMD_TABLE_ENTRY; i++) {
ecos_pr_fun("%s %s\n", name, proc_table[i].cmd);
}
ecos_pr_fun("%s led\n", name);
}
void rtl8192cd_proc_debug(struct net_device *dev, char *cmd)
{
int i, eof;
char *tmpbuf, *start;
start = tmpbuf = 0;
for (i=0; i<NUM_CMD_TABLE_ENTRY; i++) {
if (!strcmp(cmd, proc_table[i].cmd)) {
proc_table[i].func(tmpbuf, &start, 0, 0, &eof, dev);
}
}
}
#else
void rtl8192cd_proc_debug(struct net_device *dev, char *cmd)
{
int i, j, eof, len;
char *tmpbuf, *start;
start = tmpbuf = (char *)kmalloc(4096, 0);
for (i=0; i<NUM_CMD_TABLE_ENTRY; i++) {
if (!strcmp(cmd, proc_table[i].cmd)) {
memset(tmpbuf, 0, 4096);
len = proc_table[i].func(tmpbuf, &start, 0, 4096, &eof, dev);
for(j=0; j<len; j++)
printk("%c", tmpbuf[j]);
}
}
kfree(tmpbuf);
}
#endif
#ifdef CONFIG_MSC
int rtl8192cd_show_wifi_debug(char *dev_name, char *cmd, char *str)
{
int i, j, eof, len;
char *tmpbuf, *start;
struct net_device *dev;
printk("dev_name=%s, cmd=%s.\n", dev_name, cmd);
dev = dev_get_by_name(dev_name);
if (dev) {
start = tmpbuf = (char *)kmalloc(4096, 0);
for (i=0; i<NUM_CMD_TABLE_ENTRY; i++) {
if (!strcmp(cmd, proc_table[i].cmd)) {
memset(tmpbuf, 0, 4096);
len = proc_table[i].func(tmpbuf, &start, 0, 4096, &eof, dev);
strcpy(str, tmpbuf);
for(j=0; j<len; j++)
printk("%c", tmpbuf[j]);
}
}
kfree(tmpbuf);
dev_put(dev);
}
else
return 1;
return 0;
}
EXPORT_SYMBOL(rtl8192cd_show_wifi_debug);
EXPORT_SYMBOL(rtl8192cd_proc_debug);
#endif
#endif // __KERNEL__
#endif // __INCLUDE_PROC_FS__
|