blob: 5126d1299cf0de124f4f22c28fed0087a19fb254 [file] [log] [blame]
lesl0bad28f2019-12-02 23:48:58 +08001/*
2 * Copyright 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.wifi.hostapd@1.2;
18
lesl1cc02e52019-12-26 15:18:58 +080019import @1.0::IHostapd.EncryptionType;
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -080020import @1.0::IHostapd.NetworkParams;
lesl0bad28f2019-12-02 23:48:58 +080021import @1.1::IHostapd;
22import HostapdStatus;
23import MacAddress;
24import Ieee80211ReasonCode;
Roger Wang9e002932019-12-30 12:58:18 +080025import DebugLevel;
lesl0bad28f2019-12-02 23:48:58 +080026
27/**
28 * Top-level object for managing SoftAPs.
29 */
30interface IHostapd extends @1.1::IHostapd {
lesl1cc02e52019-12-26 15:18:58 +080031 /** Possible Security types. */
32 enum EncryptionType : @1.0::IHostapd.EncryptionType {
33 WPA3_SAE_TRANSITION,
34 WPA3_SAE,
35 };
36
lesl0bad28f2019-12-02 23:48:58 +080037 /**
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -080038 * Band bitmMask to use for the SoftAp operations.
39 * A combinatoin of these bits are used to identify the allowed bands
40 * to start the softAp
41 */
42 enum BandMask : uint32_t {
43 /**
44 * 2.4 GHz band.
45 */
46 BAND_2_GHZ = 1 << 0,
47 /**
48 * 5 GHz band.
49 */
50 BAND_5_GHZ = 1 << 1,
51 /**
52 * 6 GHz band.
53 */
54 BAND_6_GHZ = 1 << 2,
55 };
56
57 /**
58 * Parameters to control the HW mode for the interface.
59 */
60 struct HwModeParams {
61 /**
62 * Whether IEEE 802.11ax (HE) is enabled or not.
63 * Note: hw_mode=a is used to specify that 5 GHz band or 6 GHz band is
64 * used with HE.
65 */
66 bool enable80211AX;
Ahmed ElArabawy0e991482019-12-21 12:56:47 -080067
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -080068 /**
69 * Whether 6GHz band enabled or not on softAp.
70 * Note: hw_mode=a is used to specify that 5 GHz band or 6 GHz band is
71 * used.
72 */
73 bool enable6GhzBand;
Ahmed ElArabawyc4af97a2020-01-02 14:23:02 -080074
75 /**
76 * Whether HE single user beamformer in enabled or not on softAp.
77 * Note: this is only applicable if 802.11ax is supported for softAp
78 */
79 bool enableHeSingleUserBeamformer;
80
81 /**
82 * Whether HE single user beamformee is enabled or not on softAp.
83 * Note: this is only applicable if 802.11ax is supported for softAp
84 */
85 bool enableHeSingleUserBeamformee;
86
87 /**
88 * Whether HE multiple user beamformer is enabled or not on softAp.
89 * Note: this is only applicable if 802.11ax is supported for softAp
90 */
91 bool enableHeMultiUserBeamformer;
92
93 /**
94 * Used BSS Color for softAp running in 802.11ax mode
95 * Note: this is only applicable if 802.11ax is supported for softAp
96 */
97 uint32_t heBssColor;
98
99 /**
100 * Whether HE Target Wait Time (TWT) is enabled or not on softAp.
101 * Note: this is only applicable if 802.11ax is supported for softAp
102 */
103 bool enableHeTargetWakeTime;
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800104 };
105
106 /**
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800107 * Parameters to specify the channel frequency range for ACS.
108 */
109 struct AcsFrequencyRange {
110 /**
111 * Channel Frequency (in MHz) at the start of the range.
112 */
113 uint32_t start;
114
115 /**
116 * Channel Frequency (in MHz) at the end of the range.
117 */
118 uint32_t end;
119 };
120
121 /**
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800122 * Parameters to control the channel selection for the interface.
123 */
124 struct ChannelParams {
125 /**
126 * Band to use for the SoftAp operations.
127 */
128 bitfield<BandMask> bandMask;
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800129
130 /**
131 * This option can be used to specify the channel frequencies (in MHz) selected by ACS.
132 * If this is an empty list, all channels allowed in selected HW mode
133 * are specified implicitly.
134 * Note: channels may be overridden by firmware.
135 * Note: this option is ignored if ACS is disabled.
136 */
137 vec<AcsFrequencyRange> acsChannelFreqRangesMhz;
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800138 };
139
140 /**
141 * Parameters to use for setting up the access point interface.
142 */
143 struct IfaceParams {
144 /**
145 * Baseline information as defined in HAL 1.1.
146 */
147 @1.1::IHostapd.IfaceParams V1_1;
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800148
149 /**
150 * Additional Hw mode params for the interface
151 */
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800152 HwModeParams hwModeParams;
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800153
154 /**
155 * Additional Channel params for the interface
156 */
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800157 ChannelParams channelParams;
158 };
159
160 /**
lesl1cc02e52019-12-26 15:18:58 +0800161 * Parameters to use for setting up the access point network.
162 */
163 struct NetworkParams {
164 /**
165 * Baseline information as defined in HAL 1.0.
166 */
167 @1.0::IHostapd.NetworkParams V1_0;
168 /** Key management mask for the replace V1_0.encryptionType. */
169 EncryptionType encryptionType;
170 /**
171 * Passphrase for WPA3_SAE network, WPA3_SAE_TRANSITION and
172 * WPA2_PSK. Replaces @1.0::IHostapd.NetworkParams.pskPassphrase.
173 */
174 string passphrase;
175 };
176
177
178 /**
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800179 * Adds a new access point for hostapd to control.
180 *
181 * This should trigger the setup of an access point with the specified
182 * interface and network params.
183 *
184 * @param ifaceParams AccessPoint Params for the access point.
185 * @param nwParams Network Params for the access point.
186 * @return status Status of the operation.
187 * Possible status codes:
188 * |HostapdStatusCode.SUCCESS|,
189 * |HostapdStatusCode.FAILURE_ARGS_INVALID|,
190 * |HostapdStatusCode.FAILURE_UNKNOWN|,
191 * |HostapdStatusCode.FAILURE_IFACE_EXISTS|
192 */
193 addAccessPoint_1_2(IfaceParams ifaceParams, NetworkParams nwParams)
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800194 generates (HostapdStatus status);
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800195
196 /**
lesl0bad28f2019-12-02 23:48:58 +0800197 * force one of the hotspot clients disconnect..
198 *
199 * @param ifaceName Name of the interface.
200 * @param clientAddress Mac Address of the hotspot client.
201 * @param reasonCode One of disconnect reason code which defined by 802.11.
202 * @return status Status of the operation.
203 * Possible status codes:
204 * |HostapdStatusCode.SUCCESS|,
205 * |HostapdStatusCode.FAILURE_IFACE_UNKNOWN|
206 * |HostapdStatusCode.FAILURE_CLIENT_UNKNOWN|
207 */
208 forceClientDisconnect(string ifaceName, MacAddress clientAddress,
209 Ieee80211ReasonCode reasonCode) generates (HostapdStatus status);
Roger Wang9e002932019-12-30 12:58:18 +0800210
211 /**
212 * Set debug parameters for the hostapd.
213 *
214 * @param level Debug logging level for the hostapd.
215 * (one of |DebugLevel| values).
216 * @return status Status of the operation.
217 * Possible status codes:
218 * |HostapdStatusCode.SUCCESS|,
219 * |HostapdStatusCode.FAILURE_UNKNOWN|
220 */
221 setDebugParams(DebugLevel level)
222 generates (HostapdStatus status);
lesl0bad28f2019-12-02 23:48:58 +0800223};