Roshan Pius | 39f588f | 2016-10-31 14:51:27 -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.supplicant@1.0; |
| 18 | |
| 19 | import ISupplicantIface; |
| 20 | import ISupplicantStaIfaceCallback; |
| 21 | |
| 22 | /** |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 23 | * Interface exposed by the supplicant for each station mode network |
Roshan Pius | 39f588f | 2016-10-31 14:51:27 -0700 | [diff] [blame] | 24 | * interface (e.g wlan0) it controls. |
| 25 | */ |
| 26 | interface ISupplicantStaIface extends ISupplicantIface { |
| 27 | /** |
Roshan Pius | b76dbbe | 2016-11-09 09:55:42 -0800 | [diff] [blame] | 28 | * Access Network Query Protocol info ID elements |
| 29 | * for IEEE Std 802.11u-2011. |
| 30 | */ |
Roshan Pius | e3f25f1 | 2016-12-08 13:20:05 -0800 | [diff] [blame] | 31 | enum AnqpInfoId : uint16_t { |
Roshan Pius | b76dbbe | 2016-11-09 09:55:42 -0800 | [diff] [blame] | 32 | VENUE_NAME = 258, |
| 33 | ROAMING_CONSORTIUM = 261, |
| 34 | IP_ADDR_TYPE_AVAILABILITY = 262, |
| 35 | NAI_REALM = 263, |
| 36 | ANQP_3GPP_CELLULAR_NETWORK = 264, |
| 37 | DOMAIN_NAME = 268 |
| 38 | }; |
| 39 | |
| 40 | /** |
| 41 | * Access Network Query Protocol subtype elements |
| 42 | * for Hotspot 2.0. |
| 43 | */ |
| 44 | enum Hs20AnqpSubtypes : uint32_t { |
Roshan Pius | e3f25f1 | 2016-12-08 13:20:05 -0800 | [diff] [blame] | 45 | OPERATOR_FRIENDLY_NAME = 3, |
Roshan Pius | b76dbbe | 2016-11-09 09:55:42 -0800 | [diff] [blame] | 46 | WAN_METRICS = 4, |
| 47 | CONNECTION_CAPABILITY = 5, |
| 48 | OSU_PROVIDERS_LIST = 8, |
| 49 | }; |
| 50 | |
| 51 | /** |
Roshan Pius | 3f050c1 | 2016-12-14 08:06:58 -0800 | [diff] [blame] | 52 | * Enum describing the types of RX filter supported |
| 53 | * via driver commands. |
| 54 | */ |
| 55 | enum RxFilterType : uint8_t { |
| 56 | V4_MULTICAST = 0, |
| 57 | V6_MULTICAST = 1 |
| 58 | }; |
| 59 | |
| 60 | /** |
| 61 | * Enum describing the modes of BT coexistence supported |
| 62 | * via driver commands. |
| 63 | */ |
| 64 | enum BtCoexistenceMode : uint8_t { |
| 65 | ENABLED = 0, |
| 66 | DISABLED = 1, |
| 67 | SENSE = 2 |
| 68 | }; |
| 69 | |
| 70 | /** |
Roshan Pius | 39f588f | 2016-10-31 14:51:27 -0700 | [diff] [blame] | 71 | * Register for callbacks from this interface. |
| 72 | * |
| 73 | * These callbacks are invoked for events that are specific to this interface. |
| 74 | * Registration of multiple callback objects is supported. These objects must |
| 75 | * be automatically deleted when the corresponding client process is dead or |
| 76 | * if this interface is removed. |
| 77 | * |
| 78 | * @param callback An instance of the |ISupplicantStaIfaceCallback| HIDL |
| 79 | * interface object. |
| 80 | * @return status Status of the operation. |
| 81 | * Possible status codes: |
| 82 | * |SupplicantStatusCode.SUCCESS|, |
| 83 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 84 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 85 | */ |
| 86 | registerCallback(ISupplicantStaIfaceCallback callback) |
| 87 | generates (SupplicantStatus status); |
| 88 | |
| 89 | /** |
| 90 | * Reconnect to the currently active network, even if we are already |
| 91 | * connected. |
| 92 | * |
| 93 | * @return status Status of the operation. |
| 94 | * Possible status codes: |
| 95 | * |SupplicantStatusCode.SUCCESS|, |
| 96 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 97 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 98 | * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| |
| 99 | */ |
| 100 | reassociate() generates (SupplicantStatus status); |
| 101 | |
| 102 | /** |
| 103 | * Reconnect to the currently active network, if we are currently |
| 104 | * disconnected. |
| 105 | * |
| 106 | * @return status Status of the operation. |
| 107 | * Possible status codes: |
| 108 | * |SupplicantStatusCode.SUCCESS|, |
| 109 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 110 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 111 | * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|, |
| 112 | * |SupplicantStatusCode.FAILURE_IFACE_NOT_DISCONNECTED| |
| 113 | */ |
| 114 | reconnect() generates (SupplicantStatus status); |
| 115 | |
| 116 | /** |
| 117 | * Disconnect from the current active network. |
| 118 | * |
| 119 | * @return status Status of the operation. |
| 120 | * Possible status codes: |
| 121 | * |SupplicantStatusCode.SUCCESS|, |
| 122 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 123 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 124 | * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| |
| 125 | */ |
| 126 | disconnect() generates (SupplicantStatus status); |
| 127 | |
| 128 | /** |
| 129 | * Turn on/off power save mode for the interface. |
| 130 | * |
| 131 | * @param enable Indicate if power save is to be turned on/off. |
| 132 | * @return status Status of the operation. |
| 133 | * Possible status codes: |
| 134 | * |SupplicantStatusCode.SUCCESS|, |
| 135 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 136 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 137 | * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| |
| 138 | */ |
| 139 | setPowerSave(bool enable) generates (SupplicantStatus status); |
| 140 | |
| 141 | /** |
Roshan Pius | 3f050c1 | 2016-12-14 08:06:58 -0800 | [diff] [blame] | 142 | * Initiate TDLS discover with the provided peer MAC address. |
Roshan Pius | 39f588f | 2016-10-31 14:51:27 -0700 | [diff] [blame] | 143 | * |
| 144 | * @param macAddress MAC address of the peer. |
| 145 | * @return status Status of the operation. |
| 146 | * Possible status codes: |
| 147 | * |SupplicantStatusCode.SUCCESS|, |
| 148 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 149 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 150 | */ |
| 151 | initiateTdlsDiscover(MacAddress macAddress) |
| 152 | generates (SupplicantStatus status); |
| 153 | |
| 154 | /** |
Roshan Pius | 3f050c1 | 2016-12-14 08:06:58 -0800 | [diff] [blame] | 155 | * Initiate TDLS setup with the provided peer MAC address. |
Roshan Pius | 39f588f | 2016-10-31 14:51:27 -0700 | [diff] [blame] | 156 | * |
| 157 | * @param macAddress MAC address of the peer. |
| 158 | * @return status Status of the operation. |
| 159 | * Possible status codes: |
| 160 | * |SupplicantStatusCode.SUCCESS|, |
| 161 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 162 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 163 | */ |
| 164 | initiateTdlsSetup(MacAddress macAddress) |
| 165 | generates (SupplicantStatus status); |
| 166 | |
| 167 | /** |
Roshan Pius | 3f050c1 | 2016-12-14 08:06:58 -0800 | [diff] [blame] | 168 | * Initiate TDLS teardown with the provided peer MAC address. |
Roshan Pius | 39f588f | 2016-10-31 14:51:27 -0700 | [diff] [blame] | 169 | * |
| 170 | * @param macAddress MAC address of the peer. |
| 171 | * @return status Status of the operation. |
| 172 | * Possible status codes: |
| 173 | * |SupplicantStatusCode.SUCCESS|, |
| 174 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 175 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 176 | */ |
| 177 | initiateTdlsTeardown(MacAddress macAddress) |
| 178 | generates (SupplicantStatus status); |
Roshan Pius | b76dbbe | 2016-11-09 09:55:42 -0800 | [diff] [blame] | 179 | |
| 180 | /** |
| 181 | * Initiate ANQP (for IEEE 802.11u Interworking/Hotspot 2.0) queries with the |
| 182 | * specified access point. |
| 183 | * The ANQP data fetched must be returned in the |
| 184 | * |ISupplicantStaIfaceCallback.onAnqpQueryDone| callback. |
| 185 | * |
| 186 | * @param macAddress MAC address of the access point. |
| 187 | * @param infoElements List of information elements to query for. |
| 188 | * @param subtypes List of HS20 subtypes to query for. |
| 189 | * @return status Status of the operation. |
| 190 | * Possible status codes: |
| 191 | * |SupplicantStatusCode.SUCCESS|, |
| 192 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 193 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 194 | */ |
| 195 | initiateAnqpQuery(MacAddress macAddress, |
| 196 | vec<AnqpInfoId> infoElements, |
| 197 | vec<Hs20AnqpSubtypes> subTypes) |
| 198 | generates (SupplicantStatus status); |
| 199 | |
| 200 | /** |
| 201 | * Initiate the Hotspot 2.0 icon query with the specified accesss point. |
| 202 | * The icon data fetched must be returned in the |
| 203 | * |ISupplicantStaIfaceCallback.onHs20IconQueryDone| callback. |
| 204 | * |
| 205 | * @param macAddress MAC address of the access point. |
| 206 | * @param fileName Name of the file to request from the access point. |
| 207 | * @return status Status of the operation. |
| 208 | * Possible status codes: |
| 209 | * |SupplicantStatusCode.SUCCESS|, |
| 210 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 211 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 212 | */ |
| 213 | initiateHs20IconQuery(MacAddress macAddress, string fileName) |
| 214 | generates (SupplicantStatus status); |
Roshan Pius | 3f050c1 | 2016-12-14 08:06:58 -0800 | [diff] [blame] | 215 | |
| 216 | /** |
| 217 | * Send driver command to get MAC address of the device. |
| 218 | * |
| 219 | * @return status Status of the operation. |
| 220 | * Possible status codes: |
| 221 | * |SupplicantStatusCode.SUCCESS|, |
| 222 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 223 | * @return macAddr MAC address of the device. |
| 224 | */ |
| 225 | getMacAddress() |
| 226 | generates (SupplicantStatus status, MacAddress macAddr); |
| 227 | |
| 228 | /** |
| 229 | * Send driver command to start RX filter. |
| 230 | * |
| 231 | * @return status Status of the operation. |
| 232 | * Possible status codes: |
| 233 | * |SupplicantStatusCode.SUCCESS|, |
| 234 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 235 | */ |
| 236 | startRxFilter() generates (SupplicantStatus status); |
| 237 | |
| 238 | /** |
| 239 | * Send driver command to stop RX filter. |
| 240 | * |
| 241 | * @return status Status of the operation. |
| 242 | * Possible status codes: |
| 243 | * |SupplicantStatusCode.SUCCESS|, |
| 244 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 245 | */ |
| 246 | stopRxFilter() generates (SupplicantStatus status); |
| 247 | |
| 248 | /** |
| 249 | * Send driver command to add the specified RX filter. |
| 250 | * |
| 251 | * @param type Type of filter. |
| 252 | * @return status Status of the operation. |
| 253 | * Possible status codes: |
| 254 | * |SupplicantStatusCode.SUCCESS|, |
| 255 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 256 | */ |
| 257 | addRxFilter(RxFilterType type) |
| 258 | generates (SupplicantStatus status); |
| 259 | |
| 260 | /** |
| 261 | * Send driver command to remove the specified RX filter. |
| 262 | * |
| 263 | * @param type Type of filter. |
| 264 | * @return status Status of the operation. |
| 265 | * Possible status codes: |
| 266 | * |SupplicantStatusCode.SUCCESS|, |
| 267 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 268 | */ |
| 269 | removeRxFilter(RxFilterType type) |
| 270 | generates (SupplicantStatus status); |
| 271 | |
| 272 | /** |
| 273 | * Send driver command to set Bluetooth coexistence mode. |
| 274 | * |
| 275 | * @param mode Mode of Bluetooth coexistence. |
| 276 | * @return status Status of the operation. |
| 277 | * Possible status codes: |
| 278 | * |SupplicantStatusCode.SUCCESS|, |
| 279 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 280 | */ |
| 281 | setBtCoexistenceMode(BtCoexistenceMode mode) |
| 282 | generates (SupplicantStatus status); |
| 283 | |
| 284 | /** |
| 285 | * Send driver command to set Bluetooth coexistence scan mode. |
| 286 | * When this mode is on, some of the low-level scan parameters |
| 287 | * used by the driver are changed to reduce interference |
| 288 | * with A2DP streaming. |
| 289 | * |
| 290 | * @param enable true to enable, false to disable. |
| 291 | * @return status Status of the operation. |
| 292 | * Possible status codes: |
| 293 | * |SupplicantStatusCode.SUCCESS|, |
| 294 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 295 | */ |
| 296 | setBtCoexistenceScanModeEnabled(bool enable) |
| 297 | generates (SupplicantStatus status); |
| 298 | |
| 299 | /** |
| 300 | * Send driver command to set suspend optimizations for power save. |
| 301 | * |
| 302 | * @param enable true to enable, false to disable. |
| 303 | * @return status Status of the operation. |
| 304 | * Possible status codes: |
| 305 | * |SupplicantStatusCode.SUCCESS|, |
| 306 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 307 | */ |
| 308 | setSuspendModeEnabled(bool enable) |
| 309 | generates (SupplicantStatus status); |
| 310 | |
| 311 | /** |
| 312 | * Send driver command to set country code. |
| 313 | * |
| 314 | * @param code 2 byte country code (as defined in ISO 3166) to set. |
| 315 | * @return status Status of the operation. |
| 316 | * Possible status codes: |
| 317 | * |SupplicantStatusCode.SUCCESS|, |
| 318 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 319 | */ |
| 320 | setCountryCode(int8_t[2] code) |
| 321 | generates (SupplicantStatus status); |
Roshan Pius | 39f588f | 2016-10-31 14:51:27 -0700 | [diff] [blame] | 322 | }; |