18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is part of wl18xx
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2012 Texas Instruments. All rights reserved.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __WL18XX_EVENT_H__
98c2ecf20Sopenharmony_ci#define __WL18XX_EVENT_H__
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include "../wlcore/wlcore.h"
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cienum {
148c2ecf20Sopenharmony_ci	SCAN_COMPLETE_EVENT_ID                   = BIT(8),
158c2ecf20Sopenharmony_ci	RADAR_DETECTED_EVENT_ID                  = BIT(9),
168c2ecf20Sopenharmony_ci	CHANNEL_SWITCH_COMPLETE_EVENT_ID         = BIT(10),
178c2ecf20Sopenharmony_ci	BSS_LOSS_EVENT_ID                        = BIT(11),
188c2ecf20Sopenharmony_ci	MAX_TX_FAILURE_EVENT_ID                  = BIT(12),
198c2ecf20Sopenharmony_ci	DUMMY_PACKET_EVENT_ID                    = BIT(13),
208c2ecf20Sopenharmony_ci	INACTIVE_STA_EVENT_ID                    = BIT(14),
218c2ecf20Sopenharmony_ci	PEER_REMOVE_COMPLETE_EVENT_ID            = BIT(15),
228c2ecf20Sopenharmony_ci	PERIODIC_SCAN_COMPLETE_EVENT_ID          = BIT(16),
238c2ecf20Sopenharmony_ci	BA_SESSION_RX_CONSTRAINT_EVENT_ID        = BIT(17),
248c2ecf20Sopenharmony_ci	REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID      = BIT(18),
258c2ecf20Sopenharmony_ci	DFS_CHANNELS_CONFIG_COMPLETE_EVENT       = BIT(19),
268c2ecf20Sopenharmony_ci	PERIODIC_SCAN_REPORT_EVENT_ID            = BIT(20),
278c2ecf20Sopenharmony_ci	RX_BA_WIN_SIZE_CHANGE_EVENT_ID           = BIT(21),
288c2ecf20Sopenharmony_ci	SMART_CONFIG_SYNC_EVENT_ID               = BIT(22),
298c2ecf20Sopenharmony_ci	SMART_CONFIG_DECODE_EVENT_ID             = BIT(23),
308c2ecf20Sopenharmony_ci	TIME_SYNC_EVENT_ID                       = BIT(24),
318c2ecf20Sopenharmony_ci	FW_LOGGER_INDICATION			= BIT(25),
328c2ecf20Sopenharmony_ci};
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_cienum wl18xx_radar_types {
358c2ecf20Sopenharmony_ci	RADAR_TYPE_NONE,
368c2ecf20Sopenharmony_ci	RADAR_TYPE_REGULAR,
378c2ecf20Sopenharmony_ci	RADAR_TYPE_CHIRP
388c2ecf20Sopenharmony_ci};
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_cistruct wl18xx_event_mailbox {
418c2ecf20Sopenharmony_ci	__le32 events_vector;
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci	u8 number_of_scan_results;
448c2ecf20Sopenharmony_ci	u8 number_of_sched_scan_results;
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci	__le16 channel_switch_role_id_bitmap;
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci	s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci	/* bitmap of removed links */
518c2ecf20Sopenharmony_ci	__le32 hlid_removed_bitmap;
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci	/* rx ba constraint */
548c2ecf20Sopenharmony_ci	__le16 rx_ba_role_id_bitmap; /* 0xfff means any role. */
558c2ecf20Sopenharmony_ci	__le16 rx_ba_allowed_bitmap;
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci	/* bitmap of roc completed (by role id) */
588c2ecf20Sopenharmony_ci	__le16 roc_completed_bitmap;
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci	/* bitmap of stations (by role id) with bss loss */
618c2ecf20Sopenharmony_ci	__le16 bss_loss_bitmap;
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci	/* bitmap of stations (by HLID) which exceeded max tx retries */
648c2ecf20Sopenharmony_ci	__le16 tx_retry_exceeded_bitmap;
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci	/* time sync high msb*/
678c2ecf20Sopenharmony_ci	__le16 time_sync_tsf_high_msb;
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci	/* bitmap of inactive stations (by HLID) */
708c2ecf20Sopenharmony_ci	__le16 inactive_sta_bitmap;
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci	/* time sync high lsb*/
738c2ecf20Sopenharmony_ci	__le16 time_sync_tsf_high_lsb;
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci	/* rx BA win size indicated by RX_BA_WIN_SIZE_CHANGE_EVENT_ID */
768c2ecf20Sopenharmony_ci	u8 rx_ba_role_id;
778c2ecf20Sopenharmony_ci	u8 rx_ba_link_id;
788c2ecf20Sopenharmony_ci	u8 rx_ba_win_size;
798c2ecf20Sopenharmony_ci	u8 padding;
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci	/* smart config */
828c2ecf20Sopenharmony_ci	u8 sc_ssid_len;
838c2ecf20Sopenharmony_ci	u8 sc_pwd_len;
848c2ecf20Sopenharmony_ci	u8 sc_token_len;
858c2ecf20Sopenharmony_ci	u8 padding1;
868c2ecf20Sopenharmony_ci	u8 sc_ssid[32];
878c2ecf20Sopenharmony_ci	u8 sc_pwd[64];
888c2ecf20Sopenharmony_ci	u8 sc_token[32];
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci	/* smart config sync channel */
918c2ecf20Sopenharmony_ci	u8 sc_sync_channel;
928c2ecf20Sopenharmony_ci	u8 sc_sync_band;
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci	/* time sync low msb*/
958c2ecf20Sopenharmony_ci	__le16 time_sync_tsf_low_msb;
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci	/* radar detect */
988c2ecf20Sopenharmony_ci	u8 radar_channel;
998c2ecf20Sopenharmony_ci	u8 radar_type;
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci	/* time sync low lsb*/
1028c2ecf20Sopenharmony_ci	__le16 time_sync_tsf_low_lsb;
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci} __packed;
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ciint wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
1078c2ecf20Sopenharmony_ci			  bool *timeout);
1088c2ecf20Sopenharmony_ciint wl18xx_process_mailbox_events(struct wl1271 *wl);
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci#endif
111