18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is part of wl12xx
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2012 Texas Instruments. All rights reserved.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __WL12XX_EVENT_H__
98c2ecf20Sopenharmony_ci#define __WL12XX_EVENT_H__
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include "../wlcore/wlcore.h"
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cienum {
148c2ecf20Sopenharmony_ci	MEASUREMENT_START_EVENT_ID		 = BIT(8),
158c2ecf20Sopenharmony_ci	MEASUREMENT_COMPLETE_EVENT_ID		 = BIT(9),
168c2ecf20Sopenharmony_ci	SCAN_COMPLETE_EVENT_ID			 = BIT(10),
178c2ecf20Sopenharmony_ci	WFD_DISCOVERY_COMPLETE_EVENT_ID		 = BIT(11),
188c2ecf20Sopenharmony_ci	AP_DISCOVERY_COMPLETE_EVENT_ID		 = BIT(12),
198c2ecf20Sopenharmony_ci	RESERVED1			         = BIT(13),
208c2ecf20Sopenharmony_ci	PSPOLL_DELIVERY_FAILURE_EVENT_ID	 = BIT(14),
218c2ecf20Sopenharmony_ci	ROLE_STOP_COMPLETE_EVENT_ID		 = BIT(15),
228c2ecf20Sopenharmony_ci	RADAR_DETECTED_EVENT_ID                  = BIT(16),
238c2ecf20Sopenharmony_ci	CHANNEL_SWITCH_COMPLETE_EVENT_ID	 = BIT(17),
248c2ecf20Sopenharmony_ci	BSS_LOSE_EVENT_ID			 = BIT(18),
258c2ecf20Sopenharmony_ci	REGAINED_BSS_EVENT_ID			 = BIT(19),
268c2ecf20Sopenharmony_ci	MAX_TX_RETRY_EVENT_ID			 = BIT(20),
278c2ecf20Sopenharmony_ci	DUMMY_PACKET_EVENT_ID			 = BIT(21),
288c2ecf20Sopenharmony_ci	SOFT_GEMINI_SENSE_EVENT_ID		 = BIT(22),
298c2ecf20Sopenharmony_ci	CHANGE_AUTO_MODE_TIMEOUT_EVENT_ID	 = BIT(23),
308c2ecf20Sopenharmony_ci	SOFT_GEMINI_AVALANCHE_EVENT_ID		 = BIT(24),
318c2ecf20Sopenharmony_ci	PLT_RX_CALIBRATION_COMPLETE_EVENT_ID	 = BIT(25),
328c2ecf20Sopenharmony_ci	INACTIVE_STA_EVENT_ID			 = BIT(26),
338c2ecf20Sopenharmony_ci	PEER_REMOVE_COMPLETE_EVENT_ID		 = BIT(27),
348c2ecf20Sopenharmony_ci	PERIODIC_SCAN_COMPLETE_EVENT_ID		 = BIT(28),
358c2ecf20Sopenharmony_ci	PERIODIC_SCAN_REPORT_EVENT_ID		 = BIT(29),
368c2ecf20Sopenharmony_ci	BA_SESSION_RX_CONSTRAINT_EVENT_ID	 = BIT(30),
378c2ecf20Sopenharmony_ci	REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID	 = BIT(31),
388c2ecf20Sopenharmony_ci};
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_cistruct wl12xx_event_mailbox {
418c2ecf20Sopenharmony_ci	__le32 events_vector;
428c2ecf20Sopenharmony_ci	__le32 events_mask;
438c2ecf20Sopenharmony_ci	__le32 reserved_1;
448c2ecf20Sopenharmony_ci	__le32 reserved_2;
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci	u8 number_of_scan_results;
478c2ecf20Sopenharmony_ci	u8 scan_tag;
488c2ecf20Sopenharmony_ci	u8 completed_scan_status;
498c2ecf20Sopenharmony_ci	u8 reserved_3;
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci	u8 soft_gemini_sense_info;
528c2ecf20Sopenharmony_ci	u8 soft_gemini_protective_info;
538c2ecf20Sopenharmony_ci	s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
548c2ecf20Sopenharmony_ci	u8 change_auto_mode_timeout;
558c2ecf20Sopenharmony_ci	u8 scheduled_scan_status;
568c2ecf20Sopenharmony_ci	u8 reserved4;
578c2ecf20Sopenharmony_ci	/* tuned channel (roc) */
588c2ecf20Sopenharmony_ci	u8 roc_channel;
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci	__le16 hlid_removed_bitmap;
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci	/* bitmap of aged stations (by HLID) */
638c2ecf20Sopenharmony_ci	__le16 sta_aging_status;
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci	/* bitmap of stations (by HLID) which exceeded max tx retries */
668c2ecf20Sopenharmony_ci	__le16 sta_tx_retry_exceeded;
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci	/* discovery completed results */
698c2ecf20Sopenharmony_ci	u8 discovery_tag;
708c2ecf20Sopenharmony_ci	u8 number_of_preq_results;
718c2ecf20Sopenharmony_ci	u8 number_of_prsp_results;
728c2ecf20Sopenharmony_ci	u8 reserved_5;
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci	/* rx ba constraint */
758c2ecf20Sopenharmony_ci	u8 role_id; /* 0xFF means any role. */
768c2ecf20Sopenharmony_ci	u8 rx_ba_allowed;
778c2ecf20Sopenharmony_ci	u8 reserved_6[2];
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci	/* Channel switch results */
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci	u8 channel_switch_role_id;
828c2ecf20Sopenharmony_ci	u8 channel_switch_status;
838c2ecf20Sopenharmony_ci	u8 reserved_7[2];
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci	u8 ps_poll_delivery_failure_role_ids;
868c2ecf20Sopenharmony_ci	u8 stopped_role_ids;
878c2ecf20Sopenharmony_ci	u8 started_role_ids;
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci	u8 reserved_8[9];
908c2ecf20Sopenharmony_ci} __packed;
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ciint wl12xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
938c2ecf20Sopenharmony_ci			  bool *timeout);
948c2ecf20Sopenharmony_ciint wl12xx_process_mailbox_events(struct wl1271 *wl);
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#endif
978c2ecf20Sopenharmony_ci
98