hc
2024-08-16 62c46c9150c4afde7e5b25436263fddf79d66f0b
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
/*
 * Copyright (C) 2015 Spreadtrum Communications Inc.
 *
 * Authors    :
 * Baolei Yuan <baolei.yuan@spreadtrum.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
 
#ifndef __SPRDWL_VENDOR_H__
#define __SPRDWL_VENDOR_H__
 
#include <net/netlink.h>
#include <net/cfg80211.h>
#include <linux/ctype.h>
 
#define OUI_SPREAD 0x001374
 
enum {
   /* Memory dump of FW */
   WIFI_LOGGER_MEMORY_DUMP_SUPPORTED = (1 << (0)),
   /*PKT status*/
   WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED = (1 << (1)),
   /*Connectivity event*/
   WIFI_LOGGER_CONNECT_EVENT_SUPPORTED = (1 << (2)),
   /* POWER of Driver */
   WIFI_LOGGER_POWER_EVENT_SUPPORTED = (1 << (3)),
   /*WAKE LOCK of Driver*/
   WIFI_LOGGER_WAKE_LOCK_SUPPORTED = (1 << (4)),
   /*verbose log of FW*/
   WIFI_LOGGER_VERBOSE_SUPPORTED = (1 << (5)),
   /*monitor the health of FW*/
   WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED = (1 << (6)),
   /*dumps driver state*/
   WIFI_LOGGER_DRIVER_DUMP_SUPPORTED = (1 << (7)),
   /*tracks connection packets' fate*/
   WIFI_LOGGER_PACKET_FATE_SUPPORTED = (1 << (8)),
};
 
enum sprdwl_wifi_error {
   WIFI_SUCCESS = 0,
   WIFI_ERROR_UNKNOWN = -1,
   WIFI_ERROR_UNINITIALIZED = -2,
   WIFI_ERROR_NOT_SUPPORTED = -3,
   WIFI_ERROR_NOT_AVAILABLE = -4,
   WIFI_ERROR_INVALID_ARGS = -5,
   WIFI_ERROR_INVALID_REQUEST_ID = -6,
   WIFI_ERROR_TIMED_OUT = -7,
   WIFI_ERROR_TOO_MANY_REQUESTS = -8,
   WIFI_ERROR_OUT_OF_MEMORY = -9,
   WIFI_ERROR_BUSY = -10,
};
 
enum sprdwl_vendor_subcommand_id {
   SPRDWL_VENDOR_SUBCMD_ROAMING = 9,
   SPRDWL_VENDOR_SUBCMD_NAN = 12,
   SPRDWL_VENDOR_SET_LLSTAT = 14,
   SPRDWL_VENDOR_GET_LLSTAT = 15,
   SPRDWL_VENDOR_CLR_LLSTAT = 16,
   SPRDWL_VENDOR_SUBCMD_GSCAN_START = 20,
   SPRDWL_VENDOR_SUBCMD_GSCAN_STOP = 21,
   SPRDWL_VENDOR_SUBCMD_GSCAN_GET_CHANNEL = 22,
   SPRDWL_VENDOR_SUBCMD_GSCAN_GET_CAPABILITIES = 23,
   SPRDWL_VENDOR_SUBCMD_GSCAN_GET_CACHED_RESULTS = 24,
   /* Used when report_threshold is reached in scan cache. */
   SPRDWL_VENDOR_SUBCMD_GSCAN_SCAN_RESULTS_AVAILABLE = 25,
   /* Used to report scan results when each probe rsp. is received,
   * if report_events enabled in wifi_scan_cmd_params.
   */
   SPRDWL_VENDOR_SUBCMD_GSCAN_FULL_SCAN_RESULT = 26,
   /* Indicates progress of scanning state-machine. */
   SPRDWL_VENDOR_SUBCMD_GSCAN_SCAN_EVENT = 27,
   /* Indicates BSSID Hotlist. */
   SPRDWL_VENDOR_SUBCMD_GSCAN_HOTLIST_AP_FOUND = 28,
   SPRDWL_VENDOR_SUBCMD_GSCAN_SET_BSSID_HOTLIST = 29,
   SPRDWL_VENDOR_SUBCMD_GSCAN_RESET_BSSID_HOTLIST = 30,
   SPRDWL_VENDOR_SUBCMD_GSCAN_SIGNIFICANT_CHANGE = 31,
   SPRDWL_VENDOR_SUBCMD_GSCAN_SET_SIGNIFICANT_CHANGE = 32,
   SPRDWL_VENDOR_SUBCMD_GSCAN_RESET_SIGNIFICANT_CHANGE = 33,
   SPRDWL_VENDOR_SUBCMD_GET_SUPPORT_FEATURE = 38,
   SPRDWL_VENDOR_SUBCMD_SET_MAC_OUI = 39,
   SPRDWL_VENDOR_SUBCMD_GSCAN_HOTLIST_AP_LOST = 41,
   SPRDWL_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42,
   SPRDWL_VENDOR_SUBCMD_GET_FEATURE = 55,
   SPRDWL_VENDOR_SUBCMD_GET_WIFI_INFO = 61,
   SPRDWL_VENDOR_SUBCMD_START_LOGGING = 62,
   SPRDWL_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP = 63,
   SPRDWL_VENDOR_SUBCMD_ROAM = 64,
   SPRDWL_VENDOR_SUBCMD_GSCAN_SET_SSID_HOTLIST = 65,
   SPRDWL_VENDOR_SUBCMD_GSCAN_RESET_SSID_HOTLIST = 66,
   SPRDWL_VENDOR_SUBCMD_PNO_SET_LIST = 69,
   SPRDWL_VENDOR_SUBCMD_PNO_SET_PASSPOINT_LIST = 70,
   SPRDWL_VENDOR_SUBCMD_PNO_RESET_PASSPOINT_LIST = 71,
   SPRDWL_VENDOR_SUBCMD_PNO_NETWORK_FOUND = 72,
   SPRDWL_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET = 76,
   SPRDWL_VENDOR_SUBCMD_GET_RING_DATA = 77,
   SPRDWL_VENDOR_SUBCMD_OFFLOADED_PACKETS = 79,
   SPRDWL_VENDOR_SUBCMD_MONITOR_RSSI = 80,
   SPRDWL_VENDOR_SUBCMD_ENABLE_ND_OFFLOAD = 82,
   SPRDWL_VENDOR_SUBCMD_GET_WAKE_REASON_STATS = 85,
   SPRDWL_VENDOR_SUBCMD_SET_SAR_LIMITS = 146,
 
   SPRDWL_VENDOR_SUBCOMMAND_MAX
};
 
#define SPRDWL_VENDOR_EVENT_NAN_INDEX 32
 
enum sprdwl_vendor_event {
   SPRDWL_VENDOR_SUBCMD_MONITOR_RSSI_INDEX = 0,
   /* NAN */
   SPRDWL_VENDOR_EVENT_NAN = 0x1400,
};
 
/* attribute id */
 
enum sprdwl_vendor_attr_gscan_id {
   SPRDWL_VENDOR_ATTR_FEATURE_SET = 1,
   SPRDWL_VENDOR_ATTR_GSCAN_NUM_CHANNELS = 3,
   SPRDWL_VENDOR_ATTR_GSCAN_CHANNELS = 4,
   SPRDWL_VENDOR_ATTR_MAX
};
 
enum sprdwl_vendor_attr_get_wifi_info {
   SPRDWL_VENDOR_ATTR_WIFI_INFO_GET_INVALID = 0,
   SPRDWL_VENDOR_ATTR_WIFI_INFO_DRIVER_VERSION = 1,
   SPRDWL_VENDOR_ATTR_WIFI_INFO_FIRMWARE_VERSION = 2,
};
 
enum sprdwl_vendor_attribute {
   SPRDWL_VENDOR_ATTR_UNSPEC,
   SPRDWL_VENDOR_ATTR_GET_LLSTAT,
   SPRDWL_VENDOR_ATTR_CLR_LLSTAT,
   /* NAN */
   SRPDWL_VENDOR_ATTR_NAN,
   SPRDWL_VENDOR_ROAMING_POLICY = 5,
};
 
/*start of link layer stats, CMD ID:14,15,16*/
enum sprdwl_wlan_vendor_attr_ll_stats_set {
   SPRDWL_LL_STATS_SET_INVALID = 0,
   /* Unsigned 32-bit value */
   SPRDWL_LL_STATS_MPDU_THRESHOLD = 1,
   SPRDWL_LL_STATS_GATHERING = 2,
   /* keep last */
   SPRDWL_LL_STATS_SET_AFTER_LAST,
   SPRDWL_LL_STATS_SET_MAX =
   SPRDWL_LL_STATS_SET_AFTER_LAST - 1,
};
 
static const struct nla_policy
sprdwl_ll_stats_policy[SPRDWL_LL_STATS_SET_MAX + 1] = {
   [SPRDWL_LL_STATS_MPDU_THRESHOLD] = { .type = NLA_U32 },
   [SPRDWL_LL_STATS_GATHERING] = { .type = NLA_U32 },
};
 
