1094332d3Sopenharmony_ci/*
2094332d3Sopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3094332d3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4094332d3Sopenharmony_ci * you may not use this file except in compliance with the License.
5094332d3Sopenharmony_ci * You may obtain a copy of the License at
6094332d3Sopenharmony_ci *
7094332d3Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8094332d3Sopenharmony_ci *
9094332d3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10094332d3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11094332d3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12094332d3Sopenharmony_ci * See the License for the specific language governing permissions and
13094332d3Sopenharmony_ci * limitations under the License.
14094332d3Sopenharmony_ci */
15094332d3Sopenharmony_ci
16094332d3Sopenharmony_ci/**
17094332d3Sopenharmony_ci * @addtogroup WLAN
18094332d3Sopenharmony_ci * @{
19094332d3Sopenharmony_ci *
20094332d3Sopenharmony_ci * @brief Provides cross-OS migration, component adaptation, and modular assembly and compilation.
21094332d3Sopenharmony_ci *
22094332d3Sopenharmony_ci * Based on the unified APIs provided by the WLAN module, developers of the Hardware Driver Interface
23094332d3Sopenharmony_ci * (HDI) are capable of creating, disabling, scanning for, and connecting to WLAN hotspots, managing WLAN chips,
24094332d3Sopenharmony_ci * network devices, and power, and applying for, releasing, and moving network data buffers.
25094332d3Sopenharmony_ci *
26094332d3Sopenharmony_ci * @since 1.0
27094332d3Sopenharmony_ci * @version 1.0
28094332d3Sopenharmony_ci */
29094332d3Sopenharmony_ci
30094332d3Sopenharmony_ci/**
31094332d3Sopenharmony_ci * @file wifi_hal.h
32094332d3Sopenharmony_ci *
33094332d3Sopenharmony_ci * @brief Declares APIs for basic WLAN features.
34094332d3Sopenharmony_ci *
35094332d3Sopenharmony_ci * @since 1.0
36094332d3Sopenharmony_ci * @version 1.0
37094332d3Sopenharmony_ci */
38094332d3Sopenharmony_ci
39094332d3Sopenharmony_ci#ifndef WIFI_HAL_H
40094332d3Sopenharmony_ci#define WIFI_HAL_H
41094332d3Sopenharmony_ci
42094332d3Sopenharmony_ci#include "wifi_hal_ap_feature.h"
43094332d3Sopenharmony_ci#include "wifi_hal_sta_feature.h"
44094332d3Sopenharmony_ci#include "wifi_hal_p2p_feature.h"
45094332d3Sopenharmony_ci
46094332d3Sopenharmony_ci#ifdef __cplusplus
47094332d3Sopenharmony_ci#if __cplusplus
48094332d3Sopenharmony_ciextern "C" {
49094332d3Sopenharmony_ci#endif
50094332d3Sopenharmony_ci#endif
51094332d3Sopenharmony_ci
52094332d3Sopenharmony_ci/**
53094332d3Sopenharmony_ci * @brief Defines a callback to listen for <b>IWiFi</b> asynchronous events.
54094332d3Sopenharmony_ci *
55094332d3Sopenharmony_ci * @param event Indicates the event type passed to the callback.
56094332d3Sopenharmony_ci * @param data Indicates the pointer to the data passed to the callback.
57094332d3Sopenharmony_ci * @param ifName The interface name.
58094332d3Sopenharmony_ci *
59094332d3Sopenharmony_ci * @return Returns <b>0</b> if the <b>IWiFi</b> callback is defined; returns a negative value otherwise.
60094332d3Sopenharmony_ci *
61094332d3Sopenharmony_ci * @since 1.0
62094332d3Sopenharmony_ci * @version 1.0
63094332d3Sopenharmony_ci */
64094332d3Sopenharmony_citypedef int32_t (*CallbackFunc)(uint32_t event, void *data, const char *ifName);
65094332d3Sopenharmony_ci
66094332d3Sopenharmony_ci/**
67094332d3Sopenharmony_ci * @brief Defines a hid2d callback to listen for <b>IWiFi</b> asynchronous events.
68094332d3Sopenharmony_ci *
69094332d3Sopenharmony_ci * @param recvMsg Indicates message received.
70094332d3Sopenharmony_ci * @param recvMsgLen Indicates the length of message.
71094332d3Sopenharmony_ci *
72094332d3Sopenharmony_ci * @return Returns <b>0</b> if the <b>IWiFi</b> hid2d callback is defined; returns a negative value otherwise.
73094332d3Sopenharmony_ci *
74094332d3Sopenharmony_ci * @since 1.0
75094332d3Sopenharmony_ci * @version 1.0
76094332d3Sopenharmony_ci */
77094332d3Sopenharmony_citypedef int32_t (*Hid2dCallbackFunc)(const uint8_t *recvMsg, uint32_t recvMsgLen);
78094332d3Sopenharmony_ci
79094332d3Sopenharmony_ci/**
80094332d3Sopenharmony_ci * @brief Defines the basic WLAN features provided by the hardware abstraction layer (HAL).
81094332d3Sopenharmony_ci *
82094332d3Sopenharmony_ci * The basic features include creating and stopping a channel between the HAL and the WLAN driver,
83094332d3Sopenharmony_ci * and creating, obtaining, and destroying WLAN features.
84094332d3Sopenharmony_ci *
85094332d3Sopenharmony_ci * @since 1.0
86094332d3Sopenharmony_ci * @version 1.0
87094332d3Sopenharmony_ci */
88094332d3Sopenharmony_cistruct IWiFi {
89094332d3Sopenharmony_ci    /**
90094332d3Sopenharmony_ci     * @brief Creates a channel between the HAL and the WLAN driver and obtains the driver NIC information.
91094332d3Sopenharmony_ci     *
92094332d3Sopenharmony_ci     * @param iwifi Indicates the pointer to the {@link IWiFi} object.
93094332d3Sopenharmony_ci     *
94094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the channel is created and the driver NIC information is obtained;
95094332d3Sopenharmony_ci     * returns a negative value otherwise.
96094332d3Sopenharmony_ci     *
97094332d3Sopenharmony_ci     * @since 1.0
98094332d3Sopenharmony_ci     * @version 1.0
99094332d3Sopenharmony_ci     */
100094332d3Sopenharmony_ci    int32_t (*start)(struct IWiFi *iwifi);
101094332d3Sopenharmony_ci
102094332d3Sopenharmony_ci    /**
103094332d3Sopenharmony_ci     * @brief Stops the channel between the HAL and the WLAN driver.
104094332d3Sopenharmony_ci     *
105094332d3Sopenharmony_ci     * @param iwifi Indicates the pointer to the {@link IWiFi} object.
106094332d3Sopenharmony_ci     *
107094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the channel is stopped; returns a negative value otherwise.
108094332d3Sopenharmony_ci     *
109094332d3Sopenharmony_ci     * @since 1.0
110094332d3Sopenharmony_ci     * @version 1.0
111094332d3Sopenharmony_ci     */
112094332d3Sopenharmony_ci    int32_t (*stop)(struct IWiFi *iwifi);
113094332d3Sopenharmony_ci
114094332d3Sopenharmony_ci    /**
115094332d3Sopenharmony_ci     * @brief Obtains the WLAN features available for the device no matter whether it works as an AP,
116094332d3Sopenharmony_ci     * STA, or P2P server/client.
117094332d3Sopenharmony_ci     *
118094332d3Sopenharmony_ci     * @param supType Indicates the pointer to the WLAN features available for the device.
119094332d3Sopenharmony_ci     * @param size Indicates the length of the <b>supType</b> array.
120094332d3Sopenharmony_ci     *
121094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the WLAN features are obtained; returns a negative value otherwise.
122094332d3Sopenharmony_ci     *
123094332d3Sopenharmony_ci     * @since 1.0
124094332d3Sopenharmony_ci     * @version 1.0
125094332d3Sopenharmony_ci     */
126094332d3Sopenharmony_ci    int32_t (*getSupportFeature)(uint8_t *supType, uint32_t size);
127094332d3Sopenharmony_ci
128094332d3Sopenharmony_ci    /**
129094332d3Sopenharmony_ci     * @brief Obtains the WLAN features available for the device that plays different roles simultaneously
130094332d3Sopenharmony_ci     * (any combination of AP, STA, and P2P server/client).
131094332d3Sopenharmony_ci     *
132094332d3Sopenharmony_ci     * @param combo Indicates the pointer to WLAN features available for the device.
133094332d3Sopenharmony_ci     * @param size Indicates the length of the <b>combo</b> array.
134094332d3Sopenharmony_ci     *
135094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the WLAN features are obtained; returns a negative value otherwise.
136094332d3Sopenharmony_ci     *
137094332d3Sopenharmony_ci     * @since 1.0
138094332d3Sopenharmony_ci     * @version 1.0
139094332d3Sopenharmony_ci     */
140094332d3Sopenharmony_ci    int32_t (*getSupportCombo)(uint64_t *combo, uint32_t size);
141094332d3Sopenharmony_ci
142094332d3Sopenharmony_ci    /**
143094332d3Sopenharmony_ci     * @brief Creates an {@link IWiFiBaseFeature} object of a specified type.
144094332d3Sopenharmony_ci     *
145094332d3Sopenharmony_ci     * @param type Indicates the feature type.
146094332d3Sopenharmony_ci     * @param ifeature Indicates the double pointer to the {@link IWiFiBaseFeature} object.
147094332d3Sopenharmony_ci     *
148094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the {@link IWiFiBaseFeature} object is created; returns a negative value otherwise.
149094332d3Sopenharmony_ci     *
150094332d3Sopenharmony_ci     * @since 1.0
151094332d3Sopenharmony_ci     * @version 1.0
152094332d3Sopenharmony_ci     */
153094332d3Sopenharmony_ci    int32_t (*createFeature)(int32_t type, struct IWiFiBaseFeature **ifeature);
154094332d3Sopenharmony_ci
155094332d3Sopenharmony_ci    /**
156094332d3Sopenharmony_ci     * @brief Obtains an {@link IWiFiBaseFeature} object based on a specified network interface name.
157094332d3Sopenharmony_ci     *
158094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
159094332d3Sopenharmony_ci     * @param ifeature Indicates the double pointer to the {@link IWiFiBaseFeature} object.
160094332d3Sopenharmony_ci     *
161094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the {@link IWiFiBaseFeature} object is obtained; returns a negative value otherwise.
162094332d3Sopenharmony_ci     *
163094332d3Sopenharmony_ci     * @since 1.0
164094332d3Sopenharmony_ci     * @version 1.0
165094332d3Sopenharmony_ci     */
166094332d3Sopenharmony_ci    int32_t (*getFeatureByIfName)(const char *ifName, struct IWiFiBaseFeature **ifeature);
167094332d3Sopenharmony_ci
168094332d3Sopenharmony_ci    /**
169094332d3Sopenharmony_ci     * @brief Registers a callback to listen for <b>IWiFi</b> asynchronous events.
170094332d3Sopenharmony_ci     *
171094332d3Sopenharmony_ci     * @param cbFunc Indicates the callback to register.
172094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
173094332d3Sopenharmony_ci     *
174094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the callback is registered; returns a negative value otherwise.
175094332d3Sopenharmony_ci     *
176094332d3Sopenharmony_ci     * @since 1.0
177094332d3Sopenharmony_ci     * @version 1.0
178094332d3Sopenharmony_ci     */
179094332d3Sopenharmony_ci    int32_t (*registerEventCallback)(CallbackFunc cbFunc, const char *ifName);
180094332d3Sopenharmony_ci
181094332d3Sopenharmony_ci    /**
182094332d3Sopenharmony_ci     * @brief Deregisters an <b>IWiFi</b> callback.
183094332d3Sopenharmony_ci
184094332d3Sopenharmony_ci     * @param cbFunc Indicates the callback to register.
185094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
186094332d3Sopenharmony_ci     *
187094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the <b>IWiFi</b> callback is deregistered; returns a negative value otherwise.
188094332d3Sopenharmony_ci     *
189094332d3Sopenharmony_ci     * @since 1.0
190094332d3Sopenharmony_ci     * @version 1.0
191094332d3Sopenharmony_ci     */
192094332d3Sopenharmony_ci    int32_t (*unregisterEventCallback)(CallbackFunc cbFunc, const char *ifName);
193094332d3Sopenharmony_ci
194094332d3Sopenharmony_ci    /**
195094332d3Sopenharmony_ci     * @brief Destroys a specified {@link IWiFiBaseFeature} object.
196094332d3Sopenharmony_ci     *
197094332d3Sopenharmony_ci     * @param ifeature Indicates the pointer to the {@link IWiFiBaseFeature} object to destroy.
198094332d3Sopenharmony_ci     *
199094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the {@link IWiFiBaseFeature} object is destroyed; returns a negative value otherwise.
200094332d3Sopenharmony_ci     *
201094332d3Sopenharmony_ci     * @since 1.0
202094332d3Sopenharmony_ci     * @version 1.0
203094332d3Sopenharmony_ci     */
204094332d3Sopenharmony_ci    int32_t (*destroyFeature)(struct IWiFiBaseFeature *ifeature);
205094332d3Sopenharmony_ci
206094332d3Sopenharmony_ci    /**
207094332d3Sopenharmony_ci     * @brief Resets the WLAN driver with a specified chip ID.
208094332d3Sopenharmony_ci     *
209094332d3Sopenharmony_ci     * @param chipId Indicates the chip ID.
210094332d3Sopenharmony_ci     *
211094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the WLAN driver is reset; returns a negative value otherwise.
212094332d3Sopenharmony_ci     *
213094332d3Sopenharmony_ci     * @since 1.0
214094332d3Sopenharmony_ci     * @version 1.0
215094332d3Sopenharmony_ci     */
216094332d3Sopenharmony_ci    int32_t (*resetDriver)(const uint8_t chipId, const char *ifName);
217094332d3Sopenharmony_ci
218094332d3Sopenharmony_ci    /**
219094332d3Sopenharmony_ci     * @brief get net device infos.
220094332d3Sopenharmony_ci     *
221094332d3Sopenharmony_ci     * @param netDeviceInfoResult get net device infos.
222094332d3Sopenharmony_ci     *
223094332d3Sopenharmony_ci     * @return Returns <b>0</b> if get infos successful; returns a negative value otherwise.
224094332d3Sopenharmony_ci     *
225094332d3Sopenharmony_ci     * @since 1.0
226094332d3Sopenharmony_ci     * @version 1.0
227094332d3Sopenharmony_ci     */
228094332d3Sopenharmony_ci    int32_t (*getNetDevInfo)(struct NetDeviceInfoResult *netDeviceInfoResult);
229094332d3Sopenharmony_ci
230094332d3Sopenharmony_ci    /**
231094332d3Sopenharmony_ci     * @brief Obtains the power mode which is being used.
232094332d3Sopenharmony_ci     *
233094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
234094332d3Sopenharmony_ci     * @param mode Indicates the pointer to the power mode.
235094332d3Sopenharmony_ci     *
236094332d3Sopenharmony_ci     * @return Returns <b>0</b> if get infos successful; returns a negative value otherwise.
237094332d3Sopenharmony_ci     *
238094332d3Sopenharmony_ci     * @since 1.0
239094332d3Sopenharmony_ci     * @version 1.0
240094332d3Sopenharmony_ci     */
241094332d3Sopenharmony_ci    int32_t (*getPowerMode)(const char *ifName, uint8_t *mode);
242094332d3Sopenharmony_ci
243094332d3Sopenharmony_ci    /**
244094332d3Sopenharmony_ci     * @brief Set the power mode.
245094332d3Sopenharmony_ci     *
246094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
247094332d3Sopenharmony_ci     * @param mode The value set to power mode.
248094332d3Sopenharmony_ci     *
249094332d3Sopenharmony_ci     * @return Returns <b>0</b> if get infos successful; returns a negative value otherwise.
250094332d3Sopenharmony_ci     *
251094332d3Sopenharmony_ci     * @since 1.0
252094332d3Sopenharmony_ci     * @version 1.0
253094332d3Sopenharmony_ci     */
254094332d3Sopenharmony_ci    int32_t (*setPowerMode)(const char *ifName, uint8_t mode);
255094332d3Sopenharmony_ci
256094332d3Sopenharmony_ci    /**
257094332d3Sopenharmony_ci     * @brief Start channel measurement(asynchronous interface, need call getChannelMeasResult to
258094332d3Sopenharmony_ci     * get measurement results).
259094332d3Sopenharmony_ci     *
260094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
261094332d3Sopenharmony_ci     * @param measParam Parameters of the measurement channel.
262094332d3Sopenharmony_ci     *
263094332d3Sopenharmony_ci     * @return Returns <b>0</b> if get infos successful; returns a negative value otherwise.
264094332d3Sopenharmony_ci     *
265094332d3Sopenharmony_ci     * @since 3.2
266094332d3Sopenharmony_ci     * @version 1.0
267094332d3Sopenharmony_ci     */
268094332d3Sopenharmony_ci    int32_t (*startChannelMeas)(const char *ifName, const struct MeasParam *measParam);
269094332d3Sopenharmony_ci
270094332d3Sopenharmony_ci    /**
271094332d3Sopenharmony_ci     * @brief Obtaining channel measurement results.
272094332d3Sopenharmony_ci     *
273094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
274094332d3Sopenharmony_ci     * @param measResult Channel measurement result data.
275094332d3Sopenharmony_ci     *
276094332d3Sopenharmony_ci     * @return Returns <b>0</b> if get infos successful; returns a negative value otherwise.
277094332d3Sopenharmony_ci     *
278094332d3Sopenharmony_ci     * @since 3.2
279094332d3Sopenharmony_ci     * @version 1.0
280094332d3Sopenharmony_ci     */
281094332d3Sopenharmony_ci    int32_t (*getChannelMeasResult)(const char *ifName, struct MeasResult *measResult);
282094332d3Sopenharmony_ci
283094332d3Sopenharmony_ci    /**
284094332d3Sopenharmony_ci     * @brief Config projection screen parameters.
285094332d3Sopenharmony_ci     *
286094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
287094332d3Sopenharmony_ci     * @param param Indicates the parameters used to config projection screen.
288094332d3Sopenharmony_ci     *
289094332d3Sopenharmony_ci     * @return Returns <b>0</b> if  Config projection screen parameters successful; returns a negative value otherwise.
290094332d3Sopenharmony_ci     *
291094332d3Sopenharmony_ci     * @since 3.2
292094332d3Sopenharmony_ci     * @version 1.0
293094332d3Sopenharmony_ci     */
294094332d3Sopenharmony_ci    int32_t (*setProjectionScreenParam)(const char *ifName, const ProjectionScreenParam *param);
295094332d3Sopenharmony_ci
296094332d3Sopenharmony_ci    /**
297094332d3Sopenharmony_ci     * @brief Send ioctl command to driver.
298094332d3Sopenharmony_ci     *
299094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
300094332d3Sopenharmony_ci     * @param cmdId Indicates the command identity document.
301094332d3Sopenharmony_ci     * @param paramBuf Indicates the paramter send to driver.
302094332d3Sopenharmony_ci     * @param paramBufLen Indicates the length of parameter.
303094332d3Sopenharmony_ci     *
304094332d3Sopenharmony_ci     * @return Returns <b>0</b> if  Send ioctl command successful; returns a negative value otherwise.
305094332d3Sopenharmony_ci     *
306094332d3Sopenharmony_ci     * @since 3.2
307094332d3Sopenharmony_ci     * @version 1.0
308094332d3Sopenharmony_ci     */
309094332d3Sopenharmony_ci    int32_t (*sendCmdIoctl)(const char *ifName, int32_t cmdId, const int8_t *paramBuf, uint32_t paramBufLen);
310094332d3Sopenharmony_ci
311094332d3Sopenharmony_ci    /**
312094332d3Sopenharmony_ci     * @brief Registers a hid2d callback to listen for <b>IWiFi</b> asynchronous events.
313094332d3Sopenharmony_ci     *
314094332d3Sopenharmony_ci     * @param func Indicates the callback function to register.
315094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
316094332d3Sopenharmony_ci     *
317094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the hid2d callback is registered; returns a negative value otherwise.
318094332d3Sopenharmony_ci     *
319094332d3Sopenharmony_ci     * @since 3.2
320094332d3Sopenharmony_ci     * @version 1.0
321094332d3Sopenharmony_ci     */
322094332d3Sopenharmony_ci    int32_t (*registerHid2dCallback)(Hid2dCallback func, const char *ifName);
323094332d3Sopenharmony_ci
324094332d3Sopenharmony_ci    /**
325094332d3Sopenharmony_ci     * @brief Unegisters a hid2d callback to listen for <b>IWiFi</b> asynchronous events.
326094332d3Sopenharmony_ci     *
327094332d3Sopenharmony_ci     * @param func Indicates the callback function to unregister.
328094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
329094332d3Sopenharmony_ci     *
330094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the hid2d callback is unregistered; returns a negative value otherwise.
331094332d3Sopenharmony_ci     *
332094332d3Sopenharmony_ci     * @since 3.2
333094332d3Sopenharmony_ci     * @version 1.0
334094332d3Sopenharmony_ci     */
335094332d3Sopenharmony_ci    int32_t (*unregisterHid2dCallback)(Hid2dCallback func, const char *ifName);
336094332d3Sopenharmony_ci
337094332d3Sopenharmony_ci    /**
338094332d3Sopenharmony_ci     * @brief Get station information.
339094332d3Sopenharmony_ci     *
340094332d3Sopenharmony_ci     * @param ifName Indicates the pointer to the network interface name.
341094332d3Sopenharmony_ci     * @param info Indicates the Station information.
342094332d3Sopenharmony_ci     * @param mac Indicates the mac address of station.
343094332d3Sopenharmony_ci     * @param param Indicates the length of mac address.
344094332d3Sopenharmony_ci     *
345094332d3Sopenharmony_ci     * @return Returns <b>0</b> if get station information successful; returns a negative value otherwise.
346094332d3Sopenharmony_ci     *
347094332d3Sopenharmony_ci     * @since 3.2
348094332d3Sopenharmony_ci     * @version 1.0
349094332d3Sopenharmony_ci     */
350094332d3Sopenharmony_ci    int32_t (*getStationInfo)(const char *ifName, StationInfo *info, const uint8_t *mac, uint32_t macLen);
351094332d3Sopenharmony_ci
352094332d3Sopenharmony_ci    /**
353094332d3Sopenharmony_ci     * @brief Send action frame data.
354094332d3Sopenharmony_ci     *
355094332d3Sopenharmony_ci     * @param ifName Indicates the NIC name.
356094332d3Sopenharmony_ci     * @param freq Indicates the send channel frequency.
357094332d3Sopenharmony_ci     * @param frameData Indicates the action frame data.
358094332d3Sopenharmony_ci     * @param frameDataLen Indicates the action frame data length.
359094332d3Sopenharmony_ci     *
360094332d3Sopenharmony_ci     * @return Returns <b>0</b> if get station information successful; returns a negative value otherwise.
361094332d3Sopenharmony_ci     *
362094332d3Sopenharmony_ci     * @since 4.1
363094332d3Sopenharmony_ci     * @version 1.2
364094332d3Sopenharmony_ci     */
365094332d3Sopenharmony_ci    int32_t (*sendActionFrame)(const char *ifName, uint32_t freq, const uint8_t *frameData,
366094332d3Sopenharmony_ci        uint32_t frameDataLen);
367094332d3Sopenharmony_ci
368094332d3Sopenharmony_ci    /**
369094332d3Sopenharmony_ci     * @brief Register action frame receiver.
370094332d3Sopenharmony_ci     *
371094332d3Sopenharmony_ci     * @param ifName Indicates the NIC name.
372094332d3Sopenharmony_ci     * @param match Indicates the data matching action frame.
373094332d3Sopenharmony_ci     * @param matchLen Indicates the matching data length.
374094332d3Sopenharmony_ci     *
375094332d3Sopenharmony_ci     * @return Returns <b>0</b> if get station information successful; returns a negative value otherwise.
376094332d3Sopenharmony_ci     *
377094332d3Sopenharmony_ci     * @since 4.1
378094332d3Sopenharmony_ci     * @version 1.2
379094332d3Sopenharmony_ci     */
380094332d3Sopenharmony_ci    int32_t (*registerActionFrameReceiver)(const char *ifName, const uint8_t *match, uint32_t matchLen);
381094332d3Sopenharmony_ci
382094332d3Sopenharmony_ci    /**
383094332d3Sopenharmony_ci     * @brief set power save manager mode.
384094332d3Sopenharmony_ci     *
385094332d3Sopenharmony_ci     * @param ifName Indicates the NIC name.
386094332d3Sopenharmony_ci     * @param frequency Indicates connected ap frequency.
387094332d3Sopenharmony_ci     * @param mode Indicates power save mode, 3(enable power save), 4(disable power save).
388094332d3Sopenharmony_ci     *
389094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns a negative value if the operation fails.
390094332d3Sopenharmony_ci     *
391094332d3Sopenharmony_ci     * @since 4.1
392094332d3Sopenharmony_ci     * @version 1.2
393094332d3Sopenharmony_ci     */
394094332d3Sopenharmony_ci    int32_t (*setPowerSaveMode)(const char *ifName, int32_t frequency, int32_t mode);
395094332d3Sopenharmony_ci
396094332d3Sopenharmony_ci    /**
397094332d3Sopenharmony_ci     * @brief set dpi mark rule.
398094332d3Sopenharmony_ci     *
399094332d3Sopenharmony_ci     * @param uid Indicates target app uid.
400094332d3Sopenharmony_ci     * @param protocol Indicates target protocol type, tcp/udp.
401094332d3Sopenharmony_ci     * @param enable Indicates enable/disable dpi mark rule.
402094332d3Sopenharmony_ci     *
403094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns a negative value if the operation fails.
404094332d3Sopenharmony_ci     *
405094332d3Sopenharmony_ci     * @since 4.1
406094332d3Sopenharmony_ci     * @version 1.2
407094332d3Sopenharmony_ci     */
408094332d3Sopenharmony_ci    int32_t (*setDpiMarkRule)(int32_t uid, int32_t protocol, int32_t enable);
409094332d3Sopenharmony_ci};
410094332d3Sopenharmony_ci
411094332d3Sopenharmony_ci/**
412094332d3Sopenharmony_ci * @brief Creates an {@link IWiFi} structure.
413094332d3Sopenharmony_ci *
414094332d3Sopenharmony_ci * @param wifiInstance Indicates the double pointer to the {@link IWiFi} structure.
415094332d3Sopenharmony_ci *
416094332d3Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
417094332d3Sopenharmony_ci *
418094332d3Sopenharmony_ci * @since 1.0
419094332d3Sopenharmony_ci * @version 1.0
420094332d3Sopenharmony_ci */
421094332d3Sopenharmony_ciint32_t WifiConstruct(struct IWiFi **wifiInstance);
422094332d3Sopenharmony_ci
423094332d3Sopenharmony_ci/**
424094332d3Sopenharmony_ci * @brief Destroys a specified {@link IWiFi} structure.
425094332d3Sopenharmony_ci *
426094332d3Sopenharmony_ci * @param wifiInstance Indicates the double pointer to the {@link IWiFi} structure.
427094332d3Sopenharmony_ci *
428094332d3Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise.
429094332d3Sopenharmony_ci *
430094332d3Sopenharmony_ci * @since 1.0
431094332d3Sopenharmony_ci * @version 1.0
432094332d3Sopenharmony_ci */
433094332d3Sopenharmony_ciint32_t WifiDestruct(struct IWiFi **wifiInstance);
434094332d3Sopenharmony_ci
435094332d3Sopenharmony_ci#ifdef __cplusplus
436094332d3Sopenharmony_ci#if __cplusplus
437094332d3Sopenharmony_ci}
438094332d3Sopenharmony_ci#endif
439094332d3Sopenharmony_ci#endif
440094332d3Sopenharmony_ci
441094332d3Sopenharmony_ci#endif
442094332d3Sopenharmony_ci/** @} */
443