xref: /wlan-driver/qca-wifi-host-cmn/wmi/inc/wmi_unified_action_oui_tlv.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _WMI_UNIFIED_ACTION_OUI_TLV_H_
20 #define _WMI_UNIFIED_ACTION_OUI_TLV_H_
21 
22 #ifdef WLAN_FEATURE_ACTION_OUI
23 
24 #include "wmi.h"
25 #include "wmi_unified.h"
26 #include "wmi_unified_api.h"
27 #include "wmi_unified_param.h"
28 
29 /**
30  * wmi_get_action_oui_info_mask() - convert info mask to firmware specific
31  * @info_mask: host specific info mask
32  *
33  * Return: firmware specific information mask
34  */
35 uint32_t wmi_get_action_oui_info_mask(uint32_t info_mask);
36 
37 /**
38  * wmi_get_action_oui_id() - convert action id to firmware specific
39  * @action_id: host specific action id
40  * @id: output pointer to hold converted fw specific action id
41  *
42  * Return: true on conversion else failure
43  */
44 bool wmi_get_action_oui_id(enum action_oui_id action_id,
45 			   wmi_vendor_oui_action_id *id);
46 
47 
48 /**
49  * wmi_fill_oui_extensions() - populates wmi_vendor_oui_ext array
50  * @extension: pointer to user supplied action oui extensions
51  * @no_oui_extns: number of action oui extensions
52  * @cmd_ext: output pointer to TLV
53  *
54  * This function parses the user supplied input data and populates the
55  * array of variable structures TLV in WMI_PDEV_CONFIG_VENDOR_OUI_ACTION_CMDID
56  *
57  * Return: None
58  */
59 void wmi_fill_oui_extensions(struct action_oui_extension *extension,
60 			     uint32_t no_oui_extns,
61 			     wmi_vendor_oui_ext *cmd_ext);
62 
63 /**
64  * wmi_fill_oui_extensions_buffer() - populates data buffer in action oui cmd
65  * @extension: pointer to user supplied action oui extensions
66  * @cmd_ext: pointer to vendor_oui_ext TLV in action oui cmd
67  * @no_oui_extns: number of action oui extensions
68  * @rem_var_buf_len: remaining length of buffer to be populated
69  * @var_buf: output pointer to hold variable length data
70  *
71  * This function parses the user supplied input data and populates the variable
72  * buffer of type array byte TLV in WMI_PDEV_CONFIG_VENDOR_OUI_ACTION_CMDID
73  *
74  * Return: QDF_STATUS_SUCCESS for successful fill else QDF_STATUS_E_INVAL
75  */
76 QDF_STATUS
77 wmi_fill_oui_extensions_buffer(struct action_oui_extension *extension,
78 			       wmi_vendor_oui_ext *cmd_ext,
79 			       uint32_t no_oui_extns, uint32_t rem_var_buf_len,
80 			       uint8_t *var_buf);
81 
82 /**
83  * send_action_oui_cmd_tlv() - send action oui cmd to firmware
84  * @wmi_handle: wmi handler
85  * @req: pointer to action oui info
86  *
87  * Return: QDF_STATUS_SUCCESS on successful transmission else
88  *         QDF_STATUS_E_INVAL or QDF_STATUS_E_NOMEM
89  */
90 QDF_STATUS
91 send_action_oui_cmd_tlv(wmi_unified_t wmi_handle,
92 			struct action_oui_request *req);
93 
94 #endif /* WLAN_FEATURE_ACTION_OUI */
95 
96 #endif /* _WMI_UNIFIED_ACTION_OUI_TLV_H_ */
97