summaryrefslogtreecommitdiff
path: root/wifi/1.6/types.hal
blob: aed37fad0de8d4ec823226c8b1d84ef24f1afc16 (plain)
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
/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.wifi@1.6;

import @1.0::MacAddress;
import @1.0::NanCipherSuiteType;
import @1.0::NanDataPathChannelCfg;
import @1.0::NanDataPathConfirmInd;
import @1.0::NanDataPathSecurityConfig;
import @1.0::NanDataPathSecurityType;
import @1.0::NanDiscoveryCommonConfig;
import @1.0::NanInitiateDataPathRequest;
import @1.0::NanMatchAlg;
import @1.0::NanRangingIndication;
import @1.0::NanRespondToDataPathIndicationRequest;
import @1.0::NanPublishType;
import @1.0::NanTxType;
import @1.0::Rssi;
import @1.0::RttBw;
import @1.0::RttPeerType;
import @1.0::RttStatus;
import @1.0::RttType;
import @1.0::StaLinkLayerIfaceStats;
import @1.0::StaLinkLayerRadioStats;
import @1.0::TimeSpanInPs;
import @1.0::TimeStampInUs;
import @1.0::TimeStampInMs;
import @1.0::WifiChannelInMhz;
import @1.0::WifiChannelWidthInMhz;
import @1.0::WifiInformationElement;
import @1.0::WifiRateNss;
import @1.4::RttPreamble;
import @1.4::WifiRatePreamble;
import @1.5::NanConfigRequestSupplemental;
import @1.5::WifiBand;
import @1.5::StaLinkLayerIfaceContentionTimeStats;
import @1.5::WifiIfaceMode;

/**
 * Channel operating width in Mhz.
 */
enum WifiChannelWidthInMhz : @1.0::WifiChannelWidthInMhz {
    /**
     * 320 MHz
     */
    WIDTH_320 = 7,
};

/**
 * RTT Measurement Bandwidth.
 */
enum RttBw : @1.0::RttBw {
    BW_320MHZ = 0x40,
};

/**
 * RTT Measurement Preamble.
 */
enum RttPreamble : @1.4::RttPreamble {
    /**
     * Preamble type for 11be
     */
    EHT = 0x10,
};

/**
 * Wifi Rate Preamble
 */
enum WifiRatePreamble : @1.4::WifiRatePreamble {
    /**
     * Preamble type for 11be
     */
    EHT = 6,
};

/**
 * Antenna configuration
 */
enum WifiAntennaMode : uint32_t {
  WIFI_ANTENNA_MODE_UNSPECIFIED    = 0,
  WIFI_ANTENNA_MODE_1X1        = 1,
  WIFI_ANTENNA_MODE_2X2        = 2,
  WIFI_ANTENNA_MODE_3X3        = 3,
  WIFI_ANTENNA_MODE_4X4        = 4,
};

/**
 * Channel information.
 */
struct WifiChannelInfo {
    /**
     * Channel width (20, 40, 80, 80+80, 160, 320).
     */
    WifiChannelWidthInMhz width;

    /**
     * Primary 20 MHz channel.
     */
    WifiChannelInMhz centerFreq;

    /**
     * Center frequency (MHz) first segment.
     */
    WifiChannelInMhz centerFreq0;

    /**
     * Center frequency (MHz) second segment.
     */
    WifiChannelInMhz centerFreq1;
};

/**
 * RTT configuration.
 */
struct RttConfig {
    /**
     * Peer device mac address.
     */
    MacAddress addr;

    /**
     * 1-sided or 2-sided RTT.
     */
    RttType type;

    /**
     * Optional - peer device hint (STA, P2P, AP).
     */
    RttPeerType peer;

    /**
     * Required for STA-AP mode, optional for P2P, NBD etc.
     */
    WifiChannelInfo channel;

    /**
     * Time interval between bursts (units: 100 ms).
     * Applies to 1-sided and 2-sided RTT multi-burst requests.
     * Range: 0-31, 0: no preference by initiator (2-sided RTT).
     */
    uint32_t burstPeriod;

    /**
     * Total number of RTT bursts to be executed. It will be
     * specified in the same way as the parameter "Number of
     * Burst Exponent" found in the FTM frame format. It
     * applies to both: 1-sided RTT and 2-sided RTT. Valid
     * values are 0 to 15 as defined in 802.11mc std.
     * 0 means single shot
     * The implication of this parameter on the maximum
     * number of RTT results is the following:
     * for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst)
     * for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1)
     */
    uint32_t numBurst;

    /**
     * Num of frames per burst.
     * Minimum value = 1, Maximum value = 31
     * For 2-sided this equals the number of FTM frames
     * to be attempted in a single burst. This also
     * equals the number of FTM frames that the
     * initiator will request that the responder send
     * in a single frame.
     */
    uint32_t numFramesPerBurst;

