blob: aff1e4351617afd52aa28da4e6393ca7e0532f14 [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.
77 * @return entries Vector of debug ring buffer data entries. These
78 * should be parsed based on the type of entry.
79 */
80 /** Connectivity event data callback */
81 oneway onDebugRingBufferConnectivityEventEntriesAvailable(
82 WifiDebugRingBufferStatus status,
83 vec<WifiDebugRingEntryConnectivityEvent> entries);
84
85 /** Power event data callback */
86 oneway onDebugRingBufferPowerEventEntriesAvailable(
87 WifiDebugRingBufferStatus status,
88 vec<WifiDebugRingEntryPowerEvent> entries);
89
90 /** Wakelock event data callback */
91 oneway onDebugRingBufferWakelockEventEntriesAvailable(
92 WifiDebugRingBufferStatus status,
93 vec<WifiDebugRingEntryWakelockEvent> entries);
94
95 /** Vendor data event data callback */
96 oneway onDebugRingBufferVendorDataEntriesAvailable(
97 WifiDebugRingBufferStatus status,
98 vec<WifiDebugRingEntryVendorData> entries);
Roshan Pius203cb032016-12-14 17:41:20 -080099
100 /**
101 * Callback indicating that the chip has encountered a fatal error.
102 * Client must not attempt to parse either the errorCode or debugData.
103 * Must only be captured in a bugreport.
104 *
105 * @param errorCode Vendor defined error code.
106 * @param debugData Vendor defined data used for debugging.
107 */
108 oneway onDebugErrorAlert(int32_t errorCode, vec<uint8_t> debugData);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700109};