enum sprdwl_vendor_attr_ll_stats_results {
   SPRDWL_LL_STATS_INVALID = 0,
   SPRDWL_LL_STATS_RESULTS_REQ_ID = 1,
   SPRDWL_LL_STATS_IFACE_BEACON_RX = 2,
   SPRDWL_LL_STATS_IFACE_MGMT_RX = 3,
   SPRDWL_LL_STATS_IFACE_MGMT_ACTION_RX = 4,
   SPRDWL_LL_STATS_IFACE_MGMT_ACTION_TX = 5,
   SPRDWL_LL_STATS_IFACE_RSSI_MGMT = 6,
   SPRDWL_LL_STATS_IFACE_RSSI_DATA = 7,
   SPRDWL_LL_STATS_IFACE_RSSI_ACK = 8,
   SPRDWL_LL_STATS_IFACE_INFO_MODE = 9,
   SPRDWL_LL_STATS_IFACE_INFO_MAC_ADDR = 10,
   SPRDWL_LL_STATS_IFACE_INFO_STATE = 11,
   SPRDWL_LL_STATS_IFACE_INFO_ROAMING = 12,
   SPRDWL_LL_STATS_IFACE_INFO_CAPABILITIES = 13,
   SPRDWL_LL_STATS_IFACE_INFO_SSID = 14,
   SPRDWL_LL_STATS_IFACE_INFO_BSSID = 15,
   SPRDWL_LL_STATS_IFACE_INFO_AP_COUNTRY_STR = 16,
   SPRDWL_LL_STATS_IFACE_INFO_COUNTRY_STR = 17,
   SPRDWL_LL_STATS_WMM_AC_AC = 18,
   SPRDWL_LL_STATS_WMM_AC_TX_MPDU = 19,
   SPRDWL_LL_STATS_WMM_AC_RX_MPDU = 20,
   SPRDWL_LL_STATS_WMM_AC_TX_MCAST = 21,
   SPRDWL_LL_STATS_WMM_AC_RX_MCAST = 22,
   SPRDWL_LL_STATS_WMM_AC_RX_AMPDU = 23,
   SPRDWL_LL_STATS_WMM_AC_TX_AMPDU = 24,
   SPRDWL_LL_STATS_WMM_AC_MPDU_LOST = 25,
   SPRDWL_LL_STATS_WMM_AC_RETRIES = 26,
   SPRDWL_LL_STATS_WMM_AC_RETRIES_SHORT = 27,
   SPRDWL_LL_STATS_WMM_AC_RETRIES_LONG = 28,
   SPRDWL_LL_STATS_WMM_AC_CONTENTION_TIME_MIN = 29,
   SPRDWL_LL_STATS_WMM_AC_CONTENTION_TIME_MAX = 30,
   SPRDWL_LL_STATS_WMM_AC_CONTENTION_TIME_AVG = 31,
   SPRDWL_LL_STATS_WMM_AC_CONTENTION_NUM_SAMPLES = 32,
   SPRDWL_LL_STATS_IFACE_NUM_PEERS = 33,
   SPRDWL_LL_STATS_PEER_INFO_TYPE = 34,
   SPRDWL_LL_STATS_PEER_INFO_MAC_ADDRESS = 35,
   SPRDWL_LL_STATS_PEER_INFO_CAPABILITIES = 36,
   SPRDWL_LL_STATS_PEER_INFO_NUM_RATES = 37,
   SPRDWL_LL_STATS_RATE_PREAMBLE = 38,
   SPRDWL_LL_STATS_RATE_NSS = 39,
   SPRDWL_LL_STATS_RATE_BW = 40,
   SPRDWL_LL_STATS_RATE_MCS_INDEX = 41,
   SPRDWL_LL_STATS_RATE_BIT_RATE = 42,
   SPRDWL_LL_STATS_RATE_TX_MPDU = 43,
   SPRDWL_LL_STATS_RATE_RX_MPDU = 44,
   SPRDWL_LL_STATS_RATE_MPDU_LOST = 45,
   SPRDWL_LL_STATS_RATE_RETRIES = 46,
   SPRDWL_LL_STATS_RATE_RETRIES_SHORT = 47,
   SPRDWL_LL_STATS_RATE_RETRIES_LONG = 48,
   SPRDWL_LL_STATS_RADIO_ID = 49,
   SPRDWL_LL_STATS_RADIO_ON_TIME = 50,
   SPRDWL_LL_STATS_RADIO_TX_TIME = 51,
   SPRDWL_LL_STATS_RADIO_RX_TIME = 52,
   SPRDWL_LL_STATS_RADIO_ON_TIME_SCAN = 53,
   SPRDWL_LL_STATS_RADIO_ON_TIME_NBD = 54,
   SPRDWL_LL_STATS_RADIO_ON_TIME_GSCAN = 55,
   SPRDWL_LL_STATS_RADIO_ON_TIME_ROAM_SCAN = 56,
   SPRDWL_LL_STATS_RADIO_ON_TIME_PNO_SCAN = 57,
   SPRDWL_LL_STATS_RADIO_ON_TIME_HS20 = 58,
   SPRDWL_LL_STATS_RADIO_NUM_CHANNELS = 59,
   SPRDWL_LL_STATS_CHANNEL_INFO_WIDTH = 60,
   SPRDWL_LL_STATS_CHANNEL_INFO_CENTER_FREQ = 61,
   SPRDWL_LL_STATS_CHANNEL_INFO_CENTER_FREQ0 = 62,
   SPRDWL_LL_STATS_CHANNEL_INFO_CENTER_FREQ1 = 63,
   SPRDWL_LL_STATS_CHANNEL_ON_TIME = 64,
   SPRDWL_LL_STATS_CHANNEL_CCA_BUSY_TIME = 65,
   SPRDWL_LL_STATS_NUM_RADIOS = 66,
   SPRDWL_LL_STATS_CH_INFO = 67,
   SPRDWL_LL_STATS_PEER_INFO = 68,
   SPRDWL_LL_STATS_PEER_INFO_RATE_INFO = 69,
   SPRDWL_LL_STATS_WMM_INFO = 70,
   SPRDWL_LL_STATS_RESULTS_MORE_DATA = 71,
   SPRDWL_LL_STATS_IFACE_AVERAGE_TSF_OFFSET = 72,
   SPRDWL_LL_STATS_IFACE_LEAKY_AP_DETECTED = 73,
   SPRDWL_LL_STATS_IFACE_LEAKY_AP_AVG_NUM_FRAMES_LEAKED = 74,
   SPRDWL_LL_STATS_IFACE_LEAKY_AP_GUARD_TIME = 75,
   SPRDWL_LL_STATS_TYPE = 76,
   SPRDWL_LL_STATS_RADIO_NUM_TX_LEVELS = 77,
   SPRDWL_LL_STATS_RADIO_TX_TIME_PER_LEVEL = 78,
   SPRDWL_LL_STATS_IFACE_RTS_SUCC_CNT = 79,
   SPRDWL_LL_STATS_IFACE_RTS_FAIL_CNT = 80,
   SPRDWL_LL_STATS_IFACE_PPDU_SUCC_CNT = 81,
   SPRDWL_LL_STATS_IFACE_PPDU_FAIL_CNT = 82,
 
   /* keep last */
   SPRDWL_LL_STATS_AFTER_LAST,
   SPRDWL_LL_STATS_MAX =
   SPRDWL_LL_STATS_AFTER_LAST - 1,
};
 
enum sprdwl_wlan_vendor_attr_ll_stats_type {
   SPRDWL_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_INVALID = 0,
   SPRDWL_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_RADIO = 1,
   SPRDWL_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_IFACE = 2,
   SPRDWL_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_PEERS = 3,
 
   /* keep last */
   SPRDWL_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_AFTER_LAST,
   SPRDWL_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_MAX =
   SPRDWL_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_AFTER_LAST - 1,
};
 
enum sprdwl_attr_ll_stats_clr {
   SPRDWL_LL_STATS_CLR_INVALID = 0,
   SPRDWL_LL_STATS_CLR_CONFIG_REQ_MASK = 1,
   SPRDWL_LL_STATS_CLR_CONFIG_STOP_REQ = 2,
   SPRDWL_LL_STATS_CLR_CONFIG_RSP_MASK = 3,
   SPRDWL_LL_STATS_CLR_CONFIG_STOP_RSP = 4,
   /* keep last */
   SPRDWL_LL_STATS_CLR_AFTER_LAST,
   SPRDWL_LL_STATS_CLR_MAX =
   SPRDWL_LL_STATS_CLR_AFTER_LAST - 1,
};
 
/*end of link layer stats*/
 
/*start of gscan----CMD ID:23*/
struct sprdwl_gscan_capa {
   s16 max_scan_cache_size;
   u8 max_scan_buckets;
   u8 max_ap_cache_per_scan;
   u8 max_rssi_sample_size;
   u8 max_scan_reporting_threshold;
   u8 max_hotlist_bssids;
   u8 max_hotlist_ssids;
   u8 max_significant_wifi_change_aps;
   u8 max_bssid_history_entries;
   u8 max_number_epno_networks;
   u8 max_number_epno_networks_by_ssid;
   u8 max_whitelist_ssid;
   u8 max_blacklist_size;
};
 
struct sprdwl_roam_capa {
   u32 max_blacklist_size;
   u32 max_whitelist_size;
};
 
enum sprdwl_vendor_attr_gscan_results {
   GSCAN_RESULTS_INVALID = 0,
 
   /* Unsigned 32-bit value; must match the request Id supplied by
    * Wi-Fi HAL in the corresponding subcmd NL msg.
    */
   GSCAN_RESULTS_REQUEST_ID = 1,
 
   /* Unsigned 32-bit value; used to indicate the status response from
    * firmware/driver for the vendor sub-command.
    */
   GSCAN_STATUS = 2,
 
   /* GSCAN Valid Channels attributes */
   /* Unsigned 32bit value; followed by a nested array of CHANNELS. */
   GSCAN_RESULTS_NUM_CHANNELS = 3,
   /* An array of NUM_CHANNELS x unsigned 32-bit value integers
    * representing channel numbers.
    */
   GSCAN_RESULTS_CHANNELS = 4,
 
   /* GSCAN Capabilities attributes */
   /* Unsigned 32-bit value */
   GSCAN_SCAN_CACHE_SIZE = 5,
   /* Unsigned 32-bit value */
   GSCAN_MAX_SCAN_BUCKETS = 6,
   /* Unsigned 32-bit value */
   GSCAN_MAX_AP_CACHE_PER_SCAN = 7,
   /* Unsigned 32-bit value */
   GSCAN_MAX_RSSI_SAMPLE_SIZE = 8,
   /* Signed 32-bit value */
   GSCAN_MAX_SCAN_REPORTING_THRESHOLD = 9,
   /* Unsigned 32-bit value */
   GSCAN_MAX_HOTLIST_BSSIDS = 10,
   /* Unsigned 32-bit value */
   GSCAN_MAX_SIGNIFICANT_WIFI_CHANGE_APS = 11,
   /* Unsigned 32-bit value */
   GSCAN_MAX_BSSID_HISTORY_ENTRIES = 12,
 
   /* GSCAN Attributes used with
    * GSCAN_SCAN_RESULTS_AVAILABLE sub-command.
    */
 
   /* Unsigned 32-bit value */
   GSCAN_RESULTS_NUM_RESULTS_AVAILABLE = 13,
 
   /* GSCAN attributes used with
    * GSCAN_FULL_SCAN_RESULT sub-command.
    */
 
   /* An array of NUM_RESULTS_AVAILABLE x
    * GSCAN_RESULTS_SCAN_RESULT_*
    */
   GSCAN_RESULTS_LIST = 14,
 
   /* Unsigned 64-bit value; age of sample at the time of retrieval */
   GSCAN_RESULTS_SCAN_RESULT_TIME_STAMP = 15,
   /* 33 x unsigned 8-bit value; NULL terminated SSID */
   GSCAN_RESULTS_SCAN_RESULT_SSID = 16,
   /* An array of 6 x unsigned 8-bit value */
   GSCAN_RESULTS_SCAN_RESULT_BSSID = 17,
   /* Unsigned 32-bit value; channel frequency in MHz */
   GSCAN_RESULTS_SCAN_RESULT_CHANNEL = 18,
   /* Signed 32-bit value */
   GSCAN_RESULTS_SCAN_RESULT_RSSI = 19,
   /* Unsigned 32-bit value */
   GSCAN_RESULTS_SCAN_RESULT_RTT = 20,
   /* Unsigned 32-bit value */
   GSCAN_RESULTS_SCAN_RESULT_RTT_SD = 21,
   /* Unsigned 16-bit value */
   GSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD = 22,
   /* Unsigned 16-bit value */
   GSCAN_RESULTS_SCAN_RESULT_CAPABILITY = 23,
   /* Unsigned 32-bit value; size of the IE DATA blob */
   GSCAN_RESULTS_SCAN_RESULT_IE_LENGTH = 24,
   /* An array of IE_LENGTH x unsigned 8-bit value; blob of all the
    * information elements found in the beacon; this data should be a
    * packed list of wifi_information_element objects, one after the
    * other.
    */
   GSCAN_RESULTS_SCAN_RESULT_IE_DATA = 25,
 
   /* Unsigned 8-bit value; set by driver to indicate more scan results are
    * available.
    */
   GSCAN_RESULTS_SCAN_RESULT_MORE_DATA = 26,
 
   /* GSCAN attributes for
    * GSCAN_SCAN_EVENT sub-command.
    */
   /* Unsigned 8-bit value */
   GSCAN_RESULTS_SCAN_EVENT_TYPE = 27,
   /* Unsigned 32-bit value */
   GSCAN_RESULTS_SCAN_EVENT_STATUS = 28,
 