    /**
     * Number of retries for a failed RTT frame.
     * Applies to 1-sided RTT only. Minimum value = 0, Maximum value = 3
     */
    uint32_t numRetriesPerRttFrame;

    /**
     * Following fields are only valid for 2-side RTT.
     *
     *
     * Maximum number of retries that the initiator can
     * retry an FTMR frame.
     * Minimum value = 0, Maximum value = 3
     */
    uint32_t numRetriesPerFtmr;

    /**
     * Whether to request location civic info or not.
     */
    bool mustRequestLci;

    /**
     * Whether to request location civic records or not.
     */
    bool mustRequestLcr;

    /**
     * Applies to 1-sided and 2-sided RTT. Valid values will
     * be 2-11 and 15 as specified by the 802.11mc std for
     * the FTM parameter burst duration. In a multi-burst
     * request, if responder overrides with larger value,
     * the initiator will return failure. In a single-burst
     * request if responder overrides with larger value,
     * the initiator will sent TMR_STOP to terminate RTT
     * at the end of the burst_duration it requested.
     */
    uint32_t burstDuration;

    /**
     * RTT preamble to be used in the RTT frames.
     */
    RttPreamble preamble;

    /**
     * RTT BW to be used in the RTT frames.
     */
    RttBw bw;
};

/**
 * RTT Responder information
 */
struct RttResponder {
    WifiChannelInfo channel;

    RttPreamble preamble;
};

struct WifiChannelStats {
    /**
     * Channel information.
     */
    WifiChannelInfo channel;

    /**
     * Total time for which the radio is awake on this channel.
     */
    uint32_t onTimeInMs;

    /**
     * Total time for which CCA is held busy on this channel.
     */
    uint32_t ccaBusyTimeInMs;
};

struct StaLinkLayerRadioStats {
    /**
     * Baseline information as defined in HAL 1.0.
     */
    @1.0::StaLinkLayerRadioStats V1_0;

    /**
     * Total time for which the radio is awake due to NAN scan since boot or crash.
     */
    uint32_t onTimeInMsForNanScan;

    /**
     * Total time for which the radio is awake due to background scan since boot or crash.
     */
    uint32_t onTimeInMsForBgScan;

    /**
     * Total time for which the radio is awake due to roam scan since boot or crash.
     */
    uint32_t onTimeInMsForRoamScan;

    /**
     * Total time for which the radio is awake due to PNO scan since boot or crash.
     */
    uint32_t onTimeInMsForPnoScan;

    /**
     * Total time for which the radio is awake due to Hotspot 2.0 scans and GAS exchange since boot
     * or crash.
     */
    uint32_t onTimeInMsForHs20Scan;

    /**
     * List of channel stats associated with this radio
     */
    vec<WifiChannelStats> channelStats;

    /**
     * Radio ID: An implementation specific value identifying the radio interface for which the
     * stats are produced. Framework must not interpret this value. It must use this value for
     * persistently identifying the statistics between calls,
     * e.g. if the HAL provides them in different order.
     */
    int32_t radioId;
};

/**
 * Per peer statistics.  The types of peer include the Access Point (AP), the Tunneled Direct Link
 * Setup (TDLS), the Group Owner (GO), the Neighbor Awareness Networking (NAN), etc.
 */
struct StaPeerInfo {
    /**
     * Station count: The total number of stations currently associated with the peer.
     */
    uint16_t staCount;

    /**
     * Channel utilization: The percentage of time (normalized to 255, i.e., x% corresponds to
     * (int) x * 255 / 100) that the medium is sensed as busy measured by either physical or
     * virtual carrier sense (CS) mechanism.
     */
    uint16_t chanUtil;

    /**
     * Per rate statistics
     */
    vec<StaRateStat> rateStats;
};

/**
 * Iface statistics for the current connection.
 */
struct StaLinkLayerIfaceStats {
    /**
     * Baseline information as defined in HAL 1.0.
     */
    @1.0::StaLinkLayerIfaceStats V1_0;

    /**
     * Duty cycle for the iface.
     * if this iface is being served using time slicing on a radio with one or more ifaces
     * (i.e MCC), then the duty cycle assigned to this iface in %.
     * If not using time slicing (i.e SCC or DBS), set to 100.
     */
    uint8_t timeSliceDutyCycleInPercent;

    /**
     * WME Best Effort (BE) Access Category (AC) contention time statistics.
     */
    StaLinkLayerIfaceContentionTimeStats wmeBeContentionTimeStats;

    /**
     * WME Background (BK) Access Category (AC) contention time statistics.
     */
    StaLinkLayerIfaceContentionTimeStats wmeBkContentionTimeStats;

