1 /*
2  * Copyright (C) 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 
17 package android.net.wifi.nl80211;
18 
19 import android.net.wifi.nl80211.IApInterface;
20 import android.net.wifi.nl80211.IClientInterface;
21 import android.net.wifi.nl80211.IInterfaceEventCallback;
22 import android.net.wifi.nl80211.IWificondEventCallback;
23 import android.net.wifi.nl80211.DeviceWiphyCapabilities;
24 
25 /**
26  * Service interface that exposes primitives for controlling the WiFi
27  * subsystems of a device.
28  * @hide
29  */
30 interface IWificond {
31 
32     // Create a network interface suitable for use as an AP.
createApInterface(@tf8InCpp String iface_name)33     @nullable IApInterface createApInterface(@utf8InCpp String iface_name);
34 
35     // Create a network interface suitable for use as a WiFi client.
createClientInterface(@tf8InCpp String iface_name)36     @nullable IClientInterface createClientInterface(@utf8InCpp String iface_name);
37 
38     // Remove a previously created AP network interface.
tearDownApInterface(@tf8InCpp String iface_name)39     boolean tearDownApInterface(@utf8InCpp String iface_name);
40 
41     // Remove a previously created STA network interface.
tearDownClientInterface(@tf8InCpp String iface_name)42     boolean tearDownClientInterface(@utf8InCpp String iface_name);
43 
44     // Tear down all existing interfaces.  This should enable clients to create
45     // future interfaces immediately after this method returns.
tearDownInterfaces()46     void tearDownInterfaces();
47 
48     // @return list of the currently configured IClientInterface instances.
GetClientInterfaces()49     List<IBinder> GetClientInterfaces();
50 
51     // @return list of the currently configured IApInterface instances.
GetApInterfaces()52     List<IBinder> GetApInterfaces();
53 
54     // Returns an array of available frequencies for 2.4GHz channels.
55     // Returrns null on failure.
getAvailable2gChannels()56     @nullable int[] getAvailable2gChannels();
57 
58     // Returns an array of available frequencies for 5GHz non-DFS channels.
59     // Returrns null on failure.
getAvailable5gNonDFSChannels()60     @nullable int[] getAvailable5gNonDFSChannels();
61 
62     // Returns an array of available frequencies for DFS channels.
63     // This also includes passive only frequecies which are not for DFS channels.
64     // Returrns null on failure.
getAvailableDFSChannels()65     @nullable int[] getAvailableDFSChannels();
66 
67     // Returns an array of available frequencies for 6GHz channels.
68     // Returrns null on failure.
getAvailable6gChannels()69     @nullable int[] getAvailable6gChannels();
70 
71     // Returns an array of available frequencies for 60GHz channels.
72     // Returrns null on failure.
getAvailable60gChannels()73     @nullable int[] getAvailable60gChannels();
74 
75     // Register a callback to receive interface status updates.
76     //
77     // Multiple callbacks can be registered simultaneously.
78     // Duplicate registrations of the same callback will be ignored.
79     //
80     // @param callback object to add to the set of registered callbacks.
RegisterCallback(IInterfaceEventCallback callback)81     oneway void RegisterCallback(IInterfaceEventCallback callback);
82 
83     // Remove a callback from the set of registered callbacks.
84     //
85     // This must be the same instance as previously registered.
86     // Requests to remove unknown callbacks will be ignored.
87     //
88     // @param callback object to remove from the set of registered callbacks.
UnregisterCallback(IInterfaceEventCallback callback)89     oneway void UnregisterCallback(IInterfaceEventCallback callback);
90 
91     // Register a callback to receive wificond event.
92     //
93     // Multiple callbacks can be registered simultaneously.
94     // Duplicate registrations of the same callback will be ignored.
95     //
96     // @param callback object to add to the set of registered callbacks.
registerWificondEventCallback(IWificondEventCallback callback)97     oneway void registerWificondEventCallback(IWificondEventCallback callback);
98 
99     // Remove a callback from the set of registered wificond event callbacks.
100     //
101     // This must be the same instance as previously registered.
102     // Requests to remove unknown callbacks will be ignored.
103     //
104     // @param callback object to remove from the set of registered callbacks.
unregisterWificondEventCallback(IWificondEventCallback callback)105     oneway void unregisterWificondEventCallback(IWificondEventCallback callback);
106 
107     // @return a device wiphy capabilities for an interface
getDeviceWiphyCapabilities(@tf8InCpp String iface_name)108     @nullable DeviceWiphyCapabilities getDeviceWiphyCapabilities(@utf8InCpp String iface_name);
109 }
110