blob: e0bca712e322143cbcd2a653e8692997e8e18231 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Anurag Chouhanc5548422016-02-24 18:33:27 +05302 * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/**
29 * @file htt_isoc.h
30 *
31 * @details
32 * This file defines the target --> host messages that configure the
33 * host data-path SW with the information required for data transfers
34 * to and from the target.
35 */
36
37#ifndef _HTT_ISOC_H_
38#define _HTT_ISOC_H_
39
Govind Singh55b8daf2016-06-09 16:02:47 +053040#include <a_types.h> /* A_UINT32, A_UINT8 */
41#include <a_osapi.h> /* A_COMPILE_TIME_ASSERT */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080042
43#ifdef ATHR_WIN_NWF
Anurag Chouhanc5548422016-02-24 18:33:27 +053044#pragma warning(disable:4214) /* bit field types other than int */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080045#endif
46
47#include "htt_common.h"
48
49/*=== definitions that apply to all messages ================================*/
50
51typedef enum htt_isoc_t2h_msg_type {
52 /* 0x0 reserved for VERSION message (probably not needed) */
53
54 /* PEER_INFO - specify ID and parameters of a new peer */
55 HTT_ISOC_T2H_MSG_TYPE_PEER_INFO = 0x1,
56
57 /* PEER_UNMAP - deallocate the ID that refers to a peer */
58 HTT_ISOC_T2H_MSG_TYPE_PEER_UNMAP = 0x2,
59
60 /* ADDBA - start rx aggregation for the specified peer-TID */
61 HTT_ISOC_T2H_MSG_TYPE_RX_ADDBA = 0x3,
62
63 /* DELBA - stop rx aggregation for the specified peer-TID */
64 HTT_ISOC_T2H_MSG_TYPE_RX_DELBA = 0x4,
65
66 /* TX_COMPL_IND - over-the-air tx completion notification for a tx frame */
67 HTT_ISOC_T2H_MSG_TYPE_TX_COMPL_IND = 0x5,
68
69 /* SEC_IND - notification of the type of security used for a new peer */
70 HTT_ISOC_T2H_MSG_TYPE_SEC_IND = 0x6,
71
72 /* PEER_TX_READY - the target is ready to transmit to a new peer */
73 HTT_ISOC_T2H_MSG_TYPE_PEER_TX_READY = 0x7,
74
75 /* RX_ERR - notification that an rx frame was discarded due to errors */
76 HTT_ISOC_T2H_MSG_TYPE_RX_ERR = 0x8,
77
Govind Singh55b8daf2016-06-09 16:02:47 +053078 /* NLO_MATCH - notification that target found NLO match */
79 HTT_ISOC_T2H_MSG_TYPE_NLO_MATCH = 0x9,
80
81 /* NLO_SCAN_END - notification that target NLO SCAN END 1:1 map with NLO_MATCH */
82 HTT_ISOC_T2H_MSG_TYPE_NLO_SCAN_END = 0xA,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080083 /* keep this last */
84 HTT_ISOC_T2H_NUM_MSGS
85} htt_isoc_t2h_msg_type;
86
87/*
88 * HTT ISOC target to host message type -
89 * stored in bits 7:0 of the first word of the message
90 */
91#define HTT_ISOC_T2H_MSG_TYPE_M 0xff
92#define HTT_ISOC_T2H_MSG_TYPE_S 0
93
94#define HTT_ISOC_T2H_MSG_TYPE_SET(msg_addr, msg_type) \
95 (*((A_UINT8 *) msg_addr) = (msg_type))
96#define HTT_ISOC_T2H_MSG_TYPE_GET(msg_addr) \
97 (*((A_UINT8 *) msg_addr))
98
Govind Singh55b8daf2016-06-09 16:02:47 +053099#ifndef INLINE
100#ifdef QCA_SUPPORT_INTEGRATED_SOC
101/* host SW */
102#define INLINE inline
103#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800104/* target FW */
Govind Singh55b8daf2016-06-09 16:02:47 +0530105#define INLINE __inline
106#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800107#define HTT_ISOC_INLINE_DEF
Govind Singh55b8daf2016-06-09 16:02:47 +0530108#endif /* INLINE */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800109
Govind Singh55b8daf2016-06-09 16:02:47 +0530110static INLINE void
111htt_isoc_t2h_field_set(
112 A_UINT32 *msg_addr32,
113 unsigned offset32,
114 unsigned mask,
115 unsigned shift,
116 unsigned value)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800117{
118 /* sanity check: make sure the value fits within the field */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530119 /* qdf_assert(value << shift == (value << shift) | mask); */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800120
121 msg_addr32 += offset32;
122 /* clear the field */
123 *msg_addr32 &= ~mask;
124 /* write the new value */
125 *msg_addr32 |= (value << shift);
126}
127
128#ifdef HTT_ISOC_INLINE_DEF
129#undef HTT_ISOC_INLINE_DEF
Govind Singh55b8daf2016-06-09 16:02:47 +0530130#undef INLINE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800131#endif
132
133#define HTT_ISOC_T2H_FIELD_GET(msg_addr32, offset32, mask, shift) \
134 (((*(msg_addr32 + offset32)) & mask) >> shift)
135
136typedef enum {
137 /* ASSOC - "real" peer from STA-AP association */
138 HTT_ISOC_T2H_PEER_TYPE_ASSOC = 0x0,
139
140 /* SELF - self-peer for unicast tx to unassociated peer */
141 HTT_ISOC_T2H_PEER_TYPE_SELF = 0x1,
142
143 /* BSSID - reserved for FW use for BT-AMP+IBSS */
144 HTT_ISOC_T2H_PEER_TYPE_BSSID = 0x2,
145
146 /* BCAST - self-peer for multicast / broadcast tx */
147 HTT_ISOC_T2H_PEER_TYPE_BCAST = 0x3
148} HTT_ISOC_T2H_PEER_TYPE_ENUM;
149
150enum {
151 HTT_ISOC_NON_QOS = 0,
152 HTT_ISOC_QOS = 1
153};
154
155enum {
156 HTT_ISOC_RMF_DISABLED = 0,
157 HTT_ISOC_RMF_ENABLED = 1
158};
159
160enum {
161 HTT_ISOC_TID_MGMT = 7
162};
163
164/*=== definitions for specific messages =====================================*/
165
166/*=== PEER_INFO message ===*/
167
168/**
169 * @brief target -> host peer info message definition
170 *
171 * @details
172 * The following diagram shows the format of the peer info message sent
173 * from the target to the host. This layout assumes the target operates
174 * as little-endian.
175 *
176 * |31 25|24|23 18|17|16|15 11|10|9|8|7|6| 0|
177 * |-----------------------------------------------------------------------|
178 * | mgmt DPU idx | bcast DPU idx | DPU idx | msg type |
179 * |-----------------------------------------------------------------------|
180 * | mgmt DPU sig |bcast DPU sig | DPU sig | peer ID |
181 * |-----------------------------------------------------------------------|
182 * | MAC addr 1 | MAC addr 0 | vdev ID | |R| peer type |
183 * |-----------------------------------------------------------------------|
184 * | MAC addr 5 | MAC addr 4 | MAC addr 3 | MAC addr 2 |
185 * |-----------------------------------------------------------------------|
186 *
187 *
188 * The following field definitions describe the format of the peer info
189 * message sent from the target to the host.
190 *
191 * WORD 0:
192 * - MSG_TYPE
193 * Bits 7:0
194 * Purpose: identifies this as peer info message
195 * Value: 0x1
196 * - DPU_IDX
197 * Bits 15:8
198 * Purpose: specify the DPU index (a.k.a. security key ID) to use for
199 * unicast data frames sent to this peer
200 * Value: key ID
201 * - BCAST_DPU_IDX
202 * Bits 23:16
203 * Purpose: specify the DPU index (a.k.a. security key ID) to use for
204 * broadcast data frames sent by this (self) peer
205 * Value: key ID
206 * - MGMT_DPU_IDX
207 * Bits 31:24
208 * Purpose: specify the DPU index (a.k.a. security key ID) to use for
209 * unicast management frames sent by this (self) peer
210 * Value: key ID
211 * WORD 1:
212 * - PEER_ID
213 * Bits 10:0
214 * Purpose: The ID that the target has allocated to refer to the peer
215 * - DPU_SIG
216 * Bits 17:11
217 * Purpose: specify the DPU signature (a.k.a. security key validity
218 * magic number) to specify for unicast data frames sent to this peer
219 * - BCAST_DPU_SIG
220 * Bits 24:18
221 * Purpose: specify the DPU signature (a.k.a. security key validity
222 * magic number) to specify for broadcast data frames sent by this
223 * (self) peer
224 * - MGMT_DPU_SIG
225 * Bits 31:25
226 * Purpose: specify the DPU signature (a.k.a. security key validity
227 * magic number) to specify for unicast management frames sent by this
228 * (self) peer
229 * WORD 2:
230 * - PEER_TYPE
231 * Bits 5:0
232 * Purpose: specify whether the peer in question is a real peer or
233 * one of the types of "self-peer" created for the vdev
234 * Value: HTT_ISOC_T2H_PEER_TYPE enum
235 * - RMF_ENABLED (R)
236 * Bit 6
237 * Purpose: specify whether the peer in question has enable robust
238 * management frames, to encrypt certain managment frames
239 * Value: HTT_ISOC_RMF enum
240 * Value: HTT_ISOC_NON_QOS or HTT_ISOC_QOS
241 * - VDEV_ID
242 * Bits 15:8
243 * Purpose: For a real peer, the vdev ID indicates which virtual device
244 * the peer is associated with. For a self-peer, the vdev ID shows
245 * which virtual device the self-peer represents.
246 * - MAC_ADDR_L16
247 * Bits 31:16
248 * Purpose: Identifies which peer the peer ID is for.
249 * Value: lower 2 bytes of the peer's MAC address
250 * For a self-peer, the peer's MAC address is the MAC address of the
251 * vdev the self-peer represents.
252 * WORD 3:
253 * - MAC_ADDR_U32
254 * Bits 31:0
255 * Purpose: Identifies which peer the peer ID is for.
256 * Value: upper 4 bytes of the peer's MAC address
257 * For a self-peer, the peer's MAC address is the MAC address of the
258 * vdev the self-peer represents.
259 */
260typedef struct htt_isoc_t2h_peer_info_s {
261 /* word 0 */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530262 A_UINT32 msg_type:8, /* HTT_ISOC_T2H_MSG_TYPE_PEER_INFO */
263 dpu_idx:8, bcast_dpu_idx:8, mgmt_dpu_idx:8;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800264 /* word 1 */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530265 A_UINT32 peer_id:11, dpu_sig:7, bcast_dpu_sig:7, mgmt_dpu_sig:7;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800266 /* word 2 */
267 A_UINT32
Anurag Chouhanc5548422016-02-24 18:33:27 +0530268 peer_type:6, rmf_enabled:1, reserved0:1, vdev_id:8, mac_addr_l16:16;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800269 /* word 3 */
270 A_UINT32 mac_addr_u32;
271} htt_isoc_t2h_peer_info_t;
272
273/* word 0 */
274#define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_OFFSET32 0
275#define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_M 0x0000ff00
276#define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_S 8
277
278#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_OFFSET32 0
279#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_M 0x00ff0000
280#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_S 16
281
282#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_OFFSET32 0
283#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_M 0xff000000
284#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_S 24
285
286/* word 1 */
287#define HTT_ISOC_T2H_PEER_INFO_PEER_ID_OFFSET32 1
288#define HTT_ISOC_T2H_PEER_INFO_PEER_ID_M 0x000007ff
289#define HTT_ISOC_T2H_PEER_INFO_PEER_ID_S 0
290
291#define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_OFFSET32 1
292#define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_M 0x0003f800
293#define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_S 11
294
295#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_OFFSET32 1
296#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_M 0x01fc0000
297#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_S 18
298
299#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_OFFSET32 1
300#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_M 0xfe000000
301#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_S 25
302
303/* word 2 */
304#define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_OFFSET32 2
305#define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_M 0x0000003f
306#define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_S 0
307
308#define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_OFFSET32 2
309#define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_M 0x00000040
310#define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_S 6
311
312#define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_OFFSET32 2
313#define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_M 0x0000ff00
314#define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_S 8
315
316#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_OFFSET32 2
317#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_M 0xffff0000
318#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_S 16
319
320/* word 3 */
321#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_OFFSET32 3
322#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_M 0xffffffff
323#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_S 0
324
325/* general field access macros */
326
327#define HTT_ISOC_T2H_PEER_INFO_FIELD_SET(field, msg_addr, value) \
328 htt_isoc_t2h_field_set( \
329 ((A_UINT32 *) msg_addr), \
330 HTT_ISOC_T2H_PEER_INFO_ ## field ## _OFFSET32, \
331 HTT_ISOC_T2H_PEER_INFO_ ## field ## _M, \
332 HTT_ISOC_T2H_PEER_INFO_ ## field ## _S, \
333 value)
334
335#define HTT_ISOC_T2H_PEER_INFO_FIELD_GET(field, msg_addr) \
336 HTT_ISOC_T2H_FIELD_GET( \
337 ((A_UINT32 *) msg_addr), \
338 HTT_ISOC_T2H_PEER_INFO_ ## field ## _OFFSET32, \
339 HTT_ISOC_T2H_PEER_INFO_ ## field ## _M, \
340 HTT_ISOC_T2H_PEER_INFO_ ## field ## _S)
341
342/* access macros for specific fields */
343
344#define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_SET(msg_addr, value) \
345 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(DPU_IDX, msg_addr, value)
346#define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_GET(msg_addr) \
347 HTT_ISOC_T2H_PEER_INFO_FIELD_GET(DPU_IDX, msg_addr)
348
Govind Singh55b8daf2016-06-09 16:02:47 +0530349A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_M_Size_Check,
350 (HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_M >> HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_S) \
351 <= ((A_UINT8)~((A_UINT8)0)));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800352#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_SET(msg_addr, value) \
353 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(BCAST_DPU_IDX, msg_addr, value)
354#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_GET(msg_addr) \
Govind Singh55b8daf2016-06-09 16:02:47 +0530355 (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(BCAST_DPU_IDX, msg_addr))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800356
Govind Singh55b8daf2016-06-09 16:02:47 +0530357A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_M_Size_Check,
358 (HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_M >> HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_S) \
359 <= ((A_UINT8)~((A_UINT8)0)));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800360#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_SET(msg_addr, value) \
361 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MGMT_DPU_IDX, msg_addr, value)
362#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_GET(msg_addr) \
Govind Singh55b8daf2016-06-09 16:02:47 +0530363 (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MGMT_DPU_IDX, msg_addr))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800364
365#define HTT_ISOC_T2H_PEER_INFO_PEER_ID_SET(msg_addr, value) \
366 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(PEER_ID, msg_addr, value)
367#define HTT_ISOC_T2H_PEER_INFO_PEER_ID_GET(msg_addr) \
368 HTT_ISOC_T2H_PEER_INFO_FIELD_GET(PEER_ID, msg_addr)
369
Govind Singh55b8daf2016-06-09 16:02:47 +0530370A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_DPU_SIG_M_Size_Check,
371 (HTT_ISOC_T2H_PEER_INFO_DPU_SIG_M >> HTT_ISOC_T2H_PEER_INFO_DPU_SIG_S)\
372 <= ((A_UINT8)~((A_UINT8)0)));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800373#define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_SET(msg_addr, value) \
374 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(DPU_SIG, msg_addr, value)
375#define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_GET(msg_addr) \
Govind Singh55b8daf2016-06-09 16:02:47 +0530376 (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(DPU_SIG, msg_addr))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800377
Govind Singh55b8daf2016-06-09 16:02:47 +0530378A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_M_Size_Check,
379 (HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_M >> HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_S)\
380 <= ((A_UINT8)~((A_UINT8)0)));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800381#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_SET(msg_addr, value) \
382 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(BCAST_DPU_SIG, msg_addr, value)
383#define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_GET(msg_addr) \
Govind Singh55b8daf2016-06-09 16:02:47 +0530384 (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(BCAST_DPU_SIG, msg_addr))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800385
386#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_SET(msg_addr, value) \
387 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MGMT_DPU_SIG, msg_addr, value)
388#define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_GET(msg_addr) \
389 HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MGMT_DPU_SIG, msg_addr)
390
391#define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_SET(msg_addr, value) \
392 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(PEER_TYPE, msg_addr, value)
393#define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_GET(msg_addr) \
394 HTT_ISOC_T2H_PEER_INFO_FIELD_GET(PEER_TYPE, msg_addr)
395
396#define HTT_ISOC_T2H_PEER_INFO_QOS_CAPABLE_SET(msg_addr, value) \
397 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(QOS_CAPABLE, msg_addr, value)
398#define HTT_ISOC_T2H_PEER_INFO_QOS_CAPABLE_GET(msg_addr) \
399 HTT_ISOC_T2H_PEER_INFO_FIELD_GET(QOS_CAPABLE, msg_addr)
400
401#define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_SET(msg_addr, value) \
402 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(RMF_ENABLED, msg_addr, value)
403#define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_GET(msg_addr) \
404 HTT_ISOC_T2H_PEER_INFO_FIELD_GET(RMF_ENABLED, msg_addr)
405
406#define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_SET(msg_addr, value) \
407 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(VDEV_ID, msg_addr, value)
408#define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_GET(msg_addr) \
409 HTT_ISOC_T2H_PEER_INFO_FIELD_GET(VDEV_ID, msg_addr)
410
411#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_SET(msg_addr, value) \
412 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MAC_ADDR_L16, msg_addr, value)
413#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_GET(msg_addr) \
414 HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MAC_ADDR_L16, msg_addr)
415
416#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_SET(msg_addr, value) \
417 HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MAC_ADDR_U32, msg_addr, value)
418#define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_GET(msg_addr) \
419 HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MAC_ADDR_U32, msg_addr)
420
421/*=== PEER_UNMAP message ===*/
422
423/**
424 * @brief target -> host peer unmap message definition
425 *
426 * @details
427 * The following diagram shows the format of the peer unmap message sent
428 * from the target to the host. This layout assumes the target operates
429 * as little-endian.
430 *
431 * |31 19|18 8|7 0|
432 * |-----------------------------------------------------------------------|
433 * | reserved | peer ID | msg type |
434 * |-----------------------------------------------------------------------|
435 *
436 *
437 * The following field definitions describe the format of the peer info
438 * message sent from the target to the host.
439 *
440 * WORD 0:
441 * - MSG_TYPE
442 * Bits 7:0
443 * Purpose: identifies this as peer unmap message
444 * Value: 0x2
445 * - PEER_ID
446 * Bits 18:8
447 * Purpose: The ID that the target has allocated to refer to the peer
448 */
449typedef struct htt_isoc_t2h_peer_unmap_s {
450 /* word 0 */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530451 A_UINT32 msg_type:8, /* HTT_ISOC_T2H_MSG_TYPE_PEER_UNMAP */
452 peer_id:11, reserved0:13;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800453} htt_isoc_t2h_peer_unmap_t;
454
455/* word 0 */
456#define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_OFFSET32 0
457#define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_M 0x0007ff00
458#define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_S 8
459
460/* general field access macros */
461
462#define HTT_ISOC_T2H_PEER_UNMAP_FIELD_SET(field, msg_addr, value) \
463 htt_isoc_t2h_field_set( \
464 ((A_UINT32 *) msg_addr), \
465 HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _OFFSET32, \
466 HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _M, \
467 HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _S, \
468 value)
469
470#define HTT_ISOC_T2H_PEER_UNMAP_FIELD_GET(field, msg_addr) \
471 HTT_ISOC_T2H_FIELD_GET( \
472 ((A_UINT32 *) msg_addr), \
473 HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _OFFSET32, \
474 HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _M, \
475 HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _S)
476
477/* access macros for specific fields */
478
Govind Singh55b8daf2016-06-09 16:02:47 +0530479A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_M_Size_Check,
480 (HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_M >> HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_S) \
481 < ((A_UINT16)~((A_UINT16)0)));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800482#define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_SET(msg_addr, value) \
483 HTT_ISOC_T2H_PEER_UNMAP_FIELD_SET(PEER_ID, msg_addr, value)
484#define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_GET(msg_addr) \
Govind Singh55b8daf2016-06-09 16:02:47 +0530485 (A_UINT16)(HTT_ISOC_T2H_PEER_UNMAP_FIELD_GET(PEER_ID, msg_addr))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800486
487/*=== ADDBA message ===*/
488enum {
489 htt_isoc_addba_success = 0,
490 /* TBD: use different failure values to specify failure causes? */
491 htt_isoc_addba_fail = 1,
492};
493
494/**
495 * @brief target -> host ADDBA message definition
496 *
497 * @details
498 * The following diagram shows the format of the rx ADDBA message sent
499 * from the target to the host:
500 *
501 * |31 20|19 16|15 12|11 8|7 0|
502 * |---------------------------------------------------------------------|
503 * | peer ID | TID | window size | msg type |
504 * |---------------------------------------------------------------------|
505 * | reserved |S| start seq num |
506 * |---------------------------------------------------------------------|
507 *
508 * The following field definitions describe the format of the ADDBA
509 * message sent from the target to the host.
510 *
511 * WORD 0:
512 * - MSG_TYPE
513 * Bits 7:0
514 * Purpose: identifies this as an ADDBA message
515 * Value: 0x3
516 * - WIN_SIZE
517 * Bits 15:8
518 * Purpose: Specifies the length of the block ack window (max = 64).
519 * Value:
520 * block ack window length specified by the received ADDBA
521 * management message.
522 * - TID
523 * Bits 19:16
524 * Purpose: Specifies which traffic identifier the ADDBA is for.
525 * Value:
526 * TID specified by the received ADDBA management message.
527 * - PEER_ID
528 * Bits 31:20
529 * Purpose: Identifies which peer sent the ADDBA.
530 * Value:
531 * ID (hash value) used by the host for fast, direct lookup of
532 * host SW peer info, including rx reorder states.
533 * - START_SEQ_NUM
534 * Bits 11:0
535 * Purpose: Specifies the initial location of the block ack window
536 * Value: start sequence value specified by the ADDBA-request message
537 * - STATUS
538 * Bit 12
539 * Purpose: status of the WMI ADDBA request
540 * Value: 0 - SUCCESS, 1 - FAILURE
541 */
542typedef struct htt_isoc_t2h_addba_s {
543 /* word 0 */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530544 A_UINT32 msg_type:8, /* HTT_ISOC_T2H_MSG_TYPE_ADDBA */
545 win_size:8, tid:4, peer_id:12;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800546 /* word 1 */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530547 A_UINT32 start_seq_num:12, status:1, reserved0:19;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800548} htt_isoc_t2h_addba_t;
549
550/* word 0 */
551#define HTT_ISOC_T2H_ADDBA_WIN_SIZE_OFFSET32 0
552#define HTT_ISOC_T2H_ADDBA_WIN_SIZE_M 0x0000ff00
553#define HTT_ISOC_T2H_ADDBA_WIN_SIZE_S 8
554
555#define HTT_ISOC_T2H_ADDBA_TID_OFFSET32 0
556#define HTT_ISOC_T2H_ADDBA_TID_M 0x000f0000
557#define HTT_ISOC_T2H_ADDBA_TID_S 16
558
559#define HTT_ISOC_T2H_ADDBA_PEER_ID_OFFSET32 0
560#define HTT_ISOC_T2H_ADDBA_PEER_ID_M 0xfff00000
561#define HTT_ISOC_T2H_ADDBA_PEER_ID_S 20
562
563/* word 1 */
564#define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_OFFSET32 1
565#define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_M 0x00000fff
566#define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_S 0
567
568#define HTT_ISOC_T2H_ADDBA_STATUS_OFFSET32 1
569#define HTT_ISOC_T2H_ADDBA_STATUS_M 0x00001000
570#define HTT_ISOC_T2H_ADDBA_STATUS_S 12
571
572/* general field access macros */
573#define HTT_ISOC_T2H_ADDBA_FIELD_SET(field, msg_addr, value) \
574 htt_isoc_t2h_field_set( \
575 ((A_UINT32 *) msg_addr), \
576 HTT_ISOC_T2H_ADDBA_ ## field ## _OFFSET32, \
577 HTT_ISOC_T2H_ADDBA_ ## field ## _M, \
578 HTT_ISOC_T2H_ADDBA_ ## field ## _S, \
579 value)
580
581#define HTT_ISOC_T2H_ADDBA_FIELD_GET(field, msg_addr) \
582 HTT_ISOC_T2H_FIELD_GET( \
583 ((A_UINT32 *) msg_addr), \
584 HTT_ISOC_T2H_ADDBA_ ## field ## _OFFSET32, \
585 HTT_ISOC_T2H_ADDBA_ ## field ## _M, \
586 HTT_ISOC_T2H_ADDBA_ ## field ## _S)
587
588/* access macros for specific fields */
589
590#define HTT_ISOC_T2H_ADDBA_WIN_SIZE_SET(msg_addr, value) \
591 HTT_ISOC_T2H_ADDBA_FIELD_SET(WIN_SIZE, msg_addr, value)
592#define HTT_ISOC_T2H_ADDBA_WIN_SIZE_GET(msg_addr) \
593 HTT_ISOC_T2H_ADDBA_FIELD_GET(WIN_SIZE, msg_addr)
594
Govind Singh55b8daf2016-06-09 16:02:47 +0530595A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_ADDBA_TID_M_Size_Check,
596 (HTT_ISOC_T2H_ADDBA_TID_M >> HTT_ISOC_T2H_ADDBA_TID_S) \
597 < ((A_UINT8)~((A_UINT8)0)));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800598#define HTT_ISOC_T2H_ADDBA_TID_SET(msg_addr, value) \
599 HTT_ISOC_T2H_ADDBA_FIELD_SET(TID, msg_addr, value)
600#define HTT_ISOC_T2H_ADDBA_TID_GET(msg_addr) \
Govind Singh55b8daf2016-06-09 16:02:47 +0530601 (A_UINT8)(HTT_ISOC_T2H_ADDBA_FIELD_GET(TID, msg_addr))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800602
603#define HTT_ISOC_T2H_ADDBA_PEER_ID_SET(msg_addr, value) \
604 HTT_ISOC_T2H_ADDBA_FIELD_SET(PEER_ID, msg_addr, value)
605#define HTT_ISOC_T2H_ADDBA_PEER_ID_GET(msg_addr) \
606 HTT_ISOC_T2H_ADDBA_FIELD_GET(PEER_ID, msg_addr)
607
608#define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_SET(msg_addr, value) \
609 HTT_ISOC_T2H_ADDBA_FIELD_SET(START_SEQ_NUM, msg_addr, value)
610#define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_GET(msg_addr) \
611 HTT_ISOC_T2H_ADDBA_FIELD_GET(START_SEQ_NUM, msg_addr)
612
613#define HTT_ISOC_T2H_ADDBA_STATUS_SET(msg_addr, value) \
614 HTT_ISOC_T2H_ADDBA_FIELD_SET(STATUS, msg_addr, value)
615#define HTT_ISOC_T2H_ADDBA_STATUS_GET(msg_addr) \
616 HTT_ISOC_T2H_ADDBA_FIELD_GET(STATUS, msg_addr)
617
618/*=== DELBA message ===*/
619
620/**
621 * @brief target -> host DELBA message definition
622 *
623 * @details
624 * The following diagram shows the format of the rx DELBA message sent
625 * from the target to the host:
626 *
627 * |31 20|19 16|15 12|11 8|7 0|
628 * |---------------------------------------------------------------------|
629 * | peer ID | TID | reserved |S| msg type |
630 * |---------------------------------------------------------------------|
631 *
632 * The following field definitions describe the format of the ADDBA
633 * message sent from the target to the host.
634 *
635 * WORD 0:
636 * - MSG_TYPE
637 * Bits 7:0
638 * Purpose: identifies this as an DELBA message
639 * Value: 0x4
640 * - TID
641 * Bits 19:16
642 * Purpose: Specifies which traffic identifier the DELBA is for.
643 * Value:
644 * TID specified by the received DELBA management message.
645 * - PEER_ID
646 * Bits 31:20
647 * Purpose: Identifies which peer sent the DELBA.
648 * Value:
649 * ID (hash value) used by the host for fast, direct lookup of
650 * host SW peer info, including rx reorder states.
651 * - STATUS
652 * Bit 8
653 * Purpose: status of the WMI DELBA request
654 * Value: 0 - SUCCESS, 1 - FAILURE
655 */
656typedef struct htt_isoc_t2h_delba_s {
657 /* word 0 */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530658 A_UINT32 msg_type:8, /* HTT_ISOC_T2H_MSG_TYPE_DELBA */
659 status:1, reserved0:7, tid:4, peer_id:12;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800660} htt_isoc_t2h_delba_t;
661
662/* word 0 */
663#define HTT_ISOC_T2H_DELBA_TID_OFFSET32 0
664#define HTT_ISOC_T2H_DELBA_TID_M 0x000f0000
665#define HTT_ISOC_T2H_DELBA_TID_S 16
666
667#define HTT_ISOC_T2H_DELBA_PEER_ID_OFFSET32 0
668#define HTT_ISOC_T2H_DELBA_PEER_ID_M 0xfff00000
669#define HTT_ISOC_T2H_DELBA_PEER_ID_S 20
670
671#define HTT_ISOC_T2H_DELBA_STATUS_OFFSET32 0
672#define HTT_ISOC_T2H_DELBA_STATUS_M 0x00000100
673#define HTT_ISOC_T2H_DELBA_STATUS_S 8
674
675/* general field access macros */
676
677#define HTT_ISOC_T2H_DELBA_FIELD_SET(field, msg_addr, value) \
678 htt_isoc_t2h_field_set( \
679 ((A_UINT32 *) msg_addr), \
680 HTT_ISOC_T2H_DELBA_ ## field ## _OFFSET32, \
681 HTT_ISOC_T2H_DELBA_ ## field ## _M, \
682 HTT_ISOC_T2H_DELBA_ ## field ## _S, \
683 value)
684
685#define HTT_ISOC_T2H_DELBA_FIELD_GET(field, msg_addr) \
686 HTT_ISOC_T2H_FIELD_GET( \
687 ((A_UINT32 *) msg_addr), \
688 HTT_ISOC_T2H_DELBA_ ## field ## _OFFSET32, \
689 HTT_ISOC_T2H_DELBA_ ## field ## _M, \
690 HTT_ISOC_T2H_DELBA_ ## field ## _S)
691
692/* access macros for specific fields */
693
Govind Singh55b8daf2016-06-09 16:02:47 +0530694A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_DELBA_TID_M_Size_Check,
695 (HTT_ISOC_T2H_DELBA_TID_M >> HTT_ISOC_T2H_DELBA_TID_S) \
696 < ((A_UINT8)~((A_UINT8)0)));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800697#define HTT_ISOC_T2H_DELBA_TID_SET(msg_addr, value) \
698 HTT_ISOC_T2H_DELBA_FIELD_SET(TID, msg_addr, value)
699#define HTT_ISOC_T2H_DELBA_TID_GET(msg_addr) \
Govind Singh55b8daf2016-06-09 16:02:47 +0530700 (A_UINT8)HTT_ISOC_T2H_DELBA_FIELD_GET(TID, msg_addr)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800701
702#define HTT_ISOC_T2H_DELBA_PEER_ID_SET(msg_addr, value) \
703 HTT_ISOC_T2H_DELBA_FIELD_SET(PEER_ID, msg_addr, value)
704#define HTT_ISOC_T2H_DELBA_PEER_ID_GET(msg_addr) \
705 HTT_ISOC_T2H_DELBA_FIELD_GET(PEER_ID, msg_addr)
706
707#define HTT_ISOC_T2H_DELBA_STATUS_SET(msg_addr, value) \
708 HTT_ISOC_T2H_DELBA_FIELD_SET(STATUS, msg_addr, value)
709#define HTT_ISOC_T2H_DELBA_STATUS_GET(msg_addr) \
710 HTT_ISOC_T2H_DELBA_FIELD_GET(STATUS, msg_addr)
711
712/*=== SEC_IND message ===*/
713
714/**
715 * @brief target -> host Security indication message definition
716 *
717 * @details
718 * The following diagram shows the format of the SEC_IND message sent
719 * from the target to the host. This layout assumes the target operates
720 * as little-endian.
721 *
722 * |31 25|24|23 18|17|16|15 11|10|9|8|7|6| 0|
723 * |-----------------------------------------------------------------------|
724 * | is unicast | sec type | Peer id | msg type |
725 * |-----------------------------------------------------------------------|
726 * | mic key1 |
727 * |-----------------------------------------------------------------------|
728 * | mic key2 |
729 * |-----------------------------------------------------------------------|
730 *
731 *
732 * The following field definitions describe the format of the peer info
733 * message sent from the target to the host.
734 *
735 * WORD 0:
736 * - MSG_TYPE
737 * Bits 7:0
738 * Purpose: identifies this as SEC_IND message
739 * Value: 0x6
740 * - PEER_ID
741 * Bits 15:8
742 * Purpose: The ID that the target has allocated to refer to the peer
743 * Value: Peer ID
744 * - SEC_TYPE
745 * Bits 23:16
746 * Purpose: specify the security encryption type
747 * Value: htt_sec_type
748 * - is unicast
749 * Bits 31:24
750 * Purpose: specify unicast/bcast
751 * Value: 1-unicast/0-bcast
752 * WORD 1:
753 * - MIC1
754 * Bits 31:0
755 * Purpose: Mickey1
756 * WORD 2:
757 * - MIC2
758 * Bits 31:0
759 * Purpose: Mickey2
760 */
761typedef struct htt_isoc_t2h_sec_ind_s {
762 /* word 0 */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530763 A_UINT32 msg_type:8, /* HTT_ISOC_T2H_MSG_TYPE_SEC_IND */
764 peer_id:8, sec_type:8, is_unicast:8;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800765 /* word 1 */
766 A_UINT32 mic_key1;
767 /* word 2 */
768 A_UINT32 mic_key2;
769 /* word 3 */
770 A_UINT32 status;
771} htt_isoc_t2h_sec_ind_t;
772
773/* word 0 */
774#define HTT_ISOC_T2H_SEC_IND_PEER_ID_OFFSET32 0
775#define HTT_ISOC_T2H_SEC_IND_PEER_ID_M 0x0000ff00
776#define HTT_ISOC_T2H_SEC_IND_PEER_ID_S 8
777
778#define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_OFFSET32 0
779#define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_M 0x00ff0000
780#define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_S 16
781
782#define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_OFFSET32 0
783#define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_M 0xff000000
784#define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_S 24
785
786/* word 1 */
787#define HTT_ISOC_T2H_SEC_IND_MIC1_OFFSET32 1
788#define HTT_ISOC_T2H_SEC_IND_MIC1_M 0xffffffff
789#define HTT_ISOC_T2H_SEC_IND_MIC1_S 0
790
791/* word 2 */
792#define HTT_ISOC_T2H_SEC_IND_MIC2_OFFSET32 2
793#define HTT_ISOC_T2H_SEC_IND_MIC2_M 0xffffffff
794#define HTT_ISOC_T2H_SEC_IND_MIC2_S 0
795
796/* general field access macros */
797#define HTT_ISOC_T2H_SEC_IND_FIELD_SET(field, msg_addr, value) \
798 htt_isoc_t2h_field_set( \
799 ((A_UINT32 *) msg_addr), \
800 HTT_ISOC_T2H_SEC_IND_ ## field ## _OFFSET32, \
801 HTT_ISOC_T2H_SEC_IND_ ## field ## _M, \
802 HTT_ISOC_T2H_SEC_IND_ ## field ## _S, \
803 value)
804
805#define HTT_ISOC_T2H_SEC_IND_FIELD_GET(field, msg_addr) \
806 HTT_ISOC_T2H_FIELD_GET( \
807 ((A_UINT32 *) msg_addr), \
808 HTT_ISOC_T2H_SEC_IND_ ## field ## _OFFSET32, \
809 HTT_ISOC_T2H_SEC_IND_ ## field ## _M, \
810 HTT_ISOC_T2H_SEC_IND_ ## field ## _S)
811
812/* access macros for specific fields */
813#define HTT_ISOC_T2H_SEC_IND_PEER_ID_SET(msg_addr, value) \
814 HTT_ISOC_T2H_SEC_IND_FIELD_SET(PEER_ID, msg_addr, value)
815#define HTT_ISOC_T2H_SEC_IND_PEER_ID_GET(msg_addr) \
816 HTT_ISOC_T2H_SEC_IND_FIELD_GET(PEER_ID, msg_addr)
817
818#define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_SET(msg_addr, value) \
819 HTT_ISOC_T2H_SEC_IND_FIELD_SET(SEC_TYPE, msg_addr, value)
820#define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_GET(msg_addr) \
821 HTT_ISOC_T2H_SEC_IND_FIELD_GET(SEC_TYPE, msg_addr)
822
823#define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_SET(msg_addr, value) \
824 HTT_ISOC_T2H_SEC_IND_FIELD_SET(IS_UNICAST, msg_addr, value)
825#define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_GET(msg_addr) \
826 HTT_ISOC_T2H_SEC_IND_FIELD_GET(IS_UNICAST, msg_addr)
827
828#define HTT_ISOC_T2H_SEC_IND_MIC1_SET(msg_addr, value) \
829 HTT_ISOC_T2H_SEC_IND_FIELD_SET(MIC1, msg_addr, value)
830#define HTT_ISOC_T2H_SEC_IND_MIC1_GET(msg_addr) \
831 HTT_ISOC_T2H_SEC_IND_FIELD_GET(MIC1, msg_addr)
832
833#define HTT_ISOC_T2H_SEC_IND_MIC2_SET(msg_addr, value) \
834 HTT_ISOC_T2H_SEC_IND_FIELD_SET(MIC2, msg_addr, value)
835#define HTT_ISOC_T2H_SEC_IND_MIC2_GET(msg_addr) \
836 HTT_ISOC_T2H_SEC_IND_FIELD_GET(MIC2, msg_addr)
837
838/*=== PEER_TX_READY message ===*/
839
840/**
841 * @brief target -> host peer tx ready message definition
842 *
843 * @details
844 * The following diagram shows the format of the peer tx ready message sent
845 * from the target to the host. This layout assumes the target operates
846 * as little-endian.
847 *
848 * |31 19|18 8|7 0|
849 * |-----------------------------------------------------------------------|
850 * | reserved | peer ID | msg type |
851 * |-----------------------------------------------------------------------|
852 *
853 *
854 * The following field definitions describe the format of the peer info
855 * message sent from the target to the host.
856 *
857 * WORD 0:
858 * - MSG_TYPE
859 * Bits 7:0
860 * Purpose: identifies this as peer tx ready message
861 * Value: 0x7
862 * - PEER_ID
863 * Bits 18:8
864 * Purpose: The ID assigned to the peer by the PEER_INFO message
865 */
866typedef struct htt_isoc_t2h_peer_tx_ready_s {
867 /* word 0 */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530868 A_UINT32 msg_type:8, /* HTT_ISOC_T2H_MSG_TYPE_PEER_TX_READY */
869 peer_id:11, reserved0:13;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800870} htt_isoc_t2h_peer_tx_ready_t;
871
872/* word 0 */
873#define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_OFFSET32 0
874#define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_M 0x0007ff00
875#define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_S 8
876
877/* general field access macros */
878
879#define HTT_ISOC_T2H_PEER_TX_READY_FIELD_SET(field, msg_addr, value) \
880 htt_isoc_t2h_field_set( \
881 ((A_UINT32 *) msg_addr), \
882 HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _OFFSET32, \
883 HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _M, \
884 HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _S, \
885 value)
886
887#define HTT_ISOC_T2H_PEER_TX_READY_FIELD_GET(field, msg_addr) \
888 HTT_ISOC_T2H_FIELD_GET( \
889 ((A_UINT32 *) msg_addr), \
890 HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _OFFSET32, \
891 HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _M, \
892 HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _S)
893
894/* access macros for specific fields */
895
Govind Singh55b8daf2016-06-09 16:02:47 +0530896A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_M_Size_Check,
897 (HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_M >> \
898 HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_S) < ((A_UINT16)~((A_UINT16)0)));
899
900#define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_SET(msg_addr, value) \
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800901 HTT_ISOC_T2H_PEER_TX_READY_FIELD_SET(PEER_ID, msg_addr, value)
902#define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_GET(msg_addr) \
Govind Singh55b8daf2016-06-09 16:02:47 +0530903 ((A_UINT16)(HTT_ISOC_T2H_PEER_TX_READY_FIELD_GET(PEER_ID, msg_addr)))
904
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800905
906/*=== RX_ERR message ===*/
907
908/**
909 * @brief target -> host rx error notification message definition
910 *
911 * @details
912 * The following diagram shows the format of the rx err message sent
913 * from the target to the host. This layout assumes the target operates
914 * as little-endian.
915 *
916 * |31 16|15 8|7|6|5|4 0|
917 * |---------------------------------------------------------------------|
918 * | peer ID | rx err type | msg type |
919 * |---------------------------------------------------------------------|
920 * | reserved | rx err count |M| r | ext TID |
921 * |---------------------------------------------------------------------|
922 * M = multicast
923 * r = reserved
924 *
925 * The following field definitions describe the format of the peer info
926 * message sent from the target to the host.
927 *
928 * WORD 0:
929 * - MSG_TYPE
930 * Bits 7:0
931 * Purpose: identifies this as an rx err message
932 * Value: 0x8
933 * - RX_ERR_TYPE
934 * Bits 15:8
935 * Purpose: specifies which type of rx error is being reported
936 * Value: htt_rx_ind_mpdu_status enum
937 * - PEER_ID
938 * Bits 31:16
939 * Purpose: specify which peer sent the frame that resulted in an error
940 * WORD 1:
941 * - EXT_TID
942 * Bits 4:0
943 * Purpose: specifies which traffic type had the rx error
944 * Value: 0-15 for a real TID value, 16 for non-QoS data, 31 for unknown
945 * - MCAST
946 * Bit 6
947 * Purpose: specify whether the rx error frame was unicast or multicast
948 * Value: 0 -> unicast, 1 -> multicast
949 * - L2_HDR_IS_80211
950 * Bit 7
951 * Purpose: specifies whether the included L2 header (if present) is in
952 * 802.3 or 802.11 format
953 * Value: 0 -> 802.3, 1 -> 802.11
954 * - L2_HDR_BYTES
955 * Bits 15:8
956 * Purpose: Specify the size of the L2 header in this rx error report.
957 * Value:
958 * If no L2 header is included, this field shall be 0.
959 * If a 802.3 + LLC/SNAP header is included, this field shall be
960 * 14 (ethernet header) + 8 (LLC/SNAP).
961 * If a 802.11 header is included, this field shall be 24 bytes for
962 * a basic header, or 26 bytes if a QoS control field is included,
963 * or 30 bytes if a 4th address is included, or 32 bytes if a 4th
964 * address and a QoS control field are included, etc.
965 * Though the L2 header included in the message needs to include
966 * padding up to a 4-byte boundary, this L2 header size field need
967 * not account for the padding following the L2 header.
968 * - SEC_HDR_BYTES
969 * Bits 23:16
970 * Purpose: Specify the size of the security encapsulation header in
971 * this rx error report.
972 * Value:
973 * If no security header is included, this field shall be 0.
974 * If a security header is included, this field depends on the
975 * security type, which can be inferred from the rx error type.
976 * For TKIP MIC errors, the security header could be any of:
977 * 8 - if IV / KeyID and Extended IV are included
978 * 16 - if MIC is also included
979 * 20 - if ICV is also included
980 * - RX_ERR_CNT
981 * Bits 31:24
982 * Purpose: specifies how many rx errors are reported in this message
983 * Value:
984 * Rx error reports that include a L2 header and/or security header
985 * will set this field to 1, to indicate that the error notification
986 * is for a single frame.
987 * Rx error reports that don't include a L2 header or security header
988 * can use this field to send a single message to report multiple
989 * erroneous rx frames.
990 */
991typedef struct htt_isoc_t2h_rx_err_s {
992 /* word 0 */
Anurag Chouhanc5548422016-02-24 18:33:27 +0530993 A_UINT32 msg_type:8, /* HTT_ISOC_T2H_MSG_TYPE_RX_ERR */
994 rx_err_type:8, peer_id:16;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800995 /* word 1 */
996 A_UINT32
Anurag Chouhanc5548422016-02-24 18:33:27 +0530997 ext_tid:5,
998 reserved1:1,
999 mcast:1,
1000 l2_hdr_is_80211:1, l2_hdr_bytes:8, sec_hdr_bytes:8, rx_err_cnt:8;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001001 /* words 2 - M-1: L2 header */
1002 /* words M - N: security header */
1003} htt_isoc_t2h_rx_err_t;
1004
Govind Singh55b8daf2016-06-09 16:02:47 +05301005/* This needs to be exact bytes for structure htt_isoc_t2h_rx_err_t
1006 * * Since it is shared between host and FW, sizeof may not be used.
1007 * * */
1008#define HTT_ISOC_T2H_RX_ERR_BASE_BYTES 20
1009
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001010/* word 0 */
1011#define HTT_ISOC_T2H_RX_ERR_TYPE_OFFSET32 0
1012#define HTT_ISOC_T2H_RX_ERR_TYPE_M 0x0000ff00
1013#define HTT_ISOC_T2H_RX_ERR_TYPE_ID_S 8
1014
1015#define HTT_ISOC_T2H_RX_ERR_PEER_ID_OFFSET32 0
1016#define HTT_ISOC_T2H_RX_ERR_PEER_ID_M 0xffff0000
1017#define HTT_ISOC_T2H_RX_ERR_PEER_ID_S 16
1018
1019/* word 1 */
1020#define HTT_ISOC_T2H_RX_ERR_EXT_TID_OFFSET32 1
1021#define HTT_ISOC_T2H_RX_ERR_EXT_TID_M 0x0000001f
Govind Singh55b8daf2016-06-09 16:02:47 +05301022#define HTT_ISOC_T2H_RX_ERR_EXT_TID_S 0
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001023
1024#define HTT_ISOC_T2H_RX_ERR_MCAST_OFFSET32 1
1025#define HTT_ISOC_T2H_RX_ERR_MCAST_M 0x00000040
Govind Singh55b8daf2016-06-09 16:02:47 +05301026#define HTT_ISOC_T2H_RX_ERR_MCAST_S 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001027
1028#define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_OFFSET32 1
1029#define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_M 0x00000080
Govind Singh55b8daf2016-06-09 16:02:47 +05301030#define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_S 7
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001031
Govind Singh55b8daf2016-06-09 16:02:47 +05301032#define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_OFFSET32 1
1033#define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_M 0x0000ff00
1034#define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_S 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001035
Govind Singh55b8daf2016-06-09 16:02:47 +05301036#define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_OFFSET32 1
1037#define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_M 0x00ff0000
1038#define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_S 16
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001039
1040#define HTT_ISOC_T2H_RX_ERR_CNT_OFFSET32 1
1041#define HTT_ISOC_T2H_RX_ERR_CNT_M 0xff000000
Govind Singh55b8daf2016-06-09 16:02:47 +05301042#define HTT_ISOC_T2H_RX_ERR_CNT_S 24
1043
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001044
1045/* general field access macros */
1046
1047#define HTT_ISOC_T2H_RX_ERR_FIELD_SET(field, msg_addr, value) \
1048 htt_isoc_t2h_field_set( \
1049 ((A_UINT32 *) msg_addr), \
1050 HTT_ISOC_T2H_RX_ERR_ ## field ## _OFFSET32, \
1051 HTT_ISOC_T2H_RX_ERR_ ## field ## _M, \
1052 HTT_ISOC_T2H_RX_ERR_ ## field ## _S, \
1053 value)
1054
1055#define HTT_ISOC_T2H_RX_ERR_FIELD_GET(field, msg_addr) \
1056 HTT_ISOC_T2H_FIELD_GET( \
1057 ((A_UINT32 *) msg_addr), \
1058 HTT_ISOC_T2H_RX_ERR_ ## field ## _OFFSET32, \
1059 HTT_ISOC_T2H_RX_ERR_ ## field ## _M, \
1060 HTT_ISOC_T2H_RX_ERR_ ## field ## _S)
1061
1062/* access macros for specific fields */
1063
1064#define HTT_ISOC_T2H_RX_ERR_TYPE_SET(msg_addr, value) \
1065 HTT_ISOC_T2H_RX_ERR_FIELD_SET(TYPE, msg_addr, value)
1066#define HTT_ISOC_T2H_RX_ERR_TYPE_GET(msg_addr) \
1067 HTT_ISOC_T2H_RX_ERR_FIELD_GET(TYPE, msg_addr)
1068
Govind Singh55b8daf2016-06-09 16:02:47 +05301069A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_RX_ERR_PEER_ID_M_Size_Check,
1070 (HTT_ISOC_T2H_RX_ERR_PEER_ID_M >> HTT_ISOC_T2H_RX_ERR_PEER_ID_S) \
1071 <= ((A_UINT16)~((A_UINT16)0)));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001072#define HTT_ISOC_T2H_RX_ERR_PEER_ID_SET(msg_addr, value) \
1073 HTT_ISOC_T2H_RX_ERR_FIELD_SET(PEER_ID, msg_addr, value)
1074#define HTT_ISOC_T2H_RX_ERR_PEER_ID_GET(msg_addr) \
Govind Singh55b8daf2016-06-09 16:02:47 +05301075 ((A_UINT16)HTT_ISOC_T2H_RX_ERR_FIELD_GET(PEER_ID, msg_addr))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001076
1077#define HTT_ISOC_T2H_RX_ERR_EXT_TID_SET(msg_addr, value) \
1078 HTT_ISOC_T2H_RX_ERR_FIELD_SET(EXT_TID, msg_addr, value)
1079#define HTT_ISOC_T2H_RX_ERR_EXT_TID_GET(msg_addr) \
1080 HTT_ISOC_T2H_RX_ERR_FIELD_GET(EXT_TID, msg_addr)
1081
1082#define HTT_ISOC_T2H_RX_ERR_MCAST_SET(msg_addr, value) \
1083 HTT_ISOC_T2H_RX_ERR_FIELD_SET(MCAST, msg_addr, value)
1084#define HTT_ISOC_T2H_RX_ERR_MCAST_GET(msg_addr) \
1085 HTT_ISOC_T2H_RX_ERR_FIELD_GET(MCAST, msg_addr)
1086
1087#define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_SET(msg_addr, value) \
1088 HTT_ISOC_T2H_RX_ERR_FIELD_SET(L2_HDR_IS_80211, msg_addr, value)
1089#define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_GET(msg_addr) \
1090 HTT_ISOC_T2H_RX_ERR_FIELD_GET(L2_HDR_IS_80211, msg_addr)
1091
1092#define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_SET(msg_addr, value) \
1093 HTT_ISOC_T2H_RX_ERR_FIELD_SET(L2_HDR_BYTES, msg_addr, value)
1094#define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_GET(msg_addr) \
1095 HTT_ISOC_T2H_RX_ERR_FIELD_GET(L2_HDR_BYTES, msg_addr)
1096
1097#define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_SET(msg_addr, value) \
1098 HTT_ISOC_T2H_RX_ERR_FIELD_SET(SEC_HDR_BYTES, msg_addr, value)
1099#define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_GET(msg_addr) \
1100 HTT_ISOC_T2H_RX_ERR_FIELD_GET(SEC_HDR_BYTES, msg_addr)
1101
1102#define HTT_ISOC_T2H_RX_ERR_CNT_SET(msg_addr, value) \
1103 HTT_ISOC_T2H_RX_ERR_FIELD_SET(CNT, msg_addr, value)
1104#define HTT_ISOC_T2H_RX_ERR_CNT_GET(msg_addr) \
1105 HTT_ISOC_T2H_RX_ERR_FIELD_GET(CNT, msg_addr)
1106
Govind Singh55b8daf2016-06-09 16:02:47 +05301107/*=== TX OTA complete indication message ===*/
1108
1109/**
1110 * @brief target -> tx complete indicate message
1111 *
1112 * @details
1113 * The following diagram shows the format of the tx complete indication message sent
1114 * from the target to the host. This layout assumes the target operates
1115 * as little-endian.
1116 *
1117 * |31 19|18 8|7 0|
1118 * |-----------------------------------------------------------------------|
1119 * | reserved | status | msg type |
1120 * |-----------------------------------------------------------------------|
1121 *
1122 *
1123 * The following field definitions describe the format of the peer info
1124 * message sent from the target to the host.
1125 *
1126 * WORD 0:
1127 * - MSG_TYPE
1128 * Bits 7:0
1129 * Purpose: identifies this as tx complete indication message
1130 * Value: 0x7
1131 * - status
1132 * Bits 18:8
1133 * Purpose: TX completion status
1134 */
1135typedef struct htt_isoc_t2h_tx_compl_s {
1136 /* word 0 */
1137 A_UINT32
1138 /* HTT_ISOC_T2H_MSG_TYPE_TX_COMPL_IND */
1139 qmsg_type:8,
1140 status:11,
1141 reserved0:13;
1142} htt_isoc_t2h_tx_compl_t;
1143
1144/* word 0 */
1145#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_OFFSET32 0
1146#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_M 0x0007ff00
1147#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_S 8
1148
1149
1150/* general field access macros */
1151
1152#define HTT_ISOC_T2H_TX_COMPL_IND_FIELD_SET(field, msg_addr, value) \
1153 htt_isoc_t2h_field_set( \
1154 ((A_UINT32 *) msg_addr), \
1155 HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _OFFSET32, \
1156 HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _M, \
1157 HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _S, \
1158 value)
1159
1160#define HTT_ISOC_T2H_TX_COMPL_IND_FIELD_GET(field, msg_addr) \
1161 HTT_ISOC_T2H_FIELD_GET( \
1162 ((A_UINT32 *) msg_addr), \
1163 HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _OFFSET32, \
1164 HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _M, \
1165 HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _S)
1166
1167/* access macros for specific fields */
1168
1169#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_SET(msg_addr, value) \
1170 HTT_ISOC_T2H_TX_COMPL_IND_FIELD_SET(STATUS, msg_addr, value)
1171#define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_GET(msg_addr) \
1172 HTT_ISOC_T2H_TX_COMPL_IND_FIELD_GET(STATUS, msg_addr)
1173
1174#define HTT_TX_COMPL_IND_STAT_OK 0
1175#define HTT_TX_COMPL_IND_STAT_DISCARD 1
1176#define HTT_TX_COMPL_IND_STAT_NO_ACK 2
1177#define HTT_TX_COMPL_IND_STAT_POSTPONE 3
1178
1179/*=== NLO indication message ===*/
1180
1181/**
1182* @brief target -> NLO indicate message
1183*
1184* @details
1185* The following diagram shows the format of the NLO indication message sent
1186* from the target to the host. This layout assumes the target operates
1187* as little-endian.
1188*
1189* |31 8|7 0|
1190* |-----------------------------------------------------------------------|
1191* | reserved | msg type |
1192* |-----------------------------------------------------------------------|
1193*
1194*
1195* The following field definitions describe the format of NLO MATCH indication
1196* message sent from the target to the host.
1197*
1198* WORD 0:
1199* - MSG_TYPE
1200* Bits 7:0
1201* Purpose: identifies this as NLO indication message
1202* Value: 0x9 - HTT_ISOC_T2H_MSG_TYPE_NLO_MATCH
1203* Value: 0xA - HTT_ISOC_T2H_MSG_TYPE_NLO_SCAN_END
1204*/
1205typedef struct htt_isoc_t2h_nlo_ind_s {
1206 /* word 0 */
1207 A_UINT32
1208 msg_type:8,
1209 vdev_id:8,
1210 reserved0:16;
1211} htt_isoc_t2h_nlo_ind_t;
1212
1213/* word 0 */
1214#define HTT_ISOC_T2H_NLO_IND_VDEVID_OFFSET32 0
1215#define HTT_ISOC_T2H_NLO_IND_VDEVID_M 0x0000ff00
1216#define HTT_ISOC_T2H_NLO_IND_VDEVID_S 8
1217
1218
1219/* general field access macros */
1220
1221#define HTT_ISOC_T2H_NLO_IND_FIELD_SET(field, msg_addr, value) \
1222 htt_isoc_t2h_field_set( \
1223 ((A_UINT32 *) msg_addr), \
1224 HTT_ISOC_T2H_NLO_IND_ ## field ## _OFFSET32, \
1225 HTT_ISOC_T2H_NLO_IND_ ## field ## _M, \
1226 HTT_ISOC_T2H_NLO_IND_ ## field ## _S, \
1227 value)
1228
1229#define HTT_ISOC_T2H_NLO_IND_FIELD_GET(field, msg_addr) \
1230 HTT_ISOC_T2H_FIELD_GET( \
1231 ((A_UINT32 *) msg_addr), \
1232 HTT_ISOC_T2H_NLO_IND_ ## field ## _OFFSET32, \
1233 HTT_ISOC_T2H_NLO_IND_ ## field ## _M, \
1234 HTT_ISOC_T2H_NLO_IND_ ## field ## _S)
1235
1236/* access macros for specific fields */
1237
1238#define HTT_ISOC_T2H_NLO_IND_VDEVID_SET(msg_addr, value) \
1239 HTT_ISOC_T2H_NLO_IND_FIELD_SET(VDEVID, msg_addr, value)
1240#define HTT_ISOC_T2H_NLO_IND_VDEVID_GET(msg_addr) \
1241 HTT_ISOC_T2H_NLO_IND_FIELD_GET(VDEVID, msg_addr)
1242
1243
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001244#endif /* _HTT_ISOC_H_ */