blob: 0d9e329fc6a2f68fdfd1a7f4046fec1a813d5f51 [file] [log] [blame]
Mitchell Wills5443a9f2016-08-18 11:44:58 -07001/*
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
17package android.hardware.wifi@1.0;
18
19interface IWifiChipEventCallback {
20 /**
21 * Callback indicating that the chip has been reconfigured successfully. At
22 * this point the interfaces available in the mode must be able to be
Roshan Pius2c06a3f2016-12-15 17:51:40 -080023 * configured. When this is called any previous iface objects must be
Mitchell Wills5443a9f2016-08-18 11:44:58 -070024 * considered invalid.
25 *
26 * @param modeId The mode that the chip switched to, corresponding to the id
Roshan Pius6f31d922016-10-04 15:08:05 -070027 * property of the target ChipMode.
Mitchell Wills5443a9f2016-08-18 11:44:58 -070028 */
29 oneway onChipReconfigured(ChipModeId modeId);
Roshan Piuse3a02b02016-10-19 12:31:01 -070030
31 /**
Roshan Pius2c06a3f2016-12-15 17:51:40 -080032 * Callback indicating that a chip reconfiguration failed. This is a fatal
33 * error and any iface objects available previously must be considered
34 * invalid. The client can attempt to recover by trying to reconfigure the
35 * chip again using |IWifiChip.configureChip|.
36 *
37 * @param status Failure reason code.
38 */
39 oneway onChipReconfigureFailure(WifiStatus status);
40
41 /**
42 * Callback indicating that a new iface has been added to the chip.
43 *
44 * @param type Type of iface added.
45 * @param name Name of iface added.
46 */
47 oneway onIfaceAdded(IfaceType type, string name);
48
49 /**
50 * Callback indicating that an existing iface has been removed from the chip.
51 *
52 * @param type Type of iface removed.
53 * @param name Name of iface removed.
54 */
55 oneway onIfaceRemoved(IfaceType type, string name);
56
57 /**
Roshan Piuse3a02b02016-10-19 12:31:01 -070058 * Callbacks for reporting debug ring buffer data.
59 *
60 * The ring buffer data collection is event based:
61 * - Driver calls this callback when new records are available, the
62 * |WifiDebugRingBufferStatus| passed up to framework in the callback
63 * indicates to framework if more data is available in the ring buffer.
64 * It is not expected that driver will necessarily always empty the ring
65 * immediately as data is available, instead driver will report data
66 * every X seconds or if N bytes are available based on the parameters
67 * set via |startLoggingToDebugRingBuffer|.
68 * - In the case where a bug report has to be captured, framework will
69 * require driver to upload all data immediately. This is indicated to
70 * driver when framework calls |forceDumpToDebugRingBuffer|. The driver
71 * will start sending all available data in the indicated ring by repeatedly
72 * invoking this callback.
73 *
74 * @return status Status of the corresponding ring buffer. This should
75 * contain the name of the ring buffer on which the data is
76 * available.
Roshan Pius48185b22016-12-15 19:10:30 -080077 * @return data Raw bytes of data sent by the driver. Must be dumped
78 * out to a bugreport and post processed.
Roshan Piuse3a02b02016-10-19 12:31:01 -070079 */
Roshan Pius48185b22016-12-15 19:10:30 -080080 oneway onDebugRingBufferDataAvailable(
81 WifiDebugRingBufferStatus status, vec<uint8_t> data);
Roshan Pius203cb032016-12-14 17:41:20 -080082
83 /**
84 * Callback indicating that the chip has encountered a fatal error.
85 * Client must not attempt to parse either the errorCode or debugData.
86 * Must only be captured in a bugreport.
87 *
88 * @param errorCode Vendor defined error code.
89 * @param debugData Vendor defined data used for debugging.
90 */
91 oneway onDebugErrorAlert(int32_t errorCode, vec<uint8_t> debugData);
Mitchell Wills5443a9f2016-08-18 11:44:58 -070092};