• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17package android.hardware.wifi.supplicant@1.3;
18
19import @1.2::ISupplicantStaIfaceCallback;
20import @1.0::ISupplicantStaIfaceCallback.State;
21import @1.0::Bssid;
22import @1.0::SupplicantNetworkId;
23import @1.0::Ssid;
24
25/**
26 * Callback Interface exposed by the supplicant service
27 * for each station mode interface (ISupplicantStaIface).
28 *
29 * Clients need to host an instance of this HIDL interface object and
30 * pass a reference of the object to the supplicant via the
31 * corresponding |ISupplicantStaIface.registerCallback_1_3| method.
32 */
33interface ISupplicantStaIfaceCallback extends @1.2::ISupplicantStaIfaceCallback {
34    /**
35     * IEEE Std 802.11-2016 - Table 9-357.
36     * BTM status code filled in BSS transition management response frame.
37     */
38    enum BssTmStatusCode : uint8_t {
39        ACCEPT = 0,
40        REJECT_UNSPECIFIED = 1,
41        REJECT_INSUFFICIENT_BEACON = 2,
42        REJECT_INSUFFICIENT_CAPABITY = 3,
43        REJECT_BSS_TERMINATION_UNDESIRED = 4,
44        REJECT_BSS_TERMINATION_DELAY_REQUEST = 5,
45        REJECT_STA_CANDIDATE_LIST_PROVIDED = 6,
46        REJECT_NO_SUITABLE_CANDIDATES = 7,
47        REJECT_LEAVING_ESS = 8,
48    };
49
50    /**
51     * Bitmask of various information retrieved from BSS transition management request frame.
52     */
53    enum BssTmDataFlagsMask : uint32_t {
54        /**
55         * Preferred candidate list included.
56         */
57        WNM_MODE_PREFERRED_CANDIDATE_LIST_INCLUDED = 1 << 0,
58        /**
59         * Abridged.
60         */
61        WNM_MODE_ABRIDGED = 1 << 1,
62        /**
63         * Disassociation Imminent.
64         */
65        WNM_MODE_DISASSOCIATION_IMMINENT = 1 << 2,
66        /**
67         * BSS termination included.
68         */
69        WNM_MODE_BSS_TERMINATION_INCLUDED = 1 << 3,
70        /**
71         * ESS Disassociation Imminent.
72         */
73        WNM_MODE_ESS_DISASSOCIATION_IMMINENT = 1 << 4,
74        /**
75         * MBO transition reason code included.
76         */
77        MBO_TRANSITION_REASON_CODE_INCLUDED = 1 << 5,
78        /**
79         * MBO retry delay time included.
80         */
81        MBO_ASSOC_RETRY_DELAY_INCLUDED = 1 << 6,
82        /**
83         * MBO cellular data connection preference value included.
84         */
85        MBO_CELLULAR_DATA_CONNECTION_PREFERENCE_INCLUDED = 1 << 7,
86    };
87
88    /**
89     *  MBO spec v1.2, 4.2.6 Table 18: MBO transition reason code attribute
90     *  values.
91     */
92    enum MboTransitionReasonCode : uint8_t {
93        UNSPECIFIED = 0,
94        EXCESSIVE_FRAME_LOSS = 1,
95        EXCESSIVE_TRAFFIC_DELAY = 2,
96        INSUFFICIENT_BANDWIDTH = 3,
97        LOAD_BALANCING = 4,
98        LOW_RSSI = 5,
99        RX_EXCESSIVE_RETRIES = 6,
100        HIGH_INTERFERENCE = 7,
101        GRAY_ZONE = 8,
102        TRANSITION_TO_PREMIUM_AP = 9,
103    };
104
105    /**
106     *  MBO spec v1.2, 4.2.5 Table 16: MBO Cellular Data connection preference
107     *  attribute values. AP use this to indicate STA, its preference for the
108     *  STA to move from BSS to cellular network.
109     */
110    enum MboCellularDataConnectionPrefValue : uint8_t {
111        EXCLUDED = 0,
112        NOT_PREFERRED = 1,
113        /*
114         * 2-254 Reserved.
115         */
116        PREFERRED = 255,
117    };
118
119    /**
120     * Data retrieved from received BSS transition management request frame.
121     */
122    struct BssTmData {
123        /*
124         * Status code filled in BSS transition management response frame
125         */
126        BssTmStatusCode status;
127
128        /*
129         * Bitmask of BssTmDataFlagsMask
130         */
131        bitfield<BssTmDataFlagsMask> flags;
132
133        /*
134         * Duration for which STA shouldn't try to re-associate.
135         */
136        uint32_t assocRetryDelayMs;
137
138        /*
139         * Reason for BSS transition request.
140         */
141        MboTransitionReasonCode mboTransitionReason;
142
143        /*
144         * Cellular Data Connection preference value.
145         */
146        MboCellularDataConnectionPrefValue mboCellPreference;
147    };
148
149    /**
150     * Indicates pairwise master key (PMK) cache added event.
151     *
152     * @param expirationTimeInSec expiration time in seconds
153     * @param serializedEntry is serialized PMK cache entry, the content is
154     *              opaque for the framework and depends on the native implementation.
155     */
156    oneway onPmkCacheAdded(int64_t expirationTimeInSec, vec<uint8_t> serializedEntry);
157
158    /**
159     * Indicates a DPP success event.
160     */
161    oneway onDppSuccess(DppSuccessCode code);
162
163    /**
164     * Indicates a DPP progress event.
165     */
166    oneway onDppProgress_1_3(DppProgressCode code);
167
168    /**
169     * Indicates a DPP failure event.
170     *
171     * ssid: A string indicating the SSID for the AP that the Enrollee attempted to connect.
172     * channelList: A string containing a list of operating channels and operating classes
173     *     indicating the channels that the Enrollee scanned in attempting to discover the AP.
174     *     The list conforms to the following ABNF syntax:
175     *         channel-list2 = class-and-channels *(“,” class-and-channels)
176     *         class-and-channels = class “/” channel *(“,” channel)
177     *         class = 1*3DIGIT
178     *         channel = 1*3DIGIT
179     * bandList: A list of band parameters that are supported by the Enrollee expressed as the
180     *     Operating Class.
181     */
182    oneway onDppFailure_1_3(DppFailureCode code, string ssid, string channelList,
183        vec<uint16_t> bandList);
184
185    /**
186     * Indicates BTM request frame handling status.
187     *
188     * @param BssTmData Data retrieved from received BSS transition management
189     * request frame.
190     */
191    oneway onBssTmHandlingDone(BssTmData tmData);
192
193    /**
194     * Indicates an EAP authentication failure.
195     * @param errorCode Error code for EAP authentication failure.
196     *        Either standard error code (enum EapErrorCode) or
197     *        private error code defined by network provider.
198     */
199    oneway onEapFailure_1_3(uint32_t errorCode);
200
201    /**
202     * Used to indicate a state change event on this particular iface. If this
203     * event is triggered by a particular network, the |SupplicantNetworkId|,
204     * |ssid|, |bssid| parameters must indicate the parameters of the network/AP
205     * which caused this state transition.
206     *
207     * @param newState New State of the interface. This must be one of the |State|
208     *        values above.
209     * @param bssid BSSID of the corresponding AP which caused this state
210     *        change event. This must be zero'ed if this event is not
211     *        specific to a particular network.
212     * @param id ID of the corresponding network which caused this
213     *        state change event. This must be invalid (UINT32_MAX) if this
214     *        event is not specific to a particular network.
215     * @param ssid SSID of the corresponding network which caused this state
216     *        change event. This must be empty if this event is not specific
217     *        to a particular network.
218     * @param filsHlpSent If FILS HLP IEs were included in this association.
219     */
220    oneway onStateChanged_1_3(State newState, Bssid bssid, SupplicantNetworkId id, Ssid ssid,
221        bool filsHlpSent);
222};
223