   /* GSCAN attributes for
    * GSCAN_HOTLIST_AP_FOUND sub-command.
    */
   /* Use attr GSCAN_RESULTS_NUM_RESULTS_AVAILABLE
    * to indicate number of results.
    * Also, use GSCAN_RESULTS_LIST to indicate the
    * list of results.
    */
 
   /* GSCAN attributes for
    * GSCAN_SIGNIFICANT_CHANGE sub-command.
    */
   /* An array of 6 x unsigned 8-bit value */
   GSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_BSSID = 29,
   /* Unsigned 32-bit value */
   GSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_CHANNEL = 30,
   /* Unsigned 32-bit value. */
   GSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_NUM_RSSI = 31,
   /* A nested array of signed 32-bit RSSI values. Size of the array is
    * determined by (NUM_RSSI of SIGNIFICANT_CHANGE_RESULT_NUM_RSSI.
    */
   GSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_RSSI_LIST = 32,
 
   /* GSCAN attributes used with
    * GSCAN_GET_CACHED_RESULTS sub-command.
    */
   /* Use attr GSCAN_RESULTS_NUM_RESULTS_AVAILABLE
    * to indicate number of gscan cached results returned.
    * Also, use GSCAN_CACHED_RESULTS_LIST to indicate
    *  the list of gscan cached results.
    */
 
   /* An array of NUM_RESULTS_AVAILABLE x
    * NL80211_VENDOR_ATTR_GSCAN_CACHED_RESULTS_*
    */
   GSCAN_CACHED_RESULTS_LIST = 33,
   /* Unsigned 32-bit value; a unique identifier for the scan unit. */
   GSCAN_CACHED_RESULTS_SCAN_ID = 34,
   /* Unsigned 32-bit value; a bitmask w/additional information about scan.
    */
   GSCAN_CACHED_RESULTS_FLAGS = 35,
   /* Use attr GSCAN_ATTR_RESULTS_NUM_RESULTS_AVAILABLE
    * to indicate number of wifi scan results/bssids retrieved by the scan.
    * Also, use GSCAN_ATTR_RESULTS_LIST to indicate the
    * list of wifi scan results returned for each cached result block.
    */
 
   /* GSCAN attributes for
    * NL80211_VENDOR_SUBCMD_PNO_NETWORK_FOUND sub-command.
    */
   /* Use GSCAN_ATTR_RESULTS_NUM_RESULTS_AVAILABLE for
    * number of results.
    * Use GSCAN_ATTR_RESULTS_LIST to indicate the nested
    * list of wifi scan results returned for each
    * wifi_passpoint_match_result block.
    * Array size: GSCAN_ATTR_RESULTS_NUM_RESULTS_AVAILABLE.
    */
 
   /* GSCAN attributes for
    * NL80211_VENDOR_SUBCMD_PNO_PASSPOINT_NETWORK_FOUND sub-command.
    */
   /* Unsigned 32-bit value */
   GSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES = 36,
   /* A nested array of
    * GSCAN_ATTR_PNO_RESULTS_PASSPOINT_MATCH_*
    * attributes. Array size =
    * *_ATTR_GSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES.
    */
   GSCAN_PNO_RESULTS_PASSPOINT_MATCH_RESULT_LIST = 37,
 
   /* Unsigned 32-bit value; network block id for the matched network */
   GSCAN_PNO_RESULTS_PASSPOINT_MATCH_ID = 38,
   /* Use GSCAN_ATTR_RESULTS_LIST to indicate the nested
    * list of wifi scan results returned for each
    * wifi_passpoint_match_result block.
    */
   /* Unsigned 32-bit value */
   GSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP_LEN = 39,
   /* An array size of PASSPOINT_MATCH_ANQP_LEN of unsigned 8-bit values;
    * ANQP data in the information_element format.
    */
   GSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP = 40,
 
   /* Unsigned 32-bit value; a GSCAN Capabilities attribute. */
   GSCAN_MAX_HOTLIST_SSIDS = 41,
   /* Unsigned 32-bit value; a GSCAN Capabilities attribute. */
   GSCAN_MAX_NUM_EPNO_NETS = 42,
   /* Unsigned 32-bit value; a GSCAN Capabilities attribute. */
   GSCAN_MAX_NUM_EPNO_NETS_BY_SSID = 43,
   /* Unsigned 32-bit value; a GSCAN Capabilities attribute. */
   GSCAN_MAX_NUM_WHITELISTED_SSID = 44,
 
   GSCAN_RESULTS_BUCKETS_SCANNED = 45,
   /* Unsigned 32bit value; a GSCAN Capabilities attribute. */
   GSCAN_MAX_NUM_BLACKLISTED_BSSID = 46,
 
   /* keep last */
   GSCAN_RESULTS_AFTER_LAST,
   GSCAN_RESULTS_MAX =
   GSCAN_RESULTS_AFTER_LAST - 1,
};
 
enum sprdwl_vendor_attr_set_scanning_mac_oui {
   WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_INVALID = 0,
   WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI = 1,
   /* keep last */
   WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_AFTER_LAST,
   WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX =
   WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_AFTER_LAST - 1,
};
 
/*end of gscan capability---CMD ID:23*/
 
/*start of get supported feature---CMD ID:38*/
/* Feature enums */
/* Basic infrastructure mode */
#define WIFI_FEATURE_INFRA              0x0001
/* Support for 5 GHz Band */
#define WIFI_FEATURE_INFRA_5G           0x0002
/* Support for GAS/ANQP */
#define WIFI_FEATURE_HOTSPOT            0x0004
/* Wifi-Direct */
#define WIFI_FEATURE_P2P                0x0008
/* Soft AP */
#define WIFI_FEATURE_SOFT_AP            0x0010
/* Google-Scan APIs */
#define WIFI_FEATURE_GSCAN              0x0020
/* Neighbor Awareness Networking */
#define WIFI_FEATURE_NAN                0x0040
/* Device-to-device RTT */
#define WIFI_FEATURE_D2D_RTT            0x0080
/* Device-to-AP RTT */
#define WIFI_FEATURE_D2AP_RTT           0x0100
/* Batched Scan (legacy) */
#define WIFI_FEATURE_BATCH_SCAN         0x0200
/* Preferred network offload */
#define WIFI_FEATURE_PNO                0x0400
/* Support for two STAs */
#define WIFI_FEATURE_ADDITIONAL_STA     0x0800
/* Tunnel directed link setup */
#define WIFI_FEATURE_TDLS               0x1000
/* Support for TDLS off channel */
#define WIFI_FEATURE_TDLS_OFFCHANNEL    0x2000
/* Enhanced power reporting */
#define WIFI_FEATURE_EPR                0x4000
/* Support for AP STA Concurrency */
#define WIFI_FEATURE_AP_STA             0x8000
/* Link layer stats collection */
#define WIFI_FEATURE_LINK_LAYER_STATS   0x10000
/* WiFi Logger */
#define WIFI_FEATURE_LOGGER             0x20000
/* WiFi PNO enhanced */
#define WIFI_FEATURE_HAL_EPNO           0x40000
/* RSSI Monitor */
#define WIFI_FEATURE_RSSI_MONITOR       0x80000
/* WiFi mkeep_alive */
#define WIFI_FEATURE_MKEEP_ALIVE        0x100000
/* ND offload configure */
#define WIFI_FEATURE_CONFIG_NDO         0x200000
/* Capture Tx transmit power levels */
#define WIFI_FEATURE_TX_TRANSMIT_POWER  0x400000
/* Enable/Disable firmware roaming */
#define WIFI_FEATURE_CONTROL_ROAMING    0x800000
/* Support Probe IE white listing */
#define WIFI_FEATURE_IE_WHITELIST       0x1000000
/* Support MAC & Probe Sequence Number randomization */
#define WIFI_FEATURE_SCAN_RAND          0x2000000
 
/*end of get supported feature---CMD ID:38*/
 
/*start of get supported feature---CMD ID:42*/
 
#define CDS_MAX_FEATURE_SET   8
 
/*enum wlan_vendor_attr_get_concurrency_matrix - get concurrency matrix*/
enum wlan_vendor_attr_get_concurrency_matrix {
   SPRDWL_ATTR_CO_MATRIX_INVALID = 0,
   SPRDWL_ATTR_CO_MATRIX_CONFIG_PARAM_SET_SIZE_MAX = 1,
   SPRDWL_ATTR_CO_MATRIX_RESULTS_SET_SIZE = 2,
   SPRDWL_ATTR_CO_MATRIX_RESULTS_SET = 3,
   SPRDWL_ATTR_CO_MATRIX_AFTER_LAST,
   SPRDWL_ATTR_CO_MATRIX_MAX =
    SPRDWL_ATTR_CO_MATRIX_AFTER_LAST - 1,
};
 
/*end of get supported feature---CMD ID:42*/
 
/*start of get wifi info----CMD ID:61*/
enum sprdwl_attr_get_wifi_info {
   SPRDWL_ATTR_WIFI_INFO_GET_INVALID = 0,
   SPRDWL_ATTR_WIFI_INFO_DRIVER_VERSION = 1,
   SPRDWL_ATTR_WIFI_INFO_FIRMWARE_VERSION = 2,
   SPRDWL_ATTR_WIFI_INFO_GET_AFTER_LAST,
   SPRDWL_ATTR_WIFI_INFO_GET_MAX =
       SPRDWL_ATTR_WIFI_INFO_GET_AFTER_LAST - 1,
};
 
/*end of get wifi info----CMD ID:61*/
 
/*start of roaming data structure,CMD ID:64,CMD ID:9*/
enum fw_roaming_state {
   ROAMING_DISABLE,
   ROAMING_ENABLE
};
 
enum sprdwl_attr_roaming_config_params {
   SPRDWL_ROAM_INVALID = 0,
   SPRDWL_ROAM_SUBCMD = 1,
   SPRDWL_ROAM_REQ_ID = 2,
   SPRDWL_ROAM_WHITE_LIST_SSID_NUM_NETWORKS = 3,
   SPRDWL_ROAM_WHITE_LIST_SSID_LIST = 4,
   SPRDWL_ROAM_WHITE_LIST_SSID = 5,
   SPRDWL_ROAM_A_BAND_BOOST_THRESHOLD = 6,
   SPRDWL_ROAM_A_BAND_PENALTY_THRESHOLD = 7,
   SPRDWL_ROAM_A_BAND_BOOST_FACTOR = 8,
   SPRDWL_ROAM_A_BAND_PENALTY_FACTOR = 9,
   SPRDWL_ROAM_A_BAND_MAX_BOOST = 10,
   SPRDWL_ROAM_LAZY_ROAM_HISTERESYS = 11,
   SPRDWL_ROAM_ALERT_ROAM_RSSI_TRIGGER = 12,
   /* Attribute for set_lazy_roam */
   SPRDWL_ROAM_SET_LAZY_ROAM_ENABLE = 13,
   /* Attribute for set_lazy_roam with preferences */
   SPRDWL_ROAM_SET_BSSID_PREFS = 14,
   SPRDWL_ROAM_SET_LAZY_ROAM_NUM_BSSID = 15,
   SPRDWL_ROAM_SET_LAZY_ROAM_BSSID = 16,
   SPRDWL_ROAM_SET_LAZY_ROAM_RSSI_MODIFIER = 17,
   /* Attribute for set_blacklist bssid params */
   SPRDWL_ROAM_SET_BSSID_PARAMS = 18,
   SPRDWL_ROAM_SET_BSSID_PARAMS_NUM_BSSID = 19,
   SPRDWL_ROAM_SET_BSSID_PARAMS_BSSID = 20,
   /* keep last */
   SPRDWL_ROAM_AFTER_LAST,
   SPRDWL_ROAM_MAX =
   SPRDWL_ROAM_AFTER_LAST - 1,
};
 
