1  /*
2   * Copyright (c) 2017, 2019-2020 The Linux Foundation. All rights reserved.
3   * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4   *
5   * Permission to use, copy, modify, and/or distribute this software for
6   * any purpose with or without fee is hereby granted, provided that the
7   * above copyright notice and this permission notice appear in all
8   * copies.
9   *
10   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11   * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12   * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13   * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14   * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15   * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17   * PERFORMANCE OF THIS SOFTWARE.
18   */
19  
20  /**
21   * DOC: target_if_wifi_pos_rx_ops.h
22   * This file declares the functions pertinent to wifi positioning component's
23   * target if layer.
24   */
25  #ifndef _WIFI_POS_TGT_IF_RX_OPS_H_
26  #define _WIFI_POS_TGT_IF_RX_OPS_H_
27  
28  #include "qdf_types.h"
29  #include "qdf_status.h"
30  #include "target_if_wifi_pos.h"
31  #include "wlan_cmn.h"
32  
33  /**
34   * target_if_wifi_pos_oem_rsp_ev_handler: handler registered with
35   * WMI_OEM_RESPONSE_EVENTID
36   * @scn: scn handle
37   * @data_buf: event buffer
38   * @data_len: event buffer length
39   *
40   * Return: status of operation
41   */
42  int target_if_wifi_pos_oem_rsp_ev_handler(ol_scn_t scn,
43  					  uint8_t *data_buf,
44  					  uint32_t data_len);
45  
46  /**
47   * wifi_pos_oem_cap_ev_handler: handler registered with wmi_oem_cap_event_id
48   * @scn: scn handle
49   * @buf: event buffer
50   * @len: event buffer length
51   *
52   * Return: status of operation
53   */
54  int wifi_pos_oem_cap_ev_handler(ol_scn_t scn, uint8_t *buf, uint32_t len);
55  
56  /**
57   * wifi_pos_oem_meas_rpt_ev_handler: handler registered with
58   * wmi_oem_meas_report_event_id
59   * @scn: scn handle
60   * @buf: event buffer
61   * @len: event buffer length
62   *
63   * Return: status of operation
64   */
65  int wifi_pos_oem_meas_rpt_ev_handler(ol_scn_t scn, uint8_t *buf,
66  				     uint32_t len);
67  
68  /**
69   * wifi_pos_oem_err_rpt_ev_handler: handler registered with
70   * wmi_oem_err_report_event_id
71   * @scn: scn handle
72   * @buf: event buffer
73   * @len: event buffer length
74   *
75   * Return: status of operation
76   */
77  int wifi_pos_oem_err_rpt_ev_handler(ol_scn_t scn, uint8_t *buf,
78  				    uint32_t len);
79  
80  #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
81  /**
82   * target_if_wifi_pos_pasn_peer_create_ev_handler() - Handle
83   * wmi_rtt_pasn_peer_create_req_eventid event from firmware
84   * @scn: scn handle
85   * @buf: event buffer
86   * @len: event buffer length
87   *
88   * Return: zero if success, non-zero status on failure
89   */
90  int target_if_wifi_pos_pasn_peer_create_ev_handler(ol_scn_t scn,
91  						   uint8_t *buf,
92  						   uint32_t len);
93  
94  /**
95   * target_if_wifi_pos_pasn_peer_delete_ev_handler() - Handle
96   * wmi_rtt_pasn_peer_delete_eventid event from firmware
97   * @scn: scn handle
98   * @buf: event buffer
99   * @len: event buffer length
100   *
101   * Return: zero if success, non-zero status on failure
102   */
103  int target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,
104  						   uint8_t *buf,
105  						   uint32_t len);
106  
107  #else
108  static inline
target_if_wifi_pos_pasn_peer_create_ev_handler(ol_scn_t scn,uint8_t * buf,uint32_t len)109  int target_if_wifi_pos_pasn_peer_create_ev_handler(ol_scn_t scn,
110  						   uint8_t *buf,
111  						   uint32_t len)
112  {
113  	return 0;
114  }
115  
116  static inline
target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,uint8_t * buf,uint32_t len)117  int target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,
118  						   uint8_t *buf,
119  						   uint32_t len)
120  {
121  	return 0;
122  }
123  #endif /* WIFI_POS_CONVERGED && WLAN_FEATURE_RTT_11AZ_SUPPORT */
124  #endif /* _WIFI_POS_TGT_IF_RX_OPS_H_ */
125