    /**
     * WME Video (VI) Access Category (AC) contention time statistics.
     */
    StaLinkLayerIfaceContentionTimeStats wmeViContentionTimeStats;

    /**
     * WME Voice (VO) Access Category (AC) contention time statistics.
     */
    StaLinkLayerIfaceContentionTimeStats wmeVoContentionTimeStats;

    /**
     * Per peer statistics.
     */
    vec<StaPeerInfo> peers;
};

/**
 * Link layer stats retrieved via |getLinkLayerStats|.
 */
struct StaLinkLayerStats {
    StaLinkLayerIfaceStats iface;

    vec<StaLinkLayerRadioStats> radios;

    /**
     * TimeStamp for each stats sample.
     * This is the absolute milliseconds from boot when these stats were
     * sampled.
     */
    TimeStampInMs timeStampInMs;
};

/**
 * Wifi rate info.
 */
struct WifiRateInfo {
    /**
     * Preamble used for RTT measurements.
     */
    WifiRatePreamble preamble;

    /**
     * Number of spatial streams.
     */
    WifiRateNss nss;

    /**
     * Bandwidth of channel.
     */
    WifiChannelWidthInMhz bw;

    /**
     * OFDM/CCK rate code would be as per ieee std in the units of 0.5mbps.
     * HT/VHT/HE/EHT it would be mcs index.
     */
    uint8_t rateMcsIdx;

    /**
     * Bitrate in units of 100 Kbps.
     */
    uint32_t bitRateInKbps;
};

/**
 * Per rate statistics.  The rate is characterized by the combination of preamble, number of spatial
 * streams, transmission bandwidth, and modulation and coding scheme (MCS).
 */
struct StaRateStat {
    /**
     * Wifi rate information: preamble, number of spatial streams, bandwidth, MCS, etc.
     */
    WifiRateInfo rateInfo;

    /**
     * Number of successfully transmitted data packets (ACK received)
     */
    uint32_t txMpdu;

    /**
     * Number of received data packets
     */
    uint32_t rxMpdu;

    /**
     * Number of data packet losses (no ACK)
     */
    uint32_t mpduLost;

    /**
     * Number of data packet retries
     */
    uint32_t retries;
};

/**
 * RTT results.
 */
struct RttResult {
    /**
     * Peer device mac address.
     */
    MacAddress addr;

    /**
     * Burst number in a multi-burst request.
     */
    uint32_t burstNum;

    /**
     * Total RTT measurement frames attempted.
     */
    uint32_t measurementNumber;

    /**
     * Total successful RTT measurement frames.
     */
    uint32_t successNumber;

    /**
     * Maximum number of "FTM frames per burst" supported by
     * the responder STA. Applies to 2-sided RTT only.
     * If reponder overrides with larger value:
     * - for single-burst request initiator will truncate the
     * larger value and send a TMR_STOP after receiving as
     * many frames as originally requested.
     * - for multi-burst request, initiator will return
     * failure right away.
     */
    uint8_t numberPerBurstPeer;

    /**
     * Ranging status.
     */
    RttStatus status;

    /**
     * When status == RTT_STATUS_FAIL_BUSY_TRY_LATER,
     * this will be the time provided by the responder as to
     * when the request can be tried again. Applies to 2-sided
     * RTT only. In sec, 1-31sec.
     */
    uint8_t retryAfterDuration;

    /**
     * RTT type.
     */
    RttType type;

    /**
     * Average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB.
     */
    Rssi rssi;

    /**
     * Rssi spread in 0.5 dB steps e.g. 5 implies 2.5 dB spread (optional).
     */
    Rssi rssiSpread;

    /**
     * 1-sided RTT: TX rate of RTT frame.
     * 2-sided RTT: TX rate of initiator's Ack in response to FTM frame.
     */
    WifiRateInfo txRate;

    /**
     * 1-sided RTT: TX rate of Ack from other side.
     * 2-sided RTT: TX rate of FTM frame coming from responder.
     */
    WifiRateInfo rxRate;

    /**
     * Round trip time in picoseconds
     */
    TimeSpanInPs rtt;

    /**
     * Rtt standard deviation in picoseconds.
     */
    TimeSpanInPs rttSd;

    /**
     * Difference between max and min rtt times recorded in picoseconds.
     */
    TimeSpanInPs rttSpread;

    /**
     * Distance in mm (optional).
     */
    int32_t distanceInMm;

    /**
     * Standard deviation in mm (optional).
     */
    int32_t distanceSdInMm;

    /**
     * Difference between max and min distance recorded in mm (optional).
     */
    int32_t distanceSpreadInMm;

    /**
     * Time of the measurement (in microseconds since boot).
     */
    TimeStampInUs timeStampInUs;

    /**
     * in ms, actual time taken by the FW to finish one burst
     * measurement. Applies to 1-sided and 2-sided RTT.
     */
    uint32_t burstDurationInMs;

