blob: 0869da0daceeb24d9253614cfa910e3038cf085f [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 /**
Ahmed ElArabawyc4af97a2020-01-02 14:23:02 -080094 * Whether HE Target Wait Time (TWT) is enabled or not on softAp.
95 * Note: this is only applicable if 802.11ax is supported for softAp
96 */
97 bool enableHeTargetWakeTime;
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -080098 };
99
100 /**
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800101 * Parameters to specify the channel frequency range for ACS.
102 */
103 struct AcsFrequencyRange {
104 /**
105 * Channel Frequency (in MHz) at the start of the range.
106 */
107 uint32_t start;
108
109 /**
110 * Channel Frequency (in MHz) at the end of the range.
111 */
112 uint32_t end;
113 };
114
115 /**
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800116 * Parameters to control the channel selection for the interface.
117 */
118 struct ChannelParams {
119 /**
120 * Band to use for the SoftAp operations.
121 */
122 bitfield<BandMask> bandMask;
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800123
124 /**
125 * This option can be used to specify the channel frequencies (in MHz) selected by ACS.
126 * If this is an empty list, all channels allowed in selected HW mode
127 * are specified implicitly.
128 * Note: channels may be overridden by firmware.
129 * Note: this option is ignored if ACS is disabled.
130 */
131 vec<AcsFrequencyRange> acsChannelFreqRangesMhz;
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800132 };
133
134 /**
135 * Parameters to use for setting up the access point interface.
136 */
137 struct IfaceParams {
138 /**
139 * Baseline information as defined in HAL 1.1.
140 */
141 @1.1::IHostapd.IfaceParams V1_1;
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800142
143 /**
144 * Additional Hw mode params for the interface
145 */
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800146 HwModeParams hwModeParams;
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800147
148 /**
149 * Additional Channel params for the interface
150 */
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800151 ChannelParams channelParams;
152 };
153
154 /**
lesl1cc02e52019-12-26 15:18:58 +0800155 * Parameters to use for setting up the access point network.
156 */
157 struct NetworkParams {
158 /**
159 * Baseline information as defined in HAL 1.0.
160 */
161 @1.0::IHostapd.NetworkParams V1_0;
162 /** Key management mask for the replace V1_0.encryptionType. */
163 EncryptionType encryptionType;
164 /**
165 * Passphrase for WPA3_SAE network, WPA3_SAE_TRANSITION and
166 * WPA2_PSK. Replaces @1.0::IHostapd.NetworkParams.pskPassphrase.
167 */
168 string passphrase;
169 };
170
171
172 /**
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800173 * Adds a new access point for hostapd to control.
174 *
175 * This should trigger the setup of an access point with the specified
176 * interface and network params.
177 *
178 * @param ifaceParams AccessPoint Params for the access point.
179 * @param nwParams Network Params for the access point.
180 * @return status Status of the operation.
181 * Possible status codes:
182 * |HostapdStatusCode.SUCCESS|,
183 * |HostapdStatusCode.FAILURE_ARGS_INVALID|,
184 * |HostapdStatusCode.FAILURE_UNKNOWN|,
185 * |HostapdStatusCode.FAILURE_IFACE_EXISTS|
186 */
187 addAccessPoint_1_2(IfaceParams ifaceParams, NetworkParams nwParams)
Ahmed ElArabawy0e991482019-12-21 12:56:47 -0800188 generates (HostapdStatus status);
Ahmed ElArabawyc828cff2019-11-15 19:36:03 -0800189
190 /**
lesl0bad28f2019-12-02 23:48:58 +0800191 * force one of the hotspot clients disconnect..
192 *
193 * @param ifaceName Name of the interface.
194 * @param clientAddress Mac Address of the hotspot client.
195 * @param reasonCode One of disconnect reason code which defined by 802.11.
196 * @return status Status of the operation.
197 * Possible status codes:
198 * |HostapdStatusCode.SUCCESS|,
199 * |HostapdStatusCode.FAILURE_IFACE_UNKNOWN|
200 * |HostapdStatusCode.FAILURE_CLIENT_UNKNOWN|
201 */
202 forceClientDisconnect(string ifaceName, MacAddress clientAddress,
203 Ieee80211ReasonCode reasonCode) generates (HostapdStatus status);
Roger Wang9e002932019-12-30 12:58:18 +0800204
205 /**
206 * Set debug parameters for the hostapd.
207 *
208 * @param level Debug logging level for the hostapd.
209 * (one of |DebugLevel| values).
210 * @return status Status of the operation.
211 * Possible status codes:
212 * |HostapdStatusCode.SUCCESS|,
213 * |HostapdStatusCode.FAILURE_UNKNOWN|
214 */
215 setDebugParams(DebugLevel level)
216 generates (HostapdStatus status);
lesl0bad28f2019-12-02 23:48:58 +0800217};