enum sprdwl_attr_roam_subcmd {
   SPRDWL_ATTR_ROAM_SUBCMD_INVALID = 0,
   SPRDWL_ATTR_ROAM_SUBCMD_SSID_WHITE_LIST = 1,
   SPRDWL_ATTR_ROAM_SUBCMD_SET_GSCAN_ROAM_PARAMS = 2,
   SPRDWL_ATTR_ROAM_SUBCMD_SET_LAZY_ROAM = 3,
   SPRDWL_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS = 4,
   SPRDWL_ATTR_ROAM_SUBCMD_SET_BSSID_PARAMS = 5,
   SPRDWL_ATTR_ROAM_SUBCMD_SET_BLACKLIST_BSSID = 6,
   /*KEEP LAST*/
   SPRDWL_ATTR_ROAM_SUBCMD_AFTER_LAST,
   SPRDWL_ATTR_ROAM_SUBCMD_MAX =
   SPRDWL_ATTR_ROAM_SUBCMD_AFTER_LAST - 1,
};
 
#define MAX_WHITE_SSID 4
#define MAX_BLACK_BSSID  16
 
struct ssid_t {
   uint32_t length;
   char ssid_str[IEEE80211_MAX_SSID_LEN];
} __packed;
 
struct bssid_t {
   uint8_t MAC_addr[ETH_ALEN];
} __packed;
 
struct roam_white_list_params {
   uint8_t num_white_ssid;
   struct ssid_t white_list[MAX_WHITE_SSID];
} __packed;
 
struct roam_black_list_params {
   uint8_t num_black_bssid;
   struct bssid_t black_list[MAX_BLACK_BSSID];
} __packed;
 
/*end of roaming data structure,CMD ID:64*/
 
/*RSSI monitor start */
 
enum sprdwl_rssi_monitor_control {
   WLAN_RSSI_MONITORING_CONTROL_INVALID = 0,
   WLAN_RSSI_MONITORING_START,
   WLAN_RSSI_MONITORING_STOP,
};
 
/* struct rssi_monitor_req - rssi monitoring
 * @request_id: request id
 * @session_id: session id
 * @min_rssi: minimum rssi
 * @max_rssi: maximum rssi
 * @control: flag to indicate start or stop
 */
struct rssi_monitor_req {
   uint32_t request_id;
   int8_t   min_rssi;
   int8_t   max_rssi;
   bool control;
} __packed;
 
struct rssi_monitor_event {
   uint32_t     request_id;
   int8_t       curr_rssi;
   uint8_t curr_bssid[ETH_ALEN];
};
 
#define EVENT_BUF_SIZE (1024)
 
enum sprdwl_attr_rssi_monitoring {
   SPRDWL_ATTR__RSSI_MONITORING_INVALID = 0,
   SPRDWL_ATTR_RSSI_MONITORING_CONTROL,
   SPRDWL_ATTR_RSSI_MONITORING_REQUEST_ID,
   SPRDWL_ATTR_RSSI_MONITORING_MAX_RSSI,
   SPRDWL_ATTR_RSSI_MONITORING_MIN_RSSI,
   /* attributes to be used/received in callback */
   SPRDWL_ATTR_RSSI_MONITORING_CUR_BSSID,
   SPRDWL_ATTR_RSSI_MONITORING_CUR_RSSI,
   /* keep last */
   SPRDWL_ATTR_RSSI_MONITORING_AFTER_LAST,
   SPRDWL_ATTR_RSSI_MONITORING_MAX =
   SPRDWL_ATTR_RSSI_MONITORING_AFTER_LAST - 1,
};
 
/*RSSI monitor End*/
 
enum wifi_connection_state {
   WIFI_DISCONNECTED = 0,
   WIFI_AUTHENTICATING = 1,
   WIFI_ASSOCIATING = 2,
   WIFI_ASSOCIATED = 3,
   WIFI_EAPOL_STARTED = 4,
   WIFI_EAPOL_COMPLETED = 5,
};
 
enum wifi_roam_state {
   WIFI_ROAMING_IDLE = 0,
   WIFI_ROAMING_ACTIVE = 1,
};
 
/* access categories */
enum wifi_traffic_ac {
   WIFI_AC_VO = 0,
   WIFI_AC_VI = 1,
   WIFI_AC_BE = 2,
   WIFI_AC_BK = 3,
   WIFI_AC_MAX = 4,
};
 
/* configuration params */
struct wifi_link_layer_params {
   u32 mpdu_size_threshold;
   u32 aggressive_statistics_gathering;
} __packed;
 
struct wifi_clr_llstat_rsp {
   u32 stats_clear_rsp_mask;
   u8 stop_rsp;
};
 
/* wifi rate */
struct wifi_rate {
   u32 preamble:3;
   u32 nss:2;
   u32 bw:3;
   u32 ratemcsidx:8;
   u32 reserved:16;
   u32 bitrate;
};
 
struct wifi_rate_stat {
   struct wifi_rate rate;
   u32 tx_mpdu;
   u32 rx_mpdu;
   u32 mpdu_lost;
   u32 retries;
   u32 retries_short;
   u32 retries_long;
};
 
/* per peer statistics */
struct wifi_peer_info {
   u8 type;
   u8 peer_mac_address[6];
   u32 capabilities;
   u32 num_rate;
   struct wifi_rate_stat rate_stats[];
};
 
struct wifi_interface_link_layer_info {
   enum sprdwl_mode mode;
   u8 mac_addr[6];
   enum wifi_connection_state state;
   enum wifi_roam_state roaming;
   u32 capabilities;
   u8 ssid[33];
   u8 bssid[6];
   u8 ap_country_str[3];
   u8 country_str[3];
};
 
/* Per access category statistics */
struct wifi_wmm_ac_stat {
   enum wifi_traffic_ac ac;
   u32 tx_mpdu;
   u32 rx_mpdu;
   u32 tx_mcast;
   u32 rx_mcast;
   u32 rx_ampdu;
   u32 tx_ampdu;
   u32 mpdu_lost;
   u32 retries;
   u32 retries_short;
   u32 retries_long;
   u32 contention_time_min;
   u32 contention_time_max;
   u32 contention_time_avg;
   u32 contention_num_samples;
};
 
/* interface statistics */
struct wifi_iface_stat {
   void *iface;
   struct wifi_interface_link_layer_info info;
   u32 beacon_rx;
   u64 average_tsf_offset;
   u32 leaky_ap_detected;
   u32 leaky_ap_avg_num_frames_leaked;
   u32 leaky_ap_guard_time;
   u32 mgmt_rx;
   u32 mgmt_action_rx;
   u32 mgmt_action_tx;
   int rssi_mgmt;
   u32 rssi_data;
   u32 rssi_ack;
   struct wifi_wmm_ac_stat ac[WIFI_AC_MAX];
   u32 num_peers;
   struct wifi_peer_info peer_info[];
};
 
/* WiFi Common definitions */
/* channel operating width */
enum wifi_channel_width {
   WIFI_CHAN_WIDTH_20 = 0,
   WIFI_CHAN_WIDTH_40 = 1,
   WIFI_CHAN_WIDTH_80 = 2,
   WIFI_CHAN_WIDTH_160 = 3,
   WIFI_CHAN_WIDTH_80P80 = 4,
   WIFI_CHAN_WIDTH_5 = 5,
   WIFI_CHAN_WIDTH_10 = 6,
   WIFI_CHAN_WIDTH_INVALID = -1
};
 
/* channel information */
struct wifi_channel_info {
   enum wifi_channel_width width;
   u32 center_freq;
   u32 center_freq0;
   u32 center_freq1;
};
 
/* channel statistics */
struct wifi_channel_stat {
   struct wifi_channel_info channel;
   u32 on_time;
   u32 cca_busy_time;
};
 
/* radio statistics */
struct wifi_radio_stat {
   u32 radio;
   u32 on_time;
   u32 tx_time;
   u32 num_tx_levels;
   u32 *tx_time_per_levels;
   u32 rx_time;
   u32 on_time_scan;
   u32 on_time_nbd;
   u32 on_time_gscan;
   u32 on_time_roam_scan;
   u32 on_time_pno_scan;
   u32 on_time_hs20;
   u32 num_channels;
   struct wifi_channel_stat channels[];
};
 
struct sprdwl_wmm_ac_stat {
   u32 tx_mpdu;
   u32 rx_mpdu;
   u32 tx_mpdu_lost;
   u32 tx_retries;
};
 
struct sprdwl_llstat_data {
   int rssi_mgmt;
   u32 bcn_rx_cnt;
   struct sprdwl_wmm_ac_stat ac[WIFI_AC_MAX];
   u32 on_time;
   u32 on_time_scan;
   u64 radio_tx_time;
   u64 radio_rx_time;
};
 
struct sprdwl_llstat_radio {
   int rssi_mgmt;
   u32 bcn_rx_cnt;
   struct sprdwl_wmm_ac_stat ac[WIFI_AC_MAX];
};
 
 
struct sprdwl_vendor_data {
   struct wifi_radio_stat radio_st;
   struct wifi_iface_stat iface_st;
};
 
/*end of link layer stats*/
 
/*start of wake stats---CMD ID:85*/
enum sprdwl_wake_stats {
   WLAN_ATTR_GET_WAKE_STATS_INVALID = 0,
   WLAN_ATTR_TOTAL_CMD_EVENT_WAKE,
   WLAN_ATTR_CMD_EVENT_WAKE_CNT_PTR,
   WLAN_ATTR_CMD_EVENT_WAKE_CNT_SZ,
   WLAN_ATTR_TOTAL_DRIVER_FW_LOCAL_WAKE,
   WLAN_ATTR_DRIVER_FW_LOCAL_WAKE_CNT_PTR,
   WLAN_ATTR_DRIVER_FW_LOCAL_WAKE_CNT_SZ,
   WLAN_ATTR_TOTAL_RX_DATA_WAKE,
   WLAN_ATTR_RX_UNICAST_CNT,
   WLAN_ATTR_RX_MULTICAST_CNT,
   WLAN_ATTR_RX_BROADCAST_CNT,
   WLAN_ATTR_ICMP_PKT,
   WLAN_ATTR_ICMP6_PKT,
   WLAN_ATTR_ICMP6_RA,
   WLAN_ATTR_ICMP6_NA,
   WLAN_ATTR_ICMP6_NS,
   WLAN_ATTR_ICMP4_RX_MULTICAST_CNT,
   WLAN_ATTR_ICMP6_RX_MULTICAST_CNT,
   WLAN_ATTR_OTHER_RX_MULTICAST_CNT,
   /* keep last */
   WLAN_GET_WAKE_STATS_AFTER_LAST,
   WLAN_GET_WAKE_STATS_MAX =
       WLAN_GET_WAKE_STATS_AFTER_LAST - 1,
};
 