    /**
     * Number of bursts allowed by the responder. Applies
     * to 2-sided RTT only.
     */
    uint32_t negotiatedBurstNum;

    /**
     * for 11mc only.
     */
    WifiInformationElement lci;

    /**
     * for 11mc only.
     */
    WifiInformationElement lcr;
};

/**
 * NAN data path channel information provided to the framework.
 */
struct NanDataPathChannelInfo {
    /**
     * Channel frequency in MHz.
     */
    WifiChannelInMhz channelFreq;

    /**
     * Channel bandwidth in MHz.
     */
    WifiChannelWidthInMhz channelBandwidth;

    /**
     * Number of spatial streams used in the channel.
     */
    uint32_t numSpatialStreams;
};

/**
 * NAN Data path confirmation Indication structure.
 * Event indication is received on both initiator and responder side when negotiation for a
 * data-path finish: on success or failure.
 */
struct NanDataPathConfirmInd {
    /**
     * Baseline information as defined in HAL 1.0.
     */
    @1.0::NanDataPathConfirmInd V1_0;

    /**
     * The channel(s) on which the NDP is scheduled to operate.
     * Updates to the operational channels are provided using the |eventDataPathScheduleUpdate|
     * event.
     */
    vec<NanDataPathChannelInfo> channelInfo;
};

/**
 * NAN data path channel information update indication structure.
 * Event indication is received by all NDP owners whenever the channels on which the NDP operates
 * are updated.
 * Note: multiple NDPs may share the same schedule, the indication specifies all NDPs to which it
 * applies.
 */
struct NanDataPathScheduleUpdateInd {
    /**
     * The discovery address (NMI) of the peer to which the NDP is connected.
     */
    MacAddress peerDiscoveryAddress;

    /**
     * The updated channel(s) information.
     */
    vec<NanDataPathChannelInfo> channelInfo;

    /**
     * The list of NDPs to which this update applies.
     */
    vec<uint32_t> ndpInstanceIds;
};

/**
 * Wifi usable channel information.
 */
struct WifiUsableChannel {
    /**
     * Wifi channel freqeuncy in MHz.
     */
    WifiChannelInMhz channel;

    /**
     * Wifi channel bandwidth in MHz.
     */
    WifiChannelWidthInMhz channelBandwidth;

    /**
     * Iface modes feasible on this channel.
     */
    bitfield<WifiIfaceMode> ifaceModeMask;
};

/**
 * RTT Capabilities.
 */
struct RttCapabilities {
    /**
     * if 1-sided rtt data collection is supported.
     */
    bool rttOneSidedSupported;

    /**
     * if ftm rtt data collection is supported.
     */
    bool rttFtmSupported;

    /**
     * if initiator supports LCI request. Applies to 2-sided RTT.
     */
    bool lciSupported;

    /**
     * if initiator supports LCR request. Applies to 2-sided RTT.
     */
    bool lcrSupported;

    /**
     * if 11mc responder mode is supported.
     */
    bool responderSupported;

    /**
     * Bit mask indicates what preamble is supported by initiator.
     * Combination of |RttPreamble| values.
     */
    bitfield<RttPreamble> preambleSupport;

    /**
     * Bit mask indicates what BW is supported by initiator.
     * Combination of |RttBw| values.
     */
    bitfield<RttBw> bwSupport;

    /**
     * Draft 11mc spec version supported by chip.
     * For instance, version 4.0 must be 40 and version 4.3 must be 43 etc.
     */
    uint8_t mcVersion;
};

/**
 * Cipher suite flags.
 */
enum NanCipherSuiteType : @1.0::NanCipherSuiteType {
    /**
     *  NCS-PK-128
     */
    PUBLIC_KEY_128_MASK = 1 << 2,
    /**
     *  NCS-PK-256
     */
    PUBLIC_KEY_256_MASK = 1 << 3,
};

/**
 * NAN configuration request parameters added in the 1.2 HAL. These are supplemental to previous
 * versions.
 */
struct NanConfigRequestSupplemental {
    /**
     * Baseline information as defined in HAL 1.5.
     */
    @1.5::NanConfigRequestSupplemental V1_5;

    /**
     * Controls NAN instant communication mode operate on which channel
     */
    uint32_t instantModeChannel;
};

/**
 * Configuration of NAN data-path security.
 */
struct NanDataPathSecurityConfig {
    /**
     * Security configuration of the data-path (NDP). Security is enabled if not equal to
     * |NanDataPathSecurityType.OPEN|.
     * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
     */
    NanDataPathSecurityType securityType;

    /**
     * Cipher type for data-paths. If |securityType| is |NanDataPathSecurityType.OPEN| then must
     * be set to |NanCipherSuiteType.NONE|, otherwise a non-|NanCipherSuiteType.NONE| cipher suite
     * must be specified.
     */
    NanCipherSuiteType cipherType;

