1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#include "wifi_ext_iface.h"
17#include <hdf_log.h>
18
19namespace OHOS {
20namespace HDI {
21namespace Wlan {
22namespace Chip {
23namespace V1_0 {
24WifiExtIface::WifiExtIface(
25    const std::string& ifName,
26    const std::weak_ptr<WifiVendorHal> vendorHal,
27    const std::weak_ptr<IfaceUtil> ifaceUtil)
28    : ifName_(ifName),
29      vendorHal_(vendorHal),
30      ifaceUtil_(ifaceUtil),
31      isValid_(true) {}
32
33void WifiExtIface::Invalidate()
34{
35    vendorHal_.reset();
36    isValid_ = false;
37}
38
39bool WifiExtIface::IsValid()
40{
41    return isValid_;
42}
43
44std::string WifiExtIface::GetName()
45{
46    return ifName_;
47}
48
49int32_t WifiExtIface::GetIfaceType(IfaceType& type)
50{
51    return HDF_ERR_NOT_SUPPORT;
52}
53
54int32_t WifiExtIface::GetIfaceName(std::string& name)
55{
56    return HDF_ERR_NOT_SUPPORT;
57}
58
59int32_t WifiExtIface::GetSupportFreqs(int band, std::vector<uint32_t>& frequencies)
60{
61    return HDF_ERR_NOT_SUPPORT;
62}
63
64int32_t WifiExtIface::GetIfaceCap(uint32_t& capabilities)
65{
66    return HDF_ERR_NOT_SUPPORT;
67}
68
69int32_t WifiExtIface::SetMacAddress(const std::string& mac)
70{
71    return HDF_ERR_NOT_SUPPORT;
72}
73
74int32_t WifiExtIface::SetCountryCode(const std::string& code)
75{
76    return HDF_ERR_NOT_SUPPORT;
77}
78
79int32_t WifiExtIface::GetPowerMode(int32_t& powerMode)
80{
81    return HDF_ERR_NOT_SUPPORT;
82}
83
84int32_t WifiExtIface::SetPowerMode(int32_t powerMode)
85{
86    return HDF_ERR_NOT_SUPPORT;
87}
88
89int32_t WifiExtIface::RegisterChipIfaceCallBack(const sptr<IChipIfaceCallback>& chipIfaceCallback)
90{
91    return HDF_ERR_NOT_SUPPORT;
92}
93
94int32_t WifiExtIface::UnRegisterChipIfaceCallBack(const sptr<IChipIfaceCallback>& chipIfaceCallback)
95{
96    return HDF_ERR_NOT_SUPPORT;
97}
98
99int32_t WifiExtIface::StartScan(const ScanParams& scanParam)
100{
101    return HDF_ERR_NOT_SUPPORT;
102}
103
104int32_t WifiExtIface::GetScanInfos(std::vector<ScanResultsInfo>& scanResultsInfo)
105{
106    return HDF_ERR_NOT_SUPPORT;
107}
108
109int32_t WifiExtIface::StartPnoScan(const PnoScanParams& pnoParams)
110{
111    return HDF_ERR_NOT_SUPPORT;
112}
113
114int32_t WifiExtIface::StopPnoScan()
115{
116    return HDF_ERR_NOT_SUPPORT;
117}
118
119int32_t WifiExtIface::GetSignalPollInfo(SignalPollResult& signalPollResult)
120{
121    return HDF_ERR_NOT_SUPPORT;
122}
123
124int32_t WifiExtIface::EnablePowerMode(int32_t mode)
125{
126    return HDF_ERR_NOT_SUPPORT;
127}
128
129int32_t WifiExtIface::SetDpiMarkRule(int32_t uid, int32_t protocol, int32_t enable)
130{
131    return HDF_ERR_NOT_SUPPORT;
132}
133
134int32_t WifiExtIface::SetTxPower(int32_t power)
135{
136    return HDF_ERR_NOT_SUPPORT;
137}
138
139int32_t WifiExtIface::SetIfaceState(bool state)
140{
141    return HDF_ERR_NOT_SUPPORT;
142}
143
144int32_t WifiExtIface::SendCmdToDriver(const std::string& ifName, int32_t cmdId, const std::vector<int8_t>& paramBuf)
145{
146    WifiError status = vendorHal_.lock()->SendCmdToDriver(ifName, cmdId, paramBuf);
147    if (status == HAL_SUCCESS) {
148        return HDF_SUCCESS;
149    }
150    return HDF_FAILURE;
151}
152
153int32_t WifiExtIface::SendActionFrame(const std::string& ifName, uint32_t freq, const std::vector<uint8_t>& frameData)
154{
155    return HDF_ERR_NOT_SUPPORT;
156}
157
158int32_t WifiExtIface::RegisterActionFrameReceiver(const std::string& ifName, const std::vector<uint8_t>& match)
159{
160    return HDF_ERR_NOT_SUPPORT;
161}
162
163int32_t WifiExtIface::GetCoexictenceChannelList(const std::string& ifName, std::vector<uint8_t>& paramBuf)
164{
165    return HDF_ERR_NOT_SUPPORT;
166}
167
168}
169}
170}
171}
172}