/*end of wake sats---CMD ID:85*/
 
 
/*start of SAR limit---- CMD ID:146*/
enum sprdwl_vendor_sar_limits_select {
   WLAN_SAR_LIMITS_BDF0 = 0,
   WLAN_SAR_LIMITS_BDF1 = 1,
   WLAN_SAR_LIMITS_BDF2 = 2,
   WLAN_SAR_LIMITS_BDF3 = 3,
   WLAN_SAR_LIMITS_BDF4 = 4,
   WLAN_SAR_LIMITS_NONE = 5,
   WLAN_SAR_LIMITS_USER = 6,
};
 
enum sprdwl_vendor_attr_sar_limits {
   WLAN_ATTR_SAR_LIMITS_INVALID = 0,
   WLAN_ATTR_SAR_LIMITS_SAR_ENABLE = 1,
   WLAN_ATTR_SAR_LIMITS_NUM_SPECS = 2,
   WLAN_ATTR_SAR_LIMITS_SPEC = 3,
   WLAN_ATTR_SAR_LIMITS_SPEC_BAND = 4,
   WLAN_ATTR_SAR_LIMITS_SPEC_CHAIN = 5,
   WLAN_ATTR_SAR_LIMITS_SPEC_MODULATION = 6,
   WLAN_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT = 7,
   WLAN_ATTR_SAR_LIMITS_AFTER_LAST,
   WLAN_ATTR_SAR_LIMITS_MAX =
       WLAN_ATTR_SAR_LIMITS_AFTER_LAST - 1
};
/*end of SAR limit---CMD ID:146*/
int sprdwl_vendor_init(struct wiphy *wiphy);
int sprdwl_vendor_deinit(struct wiphy *wiphy);
 
#define MAX_CHANNELS 16
#define MAX_BUCKETS 4
#define MAX_HOTLIST_APS 16
#define MAX_WHITELIST_APS 16
#define MAX_PREFER_APS 16
#define MAX_BLACKLIST_BSSID 16
#define MAX_SIGNIFICANT_CHANGE_APS 16
#define MAX_AP_CACHE_PER_SCAN 32
#define MAX_CHANNLES_NUM 14
 
#define MAX_EPNO_NETWORKS 16
 
enum sprdwl_vendor_attr_gscan_config_params {
   GSCAN_ATTR_SUBCMD_CONFIG_PARAM_INVALID = 0,
   /* Unsigned 32-bit value; Middleware provides it to the driver.
   *Middle ware either gets it from caller, e.g., framework,
   or generates one if framework doesn't provide it.
   */
 
   GSCAN_ATTR_SUBCMD_CONFIG_PARAM_REQUEST_ID,
 
   /* NL attributes for data used by
   * NL80211_VENDOR_SUBCMD_GSCAN_GET_VALID_CHANNELS sub command.
   */
   /* Unsigned 32-bit value */
   GSCAN_ATTR_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND,
   /* Unsigned 32-bit value */
   GSCAN_ATTR_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS,
 
   /* NL attributes for input params used by
    * NL80211_VENDOR_SUBCMD_GSCAN_START sub command.
   */
 
   /* Unsigned 32-bit value; channel frequency */
   GSCAN_ATTR_CHANNEL_SPEC_CHANNEL,
   /* Unsigned 32-bit value; dwell time in ms. */
   GSCAN_ATTR_CHANNEL_SPEC_DWELL_TIME,
   /* Unsigned 8-bit value; 0: active; 1: passive; N/A for DFS */
   GSCAN_ATTR_CHANNEL_SPEC_PASSIVE,
   /* Unsigned 8-bit value; channel class */
   GSCAN_ATTR_CHANNEL_SPEC_CLASS,
 
   /* Unsigned 8-bit value; bucket index, 0 based */
   GSCAN_ATTR_BUCKET_SPEC_INDEX,
   /* Unsigned 8-bit value; band. */
   GSCAN_ATTR_BUCKET_SPEC_BAND,
   /* Unsigned 32-bit value; desired period, in ms. */
   GSCAN_ATTR_BUCKET_SPEC_PERIOD = 10,
   /* Unsigned 8-bit value; report events semantics. */
   GSCAN_ATTR_BUCKET_SPEC_REPORT_EVENTS,
   /* Unsigned 32-bit value. Followed by a nested array of
   * GSCAN_CHANNEL_SPECS attributes.
   */
   GSCAN_ATTR_BUCKET_SPEC_NUM_CHANNEL_SPECS,
 
   /* Array of GSCAN_ATTR_CHANNEL_SPEC_* attributes.
   * Array size: GSCAN_ATTR_BUCKET_SPEC_NUM_CHANNEL_SPECS
   */
   GSCAN_ATTR_CHANNEL_SPEC,
 
   /* Unsigned 32-bit value; base timer period in ms. */
   GSCAN_ATTR_SCAN_CMD_PARAMS_BASE_PERIOD,
   /* Unsigned 32-bit value; number of APs to store in each scan in the
   * BSSID/RSSI history buffer (keep the highest RSSI APs).
   */
   GSCAN_ATTR_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN = 15,
 
   /* Unsigned 8-bit value; In %, when scan buffer is this much full,
   *wake up APPS.
   */
   GSCAN_ATTR_SCAN_CMD_PARAMS_REPORT_THR,
 
   /* Unsigned 8-bit value; number of scan bucket specs; followed by
   *a nested array of_GSCAN_BUCKET_SPEC_* attributes and values.
   *The size of the array is determined by NUM_BUCKETS.
   */
   GSCAN_ATTR_SCAN_CMD_PARAMS_NUM_BUCKETS,
 
   /* Array of GSCAN_ATTR_BUCKET_SPEC_* attributes.
   * Array size: GSCAN_ATTR_SCAN_CMD_PARAMS_NUM_BUCKETS
   */
   GSCAN_ATTR_BUCKET_SPEC,
 
   /* Unsigned 8-bit value */
   GSCAN_ATTR_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH,
   /* Unsigned 32-bit value; maximum number of results to be returned. */
   GSCAN_ATTR_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX = 20,
 
   /* An array of 6 x Unsigned 8-bit value */
   GSCAN_ATTR_AP_THR_PARAM_BSSID,
   /* Signed 32-bit value */
   GSCAN_ATTR_AP_THR_PARAM_RSSI_LOW,
   /* Signed 32-bit value */
   GSCAN_ATTR_AP_THR_PARAM_RSSI_HIGH,
   /* Unsigned 32-bit value */
   GSCAN_ATTR_AP_THR_PARAM_CHANNEL,
 
   /* Number of hotlist APs as unsigned 32-bit value, followed by a nested
   * array of AP_THR_PARAM attributes and values. The size of the
   * array is determined by NUM_AP.
   */
   GSCAN_ATTR_BSSID_HOTLIST_PARAMS_NUM_AP = 25,
 
   /* Array of GSCAN_ATTR_AP_THR_PARAM_* attributes.
   * Array size: GSCAN_ATTR_BUCKET_SPEC_NUM_CHANNEL_SPECS
   */
   GSCAN_ATTR_AP_THR_PARAM,
 
   /* Unsigned 32bit value; number of samples for averaging RSSI. */
   GSCAN_ATTR_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE,
   /* Unsigned 32bit value; number of samples to confirm AP loss. */
   GSCAN_ATTR_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE,
   /* Unsigned 32bit value; number of APs breaching threshold. */
   GSCAN_ATTR_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING,
   /* Unsigned 32bit value; number of APs. Followed by an array of
   * AP_THR_PARAM attributes. Size of the array is NUM_AP.
   */
   GSCAN_ATTR_SIGNIFICANT_CHANGE_PARAMS_NUM_AP = 30,
   GSCAN_ATTR_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE,
 
   GSCAN_ATTR_BUCKET_SPEC_MAX_PERIOD = 32,
   /* Unsigned 32-bit value. */
   GSCAN_ATTR_BUCKET_SPEC_BASE = 33,
   /* Unsigned 32-bit value. For exponential back off bucket, number of
    * scans to perform for a given period.
    */
   GSCAN_ATTR_BUCKET_SPEC_STEP_COUNT = 34,
 
   GSCAN_ATTR_SCAN_CMD_PARAMS_REPORT_THR_NUM_SCANS = 35,
   /* Unsigned 3-2bit value; number of samples to confirm SSID loss. */
   GSCAN_ATTR_GSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE = 36,
   /* Number of hotlist SSIDs as unsigned 32-bit value, followed by a
    * nested array of SSID_THRESHOLD_PARAM_* attributes and values. The
    * size of the array is determined by NUM_SSID.
    */
   GSCAN_ATTR_GSCAN_SSID_HOTLIST_PARAMS_NUM_SSID = 37,
   /* Array of GSCAN_ATTR_GSCAN_SSID_THRESHOLD_PARAM_*
    * attributes.
    * Array size: GSCAN_ATTR_GSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
    */
   GSCAN_ATTR_GSCAN_SSID_THR_PARAM = 38,
 
   /* An array of 33 x unsigned 8-bit value; NULL terminated SSID */
   GSCAN_ATTR_GSCAN_SSID_THR_PARAM_SSID = 39,
   /* Unsigned 8-bit value */
   GSCAN_ATTR_GSCAN_SSID_THR_PARAM_BAND = 40,
   /* Signed 32-bit value */
   GSCAN_ATTR_GSCAN_SSID_THR_PARAM_RSSI_LOW = 41,
   /* Signed 32-bit value */
   GSCAN_ATTR_GSCAN_SSID_THR_PARAM_RSSI_HIGH = 42,
 
   /* keep last */
   GSCAN_ATTR_SUBCMD_CONFIG_PARAM_AFTER_LAST,
   GSCAN_ATTR_SUBCMD_CONFIG_PARAM_MAX =
   GSCAN_ATTR_SUBCMD_CONFIG_PARAM_AFTER_LAST - 1,
 
};
enum nl80211_vendor_subcmds_index {
   NL80211_VENDOR_SUBCMD_LL_STATS_SET_INDEX,
   NL80211_VENDOR_SUBCMD_LL_STATS_GET_INDEX,
   NL80211_VENDOR_SUBCMD_LL_STATS_CLR_INDEX,
   NL80211_VENDOR_SUBCMD_LL_RADIO_STATS_INDEX,
   NL80211_VENDOR_SUBCMD_LL_IFACE_STATS_INDEX,
   NL80211_VENDOR_SUBCMD_LL_PEER_INFO_STATS_INDEX,
   /* GSCAN Events */
   NL80211_VENDOR_SUBCMD_GSCAN_START_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_STOP_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_GET_CAPABILITIES_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_GET_CACHED_RESULTS_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_SCAN_RESULTS_AVAILABLE_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_FULL_SCAN_RESULT_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_SCAN_EVENT_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_HOTLIST_AP_FOUND_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_HOTLIST_AP_LOST_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_SET_BSSID_HOTLIST_INDEX,
   NL80211_VENDOR_SUBCMD_GSCAN_RESET_BSSID_HOTLIST_INDEX,
   NL80211_VENDOR_SUBCMD_SIGNIFICANT_CHANGE_INDEX,
   NL80211_VENDOR_SUBCMD_SET_SIGNIFICANT_CHANGE_INDEX,
   NL80211_VENDOR_SUBCMD_RESET_SIGNIFICANT_CHANGE_INDEX,
   /*EXT TDLS*/
   NL80211_VENDOR_SUBCMD_TDLS_STATE_CHANGE_INDEX,
   NL80211_VENDOR_SUBCMD_NAN_INDEX,
};
enum sprdwl_gscan_attribute {
   GSCAN_NUM_BUCKETS = 1,
   GSCAN_BASE_PERIOD,
   GSCAN_BUCKETS_BAND,
   GSCAN_BUCKET_ID,
   GSCAN_BUCKET_PERIOD,
   GSCAN_BUCKET_NUM_CHANNELS,
   GSCAN_BUCKET_CHANNELS,
   GSCAN_BUCKET_SPEC,
   GSCAN_BUCKET_CHANNELS_SPEC,
   GSCAN_CH_DWELL_TIME,
   GSCAN_CH_PASSIVE,
   GSCAN_NUM_AP_PER_SCAN,
   GSCAN_REPORT_THRESHOLD,
   GSCAN_NUM_SCANS_TO_CACHE,
   GSCAN_BAND = GSCAN_BUCKETS_BAND,
 