    /**
     * Optional Pairwise Master Key (PMK). Must be specified (and is only used) if |securityType| is
     * set to |NanDataPathSecurityType.PMK|.
     * Ref: IEEE 802.11i
     */
    uint8_t[32] pmk;

    /**
     * Optional Passphrase. Must be specified (and is only used) if |securityType| is set to
     * |NanDataPathSecurityType.PASSPHRASE|.
     * Min length: |MIN_PASSPHRASE_LENGTH|
     * Max length: |MAX_PASSPHRASE_LENGTH|
     * NAN Spec: Appendix: Mapping passphrase to PMK for NCS-SK Cipher Suites
     */
    vec<uint8_t> passphrase;

    /**
     * Security Context Identifier attribute contains PMKID shall be included in NDP setup and
     * response messages. Security Context Identifier, Identifies the Security Context. When
     * security is enabled this field contains the 16 octet PMKID identifying the PMK used for
     * setting up the Secure Data Path.
     */
    uint8_t[16] scid;
};

/**
 * Response to a data-path request from a peer.
 */
struct NanRespondToDataPathIndicationRequest {
    /**
     * Accept (true) or reject (false) the request.
     * NAN Spec: Data Path Attributes / NDP Attribute / Type and Status
     */
    bool acceptRequest;

    /**
     * ID of the data-path (NDP) for which we're responding - obtained as part of the request in
     * |IWifiNanIfaceEventCallback.eventDataPathRequest|.
     */
    uint32_t ndpInstanceId;

    /**
     * NAN data interface name on which this data-path session is to be started.
     * This must be an interface created using |IWifiNanIface.createDataInterfaceRequest|.
     */
    string ifaceName;

    /**
     * Security configuration of the requested data-path.
     */
    NanDataPathSecurityConfig securityConfig;

    /**
     * Arbitrary information communicated to the peer as part of the data-path setup process - there
     * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
     * with no parsing.
     * Max length: |NanCapabilities.maxAppInfoLen|.
     * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
     */
    vec<uint8_t> appInfo;

    /**
     * A service name to be used with |passphrase| to construct a Pairwise Master Key (PMK) for the
     * data-path. Only relevant when a data-path is requested which is not associated with a NAN
     * discovery session - e.g. using out-of-band discovery.
     * Constraints: same as |NanDiscoveryCommonConfig.serviceName|
     * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
     */
    vec<uint8_t> serviceNameOutOfBand;
};

/**
 *  Data Path Initiator requesting a data-path.
 */
struct NanInitiateDataPathRequest {
    /**
     * ID of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch| or
     * |IWifiNanIfaceEventCallback.eventFollowupReceived|.
     */
    uint32_t peerId;

    /**
     * NAN management interface MAC address of the peer. Obtained as part of an earlier
     * |IWifiNanIfaceEventCallback.eventMatch| or |IWifiNanIfaceEventCallback.eventFollowupReceived|.
     */
    MacAddress peerDiscMacAddr;

    /**
     * Config flag for channel request.
     */
    NanDataPathChannelCfg channelRequestType;

    /**
     * Channel frequency in MHz to start data-path. Not relevant if |channelRequestType| is
     * |NanDataPathChannelCfg.CHANNEL_NOT_REQUESTED|.
     */
    WifiChannelInMhz channel;

    /**
     * NAN data interface name on which this data-path session is to be initiated.
     * This must be an interface created using |IWifiNanIface.createDataInterfaceRequest|.
     */
    string ifaceName;

    /**
     * Security configuration of the requested data-path.
     */
    NanDataPathSecurityConfig securityConfig;

    /**
     * Arbitrary information communicated to the peer as part of the data-path setup process - there
     * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
     * with no parsing.
     * Max length: |NanCapabilities.maxAppInfoLen|.
     * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
     */
    vec<uint8_t> appInfo;

    /**
     * A service name to be used with |passphrase| to construct a Pairwise Master Key (PMK) for the
     * data-path. Only relevant when a data-path is requested which is not associated with a NAN
     * discovery session - e.g. using out-of-band discovery.
     * Constraints: same as |NanDiscoveryCommonConfig.serviceName|
     * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
     */
    vec<uint8_t> serviceNameOutOfBand;
};

/**
 * Configurations of NAN discovery sessions: common to publish and subscribe discovery.
 */
struct NanDiscoveryCommonConfig {
    /**
     * The ID of the discovery session being configured. A value of 0 specifies a request to create
     * a new discovery session. The new discovery session ID is returned with
     * |IWifiNanIfaceEventCallback.notifyStartPublishResponse| or
     * |IWifiNanIfaceEventCallback.notifyStartSubscribeResponse|.
     * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
     */
    uint8_t sessionId;

