blob: d776644581371b361c5d4f00b8c4e445de78c591 [file] [log] [blame]
Roshan Pius3c4e8a32016-10-03 14:53:58 -07001/*
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_CHIP_H_
18#define WIFI_CHIP_H_
19
20#include <set>
21
Roshan Pius3c4e8a32016-10-03 14:53:58 -070022#include <android-base/macros.h>
Roshan Pius79a99752016-10-04 13:03:58 -070023#include <android/hardware/wifi/1.0/IWifiChip.h>
Roshan Pius3c4e8a32016-10-03 14:53:58 -070024#include <hardware_legacy/wifi_hal.h>
25
26#include "wifi_hal_state.h"
27
28namespace android {
29namespace hardware {
30namespace wifi {
Roshan Pius79a99752016-10-04 13:03:58 -070031namespace V1_0 {
32namespace implementation {
Roshan Pius3c4e8a32016-10-03 14:53:58 -070033
Roshan Pius79a99752016-10-04 13:03:58 -070034class WifiChip : public IWifiChip {
Roshan Pius3c4e8a32016-10-03 14:53:58 -070035 public:
Roshan Pius79a99752016-10-04 13:03:58 -070036 WifiChip(WifiHalState* hal_state, wifi_interface_handle interface_handle);
Roshan Pius3c4e8a32016-10-03 14:53:58 -070037
38 void Invalidate();
39
40 Return<void> registerEventCallback(
Roshan Pius79a99752016-10-04 13:03:58 -070041 const sp<IWifiChipEventCallback>& callback) override;
Roshan Pius3c4e8a32016-10-03 14:53:58 -070042
43 Return<void> getAvailableModes(getAvailableModes_cb cb) override;
44
45 Return<void> configureChip(uint32_t mode_id) override;
46
47 Return<uint32_t> getMode() override;
48
49 Return<void> requestChipDebugInfo() override;
50
51 Return<void> requestDriverDebugDump() override;
52
53 Return<void> requestFirmwareDebugDump() override;
54
55 private:
56 WifiHalState* hal_state_;
57 wifi_interface_handle interface_handle_;
Roshan Pius79a99752016-10-04 13:03:58 -070058 std::set<sp<IWifiChipEventCallback>> callbacks_;
Roshan Pius3c4e8a32016-10-03 14:53:58 -070059
60 DISALLOW_COPY_AND_ASSIGN(WifiChip);
61};
62
Roshan Pius79a99752016-10-04 13:03:58 -070063} // namespace implementation
64} // namespace V1_0
Roshan Pius3c4e8a32016-10-03 14:53:58 -070065} // namespace wifi
66} // namespace hardware
67} // namespace android
68
69#endif // WIFI_CHIP_H_