blob: 3166691313bf30df405c31ce3789259bf6e072ab [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
19import IWifiChip;
20import IWifiEventCallback;
21
22/**
23 * This is the root of the HAL module and is the interface returned when
24 * loading an implementation of the Wi-Fi HAL. There must be at most one
25 * module loaded in the system.
26 */
27interface IWifi {
28 /**
29 * Requests notifications of significant events for the HAL. Multiple calls to
30 * this must register multiple callbacks each of which must receive all
Roshan Pius6f31d922016-10-04 15:08:05 -070031 * events. |IWifiEventCallback| object registration must be independent of the
32 * state of the rest of the HAL and must persist though stops/starts. These
33 * objects must be deleted when the corresponding client process is dead.
34 *
35 * @param callback An instance of the |IWifiEventCallback| HIDL interface
36 * object.
Mitchell Wills5443a9f2016-08-18 11:44:58 -070037 */
38 @entry
39 @callflow(next={"*"})
40 oneway registerEventCallback(IWifiEventCallback callback);
41
42 /**
43 * Get the current state of the HAL.
Roshan Pius6f31d922016-10-04 15:08:05 -070044 *
45 * @return started true if started, false otherwise.
Mitchell Wills5443a9f2016-08-18 11:44:58 -070046 */
47 isStarted() generates (bool started);
48
49 /**
50 * Perform any setup that is required to make use of the module. If the module
Roshan Piusa52dc732016-10-10 11:53:07 -070051 * is already started then this must be a noop.
52 * Must trigger |IWifiEventCallback.onStart| on success.
53 *
54 * @return status WifiStatus of the operation.
55 * Possible status codes:
56 * |WifiStatusCode.SUCCESS|,
57 * |WifiStatusCode.NOT_AVAILABLE|,
58 * |WifiStatusCode.UNKNOWN|
Mitchell Wills5443a9f2016-08-18 11:44:58 -070059 */
60 @entry
61 @callflow(next={"registerEventCallback", "start", "stop", "getChip"})
Roshan Piusa52dc732016-10-10 11:53:07 -070062 start() generates (WifiStatus status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -070063
64 /**
65 * Tear down any state, ongoing commands, etc. If the module is already
66 * stopped then this must be a noop. If the HAL is already stopped or it
Roshan Piusa52dc732016-10-10 11:53:07 -070067 * succeeds then onStop must be called. After calling this all IWifiChip
68 * objects will be considered invalid.
69 * Must trigger |IWifiEventCallback.onStop| on success.
70 * Must trigger |IWifiEventCallback.onFailure| on failure.
Mitchell Wills5443a9f2016-08-18 11:44:58 -070071 *
72 * Calling stop then start is a valid way of resetting state in the HAL,
73 * driver, firmware.
Roshan Piusa52dc732016-10-10 11:53:07 -070074 *
75 * @return status WifiStatus of the operation.
76 * Possible status codes:
77 * |WifiStatusCode.SUCCESS|,
78 * |WifiStatusCode.NOT_AVAILABLE|,
79 * |WifiStatusCode.UNKNOWN|
Mitchell Wills5443a9f2016-08-18 11:44:58 -070080 */
81 @exit
82 @callflow(next={"registerEventCallback", "start", "stop"})
Roshan Piusa52dc732016-10-10 11:53:07 -070083 stop() generates (WifiStatus status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -070084
Mitchell Wills5443a9f2016-08-18 11:44:58 -070085 /**
Roshan Piusadcfba42016-10-05 10:19:06 -070086 * Retrieve the list of all chip Id's on the device.
87 * The corresponding |IWifiChip| object for any chip can be
88 * retrieved using |getChip| method.
89 *
90 * @return chipIds List of all chip Id's on the device.
Mitchell Wills5443a9f2016-08-18 11:44:58 -070091 */
92 @callflow(next={"*"})
Roshan Piusadcfba42016-10-05 10:19:06 -070093 getChipIds() generates (vec<ChipId> chipIds);
94
95 /**
96 * Gets a HIDL interface object for the chip corresponding to the
97 * provided chipId.
98 *
99 * @return chip HIDL interface object representing the chip.
100 */
101 @callflow(next={"*"})
102 getChip(ChipId chipId) generates (IWifiChip chip);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700103};