    /**
     * The lifetime of the discovery session in seconds. A value of 0 means run forever or until
     * canceled using |IWifiIface.stopPublishRequest| or |IWifiIface.stopSubscribeRequest|.
     */
    uint16_t ttlSec;

    /**
     * Indicates the interval between two Discovery Windows in which the device supporting the
     * service is awake to transmit or receive the Service Discovery frames. Valid values of Awake
     * DW Interval are: 1, 2, 4, 8 and 16. A value of 0 will default to 1. Does not override
     * |NanBandSpecificConfig.discoveryWindowIntervalVal| configurations if those are specified.
     */
    uint16_t discoveryWindowPeriod;

    /**
     * The lifetime of the discovery session in number of transmitted SDF discovery packets. A value
     * of 0 means forever or until canceled using |IWifiIface.stopPublishRequest| or
     * |IWifiIface.stopSubscribeRequest|.
     */
    uint8_t discoveryCount;

    /**
     * UTF-8 encoded string identifying the service.
     * Max length: |NanCapabilities.maxServiceNameLen|.
     * NAN Spec: The only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric
     * values (A-Z, a-z, 0-9), the hyphen ('-'), and the period ('.'). All valid multi-byte UTF-8
     * characters are acceptable in a Service Name.
     */
    vec<uint8_t> serviceName;

    /**
     * Specifies how often to trigger |IWifiNanIfaceEventCallback.eventMatch| when continuously
     * discovering the same discovery session (with no changes).
     */
    NanMatchAlg discoveryMatchIndicator;

    /**
     * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
     * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
     * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
     * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
     */
    vec<uint8_t> serviceSpecificInfo;

    /**
     * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
     * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
     * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
     * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
     */
    vec<uint8_t> extendedServiceSpecificInfo;

    /**
     * Ordered sequence of <length, value> pairs (|length| uses 1 byte and contains the number of
     * bytes in the |value| field) which specify further match criteria (beyond the service name).
     * The match behavior is specified in details in the NAN spec.
     * Publisher: used in SOLICITED or SOLICITED_UNSOLICITED sessions.
     * Subscriber: used in ACTIVE or PASSIVE sessions.
     * Max length: |NanCapabilities.maxMatchFilterLen|.
     * NAN Spec: matching_filter_rx
     */
    vec<uint8_t> rxMatchFilter;

    /**
     * Ordered sequence of <length, value> pairs (|length| uses 1 byte and contains the number of
     * bytes in the |value| field) which specify further match criteria (beyond the service name).
     * The match behavior is specified in details in the NAN spec.
     * Publisher: used if provided.
     * Subscriber: used (if provided) only in ACTIVE sessions.
     * Max length: |NanCapabilities.maxMatchFilterLen|.
     * NAN Spec: matching_filter_tx and Service Descriptor Attribute (SDA) / Matching Filter
     */
    vec<uint8_t> txMatchFilter;

    /**
     * Specifies whether or not the discovery session uses the
     * |NanBandSpecificConfig.rssiCloseProximity| value (configured in enable/configure requests) to
     * filter out matched discovered peers.
     * NAN Spec: Service Descriptor Attribute / Service Control / Discovery Range Limited.
     */
    bool useRssiThreshold;

    /**
     * Controls whether or not the |IWifiNanIfaceEventCallback.eventPublishTerminated| (for publish
     * discovery sessions) or |IWifiNanIfaceEventCallback.eventSubscribeTerminated| (for subscribe
     * discovery sessions) will be delivered.
     */
    bool disableDiscoveryTerminationIndication;

    /**
     * Controls whether or not the |IWifiNanIfaceEventCallback.eventMatchExpired| will be delivered.
     */
    bool disableMatchExpirationIndication;

    /**
     * Controls whether or not the |IWifiNanIfaceEventCallback.eventFollowupReceived| will be
     * delivered.
     */
    bool disableFollowupReceivedIndication;

    /**
     * Security configuration of data-paths created in the context of this discovery session. Security
     * parameters can be overridden during the actual construction of the data-path - allowing
     * individual data-paths to have unique PMKs or Passphrases.
     */
    NanDataPathSecurityConfig securityConfig;

    /**
     * Specifies whether or not there is a ranging requirement in this discovery session.
     * Ranging is only performed if all other match criteria with the peer are met. Ranging must
     * be performed if both peers in the discovery session (publisher and subscriber) set this
     * flag to true. Otherwise, if either peer sets this flag to false, ranging must not be performed
     * and must not impact discovery decisions.
     * Note: specifying that ranging is required also implies that this device must automatically
     * accept ranging requests from peers.
     * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Ranging Require.
     */
    bool rangingRequired;

