xref: /wlan-driver/qca-wifi-host-cmn/utils/host_diag_log/src/host_diag_log.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
5*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
6*5113495bSYour Name  * above copyright notice and this permission notice appear in all
7*5113495bSYour Name  * copies.
8*5113495bSYour Name  *
9*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
17*5113495bSYour Name  */
18*5113495bSYour Name 
19*5113495bSYour Name /*============================================================================
20*5113495bSYour Name    FILE:         host_diag_log.c
21*5113495bSYour Name 
22*5113495bSYour Name    OVERVIEW:     This source file contains definitions for WLAN UTIL diag APIs
23*5113495bSYour Name 
24*5113495bSYour Name    DEPENDENCIES:
25*5113495bSYour Name    ============================================================================*/
26*5113495bSYour Name 
27*5113495bSYour Name #include "qdf_types.h"
28*5113495bSYour Name #include "i_host_diag_core_log.h"
29*5113495bSYour Name #include "host_diag_core_event.h"
30*5113495bSYour Name #include "wlan_nlink_common.h"
31*5113495bSYour Name #include "cds_sched.h"
32*5113495bSYour Name #include "wlan_ptt_sock_svc.h"
33*5113495bSYour Name #include "wlan_nlink_srv.h"
34*5113495bSYour Name #include "cds_api.h"
35*5113495bSYour Name #include "wlan_ps_wow_diag.h"
36*5113495bSYour Name #include "qdf_str.h"
37*5113495bSYour Name 
38*5113495bSYour Name #define PTT_MSG_DIAG_CMDS_TYPE   (0x5050)
39*5113495bSYour Name 
40*5113495bSYour Name #define DIAG_TYPE_LOGS   (1)
41*5113495bSYour Name #define DIAG_TYPE_EVENTS (2)
42*5113495bSYour Name 
43*5113495bSYour Name #define DIAG_SWAP16(A) ((((uint16_t)(A) & 0xff00) >> 8) | (((uint16_t)(A) & 0x00ff) << 8))
44*5113495bSYour Name 
45*5113495bSYour Name typedef struct event_report_s {
46*5113495bSYour Name 	uint32_t diag_type;
47*5113495bSYour Name 	uint16_t event_id;
48*5113495bSYour Name 	uint16_t length;
49*5113495bSYour Name } event_report_t;
50*5113495bSYour Name 
51*5113495bSYour Name /**---------------------------------------------------------------------------
52*5113495bSYour Name 
53*5113495bSYour Name    \brief host_diag_log_set_code() -
54*5113495bSYour Name 
55*5113495bSYour Name    This function sets the logging code in the given log record.
56*5113495bSYour Name 
57*5113495bSYour Name    \param  - ptr - Pointer to the log header type.
58*5113495bSYour Name 		- code - log code.
59*5113495bSYour Name    \return - None
60*5113495bSYour Name 
61*5113495bSYour Name    --------------------------------------------------------------------------*/
62*5113495bSYour Name 
host_diag_log_set_code(void * ptr,uint16_t code)63*5113495bSYour Name void host_diag_log_set_code(void *ptr, uint16_t code)
64*5113495bSYour Name {
65*5113495bSYour Name 	if (ptr) {
66*5113495bSYour Name 		/* All log packets are required to start with 'log_header_type' */
67*5113495bSYour Name 		((log_hdr_type *) ptr)->code = code;
68*5113495bSYour Name 	}
69*5113495bSYour Name }
70*5113495bSYour Name 
71*5113495bSYour Name /**---------------------------------------------------------------------------
72*5113495bSYour Name 
73*5113495bSYour Name    \brief host_diag_log_set_length() -
74*5113495bSYour Name 
75*5113495bSYour Name    This function sets the length field in the given log record.
76*5113495bSYour Name 
77*5113495bSYour Name    \param  - ptr - Pointer to the log header type.
78*5113495bSYour Name 		- length - log length.
79*5113495bSYour Name 
80*5113495bSYour Name    \return - None
81*5113495bSYour Name 
82*5113495bSYour Name    --------------------------------------------------------------------------*/
83*5113495bSYour Name 
host_diag_log_set_length(void * ptr,uint16_t length)84*5113495bSYour Name void host_diag_log_set_length(void *ptr, uint16_t length)
85*5113495bSYour Name {
86*5113495bSYour Name 	if (ptr) {
87*5113495bSYour Name 		/* All log packets are required to start with 'log_header_type' */
88*5113495bSYour Name 		((log_hdr_type *) ptr)->len = (uint16_t) length;
89*5113495bSYour Name 	}
90*5113495bSYour Name }
91*5113495bSYour Name 
92*5113495bSYour Name /**---------------------------------------------------------------------------
93*5113495bSYour Name 
94*5113495bSYour Name    \brief host_diag_log_submit() -
95*5113495bSYour Name 
96*5113495bSYour Name    This function sends the log data to the ptt socket app only if it is registered with the driver.
97*5113495bSYour Name 
98*5113495bSYour Name    \param  - ptr - Pointer to the log header type.
99*5113495bSYour Name 
100*5113495bSYour Name    \return - None
101*5113495bSYour Name 
102*5113495bSYour Name    --------------------------------------------------------------------------*/
103*5113495bSYour Name 
host_diag_log_submit(void * plog_hdr_ptr)104*5113495bSYour Name void host_diag_log_submit(void *plog_hdr_ptr)
105*5113495bSYour Name {
106*5113495bSYour Name 	log_hdr_type *pHdr = (log_hdr_type *) plog_hdr_ptr;
107*5113495bSYour Name 	tAniHdr *wmsg = NULL;
108*5113495bSYour Name 	uint8_t *pBuf;
109*5113495bSYour Name 	uint16_t data_len;
110*5113495bSYour Name 	uint16_t total_len;
111*5113495bSYour Name 
112*5113495bSYour Name 	if (cds_is_load_or_unload_in_progress())
113*5113495bSYour Name 		return;
114*5113495bSYour Name 
115*5113495bSYour Name 	if (nl_srv_is_initialized() != 0)
116*5113495bSYour Name 		return;
117*5113495bSYour Name 
118*5113495bSYour Name 	if (cds_is_multicast_logging()) {
119*5113495bSYour Name 		data_len = pHdr->len;
120*5113495bSYour Name 
121*5113495bSYour Name 		total_len = sizeof(tAniHdr) + sizeof(uint32_t) + data_len;
122*5113495bSYour Name 
123*5113495bSYour Name 		pBuf = (uint8_t *) qdf_mem_malloc(total_len);
124*5113495bSYour Name 
125*5113495bSYour Name 		if (!pBuf)
126*5113495bSYour Name 			return;
127*5113495bSYour Name 
128*5113495bSYour Name 		wmsg = (tAniHdr *) pBuf;
129*5113495bSYour Name 		wmsg->type = PTT_MSG_DIAG_CMDS_TYPE;
130*5113495bSYour Name 		wmsg->length = total_len;
131*5113495bSYour Name 		wmsg->length = DIAG_SWAP16(wmsg->length);
132*5113495bSYour Name 		pBuf += sizeof(tAniHdr);
133*5113495bSYour Name 
134*5113495bSYour Name 		/*  Diag Type events or log */
135*5113495bSYour Name 		*(uint32_t *) pBuf = DIAG_TYPE_LOGS;
136*5113495bSYour Name 		pBuf += sizeof(uint32_t);
137*5113495bSYour Name 
138*5113495bSYour Name 		memcpy(pBuf, pHdr, data_len);
139*5113495bSYour Name 		ptt_sock_send_msg_to_app (wmsg, 0, ANI_NL_MSG_PUMAC,
140*5113495bSYour Name 			INVALID_PID);
141*5113495bSYour Name 		qdf_mem_free((void *)wmsg);
142*5113495bSYour Name 	}
143*5113495bSYour Name 	return;
144*5113495bSYour Name }
145*5113495bSYour Name 
146*5113495bSYour Name /**
147*5113495bSYour Name  * host_diag_log_wlock() - This function is used to send wake lock diag events
148*5113495bSYour Name  * @reason: Reason why the wakelock was taken or released
149*5113495bSYour Name  * @wake_lock_name: Function in which the wakelock was taken or released
150*5113495bSYour Name  * @timeout: Timeout value in case of timed wakelocks
151*5113495bSYour Name  * @status: Status field indicating whether the wake lock was taken/released
152*5113495bSYour Name  *
153*5113495bSYour Name  * This function is used to send wake lock diag events to user space
154*5113495bSYour Name  *
155*5113495bSYour Name  * Return: None
156*5113495bSYour Name  *
157*5113495bSYour Name  */
host_diag_log_wlock(uint32_t reason,const char * wake_lock_name,uint32_t timeout,uint32_t status)158*5113495bSYour Name void host_diag_log_wlock(uint32_t reason, const char *wake_lock_name,
159*5113495bSYour Name 		uint32_t timeout, uint32_t status)
160*5113495bSYour Name {
161*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(wlan_diag_event,
162*5113495bSYour Name 			struct host_event_wlan_wake_lock);
163*5113495bSYour Name 
164*5113495bSYour Name 	if ((nl_srv_is_initialized() != 0) ||
165*5113495bSYour Name 	    (cds_is_wakelock_enabled() == false))
166*5113495bSYour Name 		return;
167*5113495bSYour Name 
168*5113495bSYour Name 	wlan_diag_event.status = status;
169*5113495bSYour Name 	wlan_diag_event.reason = reason;
170*5113495bSYour Name 	wlan_diag_event.timeout = timeout;
171*5113495bSYour Name 	wlan_diag_event.name_len = strlen(wake_lock_name);
172*5113495bSYour Name 	strlcpy(&wlan_diag_event.name[0],
173*5113495bSYour Name 			wake_lock_name,
174*5113495bSYour Name 			wlan_diag_event.name_len+1);
175*5113495bSYour Name 
176*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&wlan_diag_event, EVENT_WLAN_WAKE_LOCK);
177*5113495bSYour Name }
178*5113495bSYour Name 
179*5113495bSYour Name /**---------------------------------------------------------------------------
180*5113495bSYour Name 
181*5113495bSYour Name    \brief host_diag_event_report_payload() -
182*5113495bSYour Name 
183*5113495bSYour Name    This function sends the event data to the ptt socket app only if it is
184*5113495bSYour Name    registered with the driver.
185*5113495bSYour Name 
186*5113495bSYour Name    \param  - ptr - Pointer to the log header type.
187*5113495bSYour Name 
188*5113495bSYour Name    \return - None
189*5113495bSYour Name 
190*5113495bSYour Name    --------------------------------------------------------------------------*/
191*5113495bSYour Name 
host_diag_event_report_payload(uint16_t event_Id,uint16_t length,void * pPayload)192*5113495bSYour Name void host_diag_event_report_payload(uint16_t event_Id, uint16_t length,
193*5113495bSYour Name 				    void *pPayload)
194*5113495bSYour Name {
195*5113495bSYour Name 	tAniHdr *wmsg = NULL;
196*5113495bSYour Name 	uint8_t *pBuf;
197*5113495bSYour Name 	event_report_t *pEvent_report;
198*5113495bSYour Name 	uint16_t total_len;
199*5113495bSYour Name 	int ret;
200*5113495bSYour Name 
201*5113495bSYour Name 	if (cds_is_load_or_unload_in_progress())
202*5113495bSYour Name 		return;
203*5113495bSYour Name 
204*5113495bSYour Name 	if (nl_srv_is_initialized() != 0)
205*5113495bSYour Name 		return;
206*5113495bSYour Name 
207*5113495bSYour Name 	if (cds_is_multicast_logging()) {
208*5113495bSYour Name 		total_len = sizeof(tAniHdr) + sizeof(event_report_t) + length;
209*5113495bSYour Name 
210*5113495bSYour Name 		pBuf = (uint8_t *) qdf_mem_malloc(total_len);
211*5113495bSYour Name 
212*5113495bSYour Name 		if (!pBuf)
213*5113495bSYour Name 			return;
214*5113495bSYour Name 
215*5113495bSYour Name 		wmsg = (tAniHdr *) pBuf;
216*5113495bSYour Name 		wmsg->type = PTT_MSG_DIAG_CMDS_TYPE;
217*5113495bSYour Name 		wmsg->length = total_len;
218*5113495bSYour Name 		wmsg->length = DIAG_SWAP16(wmsg->length);
219*5113495bSYour Name 		pBuf += sizeof(tAniHdr);
220*5113495bSYour Name 
221*5113495bSYour Name 		pEvent_report = (event_report_t *) pBuf;
222*5113495bSYour Name 		pEvent_report->diag_type = DIAG_TYPE_EVENTS;
223*5113495bSYour Name 		pEvent_report->event_id = event_Id;
224*5113495bSYour Name 		pEvent_report->length = length;
225*5113495bSYour Name 
226*5113495bSYour Name 		pBuf += sizeof(event_report_t);
227*5113495bSYour Name 
228*5113495bSYour Name 		memcpy(pBuf, pPayload, length);
229*5113495bSYour Name 
230*5113495bSYour Name 		ret = ptt_sock_send_msg_to_app
231*5113495bSYour Name 			    (wmsg, 0, ANI_NL_MSG_PUMAC, INVALID_PID);
232*5113495bSYour Name 		if ((ret < 0) && (ret != -ESRCH)) {
233*5113495bSYour Name 			QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
234*5113495bSYour Name 				  "Ptt Socket error sending message to the app!!");
235*5113495bSYour Name 			qdf_mem_free((void *)wmsg);
236*5113495bSYour Name 			return;
237*5113495bSYour Name 		}
238*5113495bSYour Name 
239*5113495bSYour Name 		qdf_mem_free((void *)wmsg);
240*5113495bSYour Name 	}
241*5113495bSYour Name 
242*5113495bSYour Name 	return;
243*5113495bSYour Name 
244*5113495bSYour Name }
245*5113495bSYour Name 
246*5113495bSYour Name /**
247*5113495bSYour Name  * host_log_low_resource_failure() - This function is used to send low
248*5113495bSYour Name  * resource failure event
249*5113495bSYour Name  * @event_sub_type: Reason why the failure was observed
250*5113495bSYour Name  *
251*5113495bSYour Name  * This function is used to send low resource failure events to user space
252*5113495bSYour Name  *
253*5113495bSYour Name  * Return: None
254*5113495bSYour Name  *
255*5113495bSYour Name  */
host_log_low_resource_failure(uint8_t event_sub_type)256*5113495bSYour Name void host_log_low_resource_failure(uint8_t event_sub_type)
257*5113495bSYour Name {
258*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(wlan_diag_event,
259*5113495bSYour Name 			struct host_event_wlan_low_resource_failure);
260*5113495bSYour Name 
261*5113495bSYour Name 	wlan_diag_event.event_sub_type = event_sub_type;
262*5113495bSYour Name 
263*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&wlan_diag_event,
264*5113495bSYour Name 					EVENT_WLAN_LOW_RESOURCE_FAILURE);
265*5113495bSYour Name }
266*5113495bSYour Name 
host_log_rsn_info(uint8_t * ucast_cipher,uint8_t * mcast_cipher,uint8_t * akm_suite,uint8_t * group_mgmt)267*5113495bSYour Name void host_log_rsn_info(uint8_t *ucast_cipher, uint8_t *mcast_cipher,
268*5113495bSYour Name 		       uint8_t *akm_suite, uint8_t *group_mgmt)
269*5113495bSYour Name {
270*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(wlan_diag_event,
271*5113495bSYour Name 				 struct event_wlan_csr_rsn_info);
272*5113495bSYour Name 
273*5113495bSYour Name 	qdf_mem_copy(wlan_diag_event.ucast_cipher, ucast_cipher,
274*5113495bSYour Name 		     RSN_OUI_SIZE);
275*5113495bSYour Name 	qdf_mem_copy(wlan_diag_event.mcast_cipher, mcast_cipher,
276*5113495bSYour Name 		     RSN_OUI_SIZE);
277*5113495bSYour Name 	qdf_mem_copy(wlan_diag_event.akm_suite, akm_suite,
278*5113495bSYour Name 		     RSN_OUI_SIZE);
279*5113495bSYour Name 	qdf_mem_copy(wlan_diag_event.group_mgmt, group_mgmt,
280*5113495bSYour Name 		     RSN_OUI_SIZE);
281*5113495bSYour Name 
282*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&wlan_diag_event,
283*5113495bSYour Name 				    EVENT_WLAN_RSN_INFO);
284*5113495bSYour Name }
285*5113495bSYour Name 
286*5113495bSYour Name void
host_log_wlan_auth_info(uint16_t auth_algo_num,uint16_t auth_tx_seq_num,uint16_t auth_status_code)287*5113495bSYour Name host_log_wlan_auth_info(uint16_t auth_algo_num, uint16_t auth_tx_seq_num,
288*5113495bSYour Name 			uint16_t auth_status_code)
289*5113495bSYour Name {
290*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(wlan_diag_event,
291*5113495bSYour Name 				 struct event_wlan_lim_auth_info);
292*5113495bSYour Name 
293*5113495bSYour Name 	wlan_diag_event.auth_algo_num = auth_algo_num;
294*5113495bSYour Name 	wlan_diag_event.auth_transaction_seq_num = auth_tx_seq_num;
295*5113495bSYour Name 	wlan_diag_event.auth_status_code = auth_status_code;
296*5113495bSYour Name 
297*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&wlan_diag_event,
298*5113495bSYour Name 				    EVENT_WLAN_AUTH_INFO);
299*5113495bSYour Name }
300*5113495bSYour Name 
301*5113495bSYour Name #ifdef FEATURE_WLAN_DIAG_SUPPORT
302*5113495bSYour Name /**
303*5113495bSYour Name  * qdf_wow_wakeup_host_event()- send wow wakeup event
304*5113495bSYour Name  * @wow_wakeup_cause: WOW wakeup reason code
305*5113495bSYour Name  *
306*5113495bSYour Name  * This function sends wow wakeup reason code diag event
307*5113495bSYour Name  *
308*5113495bSYour Name  * Return: void.
309*5113495bSYour Name  */
qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause)310*5113495bSYour Name void qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause)
311*5113495bSYour Name {
312*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(wowRequest,
313*5113495bSYour Name 		host_event_wlan_powersave_wow_payload_type);
314*5113495bSYour Name 	qdf_mem_zero(&wowRequest, sizeof(wowRequest));
315*5113495bSYour Name 
316*5113495bSYour Name 	wowRequest.event_subtype = WLAN_WOW_WAKEUP;
317*5113495bSYour Name 	wowRequest.wow_wakeup_cause = wow_wakeup_cause;
318*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&wowRequest,
319*5113495bSYour Name 		EVENT_WLAN_POWERSAVE_WOW);
320*5113495bSYour Name }
321*5113495bSYour Name 
host_log_acs_req_event(uint8_t * intf,const uint8_t * hw_mode,uint16_t bw,uint8_t ht,uint8_t vht,uint16_t chan_start,uint16_t chan_end)322*5113495bSYour Name void host_log_acs_req_event(uint8_t *intf, const uint8_t *hw_mode, uint16_t bw,
323*5113495bSYour Name 			    uint8_t ht, uint8_t vht, uint16_t chan_start,
324*5113495bSYour Name 			    uint16_t chan_end)
325*5113495bSYour Name {
326*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(acs_req, struct host_event_wlan_acs_req);
327*5113495bSYour Name 
328*5113495bSYour Name 	qdf_str_lcopy(acs_req.intf, intf, HOST_EVENT_INTF_STR_LEN);
329*5113495bSYour Name 	qdf_str_lcopy(acs_req.hw_mode, hw_mode, HOST_EVENT_HW_MODE_STR_LEN);
330*5113495bSYour Name 	acs_req.bw = bw;
331*5113495bSYour Name 	acs_req.ht = ht;
332*5113495bSYour Name 	acs_req.vht = vht;
333*5113495bSYour Name 	acs_req.chan_start = chan_start;
334*5113495bSYour Name 	acs_req.chan_end = chan_end;
335*5113495bSYour Name 
336*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&acs_req, EVENT_WLAN_ACS_REQ);
337*5113495bSYour Name }
338*5113495bSYour Name 
host_log_acs_scan_start(uint32_t scan_id,uint8_t vdev_id)339*5113495bSYour Name void host_log_acs_scan_start(uint32_t scan_id, uint8_t vdev_id)
340*5113495bSYour Name {
341*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(acs_scan_start,
342*5113495bSYour Name 				 struct host_event_wlan_acs_scan_start);
343*5113495bSYour Name 
344*5113495bSYour Name 	acs_scan_start.scan_id = scan_id;
345*5113495bSYour Name 	acs_scan_start.vdev_id = vdev_id;
346*5113495bSYour Name 
347*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&acs_scan_start,
348*5113495bSYour Name 				    EVENT_WLAN_ACS_SCAN_START);
349*5113495bSYour Name }
350*5113495bSYour Name 
host_log_acs_scan_done(const uint8_t * status,uint8_t vdev_id,uint32_t scan_id)351*5113495bSYour Name void host_log_acs_scan_done(const uint8_t *status,
352*5113495bSYour Name 			    uint8_t vdev_id, uint32_t scan_id)
353*5113495bSYour Name {
354*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(acs_scan_done,
355*5113495bSYour Name 				 struct host_event_wlan_acs_scan_done);
356*5113495bSYour Name 
357*5113495bSYour Name 	qdf_str_lcopy(acs_scan_done.status, status, HOST_EVENT_STATUS_STR_LEN);
358*5113495bSYour Name 	acs_scan_done.vdev_id = vdev_id;
359*5113495bSYour Name 	acs_scan_done.scan_id = scan_id;
360*5113495bSYour Name 
361*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&acs_scan_done, EVENT_WLAN_ACS_SCAN_DONE);
362*5113495bSYour Name }
363*5113495bSYour Name 
host_log_acs_chan_spect_weight(uint16_t chan,uint16_t weight,int32_t rssi,uint16_t bss_count)364*5113495bSYour Name void host_log_acs_chan_spect_weight(uint16_t chan, uint16_t weight,
365*5113495bSYour Name 				    int32_t rssi, uint16_t bss_count)
366*5113495bSYour Name {
367*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(
368*5113495bSYour Name 		acs_chan_spect_weight,
369*5113495bSYour Name 		struct host_event_wlan_acs_chan_spectral_weight);
370*5113495bSYour Name 
371*5113495bSYour Name 	acs_chan_spect_weight.chan = chan;
372*5113495bSYour Name 	acs_chan_spect_weight.weight = weight;
373*5113495bSYour Name 	acs_chan_spect_weight.rssi = rssi;
374*5113495bSYour Name 	acs_chan_spect_weight.bss_count = bss_count;
375*5113495bSYour Name 
376*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&acs_chan_spect_weight,
377*5113495bSYour Name 				    EVENT_WLAN_ACS_CHANNEL_SPECTRAL_WEIGHT);
378*5113495bSYour Name }
379*5113495bSYour Name 
host_log_acs_best_chan(uint16_t chan,uint16_t weight)380*5113495bSYour Name void host_log_acs_best_chan(uint16_t chan, uint16_t weight)
381*5113495bSYour Name {
382*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(acs_best_chan,
383*5113495bSYour Name 				 struct host_event_wlan_acs_best_chan);
384*5113495bSYour Name 
385*5113495bSYour Name 	acs_best_chan.chan = chan;
386*5113495bSYour Name 	acs_best_chan.weight = weight;
387*5113495bSYour Name 
388*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&acs_best_chan,
389*5113495bSYour Name 				    EVENT_WLAN_ACS_BEST_CHANNEL);
390*5113495bSYour Name }
391*5113495bSYour Name 
host_log_device_status(uint16_t status_code)392*5113495bSYour Name void host_log_device_status(uint16_t status_code)
393*5113495bSYour Name {
394*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_DEF(driver_status,
395*5113495bSYour Name 				 host_event_wlan_bringup_status_payload_type);
396*5113495bSYour Name 
397*5113495bSYour Name 	driver_status.wlan_status = status_code;
398*5113495bSYour Name 
399*5113495bSYour Name 	/* driver version not used yet, fill properly if need later */
400*5113495bSYour Name 	qdf_mem_zero(driver_status.driver_version,
401*5113495bSYour Name 		     sizeof(driver_status.driver_version));
402*5113495bSYour Name 
403*5113495bSYour Name 	WLAN_HOST_DIAG_EVENT_REPORT(&driver_status,
404*5113495bSYour Name 				    EVENT_WLAN_BRINGUP_STATUS);
405*5113495bSYour Name }
406*5113495bSYour Name 
407*5113495bSYour Name #endif
408