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
17package [email protected];
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
23   * configured. When this is called any previous iface objects must be
24   * considered invalid.
25   *
26   * @param modeId The mode that the chip switched to, corresponding to the id
27   *        property of the target ChipMode.
28   */
29  oneway onChipReconfigured(ChipModeId modeId);
30
31  /**
32   * 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  /**
58   * 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 data Raw bytes of data sent by the driver. Must be dumped
78   *         out to a bugreport and post processed.
79   */
80  oneway onDebugRingBufferDataAvailable(
81      WifiDebugRingBufferStatus status, vec<uint8_t> data);
82
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);
92};
93