    /**
     * Interval in msec between two ranging measurements. Only relevant if |rangingRequired| is true.
     * If the Awake DW interval specified either in |discoveryWindowPeriod| or in
     * |NanBandSpecificConfig.discoveryWindowIntervalVal| is larger than the ranging interval then
     * priority is given to Awake DW interval.
     */
    uint32_t rangingIntervalMsec;

    /**
     * The type of ranging feedback to be provided by discovery session matches
     * |IWifiNanIfaceEventCallback.eventMatch|. Only relevant if |rangingRequired| is true.
     */
    bitfield<NanRangingIndication> configRangingIndications;

    /**
     * The ingress and egress distance in cm. If ranging is enabled (|rangingEnabled| is true) then
     * |configRangingIndications| is used to determine whether ingress and/or egress (or neither)
     * are used to determine whether a match has occurred.
     * NAN Spec: Service Discovery Extension Attribute (SDEA) / Ingress & Egress Range Limit
     */
    uint16_t distanceIngressCm;

    uint16_t distanceEgressCm;
};

/**
 * Publish request: specifies a publish discovery operation.
 */
struct NanPublishRequest {
    /**
     * Common configuration of discovery sessions.
     */
    NanDiscoveryCommonConfig baseConfigs;

    /**
     * The type of the publish discovery session.
     */
    NanPublishType publishType;

    /**
     * For publishType of |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
     * specifies the type of transmission used for responding to the probing subscribe discovery
     * peer.
     */
    NanTxType txType;

    /**
     * Specifies whether data-path requests |IWifiNanIfaceEventCallback.eventDataPathRequest| (in
     * the context of this discovery session) are automatically accepted (if true) - in which case
     * the Responder must not call the |IWifiNanIface.respondToDataPathIndicationRequest| method and
     * the device must automatically accept the data-path request and complete the negotiation.
     */
    bool autoAcceptDataPathRequests;
};

/**
 * Match indication structure
 */
struct NanMatchInd {
    /**
     * Publish or subscribe discovery session ID of an existing discovery session.
     * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
     */
    uint8_t discoverySessionId;

    /**
     * A unique ID of the peer. Can be subsequently used in |IWifiNanIface.transmitFollowupRequest| or
     * to set up a data-path.
     */
    uint32_t peerId;

    /**
     * The NAN Discovery (management) MAC address of the peer.
     */
    MacAddress addr;

    /**
     * The arbitrary information contained in the |NanDiscoveryCommonConfig.serviceSpecificInfo| of
     * the peer's discovery session configuration.
     * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
     * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
     */
    vec<uint8_t> serviceSpecificInfo;

    /**
     * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
     * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
     * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
     * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
     */
    vec<uint8_t> extendedServiceSpecificInfo;

    /**
     * The match filter from the discovery packet (publish or subscribe) which caused service
     * discovery. Matches the |NanDiscoveryCommonConfig.txMatchFilter| of the peer's Unsolicited
     * publish message or of the local device's Active subscribe message.
     * Max length: |NanCapabilities.maxMatchFilterLen|.
     * NAN Spec: Service Descriptor Attribute (SDA) / Matching Filter
     */
    vec<uint8_t> matchFilter;

    /**
     * Indicates the type of discovery: true if match occurred on a Beacon frame, false if the match
     * occurred on a Service Discovery Frames (SDF).
     */
    bool matchOccuredInBeaconFlag;

    /**
     * Flag to indicate firmware is out of resource and that it can no longer track this Service Name.
     * Indicates that while |IWifiNanIfaceEventCallback.eventMatch| will be received, the
     * |NanDiscoveryCommonConfig.discoveryMatchIndicator| configuration will not be honored.
     */
    bool outOfResourceFlag;

    /**
     * If RSSI filtering was enabled using |NanDiscoveryCommonConfig.useRssiThreshold| in discovery
     * session setup then this field contains the received RSSI value. It will contain 0 if RSSI
     * filtering was not enabled.
     * RSSI values are returned without sign, e.g. -70dBm will be returned as 70.
     */
    uint8_t rssiValue;

    /**
     * Cipher type for data-paths constructed in the context of this discovery session. Valid if
     * |peerRequiresSecurityEnabledInNdp| is true.
     */
    NanCipherSuiteType peerCipherType;

    /**
     * Indicates whether or not the peer requires security enabled in any data-path (NDP) constructed
     * in the context of this discovery session. The |cipherType| specifies the cipher type for such
     * data-paths.
     * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
     */
    bool peerRequiresSecurityEnabledInNdp;

    /**
     * Indicates whether or not the peer requires (and hence allows) ranging in the context of this
     * discovery session.
     * Note that ranging is only performed if all other match criteria with the peer are met.
     * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Ranging Require.
     */
    bool peerRequiresRanging;

