Hai Shalom | 1cc3ba2 | 2020-10-28 18:09:26 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 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.4; |
| 18 | |
Hai Shalom | 349bc58 | 2020-10-30 15:25:40 -0700 | [diff] [blame] | 19 | import @1.0::ISupplicantStaIfaceCallback.AnqpData; |
| 20 | import @1.0::ISupplicantStaIfaceCallback.Hs20AnqpData; |
Hai Shalom | 1cc3ba2 | 2020-10-28 18:09:26 -0700 | [diff] [blame] | 21 | import @1.3::ISupplicantStaIfaceCallback; |
| 22 | import @1.0::ISupplicantStaIfaceCallback.State; |
Sunil Ravi | 7e9d71f | 2021-01-03 08:38:52 -0800 | [diff] [blame] | 23 | import @1.0::ISupplicantStaIfaceCallback.StatusCode; |
Hai Shalom | 1cc3ba2 | 2020-10-28 18:09:26 -0700 | [diff] [blame] | 24 | import @1.0::Bssid; |
Sunil Ravi | 7e9d71f | 2021-01-03 08:38:52 -0800 | [diff] [blame] | 25 | import @1.0::Ssid; |
Hai Shalom | 1cc3ba2 | 2020-10-28 18:09:26 -0700 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * Callback Interface exposed by the supplicant service |
| 29 | * for each station mode interface (ISupplicantStaIface). |
| 30 | * |
| 31 | * Clients need to host an instance of this HIDL interface object and |
| 32 | * pass a reference of the object to the supplicant via the |
| 33 | * corresponding |ISupplicantStaIface.registerCallback_1_4| method. |
| 34 | */ |
| 35 | interface ISupplicantStaIfaceCallback extends @1.3::ISupplicantStaIfaceCallback { |
| 36 | /** |
Sunil Ravi | 7e9d71f | 2021-01-03 08:38:52 -0800 | [diff] [blame] | 37 | * MBO spec v1.2, 4.2.4 Table 14: MBO Association disallowed reason code attribute |
| 38 | * values. |
| 39 | */ |
| 40 | enum MboAssocDisallowedReasonCode : uint8_t { |
| 41 | RESERVED = 0, |
| 42 | UNSPECIFIED = 1, |
| 43 | MAX_NUM_STA_ASSOCIATED = 2, |
| 44 | AIR_INTERFACE_OVERLOADED = 3, |
| 45 | AUTH_SERVER_OVERLOADED = 4, |
| 46 | INSUFFICIENT_RSSI = 5, |
| 47 | }; |
| 48 | |
| 49 | /** |
Hai Shalom | 349bc58 | 2020-10-30 15:25:40 -0700 | [diff] [blame] | 50 | * ANQP data for IEEE Std 802.11-2016. |
| 51 | * The format of the data within these elements follows the IEEE |
| 52 | * Std 802.11-2016 standard, section 9.4.5. |
| 53 | */ |
| 54 | struct AnqpData { |
| 55 | /** |
| 56 | * Baseline information as defined in HAL 1.0. |
| 57 | */ |
Sunil Ravi | f14d9a0 | 2020-11-08 22:33:25 -0800 | [diff] [blame] | 58 | @1.0::ISupplicantStaIfaceCallback.AnqpData V1_0; |
| 59 | |
| 60 | /* |
| 61 | * Container for v1.0 of this struct |
| 62 | */ |
| 63 | vec<uint8_t> venueUrl; |
Hai Shalom | 349bc58 | 2020-10-30 15:25:40 -0700 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | /** |
Sunil Ravi | 7e9d71f | 2021-01-03 08:38:52 -0800 | [diff] [blame] | 67 | * OceRssiBasedAssocRejectAttr is extracted from (Re-)Association response |
| 68 | * frame from an OCE AP to indicate that the AP has rejected the |
| 69 | * (Re-)Association request on the basis of insufficient RSSI. |
| 70 | * Refer OCE spec v1.0 section 4.2.2 Table 7. |
| 71 | */ |
| 72 | struct OceRssiBasedAssocRejectAttr { |
| 73 | /* |
| 74 | * Delta RSSI - The difference in dB between the minimum RSSI at which |
| 75 | * the AP would accept a (Re-)Association request from the STA before |
| 76 | * Retry Delay expires and the AP's measurement of the RSSI at which the |
| 77 | * (Re-)Association request was received. |
| 78 | */ |
| 79 | uint32_t deltaRssi; |
| 80 | |
| 81 | /* |
| 82 | * Retry Delay - The time period in seconds for which the AP will not |
| 83 | * accept any subsequent (Re-)Association requests from the STA, unless |
| 84 | * the received RSSI has improved by Delta RSSI. |
| 85 | */ |
| 86 | uint32_t retryDelayS; |
| 87 | }; |
| 88 | |
| 89 | /** |
| 90 | * Association Rejection related information. |
| 91 | */ |
| 92 | struct AssociationRejectionData { |
| 93 | /** |
| 94 | * SSID of the AP that rejected the association. |
| 95 | */ |
| 96 | Ssid ssid; |
| 97 | |
| 98 | /** |
| 99 | * BSSID of the AP that rejected the association. |
| 100 | */ |
| 101 | Bssid bssid; |
| 102 | |
| 103 | /* |
| 104 | * 802.11 code to indicate the reject reason. |
| 105 | * Refer to section 8.4.1.9 of IEEE 802.11 spec. |
| 106 | */ |
| 107 | StatusCode statusCode; |
| 108 | |
| 109 | /* |
| 110 | * Flag to indicate that failure is due to timeout rather than |
| 111 | * explicit rejection response from the AP. |
| 112 | */ |
| 113 | bool timedOut; |
| 114 | |
| 115 | /** |
| 116 | * Flag to indicate that MboAssocDisallowedReasonCode is present |
| 117 | * in the (Re-)Association response frame. |
| 118 | */ |
| 119 | bool isMboAssocDisallowedReasonCodePresent; |
| 120 | |
| 121 | /** |
| 122 | * mboAssocDisallowedReason is extracted from MBO association disallowed attribute |
| 123 | * in (Re-)Association response frame to indicate that the AP is not accepting new |
| 124 | * associations. |
| 125 | * Refer MBO spec v1.2 section 4.2.4 Table 13 for the details of reason code. |
| 126 | * The value is undefined if isMboAssocDisallowedReasonCodePresent is false. |
| 127 | */ |
| 128 | MboAssocDisallowedReasonCode mboAssocDisallowedReason; |
| 129 | |
| 130 | /** |
| 131 | * Flag to indicate that OceRssiBasedAssocRejectAttr is present |
| 132 | * in the (Re-)Association response frame. |
| 133 | */ |
| 134 | bool isOceRssiBasedAssocRejectAttrPresent; |
| 135 | |
| 136 | /* |
| 137 | * OCE RSSI-based (Re-)Association rejection attribute. |
| 138 | * The contents are undefined if isOceRssiBasedAssocRejectAttrPresent is false. |
| 139 | */ |
| 140 | OceRssiBasedAssocRejectAttr oceRssiBasedAssocRejectData; |
| 141 | }; |
| 142 | |
| 143 | /** |
Hai Shalom | 1cc3ba2 | 2020-10-28 18:09:26 -0700 | [diff] [blame] | 144 | * Used to indicate a Hotspot 2.0 terms and conditions acceptance is requested from the user |
| 145 | * before allowing the device to get internet access. |
| 146 | * |
| 147 | * @param bssid BSSID of the access point. |
| 148 | * @param url URL of the T&C server. |
| 149 | */ |
| 150 | oneway onHs20TermsAndConditionsAcceptanceRequestedNotification(Bssid bssid, string url); |
Hai Shalom | 349bc58 | 2020-10-30 15:25:40 -0700 | [diff] [blame] | 151 | |
| 152 | /** |
| 153 | * Used to indicate the result of ANQP (either for IEEE 802.11u Interworking |
| 154 | * or Hotspot 2.0) query. |
| 155 | * |
| 156 | * @param bssid BSSID of the access point. |
| 157 | * @param data ANQP data fetched from the access point. |
| 158 | * All the fields in this struct must be empty if the query failed. |
| 159 | * @param hs20Data ANQP data fetched from the Hotspot 2.0 access point. |
| 160 | * All the fields in this struct must be empty if the query failed. |
| 161 | */ |
| 162 | oneway onAnqpQueryDone_1_4(Bssid bssid, AnqpData data, Hs20AnqpData hs20Data); |
Sunil Ravi | 7e9d71f | 2021-01-03 08:38:52 -0800 | [diff] [blame] | 163 | |
| 164 | /** |
| 165 | * Used to indicate an association rejection received from the AP |
| 166 | * to which the connection is being attempted. |
| 167 | * |
| 168 | * @param assocRejectData Association Rejection related information. |
| 169 | */ |
| 170 | oneway onAssociationRejected_1_4(AssociationRejectionData assocRejectData); |
Sunil Ravi | ee197f3 | 2021-01-12 18:45:11 -0800 | [diff] [blame] | 171 | |
| 172 | /** |
| 173 | * Used to indicate that the supplicant failed to find a network in scan result |
| 174 | * which matches with the network capabilities requested by upper layer |
| 175 | * for connection. |
| 176 | * |
| 177 | * @param ssid network name supplicant tried to connect. |
| 178 | */ |
| 179 | oneway onNetworkNotFound(Ssid ssid); |
Hai Shalom | 1cc3ba2 | 2020-10-28 18:09:26 -0700 | [diff] [blame] | 180 | }; |