   GSCAN_ENABLE_FEATURE,
   GSCAN_SCAN_RESULTS_COMPLETE,    /* indicates no more results */
   GSCAN_FLUSH_FEATURE,    /* Flush all the configs */
   GSCAN_FULL_SCAN_RESULTS,
   GSCAN_REPORT_EVENTS,
 
   /* remaining reserved for additional attributes */
   GSCAN_NUM_OF_RESULTS,
   GSCAN_FLUSH_RESULTS,
   GSCAN_ATT_SCAN_RESULTS,    /* flat array of wifi_scan_result */
   GSCAN_SCAN_ID,    /* indicates scan number */
   GSCAN_SCAN_FLAGS,    /* indicates if scan was aborted */
   GSCAN_AP_FLAGS,    /* flags on significant change event */
   GSCAN_NUM_CHANNELS,
   GSCAN_CHANNEL_LIST,
 
   /* remaining reserved for additional attributes */
 
   /* Adaptive scan attributes */
   GSCAN_BUCKET_STEP_COUNT,
   GSCAN_BUCKET_MAX_PERIOD,
 
   GSCAN_SSID,
   GSCAN_BSSID,
   GSCAN_CHANNEL,
   GSCAN_RSSI,
   GSCAN_TIMESTAMP,
   GSCAN_RTT,
   GSCAN_RTTSD,
 
   /* remaining reserved for additional attributes */
 
   GSCAN_HOTLIST_BSSIDS,
   GSCAN_RSSI_LOW,
   GSCAN_RSSI_HIGH,
   GSCAN_HOTLIST_ELEM,
   GSCAN_HOTLIST_FLUSH,
 
   /* remaining reserved for additional attributes */
   GSCAN_RSSI_SAMPLE_SIZE,
   GSCAN_LOST_AP_SAMPLE_SIZE,
   GSCAN_MIN_BREACHING,
   GSCAN_SIGNIFICANT_CHANGE_BSSIDS,
   GSCAN_SIGNIFICANT_CHANGE_FLUSH,
 
   /* remaining reserved for additional attributes */
 
   GSCAN_WHITELIST_SSID,
   GSCAN_NUM_WL_SSID,
   /*GSCAN_WL_SSID_LEN,*/
   GSCAN_WL_SSID_FLUSH,
   GSCAN_WHITELIST_SSID_ELEM,
   GSCAN_NUM_BSSID,
   GSCAN_BSSID_PREF_LIST,
   GSCAN_BSSID_PREF_FLUSH,
   GSCAN_BSSID_PREF,
   GSCAN_RSSI_MODIFIER,
 
   /* remaining reserved for additional attributes */
 
   GSCAN_A_BAND_BOOST_THRESHOLD,
   GSCAN_A_BAND_PENALTY_THRESHOLD,
   GSCAN_A_BAND_BOOST_FACTOR,
   GSCAN_A_BAND_PENALTY_FACTOR,
   GSCAN_A_BAND_MAX_BOOST,
   GSCAN_LAZY_ROAM_HYSTERESIS,
   GSCAN_ALERT_ROAM_RSSI_TRIGGER,
   GSCAN_LAZY_ROAM_ENABLE,
 
   /* BSSID blacklist */
   GSCAN_BSSID_BLACKLIST_FLUSH,
   GSCAN_BLACKLIST_BSSID,
   GSCAN_BLACKLIST_BSSID_SPEC,
 
   /* ANQPO */
   GSCAN_ANQPO_HS_LIST,
   GSCAN_ANQPO_HS_LIST_SIZE,
   GSCAN_ANQPO_HS_NETWORK_ID,
   GSCAN_ANQPO_HS_NAI_REALM,
   GSCAN_ANQPO_HS_ROAM_CONSORTIUM_ID,
   GSCAN_ANQPO_HS_PLMN,
 
   GSCAN_SSID_HOTLIST_FLUSH,
   GSCAN_SSID_LOST_SAMPLE_SIZE,
   GSCAN_HOTLIST_SSIDS,
   GSCAN_SSID_RSSI_HIGH,
   GSCAN_SSID_RSSI_LOW,
   GSCAN_ANQPO_LIST_FLUSH,
   ANDR_WIFI_ATTRIBUTE_PNO_RANDOM_MAC_OUI,
 
   GSCAN_MAX
};
 
enum SPRD_wlan_vendor_attr_pno_config_params {
   SPRD_WLAN_VENDOR_ATTR_PNO_INVALID = 0,
   /* Attributes for data used by
    * SPRD_NL80211_VENDOR_SUBCMD_PNO_SET_PASSPOINT_LIST sub command.
    */
   /* Unsigned 32-bit value */
   SPRD_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM = 1,
   /* Array of nested SPRD_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_*
    * attributes. Array size =
    * SPRD_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM.
    */
   SPRD_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY = 2,
 
   /* Unsigned 32-bit value */
   SPRD_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID = 3,
   /* An array of 256 x unsigned 8-bit value; NULL terminated UTF-8 encoded
    * realm, 0 if unspecified.
    */
   SPRD_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM = 4,
   /* An array of 16 x unsigned 32-bit value; roaming consortium ids to
    * match, 0 if unspecified.
    */
   SPRD_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID = 5,
   /* An array of 6 x unsigned 8-bit value; MCC/MNC combination, 0s if
    * unspecified.
    */
   SPRD_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN = 6,
 
   /* Attributes for data used by
    * SPRD_NL80211_VENDOR_SUBCMD_PNO_SET_LIST sub command.
    */
   /* Unsigned 32-bit value */
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS = 7,
   /* Array of nested
    * SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_*
    * attributes. Array size =
    * SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS.
    */
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST = 8,
   /* An array of 33 x unsigned 8-bit value; NULL terminated SSID */
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID = 9,
   /* Signed 8-bit value; threshold for considering this SSID as found,
    * required granularity for this threshold is 4 dBm to 8 dBm.
    */
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD
   = 10,
   /* Unsigned 8-bit value; WIFI_PNO_FLAG_XXX */
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS = 11,
   /* Unsigned 8-bit value; auth bit field for matching WPA IE */
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT = 12,
   /* Unsigned 8-bit to indicate ePNO type;
    * It takes values from SPRD_wlan_epno_type
    */
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_TYPE = 13,
 
   /* Nested attribute to send the channel list */
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_CHANNEL_LIST = 14,
 
   /* Unsigned 32-bit value; indicates the interval between PNO scan
    * cycles in msec.
    */
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_SCAN_INTERVAL = 15,
   SPRD_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI = 16,
   SPRD_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI = 17,
   SPRD_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX = 18,
   SPRD_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS = 19,
   SPRD_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS = 20,
   SPRD_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS = 21,
   SPRD_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS = 22,
 
   /* keep last */
   SPRD_WLAN_VENDOR_ATTR_PNO_AFTER_LAST,
   SPRD_WLAN_VENDOR_ATTR_PNO_MAX =
   SPRD_WLAN_VENDOR_ATTR_PNO_AFTER_LAST - 1,
};
 
#define SPRDWL_EPNO_PARAM_NETWORK_SSID \
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID
#define SPRDWL_EPNO_PARAM_MIN5GHZ_RSSI \
   SPRD_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI
#define SPRDWL_EPNO_PARAM_MIN24GHZ_RSSI  \
   SPRD_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI
#define SPRDWL_EPNO_PARAM_INITIAL_SCORE_MAX \
   SPRD_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX
#define SPRDWL_EPNO_PARAM_CURRENT_CONNECTION_BONUS \
   SPRD_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS
#define SPRDWL_EPNO_PARAM_SAME_NETWORK_BONUS \
   SPRD_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS
#define SPRDWL_EPNO_PARAM_SECURE_BONUS \
   SPRD_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS
#define SPRDWL_EPNO_PARAM_BAND5GHZ_BONUS \
   SPRD_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS
#define SPRDWL_EPNO_PARAM_NUM_NETWORKS \
    SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS
#define SPRDWL_EPNO_PARAM_NETWORKS_LIST \
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST
 
#define SPRDWL_EPNO_PARAM_NETWORK_SSID \
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID
#define SPRDWL_EPNO_PARAM_NETWORK_FLAGS \
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS
#define SPRDWL_EPNO_PARAM_NETWORK_AUTH_BIT \
   SPRD_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT
#define SPRDWL_VENDOR_EVENT_EPNO_FOUND \
   SPRDWL_VENDOR_SUBCMD_PNO_NETWORK_FOUND
 
enum sprdwl_gscan_wifi_band {
   WIFI_BAND_UNSPECIFIED,
   WIFI_BAND_BG = 1,
   WIFI_BAND_A = 2,
   WIFI_BAND_A_DFS = 4,
   WIFI_BAND_A_WITH_DFS = 6,
   WIFI_BAND_ABG = 3,
   WIFI_BAND_ABG_WITH_DFS = 7,
};
 
enum sprdwl_gscan_wifi_event {
   SPRD_RESERVED1,
   SPRD_RESERVED2,
   GSCAN_EVENT_SIGNIFICANT_CHANGE_RESULTS,
   GSCAN_EVENT_HOTLIST_RESULTS_FOUND,
   GSCAN_EVENT_SCAN_RESULTS_AVAILABLE,
   GSCAN_EVENT_FULL_SCAN_RESULTS,
   RTT_EVENT_COMPLETE,
   GSCAN_EVENT_COMPLETE_SCAN,
   GSCAN_EVENT_HOTLIST_RESULTS_LOST,
   GSCAN_EVENT_EPNO_EVENT,
   GOOGLE_DEBUG_RING_EVENT,
   GOOGLE_DEBUG_MEM_DUMP_EVENT,
   GSCAN_EVENT_ANQPO_HOTSPOT_MATCH,
   GOOGLE_RSSI_MONITOR_EVENT,
   GSCAN_EVENT_SSID_HOTLIST_RESULTS_FOUND,
   GSCAN_EVENT_SSID_HOTLIST_RESULTS_LOST,
 
};
 
struct sprdwl_gscan_channel_spec {
   u8 channel;
   u8 dwelltime;
   u8 passive;
   u8 resv;
};
 
#define REPORT_EVENTS_BUFFER_FULL      0
#define REPORT_EVENTS_EACH_SCAN        (1<<0)
#define REPORT_EVENTS_FULL_RESULTS     (1<<1)
#define REPORT_EVENTS_NO_BATCH         (1<<2)
 