    /**
     * Ranging indication supersedes the NanMatchAlg specification.
     * Ex: If NanMatchAlg is MATCH_ONCE, but ranging indications is continuous then continuous
     * match notifications will be received (with ranging information).
     * Ranging indication data is provided if Ranging required is enabled in the discovery
     * specification and:
     *   1) continuous ranging specified.
     *   2) ingress/egress specified and:
     *       - notify once for ingress >= ingress_distance and egress <= egress_distance,
     *       - same for ingress_egress_both
     * If the Awake DW intervals are larger than the ranging intervals then priority is given to the
     * device DW intervals.
     *
     * If ranging was required and executed contains the distance to the peer in MM. The
     * |rangingIndicationType| field specifies the event which triggered ranging.
     */
    uint32_t rangingMeasurementInMm;

    /**
     * The ranging event(s) which triggered the ranging. E.g. can indicate that continuous ranging was
     * requested, or else that an ingress event occurred.
     */
    bitfield<NanRangingIndication> rangingIndicationType;

    /**
     * Security Context Identifier attribute contains PMKID shall be included in NDP setup and
     * response messages. Security Context Identifier, Identifies the Security Context. For NAN
     * Shared Key Cipher Suite, this field contains the 16 octet PMKID identifying the PMK used for
     * setting up the Secure Data Path.
     */
    vec<uint8_t> scid;
};

/**
 * NDP Capabilities response.
 */
struct NanCapabilities {
    /**
     * Maximum number of clusters which the device can join concurrently.
     */
    uint32_t maxConcurrentClusters;

    /**
     * Maximum number of concurrent publish discovery sessions.
     */
    uint32_t maxPublishes;

    /**
     * Maximum number of concurrent subscribe discovery sessions.
     */
    uint32_t maxSubscribes;

    /**
     * Maximum length (in bytes) of service name.
     */
    uint32_t maxServiceNameLen;

    /**
     * Maximum length (in bytes) of individual match filters.
     */
    uint32_t maxMatchFilterLen;

    /**
     * Maximum length (in bytes) of aggregate match filters across all active sessions.
     */
    uint32_t maxTotalMatchFilterLen;

    /**
     * Maximum length (in bytes) of the service specific info field.
     */
    uint32_t maxServiceSpecificInfoLen;

    /**
     * Maximum length (in bytes) of the extended service specific info field.
     */
    uint32_t maxExtendedServiceSpecificInfoLen;

    /**
     * Maximum number of data interfaces (NDI) which can be created concurrently on the device.
     */
    uint32_t maxNdiInterfaces;

    /**
     * Maximum number of data paths (NDP) which can be created concurrently on the device, across all
     * data interfaces (NDI).
     */
    uint32_t maxNdpSessions;

    /**
     * Maximum length (in bytes) of application info field (used in data-path negotiations).
     */
    uint32_t maxAppInfoLen;

    /**
     * Maximum number of transmitted followup messages which can be queued by the firmware.
     */
    uint32_t maxQueuedTransmitFollowupMsgs;

    /**
     * Maximum number MAC interface addresses which can be specified to a subscribe discovery session.
     */
    uint32_t maxSubscribeInterfaceAddresses;

    /**
     * The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used.
     */
    bitfield<NanCipherSuiteType> supportedCipherSuites;

    /**
     * Flag to indicate id instant communication mode is supported.
     */
    bool instantCommunicationModeSupportFlag;
};

/**
 * Wifi radio configuration
 */
struct WifiRadioConfiguration {
    /**
     * Band on which this radio chain is operating.
     * Valid values of bandInfo are: BAND_24GHZ, BAND_5GHZ, BAND_6GHZ and
     * BAND_60GHZ.
     *
     */
    WifiBand bandInfo;

    /**
     * Wifi Antenna configuration.
     */
    WifiAntennaMode antennaMode;
};

/**
 * Wifi radio combination
 */
struct WifiRadioCombination {
    /**
     * A list of radio configurations in this combination.
     */
    vec<WifiRadioConfiguration> radioConfigurations;
};

/**
 * Wifi radio combinations matrix retrieved via |getSupportedRadioCombinationsMatrix|.
 */
struct WifiRadioCombinationMatrix {
    /**
     * A list of all the possible radio combinations that the chip can operate.
     */
    vec<WifiRadioCombination> radioCombinations;
};

/**
 * List of interface concurrency types, used in reporting device concurrency capabilities.
 */
enum IfaceConcurrencyType : uint32_t {
    /**
     * Concurrency type for station mode.
     */
    STA,
    /**
     * Concurrency type of single-port AP mode.
     */
    AP,
    /**
     * Concurrency type of two-port bridged AP mode.
     */
    AP_BRIDGED,
    /**
     * Concurrency type of peer-to-peer mode.
     */
    P2P,
    /**
     * Concurrency type of neighborhood area network mode.
     */
    NAN,
};