1 /**
2  * Copyright 2023-2024 NXP
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef __HAPD_API_H_
8 #define __HAPD_API_H_
9 
10 #ifdef CONFIG_WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE
11 int hostapd_add_enterprise_creds(const struct device *dev,
12 			struct wifi_enterprise_creds_params *creds);
13 #endif
14 
15 /**
16  * @brief Wi-Fi AP configuration parameter.
17  *
18  * @param dev Wi-Fi device
19  * @param params AP parameters
20  * @return 0 for OK; -1 for ERROR
21  */
22 int hostapd_ap_config_params(const struct device *dev, struct wifi_ap_config_params *params);
23 
24 /**
25  * @brief Set Wi-Fi AP region domain
26  *
27  * @param reg_domain region domain parameters
28  * @param dev Wi-Fi device
29  * @return 0 if OK; < 0 if error
30  */
31 int hostapd_ap_reg_domain(const struct device *dev,
32 	struct wifi_reg_domain *reg_domain);
33 
34 #ifdef CONFIG_WIFI_NM_HOSTAPD_WPS
35 /** Start AP WPS PBC/PIN
36  *
37  * @param dev Pointer to the device structure for the driver instance
38  * @param params wps operarion parameters
39  *
40  * @return 0 if ok, < 0 if error
41  */
42 int hostapd_ap_wps_config(const struct device *dev, struct wifi_wps_config_params *params);
43 #endif
44 
45 /**
46  * @brief Get Wi-Fi SAP status
47  *
48  * @param dev Wi-Fi device
49  * @param status SAP status
50  * @return 0 for OK; -1 for ERROR
51  */
52 int hostapd_ap_status(const struct device *dev, struct wifi_iface_status *status);
53 
54 /**
55  * @brief Set Wi-Fi AP configuration
56  *
57  * @param dev Wi-Fi interface name to use
58  * @param params AP configuration parameters to set
59  * @return 0 for OK; -1 for ERROR
60  */
61 int hostapd_ap_enable(const struct device *dev,
62 		      struct wifi_connect_req_params *params);
63 
64 /**
65  * @brief Disable Wi-Fi AP
66  * @param dev Wi-Fi interface name to use
67  * @return 0 for OK; -1 for ERROR
68  */
69 int hostapd_ap_disable(const struct device *dev);
70 
71 /**
72  * @brief Set Wi-Fi AP STA disconnect
73  * @param dev Wi-Fi interface name to use
74  * @param mac_addr MAC address of the station to disconnect
75  * @return 0 for OK; -1 for ERROR
76  */
77 int hostapd_ap_sta_disconnect(const struct device *dev,
78 			      const uint8_t *mac_addr);
79 
80 #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
81 #ifdef CONFIG_WIFI_NM_HOSTAPD_AP
82 /**
83  * @brief Dispatch DPP operations for AP
84  *
85  * @param dev Wi-Fi interface name to use
86  * @param dpp_params DPP action enum and params in string
87  * @return 0 for OK; -1 for ERROR
88  */
89 int hostapd_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *params);
90 #endif /* CONFIG_WIFI_NM_HOSTAPD_AP */
91 #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
92 
93 #endif /* __HAPD_API_H_ */
94