1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved.
4  * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
5  */
6 
7 #ifndef _CNSS_UTILS_H_
8 #define _CNSS_UTILS_H_
9 
10 #include <linux/types.h>
11 
12 struct device;
13 
14 enum cnss_utils_cc_src {
15 	CNSS_UTILS_SOURCE_CORE,
16 	CNSS_UTILS_SOURCE_11D,
17 	CNSS_UTILS_SOURCE_USER
18 };
19 
20 enum cnss_utils_device_type {
21 	CNSS_UNSUPPORETD_DEVICE_TYPE = -1,
22 	CNSS_HMT_DEVICE_TYPE,
23 	CNSS_HSP_DEVICE_TYPE
24 };
25 
26 extern int cnss_utils_set_wlan_unsafe_channel(struct device *dev,
27 					      u16 *unsafe_ch_list,
28 					      u16 ch_count);
29 extern int cnss_utils_get_wlan_unsafe_channel(struct device *dev,
30 					      u16 *unsafe_ch_list,
31 					      u16 *ch_count, u16 buf_len);
32 extern enum cnss_utils_device_type cnss_utils_update_device_type(
33 				enum cnss_utils_device_type device_type);
34 
35 extern int cnss_utils_wlan_set_dfs_nol(struct device *dev,
36 				       const void *info, u16 info_len);
37 extern int cnss_utils_wlan_get_dfs_nol(struct device *dev,
38 				       void *info, u16 info_len);
39 extern int cnss_utils_get_driver_load_cnt(struct device *dev);
40 extern void cnss_utils_increment_driver_load_cnt(struct device *dev);
41 extern int cnss_utils_set_wlan_mac_address(const u8 *in, uint32_t len);
42 extern u8 *cnss_utils_get_wlan_mac_address(struct device *dev, uint32_t *num);
43 extern int cnss_utils_set_wlan_derived_mac_address(const u8 *in, uint32_t len);
44 extern u8 *cnss_utils_get_wlan_derived_mac_address(struct device *dev,
45 							uint32_t *num);
46 extern void cnss_utils_set_cc_source(struct device *dev,
47 				     enum cnss_utils_cc_src cc_source);
48 extern enum cnss_utils_cc_src cnss_utils_get_cc_source(struct device *dev);
49 
50 #ifdef CONFIG_FEATURE_SMEM_MAILBOX
51 extern int cnss_utils_smem_mailbox_write(struct device *dev, int flags,
52 					 const __u8 *data, uint32_t len);
53 #endif
54 
55 #endif
56