Loading...
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * This file is part of wl18xx
4 *
5 * Copyright (C) 2012 Texas Instruments. All rights reserved.
6 */
7
8#ifndef __WL18XX_EVENT_H__
9#define __WL18XX_EVENT_H__
10
11#include "../wlcore/wlcore.h"
12
13enum {
14 SCAN_COMPLETE_EVENT_ID = BIT(8),
15 RADAR_DETECTED_EVENT_ID = BIT(9),
16 CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(10),
17 BSS_LOSS_EVENT_ID = BIT(11),
18 MAX_TX_FAILURE_EVENT_ID = BIT(12),
19 DUMMY_PACKET_EVENT_ID = BIT(13),
20 INACTIVE_STA_EVENT_ID = BIT(14),
21 PEER_REMOVE_COMPLETE_EVENT_ID = BIT(15),
22 PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(16),
23 BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(17),
24 REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(18),
25 DFS_CHANNELS_CONFIG_COMPLETE_EVENT = BIT(19),
26 PERIODIC_SCAN_REPORT_EVENT_ID = BIT(20),
27 RX_BA_WIN_SIZE_CHANGE_EVENT_ID = BIT(21),
28 SMART_CONFIG_SYNC_EVENT_ID = BIT(22),
29 SMART_CONFIG_DECODE_EVENT_ID = BIT(23),
30 TIME_SYNC_EVENT_ID = BIT(24),
31 FW_LOGGER_INDICATION = BIT(25),
32};
33
34enum wl18xx_radar_types {
35 RADAR_TYPE_NONE,
36 RADAR_TYPE_REGULAR,
37 RADAR_TYPE_CHIRP
38};
39
40struct wl18xx_event_mailbox {
41 __le32 events_vector;
42
43 u8 number_of_scan_results;
44 u8 number_of_sched_scan_results;
45
46 __le16 channel_switch_role_id_bitmap;
47
48 s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
49
50 /* bitmap of removed links */
51 __le32 hlid_removed_bitmap;
52
53 /* rx ba constraint */
54 __le16 rx_ba_role_id_bitmap; /* 0xfff means any role. */
55 __le16 rx_ba_allowed_bitmap;
56
57 /* bitmap of roc completed (by role id) */
58 __le16 roc_completed_bitmap;
59
60 /* bitmap of stations (by role id) with bss loss */
61 __le16 bss_loss_bitmap;
62
63 /* bitmap of stations (by HLID) which exceeded max tx retries */
64 __le16 tx_retry_exceeded_bitmap;
65
66 /* time sync high msb*/
67 __le16 time_sync_tsf_high_msb;
68
69 /* bitmap of inactive stations (by HLID) */
70 __le16 inactive_sta_bitmap;
71
72 /* time sync high lsb*/
73 __le16 time_sync_tsf_high_lsb;
74
75 /* rx BA win size indicated by RX_BA_WIN_SIZE_CHANGE_EVENT_ID */
76 u8 rx_ba_role_id;
77 u8 rx_ba_link_id;
78 u8 rx_ba_win_size;
79 u8 padding;
80
81 /* smart config */
82 u8 sc_ssid_len;
83 u8 sc_pwd_len;
84 u8 sc_token_len;
85 u8 padding1;
86 u8 sc_ssid[32];
87 u8 sc_pwd[64];
88 u8 sc_token[32];
89
90 /* smart config sync channel */
91 u8 sc_sync_channel;
92 u8 sc_sync_band;
93
94 /* time sync low msb*/
95 __le16 time_sync_tsf_low_msb;
96
97 /* radar detect */
98 u8 radar_channel;
99 u8 radar_type;
100
101 /* time sync low lsb*/
102 __le16 time_sync_tsf_low_lsb;
103
104} __packed;
105
106int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
107 bool *timeout);
108int wl18xx_process_mailbox_events(struct wl1271 *wl);
109
110#endif
1/*
2 * This file is part of wl18xx
3 *
4 * Copyright (C) 2012 Texas Instruments. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#ifndef __WL18XX_EVENT_H__
23#define __WL18XX_EVENT_H__
24
25#include "../wlcore/wlcore.h"
26
27enum {
28 SCAN_COMPLETE_EVENT_ID = BIT(8),
29 RADAR_DETECTED_EVENT_ID = BIT(9),
30 CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(10),
31 BSS_LOSS_EVENT_ID = BIT(11),
32 MAX_TX_FAILURE_EVENT_ID = BIT(12),
33 DUMMY_PACKET_EVENT_ID = BIT(13),
34 INACTIVE_STA_EVENT_ID = BIT(14),
35 PEER_REMOVE_COMPLETE_EVENT_ID = BIT(15),
36 PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(16),
37 BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(17),
38 REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(18),
39 DFS_CHANNELS_CONFIG_COMPLETE_EVENT = BIT(19),
40 PERIODIC_SCAN_REPORT_EVENT_ID = BIT(20),
41 RX_BA_WIN_SIZE_CHANGE_EVENT_ID = BIT(21),
42 SMART_CONFIG_SYNC_EVENT_ID = BIT(22),
43 SMART_CONFIG_DECODE_EVENT_ID = BIT(23),
44 TIME_SYNC_EVENT_ID = BIT(24),
45 FW_LOGGER_INDICATION = BIT(25),
46};
47
48enum wl18xx_radar_types {
49 RADAR_TYPE_NONE,
50 RADAR_TYPE_REGULAR,
51 RADAR_TYPE_CHIRP
52};
53
54struct wl18xx_event_mailbox {
55 __le32 events_vector;
56
57 u8 number_of_scan_results;
58 u8 number_of_sched_scan_results;
59
60 __le16 channel_switch_role_id_bitmap;
61
62 s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
63
64 /* bitmap of removed links */
65 __le32 hlid_removed_bitmap;
66
67 /* rx ba constraint */
68 __le16 rx_ba_role_id_bitmap; /* 0xfff means any role. */
69 __le16 rx_ba_allowed_bitmap;
70
71 /* bitmap of roc completed (by role id) */
72 __le16 roc_completed_bitmap;
73
74 /* bitmap of stations (by role id) with bss loss */
75 __le16 bss_loss_bitmap;
76
77 /* bitmap of stations (by HLID) which exceeded max tx retries */
78 __le16 tx_retry_exceeded_bitmap;
79
80 /* time sync high msb*/
81 __le16 time_sync_tsf_high_msb;
82
83 /* bitmap of inactive stations (by HLID) */
84 __le16 inactive_sta_bitmap;
85
86 /* time sync high lsb*/
87 __le16 time_sync_tsf_high_lsb;
88
89 /* rx BA win size indicated by RX_BA_WIN_SIZE_CHANGE_EVENT_ID */
90 u8 rx_ba_role_id;
91 u8 rx_ba_link_id;
92 u8 rx_ba_win_size;
93 u8 padding;
94
95 /* smart config */
96 u8 sc_ssid_len;
97 u8 sc_pwd_len;
98 u8 sc_token_len;
99 u8 padding1;
100 u8 sc_ssid[32];
101 u8 sc_pwd[64];
102 u8 sc_token[32];
103
104 /* smart config sync channel */
105 u8 sc_sync_channel;
106 u8 sc_sync_band;
107
108 /* time sync low msb*/
109 __le16 time_sync_tsf_low_msb;
110
111 /* radar detect */
112 u8 radar_channel;
113 u8 radar_type;
114
115 /* time sync low lsb*/
116 __le16 time_sync_tsf_low_lsb;
117
118} __packed;
119
120int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
121 bool *timeout);
122int wl18xx_process_mailbox_events(struct wl1271 *wl);
123
124#endif