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
|
/*
* Copyright 2020 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.5;
import @1.0::StaLinkLayerIfaceStats;
import @1.0::StaLinkLayerIfacePacketStats;
import @1.0::TimeStampInMs;
import @1.4::WifiBand;
import @1.0::NanCipherSuiteType;
import @1.0::NanCapabilities;
import @1.2::NanConfigRequestSupplemental;
import @1.3::StaLinkLayerRadioStats;
import @1.0::WifiChannelInMhz;
import @1.0::WifiChannelWidthInMhz;
import @1.4::WifiRateInfo;
/**
* Wifi bands defined in 80211 spec.
*/
enum WifiBand : @1.4::WifiBand {
/**
* 60 GHz.
*/
BAND_60GHZ = 16,
/**
* 2.4 GHz + 5 GHz no DFS + 6 GHz + 60 GHz.
*/
BAND_24GHZ_5GHZ_6GHZ_60GHZ = 27,
/**
* 2.4 GHz + 5 GHz with DFS + 6 GHz + 60 GHz.
*/
BAND_24GHZ_5GHZ_WITH_DFS_6GHZ_60GHZ = 31,
};
/**
* Interface operating modes.
*/
enum WifiIfaceMode : uint32_t {
/**
* Interface operation mode is client.
*/
IFACE_MODE_STA = 1 << 0,
/**
* Interface operation mode is Hotspot.
*/
IFACE_MODE_SOFTAP = 1 << 1,
/**
* Interface operation mode is Ad-Hoc network.
*/
IFACE_MODE_IBSS = 1 << 2,
/**
* Interface operation mode is Wifi Direct Client.
*/
IFACE_MODE_P2P_CLIENT = 1 << 3,
/**
* Interface operation mode is Wifi Direct Group Owner.
*/
IFACE_MODE_P2P_GO = 1 << 4,
/**
* Interface operation mode is Aware.
*/
IFACE_MODE_NAN = 1 << 5,
/**
* Interface operation mode is Mesh network.
*/
IFACE_MODE_MESH = 1 << 6,
/**
* Interface operation mode is Tunneled Direct Link Setup.
*/
IFACE_MODE_TDLS = 1 << 7,
};
/**
* 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;
};
/**
* 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.2.
*/
@1.2::NanConfigRequestSupplemental V1_2;
/**
* Controls whether NAN instant communication mode is enabled.
*/
bool enableInstantCommunicationMode;
};
/**
* NDP Capabilities response.
*/
struct NanCapabilities {
/**
* Baseline information as defined in HAL 1.0.
*/
@1.0::NanCapabilities V1_0;
/**
* Flag to indicate id instant communication mode is supported.
*/
bool instantCommunicationModeSupportFlag;
};
/**
* Contention time statistics for different traffic categories.
*/
struct StaLinkLayerIfaceContentionTimeStats {
/**
* Data packet min contention time (usec). It includes both the internal contention time
* among different access categories within the chipset and the contention time for the medium.
*/
uint32_t contentionTimeMinInUsec;
/**
* Data packet max contention time (usec). It includes both the internal contention time
* among different access categories within the chipset and the contention time for the medium.
*/
uint32_t contentionTimeMaxInUsec;
/**
* Data packet average contention time (usec). It includes both the internal contention time
* among different access categories within the chipset and the contention time for the medium.
*/
uint32_t contentionTimeAvgInUsec;
/**
* Number of data packets used for contention statistics.
*/
uint32_t contentionNumSamples;
};
/**
* 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;
};
/**
* 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;
};
struct StaLinkLayerRadioStats {
/**
* Baseline information as defined in HAL 1.3.
*/
@1.3::StaLinkLayerRadioStats V1_3;
/**
* 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;
};
/**
* 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;
};
|