#define REPORT_EVENTS_HOTLIST_RESULTS_FOUND         (1<<3)
#define REPORT_EVENTS_HOTLIST_RESULTS_LOST         (1<<4)
#define REPORT_EVENTS_SIGNIFICANT_CHANGE         (1<<5)
#define REPORT_EVENTS_EPNO         (1<<6)
#define REPORT_EVENTS_ANQPO_HOTSPOT_MATCH         (1<<7)
#define REPORT_EVENTS_SSID_HOTLIST_RESULTS_FOUND         (1<<8)
#define REPORT_EVENTS_SSID_HOTLIST_RESULTS_LOST         (1<<9)
 
enum sprdwl_gscan_event {
   WIFI_SCAN_BUFFER_FULL,
   WIFI_SCAN_COMPLETE,
};
 
struct sprdwl_gscan_bucket_spec {
   u8 bucket;
   u8 band;
   u8 num_channels;
   u8 base;
   u8 step_count;
   u8 reserved;    /*reserved for data align*/
   u16 report_events;
   u32 period;
   u32 max_period;
   struct sprdwl_gscan_channel_spec channels[MAX_CHANNELS];
};
 
struct sprdwl_cmd_gscan_set_config {
   u32 base_period;
   u8 maxAPperScan;
   u8 reportThreshold;
   u8 report_threshold_num_scans;
   u8 num_buckets;
   struct sprdwl_gscan_bucket_spec buckets[MAX_BUCKETS];
};
 
struct sprdwl_cmd_gscan_rsp_header {
   u8 subcmd;
   u8 status;
   u16 data_len;
} __packed;
 
struct sprdwl_cmd_gscan_channel_list {
   int num_channels;
   int channels[TOTAL_2G_5G_CHANNEL_NUM];
};
 
struct sprdwl_gscan_result {
   unsigned long ts;
   char ssid[32 + 1];
   char bssid[ETH_ALEN];
   u8 channel;
   s8 rssi;
   u32 rtt;
   u32 rtt_sd;
   u16 beacon_period;
   u16 capability;
   u16 ie_length;
   char ie_data[1];
} __packed;
 
struct sprdwl_gscan_cached_results {
   u8 scan_id;
   u8 flags;
   int num_results;
   struct sprdwl_gscan_result results[MAX_AP_CACHE_PER_SCAN];
};
 
struct sprdwl_gscan_hotlist_results {
   int req_id;
   u8 flags;
   int num_results;
   struct sprdwl_gscan_result results[MAX_HOTLIST_APS];
};
 
struct ssid_threshold_param {
   unsigned char ssid[IEEE80211_MAX_SSID_LEN];    /* AP SSID*/
   s8 low;        /* low threshold*/
   s8 high;        /* low threshold*/
};
 
struct wifi_ssid_hotlist_params {
   u8 lost_ssid_sample_size; /* number of samples to confirm AP loss*/
   u8 num_ssid;    /* number of hotlist APs*/
   struct ssid_threshold_param ssid[MAX_HOTLIST_APS];    /* hotlist APs*/
};
 
struct ap_threshold_param {
   unsigned char bssid[6];    /* AP BSSID*/
   s8 low;        /* low threshold*/
   s8 high;        /* low threshold*/
};
 
struct wifi_bssid_hotlist_params {
   u8 lost_ap_sample_size; /* number of samples to confirm AP loss*/
   u8 num_bssid;    /* number of hotlist APs*/
   struct ap_threshold_param ap[MAX_HOTLIST_APS];    /* hotlist APs*/
};
 
struct wifi_significant_change_params {
   u8 rssi_sample_size; /*number of samples for averaging RSSI */
   u8 lost_ap_sample_size;/*number of samples to confirm AP loss*/
   u8 min_breaching;/*number of APs breaching threshold */
   u8 num_bssid;/*max 64*/
   struct ap_threshold_param ap[MAX_SIGNIFICANT_CHANGE_APS];
};
 
struct significant_change_info {
   unsigned char bssid[6];    /* AP BSSID*/
   u8 channel;        /*channel frequency in MHz*/
   u8 num_rssi;            /*number of rssi samples*/
   s8 rssi[3];        /*RSSI history in db, here fixed 3*/
} __packed;
 
struct sprdwl_significant_change_result {
   int req_id;
   u8 flags;
   int num_results;
   struct significant_change_info results[MAX_SIGNIFICANT_CHANGE_APS];
};
 
struct wifi_epno_network {
   u8 ssid[32 + 1];
   /* threshold for considering this SSID as found required
    *granularity for this threshold is 4dBm to 8dBm
    */
   /* unsigned char rssi_threshold; */
   u8 flags; /* WIFI_PNO_FLAG_XXX*/
   u8 auth_bit_field; /* auth bit field for matching WPA IE*/
} __packed;
 
struct wifi_epno_params {
   u64 boot_time;
   u8 request_id;
   /* minimum 5GHz RSSI for a BSSID to be considered */
   s8 min5ghz_rssi;
 
   /* minimum 2.4GHz RSSI for a BSSID to be considered */
   s8 min24ghz_rssi;
 
   /* the maximum score that a network can have before bonuses */
   s8 initial_score_max;
 
   /* only report when there is a network's score this much higher */
    /* than the current connection. */
   s8 current_connection_bonus;
 
   /* score bonus for all networks with the same network flag */
   s8 same_network_bonus;
 
   /* score bonus for networks that are not open */
   s8 secure_bonus;
 
   /* 5GHz RSSI score bonus (applied to all 5GHz networks) */
   s8 band5ghz_bonus;
 
   /* number of wifi_epno_network objects */
   s8 num_networks;
 
   /* PNO networks */
   struct wifi_epno_network networks[MAX_EPNO_NETWORKS];
} __packed;
 
struct sprdwl_epno_results {
   u64 boot_time;
   u8 request_id;
   u8 nr_scan_results;
   struct sprdwl_gscan_result results[0];
} __packed;
 
struct wifi_ssid {
   char ssid[32+1]; /* null terminated*/
};
 
 
struct wifi_roam_params {
    /* Lazy roam parameters
     * A_band_XX parameters are applied to 5GHz BSSIDs when comparing with
     * a 2.4GHz BSSID they may not be applied when comparing two 5GHz BSSIDs
    */
 
   /* RSSI threshold above which 5GHz RSSI is favored*/
   int A_band_boost_threshold;
 
   /* RSSI threshold below which 5GHz RSSI is penalized*/
   int A_band_penalty_threshold;
 
   /* factor by which 5GHz RSSI is boosted*/
   /*boost=RSSI_measured-5GHz_boost_threshold)*5GHz_boost_factor*/
   int A_band_boost_factor;
 
   /* factor by which 5GHz RSSI is penalized*/
   /*penalty=(5GHz_penalty_factor-RSSI_measured)*5GHz_penalty_factor*/
   int A_band_penalty_factor;
 
   /* maximum boost that can be applied to a 5GHz RSSI*/
   int A_band_max_boost;
 
   /* Hysteresis: ensuring the currently associated BSSID is favored*/
   /*so as to prevent ping-pong situations,boost applied to current BSSID*/
   int lazy_roam_hysteresis;
 
   /* Alert mode enable, i.e. configuring when firmware enters alert mode*/
   /* RSSI below which "Alert" roam is enabled*/
   int alert_roam_rssi_trigger;
};
 
struct wifi_bssid_preference {
   unsigned char bssid[6];
   /* modifier applied to the RSSI of the BSSID for
    *the purpose of comparing it with other roam candidate
    */
   int rssi_modifier;
};
 
struct wifi_bssid_preference_params {
   int num_bssid;    /* number of preference APs*/
   /* preference APs*/
   struct wifi_bssid_preference pref_ap[MAX_PREFER_APS];
};
 
struct v_MACADDR_t {
   u8 bytes[3];
};
 
struct wifi_passpoint_network {
   /*identifier of this network block, report this in event*/
   u8  id;
   /*null terminated UTF8 encoded realm, 0 if unspecified*/
   char realm[256];
   /*roaming consortium ids to match, 0s if unspecified*/
   int64_t roaming_ids[16];
   /*mcc/mnc combination as per rules, 0s if unspecified*/
   unsigned char plmn[3];
};
 
enum offloaded_packets_sending_control {
   OFFLOADED_PACKETS_SENDING_CONTROL_INVALID = 0,
   OFFLOADED_PACKETS_SENDING_START,
   OFFLOADED_PACKETS_SENDING_STOP
};
 
/* CMD ID: 9 */
enum sprd_attr_vendor {
   ATTR_INVALID = 0,
   ATTR_DFS     = 1,
   ATTR_NAN     = 2,
   ATTR_STATS_EXT     = 3,
   ATTR_IFINDEX     = 4,
   ATTR_ROAMING_POLICY = 5,
   ATTR_MAC_ADDR = 6,
   ATTR_FEATURE_FLAGS = 7,
   ATTR_TEST = 8,
   ATTR_CONCURRENCY_CAPA = 9,
   ATTR_MAX_CONCURRENT_CHANNELS_2_4_BAND = 10,
   ATTR_MAX_CONCURRENT_CHANNELS_5_0_BAND = 11,
   ATTR_SETBAND_VALUE = 12,
   ATTR_PAD = 13,
   ATTR_FTM_SESSION_COOKIE = 14,
   ATTR_LOC_CAPA = 15,
   ATTR_FTM_MEAS_PEERS = 16,
   ATTR_FTM_MEAS_PEER_RESULTS = 17,
   ATTR_FTM_RESPONDER_ENABLE = 18,
   ATTR_FTM_LCI = 19,
   ATTR_FTM_LCR = 20,
   ATTR_LOC_SESSION_STATUS = 21,
   ATTR_FTM_INITIAL_TOKEN = 22,
   ATTR_AOA_TYPE = 23,
   ATTR_LOC_ANTENNA_ARRAY_MASK = 24,
   ATTR_AOA_MEAS_RESULT = 25,
   ATTR_CHAIN_INDEX = 26,
   ATTR_CHAIN_RSSI = 27,
   ATTR_FREQ = 28,
   ATTR_TSF = 29,
   ATTR_DMG_RF_SECTOR_INDEX = 30,
   ATTR_DMG_RF_SECTOR_TYPE = 31,
   ATTR_DMG_RF_MODULE_MASK = 32,
   ATTR_DMG_RF_SECTOR_CFG = 33,
   ATTR_RX_AGGREGATION_STATS_HOLES_NUM = 34,
   ATTR_RX_AGGREGATION_STATS_HOLES_INFO = 35,
   ATTR_BTM_MBO_TRANSITION_REASON = 36,
   ATTR_BTM_CANDIDATE_INFO = 37,
   ATTR_BRP_ANT_LIMIT_MODE = 38,
   ATTR_BRP_ANT_NUM_LIMIT = 39,
   ATTR_ANTENNA_INFO = 40,
   /* keep last */
   ATTR_AFTER_LAST,
   ATTR_MAX =
       ATTR_AFTER_LAST - 1,
};
 
/* CMD ID: 14 */
enum sprd_attr_ll_stats_set {
   ATTR_LL_STATS_SET_INVALID = 0,
   ATTR_LL_STATS_SET_CONFIG_MPDU_SIZE_THRESHOLD = 1,
   ATTR_LL_STATS_SET_CONFIG_AGGRESSIVE_STATS_GATHERING = 2,
   /* keep last */
   ATTR_LL_STATS_SET_AFTER_LAST,
   ATTR_LL_STATS_SET_MAX =
       ATTR_LL_STATS_SET_AFTER_LAST - 1,
};
 
