lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hardware.wifi.hostapd@1.2; |
| 18 | |
lesl | 1cc02e5 | 2019-12-26 15:18:58 +0800 | [diff] [blame] | 19 | import @1.0::IHostapd.EncryptionType; |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 20 | import @1.0::IHostapd.NetworkParams; |
lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 21 | import @1.1::IHostapd; |
| 22 | import HostapdStatus; |
| 23 | import MacAddress; |
| 24 | import Ieee80211ReasonCode; |
Roger Wang | 9e00293 | 2019-12-30 12:58:18 +0800 | [diff] [blame] | 25 | import DebugLevel; |
lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * Top-level object for managing SoftAPs. |
| 29 | */ |
| 30 | interface IHostapd extends @1.1::IHostapd { |
lesl | 1cc02e5 | 2019-12-26 15:18:58 +0800 | [diff] [blame] | 31 | /** Possible Security types. */ |
| 32 | enum EncryptionType : @1.0::IHostapd.EncryptionType { |
| 33 | WPA3_SAE_TRANSITION, |
| 34 | WPA3_SAE, |
| 35 | }; |
| 36 | |
lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 37 | /** |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 38 | * 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 ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 67 | |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 68 | /** |
| 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 ElArabawy | c4af97a | 2020-01-02 14:23:02 -0800 | [diff] [blame] | 74 | |
| 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 ElArabawy | c4af97a | 2020-01-02 14:23:02 -0800 | [diff] [blame] | 94 | * 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 ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 98 | }; |
| 99 | |
| 100 | /** |
Ahmed ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 101 | * 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 ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 116 | * 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 ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 123 | |
| 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 ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 132 | }; |
| 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 ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 142 | |
| 143 | /** |
| 144 | * Additional Hw mode params for the interface |
| 145 | */ |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 146 | HwModeParams hwModeParams; |
Ahmed ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 147 | |
| 148 | /** |
| 149 | * Additional Channel params for the interface |
| 150 | */ |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 151 | ChannelParams channelParams; |
| 152 | }; |
| 153 | |
| 154 | /** |
lesl | 1cc02e5 | 2019-12-26 15:18:58 +0800 | [diff] [blame] | 155 | * 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 ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 173 | * 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 ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 188 | generates (HostapdStatus status); |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 189 | |
| 190 | /** |
lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 191 | * 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 Wang | 9e00293 | 2019-12-30 12:58:18 +0800 | [diff] [blame] | 204 | |
| 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); |
lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 217 | }; |