1  /*
2   * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3   * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4   *
5   * Permission to use, copy, modify, and/or distribute this software for any
6   * purpose with or without fee is hereby granted, provided that the above
7   * copyright notice and this permission notice appear in all copies.
8   *
9   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12   * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14   * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16   */
17  
18  #ifndef _WLAN_IOT_SIM_UTILS_API_H_
19  #define _WLAN_IOT_SIM_UTILS_API_H_
20  
21  #include <wlan_objmgr_cmn.h>
22  #include <wlan_lmac_if_def.h>
23  #include <wmi_unified_param.h>
24  #include "include/wlan_pdev_mlme.h"
25  #include "wlan_pdev_mlme_api.h"
26  
27  /* Forward Declarations */
28  struct wmi_iot_sim_cmd_ops;
29  
30  /**
31   * struct iot_sim_cbacks - IOT Sim callbacks
32   * @update_beacon_trigger: reg_beacon_trigger_handler
33   */
34  struct iot_sim_cbacks {
35  	void (*update_beacon_trigger)(mlme_pdev_ext_t *);
36  };
37  
38  /**
39   * iot_sim_cmd_handler() - IOT SIM frame handler function
40   * @vdev: vdev object.
41   * @buf: skb
42   * @bcn_param:
43   * @tx: TRUE in case of Tx
44   * @param: mgmt_rx_event_params
45   *
46   * Return : QDF_STATUS_E_SUCCESS/QDF_STATUS_E_FAILURE.
47   */
48  QDF_STATUS iot_sim_cmd_handler(struct wlan_objmgr_vdev *vdev, qdf_nbuf_t buf,
49  			       struct beacon_tmpl_params *bcn_param, bool tx,
50  			       struct mgmt_rx_event_params *param);
51  
52  /**
53   * wlan_iot_sim_init() - API to init iot_sim component
54   *
55   * This API is invoked from dispatcher init during all component init.
56   * This API will register all required handlers for pdev and peer object
57   * create/delete notification.
58   *
59   * Return: SUCCESS,
60   *         Failure
61   */
62  QDF_STATUS wlan_iot_sim_init(void);
63  
64  /**
65   * wlan_iot_sim_deinit() - API to deinit iot_sim component
66   *
67   * This API is invoked from dispatcher deinit during all component deinit.
68   * This API will unregister all registered handlers for pdev and peer object
69   * create/delete notification.
70   *
71   * Return: SUCCESS,
72   *         Failure
73   */
74  QDF_STATUS wlan_iot_sim_deinit(void);
75  
76  /**
77   * wlan_lmac_if_iot_sim_register_rx_ops() - Register lmac interface Rx
78   * operations
79   * @rx_ops: Pointer to lmac interface Rx operations structure
80   *
81   * API to register iot_sim related lmac interface Rx operations
82   *
83   * Return: None
84   */
85  void wlan_lmac_if_iot_sim_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops);
86  
87  /**
88   * wlan_register_wmi_iot_sim_cmd_ops() - Register operations related to wmi
89   * commands on iot_sim parameters
90   * @pdev: the physical device object
91   * @cmd_ops: pointer to the structure holding the operations
92   *	     related to wmi commands on iot_sim parameters
93   *
94   * API to register operations related to wmi commands on iot_sim parameters
95   *
96   * Return: None
97   */
98  void
99  wlan_register_wmi_iot_sim_cmd_ops(struct wlan_objmgr_pdev *pdev,
100  				  struct wmi_iot_sim_cmd_ops *cmd_ops);
101  
102  #endif /* _WLAN_IOT_SIM_UTILS_API_H_*/
103