Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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@1.0; |
| 18 | |
| 19 | import IWifiChipEventCallback; |
Roshan Pius | fcbf923 | 2016-10-06 11:08:17 -0700 | [diff] [blame] | 20 | import IWifiIface; |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 21 | import IWifiApIface; |
| 22 | import IWifiNanIface; |
| 23 | import IWifiP2pIface; |
| 24 | import IWifiStaIface; |
Roshan Pius | fcbf923 | 2016-10-06 11:08:17 -0700 | [diff] [blame] | 25 | import IWifiRttController; |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * Interface that represents a chip that must be configured as a single unit. |
| 29 | * The HAL/driver/firmware will be responsible for determining which phy is used |
| 30 | * to perform operations like NAN, RTT, etc. |
| 31 | */ |
| 32 | interface IWifiChip { |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 33 | /** |
| 34 | * Set of interface types with the maximum number of interfaces that can have |
Roshan Pius | 271f2c2 | 2016-10-04 17:01:01 -0700 | [diff] [blame] | 35 | * one of the specified type for a given ChipIfaceCombination. See |
| 36 | * ChipIfaceCombination for examples. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 37 | */ |
Roshan Pius | 271f2c2 | 2016-10-04 17:01:01 -0700 | [diff] [blame] | 38 | struct ChipIfaceCombinationLimit { |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 39 | vec<IfaceType> types; // Each IfaceType must occur at most once. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 40 | uint32_t maxIfaces; |
| 41 | }; |
| 42 | |
| 43 | /** |
| 44 | * Set of interfaces that can operate concurrently when in a given mode. See |
| 45 | * ChipMode below. |
| 46 | * |
| 47 | * For example: |
| 48 | * [{STA} <= 2] |
| 49 | * At most two STA interfaces are supported |
| 50 | * [], [STA], [STA+STA] |
| 51 | * |
| 52 | * [{STA} <= 1, {NAN} <= 1, {AP} <= 1] |
| 53 | * Any combination of STA, NAN, AP |
| 54 | * [], [STA], [NAN], [AP], [STA+NAN], [STA+AP], [NAN+AP], [STA+NAN+AP] |
| 55 | * |
| 56 | * [{STA} <= 1, {NAN,P2P} <= 1] |
| 57 | * Optionally a STA and either NAN or P2P |
| 58 | * [], [STA], [STA+NAN], [STA+P2P], [NAN], [P2P] |
| 59 | * Not included [NAN+P2P], [STA+NAN+P2P] |
| 60 | * |
| 61 | * [{STA} <= 1, {STA,NAN} <= 1] |
| 62 | * Optionally a STA and either a second STA or a NAN |
| 63 | * [], [STA], [STA+NAN], [STA+STA], [NAN] |
| 64 | * Not included [STA+STA+NAN] |
| 65 | */ |
Roshan Pius | 271f2c2 | 2016-10-04 17:01:01 -0700 | [diff] [blame] | 66 | struct ChipIfaceCombination { |
| 67 | vec<ChipIfaceCombinationLimit> limits; |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | /** |
| 71 | * A mode that the chip can be put in. A mode defines a set of constraints on |
| 72 | * the interfaces that can exist while in that mode. Modes define a unit of |
| 73 | * configuration where all interfaces must be torn down to switch to a |
| 74 | * different mode. Some HALs may only have a single mode, but an example where |
| 75 | * multiple modes would be required is if a chip has different firmwares with |
| 76 | * different capabilities. |
| 77 | * |
| 78 | * When in a mode, it must be possible to perform any combination of creating |
| 79 | * and removing interfaces as long as at least one of the |
Roshan Pius | 271f2c2 | 2016-10-04 17:01:01 -0700 | [diff] [blame] | 80 | * ChipIfaceCombinations is satisfied. This means that if a chip has two |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 81 | * available combinations, [{STA} <= 1] and [{AP} <= 1] then it is expected |
| 82 | * that exactly one STA interface or one AP interface can be created, but it |
| 83 | * is not expected that both a STA and AP interface could be created. If it |
| 84 | * was then there would be a single available combination |
| 85 | * [{STA} <=1, {AP} <= 1]. |
| 86 | * |
| 87 | * When switching between two available combinations it is expected that |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 88 | * interfaces only supported by the initial combination must be removed until |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 89 | * the target combination is also satisfied. At that point new interfaces |
| 90 | * satisfying only the target combination can be added (meaning the initial |
| 91 | * combination limits will no longer satisfied). The addition of these new |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 92 | * interfaces must not impact the existence of interfaces that satisfy both |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 93 | * combinations. |
| 94 | * |
| 95 | * For example, a chip with available combinations: |
| 96 | * [{STA} <= 2, {NAN} <=1] and [{STA} <=1, {NAN} <= 1, {AP} <= 1}] |
| 97 | * If the chip currently has 3 interfaces STA, STA and NAN and wants to add an |
| 98 | * AP interface in place of one of the STAs then first one of the STA |
| 99 | * interfaces must be removed and then the AP interface can be created after |
| 100 | * the STA had been torn down. During this process the remaining STA and NAN |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 101 | * interfaces must not be removed/recreated. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 102 | * |
| 103 | * If a chip does not support this kind of reconfiguration in this mode then |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 104 | * the combinations must be separated into two separate modes. Before |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 105 | * switching modes all interfaces must be torn down, the mode switch must be |
| 106 | * enacted and when it completes the new interfaces must be brought up. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 107 | */ |
| 108 | struct ChipMode { |
| 109 | /** |
| 110 | * Id that can be used to put the chip in this mode. |
| 111 | */ |
| 112 | ChipModeId id; |
| 113 | |
| 114 | /** |
| 115 | * A list of the possible interface combinations that the chip can have |
| 116 | * while in this mode. |
| 117 | */ |
Roshan Pius | 271f2c2 | 2016-10-04 17:01:01 -0700 | [diff] [blame] | 118 | vec<ChipIfaceCombination> availableCombinations; |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 119 | }; |
| 120 | |
| 121 | /** |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 122 | * Information about the version of the driver and firmware running this chip. |
| 123 | * |
| 124 | * The information in these ASCII strings are vendor specific and does not |
| 125 | * need to follow any particular format. It may be dumped as part of the bug |
| 126 | * report. |
| 127 | */ |
| 128 | struct ChipDebugInfo { |
| 129 | string driverDescription; |
| 130 | string firmwareDescription; |
| 131 | }; |
| 132 | |
| 133 | /** |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame^] | 134 | * Capabilities exposed by this chip. |
| 135 | */ |
| 136 | enum ChipCapabilityMask : uint32_t { |
| 137 | /** |
| 138 | * Memory dump of Firmware. |
| 139 | */ |
| 140 | DEBUG_MEMORY_FIRMWARE_DUMP_SUPPORTED = 1 << 0, |
| 141 | /** |
| 142 | * Memory dump of Driver. |
| 143 | */ |
| 144 | DEBUG_MEMORY_DRIVER_DUMP_SUPPORTED = 1 << 1, |
| 145 | /** |
| 146 | * Connectivity events reported via debug ring buffer. |
| 147 | */ |
| 148 | DEBUG_RING_BUFFER_CONNECT_EVENT_SUPPORTED = 1 << 2, |
| 149 | /** |
| 150 | * Power events reported via debug ring buffer. |
| 151 | */ |
| 152 | DEBUG_RING_BUFFER_POWER_EVENT_SUPPORTED = 1 << 3, |
| 153 | /** |
| 154 | * Wakelock events reported via debug ring buffer. |
| 155 | */ |
| 156 | DEBUG_RING_BUFFER_WAKELOCK_EVENT_SUPPORTED = 1 << 4, |
| 157 | /** |
| 158 | * Vendor data reported via debug ring buffer. |
| 159 | * This mostly contains firmware event logs. |
| 160 | */ |
| 161 | DEBUG_RING_BUFFER_VENDOR_DATA_SUPPORTED = 1 << 5, |
| 162 | }; |
| 163 | |
| 164 | /** |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 165 | * Get the id assigned to this chip. |
| 166 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 167 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 168 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 169 | * |WifiStatusCode.SUCCESS|, |
| 170 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 171 | * @return id Assigned chip Id. |
| 172 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 173 | getId() generates (WifiStatus status, ChipId id); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 174 | |
| 175 | /** |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 176 | * Requests notifications of significant events on this chip. Multiple calls |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 177 | * to this must register multiple callbacks each of which must receive all |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 178 | * events. |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 179 | * |
| 180 | * @param callback An instance of the |IWifiChipEventCallback| HIDL interface |
| 181 | * object. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 182 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 183 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 184 | * |WifiStatusCode.SUCCESS|, |
| 185 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 186 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 187 | registerEventCallback(IWifiChipEventCallback callback) generates (WifiStatus status); |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 188 | |
| 189 | /** |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame^] | 190 | * Get the capabilities supported by this chip. |
| 191 | * |
| 192 | * @return status WifiStatus of the operation. |
| 193 | * Possible status codes: |
| 194 | * |WifiStatusCode.SUCCESS|, |
| 195 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 196 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 197 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 198 | * @return capabilities Bitset of |ChipCapabilityMask| values. |
| 199 | */ |
| 200 | getCapabilities() generates (WifiStatus status, uint32_t capabilities); |
| 201 | |
| 202 | /** |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 203 | * Get the set of operation modes that the chip supports. |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 204 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 205 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 206 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 207 | * |WifiStatusCode.SUCCESS|, |
| 208 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 209 | * @return modes List of modes supported by the device. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 210 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 211 | getAvailableModes() generates (WifiStatus status, vec<ChipMode> modes); |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 212 | |
| 213 | /** |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 214 | * Reconfigure the Chip. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 215 | * Any existing |IWifiIface| objects must be marked invalid after this call. |
| 216 | * If this fails then the chips is now in an undefined state and |
| 217 | * configureChip must be called again. |
| 218 | * Must trigger |IWifiChipEventCallback.onChipReconfigured| on success. |
| 219 | * Must trigger |IWifiEventCallback.onFailure| on failure. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 220 | * |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 221 | * @param modeId The mode that the chip must switch to, corresponding to the |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 222 | * id property of the target ChipMode. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 223 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 224 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 225 | * |WifiStatusCode.SUCCESS|, |
| 226 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 227 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 228 | * |WifiStatusCode.ERROR_UNKNOWN| |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 229 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 230 | configureChip(ChipModeId modeId) generates (WifiStatus status); |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 231 | |
| 232 | /** |
| 233 | * Get the current mode that the chip is in. |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 234 | * |
| 235 | * @return modeId The mode that the chip is currently configured to, |
| 236 | * corresponding to the id property of the target ChipMode. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 237 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 238 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 239 | * |WifiStatusCode.SUCCESS|, |
| 240 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 241 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 242 | getMode() generates (WifiStatus status, ChipModeId modeId); |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 243 | |
| 244 | /** |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 245 | * Request information about the chip. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 246 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 247 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 248 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 249 | * |WifiStatusCode.SUCCESS|, |
| 250 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 251 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 252 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 253 | * @return chipDebugInfo Instance of |ChipDebugInfo|. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 254 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 255 | requestChipDebugInfo() generates (WifiStatus status, ChipDebugInfo chipDebugInfo); |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 256 | |
| 257 | /** |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 258 | * Request vendor debug info from the driver. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 259 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 260 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 261 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 262 | * |WifiStatusCode.SUCCESS|, |
| 263 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 264 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 265 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 266 | * @param blob Vector of bytes retrieved from the driver. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 267 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 268 | requestDriverDebugDump() generates (WifiStatus status, vec<uint8_t> blob); |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 269 | |
| 270 | /** |
Roshan Pius | 6f31d92 | 2016-10-04 15:08:05 -0700 | [diff] [blame] | 271 | * Request vendor debug info from the firmware. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 272 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 273 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 274 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 275 | * |WifiStatusCode.SUCCESS|, |
| 276 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 277 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 278 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 279 | * @param blob Vector of bytes retrieved from the driver. |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 280 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 281 | requestFirmwareDebugDump() generates (WifiStatus status, vec<uint8_t> blob); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 282 | |
| 283 | /** |
| 284 | * Create an AP iface on the chip. |
| 285 | * |
| 286 | * Depending on the mode the chip is configured in, the interface creation |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 287 | * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum |
| 288 | * allowed (specified in |ChipIfaceCombination|) number of ifaces of the AP |
| 289 | * type. |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 290 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 291 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 292 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 293 | * |WifiStatusCode.SUCCESS|, |
| 294 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 295 | * |WifiStatusCode.ERROR_NOT_SUPPORTED| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 296 | * @return iface HIDL interface object representing the iface if |
| 297 | * successful, null otherwise. |
| 298 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 299 | createApIface() generates (WifiStatus status, IWifiApIface iface); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 300 | |
| 301 | /** |
| 302 | * List all the AP iface names configured on the chip. |
| 303 | * The corresponding |IWifiApIface| object for any iface are |
| 304 | * retrieved using |getApIface| method. |
| 305 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 306 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 307 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 308 | * |WifiStatusCode.SUCCESS|, |
| 309 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 310 | * @return ifnames List of all AP iface names on the chip. |
| 311 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 312 | getApIfaceNames() generates (WifiStatus status, vec<string> ifnames); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 313 | |
| 314 | /** |
| 315 | * Gets a HIDL interface object for the AP Iface corresponding |
| 316 | * to the provided ifname. |
| 317 | * |
| 318 | * @param ifname Name of the iface. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 319 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 320 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 321 | * |WifiStatusCode.SUCCESS|, |
| 322 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 323 | * @return iface HIDL interface object representing the iface if |
| 324 | * it exists, null otherwise. |
| 325 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 326 | getApIface(string ifname) generates (WifiStatus status, IWifiApIface iface); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 327 | |
| 328 | /** |
| 329 | * Create a NAN iface on the chip. |
| 330 | * |
| 331 | * Depending on the mode the chip is configured in, the interface creation |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 332 | * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum |
| 333 | * allowed (specified in |ChipIfaceCombination|) number of ifaces of the NAN |
| 334 | * type. |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 335 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 336 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 337 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 338 | * |WifiStatusCode.SUCCESS|, |
| 339 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 340 | * |WifiStatusCode.ERROR_NOT_SUPPORTED| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 341 | * @return iface HIDL interface object representing the iface if |
| 342 | * successful, null otherwise. |
| 343 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 344 | createNanIface() generates (WifiStatus status, IWifiNanIface iface); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 345 | |
| 346 | /** |
| 347 | * List all the NAN iface names configured on the chip. |
| 348 | * The corresponding |IWifiNanIface| object for any iface are |
| 349 | * retrieved using |getNanIface| method. |
| 350 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 351 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 352 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 353 | * |WifiStatusCode.SUCCESS|, |
| 354 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 355 | * @return ifnames List of all NAN iface names on the chip. |
| 356 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 357 | getNanIfaceNames() generates (WifiStatus status, vec<string> ifnames); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 358 | |
| 359 | /** |
| 360 | * Gets a HIDL interface object for the NAN Iface corresponding |
| 361 | * to the provided ifname. |
| 362 | * |
| 363 | * @param ifname Name of the iface. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 364 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 365 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 366 | * |WifiStatusCode.SUCCESS|, |
| 367 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 368 | * @return iface HIDL interface object representing the iface if |
| 369 | * it exists, null otherwise. |
| 370 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 371 | getNanIface(string ifname) generates (WifiStatus status, IWifiNanIface iface); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 372 | |
| 373 | /** |
| 374 | * Create a P2P iface on the chip. |
| 375 | * |
| 376 | * Depending on the mode the chip is configured in, the interface creation |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 377 | * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum |
| 378 | * allowed (specified in |ChipIfaceCombination|) number of ifaces of the P2P |
| 379 | * type. |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 380 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 381 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 382 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 383 | * |WifiStatusCode.SUCCESS|, |
| 384 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 385 | * |WifiStatusCode.ERROR_NOT_SUPPORTED| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 386 | * @return iface HIDL interface object representing the iface if |
| 387 | * successful, null otherwise. |
| 388 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 389 | createP2pIface() generates (WifiStatus status, IWifiP2pIface iface); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 390 | |
| 391 | /** |
| 392 | * List all the P2P iface names configured on the chip. |
| 393 | * The corresponding |IWifiP2pIface| object for any iface are |
| 394 | * retrieved using |getP2pIface| method. |
| 395 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 396 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 397 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 398 | * |WifiStatusCode.SUCCESS|, |
| 399 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 400 | * @return ifnames List of all P2P iface names on the chip. |
| 401 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 402 | getP2pIfaceNames() generates (WifiStatus status, vec<string> ifnames); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 403 | |
| 404 | /** |
| 405 | * Gets a HIDL interface object for the P2P Iface corresponding |
| 406 | * to the provided ifname. |
| 407 | * |
| 408 | * @param ifname Name of the iface. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 409 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 410 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 411 | * |WifiStatusCode.SUCCESS|, |
| 412 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 413 | * @return iface HIDL interface object representing the iface if |
| 414 | * it exists, null otherwise. |
| 415 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 416 | getP2pIface(string ifname) generates (WifiStatus status, IWifiP2pIface iface); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 417 | |
| 418 | /** |
| 419 | * Create an STA iface on the chip. |
| 420 | * |
| 421 | * Depending on the mode the chip is configured in, the interface creation |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 422 | * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum |
| 423 | * allowed (specified in |ChipIfaceCombination|) number of ifaces of the STA |
| 424 | * type. |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 425 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 426 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 427 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 428 | * |WifiStatusCode.SUCCESS|, |
| 429 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 430 | * |WifiStatusCode.ERROR_NOT_SUPPORTED| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 431 | * @return iface HIDL interface object representing the iface if |
| 432 | * successful, null otherwise. |
| 433 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 434 | createStaIface() generates (WifiStatus status, IWifiStaIface iface); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 435 | |
| 436 | /** |
| 437 | * List all the STA iface names configured on the chip. |
| 438 | * The corresponding |IWifiStaIface| object for any iface are |
| 439 | * retrieved using |getStaIface| method. |
| 440 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 441 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 442 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 443 | * |WifiStatusCode.SUCCESS|, |
| 444 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 445 | * @return ifnames List of all STA iface names on the chip. |
| 446 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 447 | getStaIfaceNames() generates (WifiStatus status, vec<string> ifnames); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 448 | |
| 449 | /** |
| 450 | * Gets a HIDL interface object for the STA Iface corresponding |
| 451 | * to the provided ifname. |
| 452 | * |
| 453 | * @param ifname Name of the iface. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 454 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 455 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 456 | * |WifiStatusCode.SUCCESS|, |
| 457 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 458 | * @return iface HIDL interface object representing the iface if |
| 459 | * it exists, null otherwise. |
| 460 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 461 | getStaIface(string ifname) generates (WifiStatus status, IWifiStaIface iface); |
Roshan Pius | fcbf923 | 2016-10-06 11:08:17 -0700 | [diff] [blame] | 462 | |
| 463 | /** |
| 464 | * Create a RTTController instance. |
| 465 | * |
| 466 | * RTT controller can be either: |
| 467 | * a) Bound to a specific iface by passing in the corresponding |IWifiIface| |
| 468 | * object in |iface| param, OR |
| 469 | * b) Let the implementation decide the iface to use for RTT operations by |
| 470 | * passing null in |iface| param. |
| 471 | * |
| 472 | * @param boundIface HIDL interface object representing the iface if |
| 473 | * the responder must be bound to a specific iface, null otherwise. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 474 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 475 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 476 | * |WifiStatusCode.SUCCESS|, |
| 477 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
Roshan Pius | fcbf923 | 2016-10-06 11:08:17 -0700 | [diff] [blame] | 478 | */ |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 479 | createRttController(IWifiIface boundIface) |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 480 | generates (WifiStatus status, IWifiRttController rtt); |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 481 | |
| 482 | /** |
| 483 | * WiFi debug ring buffer life cycle is as follow: |
| 484 | * - At initialization time, framework must call |getDebugRingBuffersStatus|. |
| 485 | * to obtain the names and list of supported ring buffers. |
| 486 | * The driver may expose several different rings each holding a different |
| 487 | * type of data (connection events, power events, etc). |
| 488 | * - When WiFi operations start framework must call |
| 489 | * |startLoggingToDebugRingBuffer| to trigger log collection for a specific |
| 490 | * ring. The vebose level for each ring buffer can be specified in this API. |
| 491 | * - During wifi operations, driver must periodically report per ring data to |
| 492 | * framework by invoking the |
| 493 | * |IWifiChipEventCallback.onDebugRingBuffer<Type>EntriesAvailable| callback. |
| 494 | * - When capturing a bug report, framework must indicate to driver that all |
| 495 | * the data has to be uploaded urgently by calling |
| 496 | * |forceDumpToDebugRingBuffer|. |
| 497 | * |
| 498 | * The data uploaded by driver must be stored by framework in separate files, |
| 499 | * with one stream of file per ring. Framework must store the files in pcapng |
| 500 | * format, allowing for easy merging and parsing with network analyzer tools. |
| 501 | * TODO: Since we're not longer dumping out the raw data, storing in separate |
| 502 | * pcapng files for parsing later must not work anymore. |
| 503 | */ |
| 504 | /** |
| 505 | * API to get the status of all ring buffers supported by driver. |
| 506 | * |
| 507 | * @return status WifiStatus of the operation. |
| 508 | * Possible status codes: |
| 509 | * |WifiStatusCode.SUCCESS|, |
| 510 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame^] | 511 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 512 | * |WifiStatusCode.NOT_AVAILABLE|, |
| 513 | * |WifiStatusCode.UNKNOWN| |
| 514 | * @return ringBuffers Vector of |WifiDebugRingBufferStatus| corresponding to the |
| 515 | * status of each ring bufffer on the device. |
| 516 | */ |
| 517 | getDebugRingBuffersStatus() generates (WifiStatus status, |
| 518 | vec<WifiDebugRingBufferStatus> ringBuffers); |
| 519 | |
| 520 | /** |
| 521 | * API to trigger the debug data collection. |
| 522 | * |
| 523 | * @param ringName represent the name of the ring for which data collection |
| 524 | * shall start. This can be retrieved via the corresponding |
| 525 | * |WifiDebugRingBufferStatus|. |
| 526 | * @parm maxIntervalInSec Maximum interval in seconds for driver to invoke |
| 527 | * |onDebugRingBufferData|, ignore if zero. |
| 528 | * @parm minDataSizeInBytes: Minimum data size in buffer for driver to invoke |
| 529 | * |onDebugRingBufferData|, ignore if zero. |
| 530 | * @return status WifiStatus of the operation. |
| 531 | * Possible status codes: |
| 532 | * |WifiStatusCode.SUCCESS|, |
| 533 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame^] | 534 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 535 | * |WifiStatusCode.NOT_AVAILABLE|, |
| 536 | * |WifiStatusCode.UNKNOWN| |
| 537 | */ |
| 538 | startLoggingToDebugRingBuffer(string ringName, |
| 539 | WifiDebugRingBufferVerboseLevel verboseLevel, |
| 540 | uint32_t maxIntervalInSec, |
| 541 | uint32_t minDataSizeInBytes) |
| 542 | generates (WifiStatus status); |
| 543 | |
| 544 | /** |
| 545 | * API to force dump data into the corresponding ring buffer. |
| 546 | * This is to be invoked during bugreport collection. |
| 547 | * |
| 548 | * @param ringName represent the name of the ring for which data collection |
| 549 | * shall be forced. This can be retrieved via the corresponding |
| 550 | * |WifiDebugRingBufferStatus|. |
| 551 | * @return status WifiStatus of the operation. |
| 552 | * Possible status codes: |
| 553 | * |WifiStatusCode.SUCCESS|, |
| 554 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame^] | 555 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 556 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
Roshan Pius | e3a02b0 | 2016-10-19 12:31:01 -0700 | [diff] [blame] | 557 | * |WifiStatusCode.NOT_AVAILABLE|, |
| 558 | * |WifiStatusCode.UNKNOWN| |
| 559 | */ |
| 560 | forceDumpToDebugRingBuffer(string ringName) generates (WifiStatus status); |
Mitchell Wills | 5443a9f | 2016-08-18 11:44:58 -0700 | [diff] [blame] | 561 | }; |