xref: /linux/drivers/net/wireless/ti/wlcore/event.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*2b27bdccSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
27b3115f2SLuciano Coelho /*
37b3115f2SLuciano Coelho  * This file is part of wl1271
47b3115f2SLuciano Coelho  *
57b3115f2SLuciano Coelho  * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
67b3115f2SLuciano Coelho  * Copyright (C) 2008-2009 Nokia Corporation
77b3115f2SLuciano Coelho  *
87b3115f2SLuciano Coelho  * Contact: Luciano Coelho <luciano.coelho@nokia.com>
97b3115f2SLuciano Coelho  */
107b3115f2SLuciano Coelho 
117b3115f2SLuciano Coelho #ifndef __EVENT_H__
127b3115f2SLuciano Coelho #define __EVENT_H__
137b3115f2SLuciano Coelho 
147b3115f2SLuciano Coelho /*
157b3115f2SLuciano Coelho  * Mbox events
167b3115f2SLuciano Coelho  *
177b3115f2SLuciano Coelho  * The event mechanism is based on a pair of event buffers (buffers A and
187b3115f2SLuciano Coelho  * B) at fixed locations in the target's memory. The host processes one
197b3115f2SLuciano Coelho  * buffer while the other buffer continues to collect events. If the host
207b3115f2SLuciano Coelho  * is not processing events, an interrupt is issued to signal that a buffer
217b3115f2SLuciano Coelho  * is ready. Once the host is done with processing events from one buffer,
227b3115f2SLuciano Coelho  * it signals the target (with an ACK interrupt) that the event buffer is
237b3115f2SLuciano Coelho  * free.
247b3115f2SLuciano Coelho  */
257b3115f2SLuciano Coelho 
267b3115f2SLuciano Coelho enum {
277b3115f2SLuciano Coelho 	RSSI_SNR_TRIGGER_0_EVENT_ID              = BIT(0),
287b3115f2SLuciano Coelho 	RSSI_SNR_TRIGGER_1_EVENT_ID              = BIT(1),
297b3115f2SLuciano Coelho 	RSSI_SNR_TRIGGER_2_EVENT_ID              = BIT(2),
307b3115f2SLuciano Coelho 	RSSI_SNR_TRIGGER_3_EVENT_ID              = BIT(3),
317b3115f2SLuciano Coelho 	RSSI_SNR_TRIGGER_4_EVENT_ID              = BIT(4),
327b3115f2SLuciano Coelho 	RSSI_SNR_TRIGGER_5_EVENT_ID              = BIT(5),
337b3115f2SLuciano Coelho 	RSSI_SNR_TRIGGER_6_EVENT_ID              = BIT(6),
347b3115f2SLuciano Coelho 	RSSI_SNR_TRIGGER_7_EVENT_ID              = BIT(7),
35c50a2825SEliad Peller 
367b3115f2SLuciano Coelho 	EVENT_MBOX_ALL_EVENT_ID			 = 0x7fffffff,
377b3115f2SLuciano Coelho };
387b3115f2SLuciano Coelho 
39c50a2825SEliad Peller /* events the driver might want to wait for */
40c50a2825SEliad Peller enum wlcore_wait_event {
41c50a2825SEliad Peller 	WLCORE_EVENT_ROLE_STOP_COMPLETE,
42c50a2825SEliad Peller 	WLCORE_EVENT_PEER_REMOVE_COMPLETE,
436b70e7ebSVictor Goldenshtein 	WLCORE_EVENT_DFS_CONFIG_COMPLETE
44c50a2825SEliad Peller };
45c50a2825SEliad Peller 
467b3115f2SLuciano Coelho enum {
477b3115f2SLuciano Coelho 	EVENT_ENTER_POWER_SAVE_FAIL = 0,
487b3115f2SLuciano Coelho 	EVENT_ENTER_POWER_SAVE_SUCCESS,
497b3115f2SLuciano Coelho };
507b3115f2SLuciano Coelho 
517b3115f2SLuciano Coelho #define NUM_OF_RSSI_SNR_TRIGGERS 8
527b3115f2SLuciano Coelho 
533719c17eSShahar Patury struct fw_logger_information {
543719c17eSShahar Patury 	__le32 max_buff_size;
553719c17eSShahar Patury 	__le32 actual_buff_size;
563719c17eSShahar Patury 	__le32 num_trace_drop;
573719c17eSShahar Patury 	__le32 buff_read_ptr;
583719c17eSShahar Patury 	__le32 buff_write_ptr;
593719c17eSShahar Patury } __packed;
603719c17eSShahar Patury 
617b3115f2SLuciano Coelho struct wl1271;
627b3115f2SLuciano Coelho 
637b3115f2SLuciano Coelho int wl1271_event_unmask(struct wl1271 *wl);
647b3115f2SLuciano Coelho int wl1271_event_handle(struct wl1271 *wl, u8 mbox);
657b3115f2SLuciano Coelho 
66c50a2825SEliad Peller void wlcore_event_soft_gemini_sense(struct wl1271 *wl, u8 enable);
67c50a2825SEliad Peller void wlcore_event_sched_scan_completed(struct wl1271 *wl,
68c50a2825SEliad Peller 				       u8 status);
69c50a2825SEliad Peller void wlcore_event_ba_rx_constraint(struct wl1271 *wl,
70c50a2825SEliad Peller 				   unsigned long roles_bitmap,
71c50a2825SEliad Peller 				   unsigned long allowed_bitmap);
72c50a2825SEliad Peller void wlcore_event_channel_switch(struct wl1271 *wl,
73c50a2825SEliad Peller 				 unsigned long roles_bitmap,
74c50a2825SEliad Peller 				 bool success);
75c50a2825SEliad Peller void wlcore_event_beacon_loss(struct wl1271 *wl, unsigned long roles_bitmap);
76c50a2825SEliad Peller void wlcore_event_dummy_packet(struct wl1271 *wl);
77c50a2825SEliad Peller void wlcore_event_max_tx_failure(struct wl1271 *wl, unsigned long sta_bitmap);
78c50a2825SEliad Peller void wlcore_event_inactive_sta(struct wl1271 *wl, unsigned long sta_bitmap);
79c50a2825SEliad Peller void wlcore_event_roc_complete(struct wl1271 *wl);
80c50a2825SEliad Peller void wlcore_event_rssi_trigger(struct wl1271 *wl, s8 *metric_arr);
813719c17eSShahar Patury int  wlcore_event_fw_logger(struct wl1271 *wl);
827b3115f2SLuciano Coelho #endif
83