blob: a4147a905df66e9926a325155cd2b9d245ac215b [file] [log] [blame]
Roshan Piusa26a6e02016-11-17 14:55:58 -08001/*
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#ifndef WIFI_MODE_CONTROLLER_H_
18#define WIFI_MODE_CONTROLLER_H_
19
20#include <wifi_hal/driver_tool.h>
21
22#include <android/hardware/wifi/1.0/IWifi.h>
23
24namespace android {
25namespace hardware {
26namespace wifi {
27namespace V1_0 {
28namespace implementation {
29namespace mode_controller {
30/**
31 * Class that encapsulates all firmware mode configuration.
32 * This class will perform the necessary firmware reloads to put the chip in the
33 * required state (essentially a wrapper over DriverTool).
34 */
35class WifiModeController {
36 public:
37 WifiModeController();
38
39 // Checks if a firmware mode change is necessary to support the specified
40 // iface type operations.
41 bool isFirmwareModeChangeNeeded(IfaceType type);
42 // Change the firmware mode to support the specified iface type operations.
43 bool changeFirmwareMode(IfaceType type);
44 // Unload the driver. This should be invoked whenever |IWifi.stop()| is
45 // invoked.
46 bool deinitialize();
47
48 private:
49 std::unique_ptr<wifi_hal::DriverTool> driver_tool_;
50};
51
52} // namespace mode_controller
53} // namespace implementation
54} // namespace V1_0
55} // namespace wifi
56} // namespace hardware
57} // namespace android
58
59#endif // WIFI_MODE_CONTROLLER_H_