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 | |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 19 | import @1.0::IHostapd.NetworkParams; |
lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 20 | import @1.1::IHostapd; |
| 21 | import HostapdStatus; |
| 22 | import MacAddress; |
| 23 | import Ieee80211ReasonCode; |
Roger Wang | 9e00293 | 2019-12-30 12:58:18 +0800 | [diff] [blame] | 24 | import DebugLevel; |
lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Top-level object for managing SoftAPs. |
| 28 | */ |
| 29 | interface IHostapd extends @1.1::IHostapd { |
| 30 | /** |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 31 | * Band bitmMask to use for the SoftAp operations. |
| 32 | * A combinatoin of these bits are used to identify the allowed bands |
| 33 | * to start the softAp |
| 34 | */ |
| 35 | enum BandMask : uint32_t { |
| 36 | /** |
| 37 | * 2.4 GHz band. |
| 38 | */ |
| 39 | BAND_2_GHZ = 1 << 0, |
| 40 | /** |
| 41 | * 5 GHz band. |
| 42 | */ |
| 43 | BAND_5_GHZ = 1 << 1, |
| 44 | /** |
| 45 | * 6 GHz band. |
| 46 | */ |
| 47 | BAND_6_GHZ = 1 << 2, |
| 48 | }; |
| 49 | |
| 50 | /** |
| 51 | * Parameters to control the HW mode for the interface. |
| 52 | */ |
| 53 | struct HwModeParams { |
| 54 | /** |
| 55 | * Whether IEEE 802.11ax (HE) is enabled or not. |
| 56 | * Note: hw_mode=a is used to specify that 5 GHz band or 6 GHz band is |
| 57 | * used with HE. |
| 58 | */ |
| 59 | bool enable80211AX; |
Ahmed ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 60 | |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 61 | /** |
| 62 | * Whether 6GHz band enabled or not on softAp. |
| 63 | * Note: hw_mode=a is used to specify that 5 GHz band or 6 GHz band is |
| 64 | * used. |
| 65 | */ |
| 66 | bool enable6GhzBand; |
Ahmed ElArabawy | c4af97a | 2020-01-02 14:23:02 -0800 | [diff] [blame] | 67 | |
| 68 | /** |
| 69 | * Whether HE single user beamformer in enabled or not on softAp. |
| 70 | * Note: this is only applicable if 802.11ax is supported for softAp |
| 71 | */ |
| 72 | bool enableHeSingleUserBeamformer; |
| 73 | |
| 74 | /** |
| 75 | * Whether HE single user beamformee is enabled or not on softAp. |
| 76 | * Note: this is only applicable if 802.11ax is supported for softAp |
| 77 | */ |
| 78 | bool enableHeSingleUserBeamformee; |
| 79 | |
| 80 | /** |
| 81 | * Whether HE multiple user beamformer is enabled or not on softAp. |
| 82 | * Note: this is only applicable if 802.11ax is supported for softAp |
| 83 | */ |
| 84 | bool enableHeMultiUserBeamformer; |
| 85 | |
| 86 | /** |
| 87 | * Used BSS Color for softAp running in 802.11ax mode |
| 88 | * Note: this is only applicable if 802.11ax is supported for softAp |
| 89 | */ |
| 90 | uint32_t heBssColor; |
| 91 | |
| 92 | /** |
| 93 | * Whether HE Target Wait Time (TWT) is enabled or not on softAp. |
| 94 | * Note: this is only applicable if 802.11ax is supported for softAp |
| 95 | */ |
| 96 | bool enableHeTargetWakeTime; |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 97 | }; |
| 98 | |
| 99 | /** |
Ahmed ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 100 | * Parameters to specify the channel frequency range for ACS. |
| 101 | */ |
| 102 | struct AcsFrequencyRange { |
| 103 | /** |
| 104 | * Channel Frequency (in MHz) at the start of the range. |
| 105 | */ |
| 106 | uint32_t start; |
| 107 | |
| 108 | /** |
| 109 | * Channel Frequency (in MHz) at the end of the range. |
| 110 | */ |
| 111 | uint32_t end; |
| 112 | }; |
| 113 | |
| 114 | /** |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 115 | * Parameters to control the channel selection for the interface. |
| 116 | */ |
| 117 | struct ChannelParams { |
| 118 | /** |
| 119 | * Band to use for the SoftAp operations. |
| 120 | */ |
| 121 | bitfield<BandMask> bandMask; |
Ahmed ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 122 | |
| 123 | /** |
| 124 | * This option can be used to specify the channel frequencies (in MHz) selected by ACS. |
| 125 | * If this is an empty list, all channels allowed in selected HW mode |
| 126 | * are specified implicitly. |
| 127 | * Note: channels may be overridden by firmware. |
| 128 | * Note: this option is ignored if ACS is disabled. |
| 129 | */ |
| 130 | vec<AcsFrequencyRange> acsChannelFreqRangesMhz; |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 131 | }; |
| 132 | |
| 133 | /** |
| 134 | * Parameters to use for setting up the access point interface. |
| 135 | */ |
| 136 | struct IfaceParams { |
| 137 | /** |
| 138 | * Baseline information as defined in HAL 1.1. |
| 139 | */ |
| 140 | @1.1::IHostapd.IfaceParams V1_1; |
Ahmed ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 141 | |
| 142 | /** |
| 143 | * Additional Hw mode params for the interface |
| 144 | */ |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 145 | HwModeParams hwModeParams; |
Ahmed ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 146 | |
| 147 | /** |
| 148 | * Additional Channel params for the interface |
| 149 | */ |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 150 | ChannelParams channelParams; |
| 151 | }; |
| 152 | |
| 153 | /** |
| 154 | * Adds a new access point for hostapd to control. |
| 155 | * |
| 156 | * This should trigger the setup of an access point with the specified |
| 157 | * interface and network params. |
| 158 | * |
| 159 | * @param ifaceParams AccessPoint Params for the access point. |
| 160 | * @param nwParams Network Params for the access point. |
| 161 | * @return status Status of the operation. |
| 162 | * Possible status codes: |
| 163 | * |HostapdStatusCode.SUCCESS|, |
| 164 | * |HostapdStatusCode.FAILURE_ARGS_INVALID|, |
| 165 | * |HostapdStatusCode.FAILURE_UNKNOWN|, |
| 166 | * |HostapdStatusCode.FAILURE_IFACE_EXISTS| |
| 167 | */ |
| 168 | addAccessPoint_1_2(IfaceParams ifaceParams, NetworkParams nwParams) |
Ahmed ElArabawy | 0e99148 | 2019-12-21 12:56:47 -0800 | [diff] [blame] | 169 | generates (HostapdStatus status); |
Ahmed ElArabawy | c828cff | 2019-11-15 19:36:03 -0800 | [diff] [blame] | 170 | |
| 171 | /** |
lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 172 | * force one of the hotspot clients disconnect.. |
| 173 | * |
| 174 | * @param ifaceName Name of the interface. |
| 175 | * @param clientAddress Mac Address of the hotspot client. |
| 176 | * @param reasonCode One of disconnect reason code which defined by 802.11. |
| 177 | * @return status Status of the operation. |
| 178 | * Possible status codes: |
| 179 | * |HostapdStatusCode.SUCCESS|, |
| 180 | * |HostapdStatusCode.FAILURE_IFACE_UNKNOWN| |
| 181 | * |HostapdStatusCode.FAILURE_CLIENT_UNKNOWN| |
| 182 | */ |
| 183 | forceClientDisconnect(string ifaceName, MacAddress clientAddress, |
| 184 | Ieee80211ReasonCode reasonCode) generates (HostapdStatus status); |
Roger Wang | 9e00293 | 2019-12-30 12:58:18 +0800 | [diff] [blame] | 185 | |
| 186 | /** |
| 187 | * Set debug parameters for the hostapd. |
| 188 | * |
| 189 | * @param level Debug logging level for the hostapd. |
| 190 | * (one of |DebugLevel| values). |
| 191 | * @return status Status of the operation. |
| 192 | * Possible status codes: |
| 193 | * |HostapdStatusCode.SUCCESS|, |
| 194 | * |HostapdStatusCode.FAILURE_UNKNOWN| |
| 195 | */ |
| 196 | setDebugParams(DebugLevel level) |
| 197 | generates (HostapdStatus status); |
lesl | 0bad28f | 2019-12-02 23:48:58 +0800 | [diff] [blame] | 198 | }; |