/* CMD ID: 15 */
enum sprd_attr_ll_stats_get {
   ATTR_LL_STATS_GET_INVALID = 0,
   ATTR_LL_STATS_GET_CONFIG_REQ_ID = 1,
   ATTR_LL_STATS_GET_CONFIG_REQ_MASK = 2,
   /* keep last */
   ATTR_LL_STATS_GET_AFTER_LAST,
   ATTR_LL_STATS_GET_MAX =
       ATTR_LL_STATS_GET_AFTER_LAST - 1,
};
 
/* CMD ID: 23 */
enum sprd_attr_gscan_config_params {
   ATTR_GSCAN_SUBCMD_CONFIG_PARAM_INVALID = 0,
   ATTR_GSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID = 1,
   ATTR_GSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND = 2,
   ATTR_GSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS = 3,
   ATTR_GSCAN_CHANNEL_SPEC_CHANNEL = 4,
   ATTR_GSCAN_CHANNEL_SPEC_DWELL_TIME = 5,
   ATTR_GSCAN_CHANNEL_SPEC_PASSIVE = 6,
   ATTR_GSCAN_CHANNEL_SPEC_CLASS = 7,
   ATTR_GSCAN_BUCKET_SPEC_INDEX = 8,
   ATTR_GSCAN_BUCKET_SPEC_BAND = 9,
   ATTR_GSCAN_BUCKET_SPEC_PERIOD = 10,
   ATTR_GSCAN_BUCKET_SPEC_REPORT_EVENTS = 11,
   ATTR_GSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS = 12,
   ATTR_GSCAN_CHANNEL_SPEC = 13,
   ATTR_GSCAN_SCAN_CMD_PARAMS_BASE_PERIOD = 14,
   ATTR_GSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN = 15,
   ATTR_GSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT = 16,
   ATTR_GSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS = 17,
   ATTR_GSCAN_BUCKET_SPEC = 18,
   ATTR_GSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH = 19,
   ATTR_GSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX = 20,
   ATTR_GSCAN_AP_THRESHOLD_PARAM_BSSID = 21,
   ATTR_GSCAN_AP_THRESHOLD_PARAM_RSSI_LOW = 22,
   ATTR_GSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH = 23,
   ATTR_GSCAN_AP_THRESHOLD_PARAM_CHANNEL = 24,
   ATTR_GSCAN_BSSID_HOTLIST_PARAMS_NUM_AP = 25,
   ATTR_GSCAN_AP_THRESHOLD_PARAM = 26,
   ATTR_GSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE = 27,
   ATTR_GSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE = 28,
   ATTR_GSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING = 29,
   ATTR_GSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP = 30,
   ATTR_GSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE = 31,
   ATTR_GSCAN_BUCKET_SPEC_MAX_PERIOD = 32,
   ATTR_GSCAN_BUCKET_SPEC_BASE = 33,
   ATTR_GSCAN_BUCKET_SPEC_STEP_COUNT = 34,
   ATTR_GSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS = 35,
   ATTR_GSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE = 36,
   ATTR_GSCAN_SSID_HOTLIST_PARAMS_NUM_SSID = 37,
   ATTR_GSCAN_SSID_THRESHOLD_PARAM = 38,
   ATTR_GSCAN_SSID_THRESHOLD_PARAM_SSID = 39,
   ATTR_GSCAN_SSID_THRESHOLD_PARAM_BAND = 40,
   ATTR_GSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW = 41,
   ATTR_GSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH = 42,
   ATTR_GSCAN_CONFIGURATION_FLAGS = 43,
   /* keep last */
   ATTR_GSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST,
   ATTR_GSCAN_SUBCMD_CONFIG_PARAM_MAX =
       ATTR_GSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST - 1,
};
 
/* CMD ID: 62 */
enum sprd_attr_wifi_logger_start {
   ATTR_WIFI_LOGGER_START_INVALID = 0,
   ATTR_WIFI_LOGGER_RING_ID = 1,
   ATTR_WIFI_LOGGER_VERBOSE_LEVEL = 2,
   ATTR_WIFI_LOGGER_FLAGS = 3,
   /* keep last */
   ATTR_WIFI_LOGGER_START_AFTER_LAST,
   ATTR_WIFI_LOGGER_START_GET_MAX =
       ATTR_WIFI_LOGGER_START_AFTER_LAST - 1,
};
 
/* CMD ID: 64 */
enum sprd_attr_roaming_config_params {
   ATTR_ROAMING_PARAM_INVALID = 0,
   ATTR_ROAMING_SUBCMD = 1,
   ATTR_ROAMING_REQ_ID = 2,
   ATTR_ROAMING_PARAM_WHITE_LIST_SSID_NUM_NETWORKS = 3,
   ATTR_ROAMING_PARAM_WHITE_LIST_SSID_LIST = 4,
   ATTR_ROAMING_PARAM_WHITE_LIST_SSID = 5,
   ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD = 6,
   ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD = 7,
   ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR = 8,
   ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR = 9,
   ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST = 10,
   ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS = 11,
   ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER = 12,
   ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE = 13,
   ATTR_ROAMING_PARAM_SET_BSSID_PREFS = 14,
   ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID = 15,
   ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID = 16,
   ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER = 17,
   ATTR_ROAMING_PARAM_SET_BSSID_PARAMS = 18,
   ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID = 19,
   ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID = 20,
   /* keep last */
   ATTR_ROAMING_PARAM_AFTER_LAST,
   ATTR_ROAMING_PARAM_MAX =
       ATTR_ROAMING_PARAM_AFTER_LAST - 1,
};
 
/* CMD ID: 76 */
enum sprd_attr_get_logger_features {
   ATTR_LOGGER_INVALID = 0,
   ATTR_LOGGER_SUPPORTED = 1,
   /* keep last */
   ATTR_LOGGER_AFTER_LAST,
   ATTR_LOGGER_MAX =
       ATTR_LOGGER_AFTER_LAST - 1,
};
 
/* CMD ID: 79 */
enum sprdwl_attr_offloaded_packets {
   ATTR_OFFLOADED_PACKETS_INVALID = 0,
   ATTR_OFFLOADED_PACKETS_SENDING_CONTROL,
   ATTR_OFFLOADED_PACKETS_REQUEST_ID,
   ATTR_OFFLOADED_PACKETS_IP_PACKET_DATA,
   ATTR_OFFLOADED_PACKETS_SRC_MAC_ADDR,
   ATTR_OFFLOADED_PACKETS_DST_MAC_ADDR,
   ATTR_OFFLOADED_PACKETS_PERIOD,
   ATTR_OFFLOADED_PACKETS_ETHER_PROTO_TYPE,
   /* Keep last */
   ATTR_OFFLOADED_PACKETS_AFTER_LAST,
   ATTR_OFFLOADED_PACKETS_MAX =
       ATTR_OFFLOADED_PACKETS_AFTER_LAST - 1,
};
 
/* CMD ID: 82 */
enum sprd_attr_nd_offload {
   ATTR_ND_OFFLOAD_INVALID = 0,
   ATTR_ND_OFFLOAD_FLAG,
   /* Keep last */
   ATTR_ND_OFFLOAD_AFTER_LAST,
   ATTR_ND_OFFLOAD_MAX =
       ATTR_ND_OFFLOAD_AFTER_LAST - 1,
};
 
/* CMD ID: 85 */
enum sprd_attr_wake_stats {
   ATTR_WAKE_STATS_INVALID = 0,
   ATTR_WAKE_STATS_TOTAL_CMD_EVENT_WAKE,
   ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_PTR,
   ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_SZ,
   ATTR_WAKE_STATS_TOTAL_DRIVER_FW_LOCAL_WAKE,
   ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_PTR,
   ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_SZ,
   ATTR_WAKE_STATS_TOTAL_RX_DATA_WAKE,
   ATTR_WAKE_STATS_RX_UNICAST_CNT,
   ATTR_WAKE_STATS_RX_MULTICAST_CNT,
   ATTR_WAKE_STATS_RX_BROADCAST_CNT,
   ATTR_WAKE_STATS_ICMP_PKT,
   ATTR_WAKE_STATS_ICMP6_PKT,
   ATTR_WAKE_STATS_ICMP6_RA,
   ATTR_WAKE_STATS_ICMP6_NA,
   ATTR_WAKE_STATS_ICMP6_NS,
   ATTR_WAKE_STATS_ICMP4_RX_MULTICAST_CNT,
   ATTR_WAKE_STATS_ICMP6_RX_MULTICAST_CNT,
   ATTR_WAKE_STATS_OTHER_RX_MULTICAST_CNT,
   ATTR_WAKE_STATS_RSSI_BREACH_CNT,
   ATTR_WAKE_STATS_LOW_RSSI_CNT,
   ATTR_WAKE_STATS_GSCAN_CNT,
   ATTR_WAKE_STATS_PNO_COMPLETE_CNT,
   ATTR_WAKE_STATS_PNO_MATCH_CNT,
   /* keep last */
   ATTR_WAKE_STATS_AFTER_LAST,
   ATTR_WAKE_STATS_MAX =
       ATTR_WAKE_STATS_AFTER_LAST - 1,
};
 
/* CMD ID: 146 */
enum sprd_attr_sar_limits {
   ATTR_SAR_LIMITS_INVALID = 0,
   ATTR_SAR_LIMITS_SAR_ENABLE = 1,
   ATTR_SAR_LIMITS_NUM_SPECS = 2,
   ATTR_SAR_LIMITS_SPEC = 3,
   ATTR_SAR_LIMITS_SPEC_BAND = 4,
   ATTR_SAR_LIMITS_SPEC_CHAIN = 5,
   ATTR_SAR_LIMITS_SPEC_MODULATION = 6,
   ATTR_SAR_LIMITS_SPEC_POWER_LIMIT = 7,
   ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX = 8,
   /* keep last */
   ATTR_SAR_LIMITS_AFTER_LAST,
   ATTR_SAR_LIMITS_MAX =
       ATTR_SAR_LIMITS_AFTER_LAST - 1
};
 
void sprdwl_report_gscan_result(struct sprdwl_vif *vif,
               u32 report_event, u8 bucketid,
               u16 chan, s16 rssi, const u8 *buf, u16 len);
int sprdwl_gscan_done(struct sprdwl_vif *vif, u8 bucketid);
int sprdwl_buffer_full_event(struct sprdwl_vif *vif);
int sprdwl_available_event(struct sprdwl_vif *vif);
int sprdwl_vendor_report_full_scan(struct sprdwl_vif *vif,
                   struct sprdwl_gscan_result *item);
int sprdwl_hotlist_change_event(struct sprdwl_vif *vif, u32 report_event);
void sprdwl_event_rssi_monitor(struct sprdwl_vif *vif, u8 *data, u16 len);
int sprdwl_vendor_cache_scan_result(struct sprdwl_vif *vif,
               u8 bucket_id, struct sprdwl_gscan_result *item);
int sprdwl_vendor_cache_hotlist_result(struct sprdwl_vif *vif,
               struct sprdwl_gscan_result *item);
int sprdwl_significant_change_event(struct sprdwl_vif *vif);
int sprdwl_vendor_cache_significant_change_result(struct sprdwl_vif *vif,
               u8 *data, u16 data_len);
int sprdwl_set_packet_offload(struct sprdwl_priv *priv, u8 vif_ctx_id,
                 u32 req, u8 enable, u32 interval,
                 u32 len, u8 *data);
 
#endif