blob: 551f64bf64578cb930fadda493c60bef0a05927b [file] [log] [blame]
Kalle Valo5e3dd152013-06-12 20:52:10 +03001/*
2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef _HTT_H_
19#define _HTT_H_
20
21#include <linux/bug.h>
Michal Kazior6e712d42013-09-24 10:18:36 +020022#include <linux/interrupt.h>
Michal Kaziora16942e2014-02-27 18:50:04 +020023#include <linux/dmapool.h>
Michal Kaziorc545070e2015-01-24 12:14:48 +020024#include <linux/hashtable.h>
Janusz Dziedzic8f739db2014-03-24 21:23:17 +010025#include <net/mac80211.h>
Kalle Valo5e3dd152013-06-12 20:52:10 +030026
Kalle Valo5e3dd152013-06-12 20:52:10 +030027#include "htc.h"
Michal Kazior6aa4cf12015-03-30 09:51:55 +030028#include "hw.h"
Kalle Valo5e3dd152013-06-12 20:52:10 +030029#include "rx_desc.h"
Rajkumar Manoharan8348db22015-03-25 13:12:27 +020030#include "hw.h"
Kalle Valo5e3dd152013-06-12 20:52:10 +030031
Kalle Valo5e3dd152013-06-12 20:52:10 +030032enum htt_dbg_stats_type {
33 HTT_DBG_STATS_WAL_PDEV_TXRX = 1 << 0,
34 HTT_DBG_STATS_RX_REORDER = 1 << 1,
35 HTT_DBG_STATS_RX_RATE_INFO = 1 << 2,
36 HTT_DBG_STATS_TX_PPDU_LOG = 1 << 3,
37 HTT_DBG_STATS_TX_RATE_INFO = 1 << 4,
38 /* bits 5-23 currently reserved */
39
40 HTT_DBG_NUM_STATS /* keep this last */
41};
42
43enum htt_h2t_msg_type { /* host-to-target */
44 HTT_H2T_MSG_TYPE_VERSION_REQ = 0,
45 HTT_H2T_MSG_TYPE_TX_FRM = 1,
46 HTT_H2T_MSG_TYPE_RX_RING_CFG = 2,
47 HTT_H2T_MSG_TYPE_STATS_REQ = 3,
48 HTT_H2T_MSG_TYPE_SYNC = 4,
49 HTT_H2T_MSG_TYPE_AGGR_CFG = 5,
50 HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 6,
Michal Kazior961d4c32013-08-09 10:13:34 +020051
52 /* This command is used for sending management frames in HTT < 3.0.
53 * HTT >= 3.0 uses TX_FRM for everything. */
Kalle Valo5e3dd152013-06-12 20:52:10 +030054 HTT_H2T_MSG_TYPE_MGMT_TX = 7,
55
56 HTT_H2T_NUM_MSGS /* keep this last */
57};
58
59struct htt_cmd_hdr {
60 u8 msg_type;
61} __packed;
62
63struct htt_ver_req {
64 u8 pad[sizeof(u32) - sizeof(struct htt_cmd_hdr)];
65} __packed;
66
67/*
68 * HTT tx MSDU descriptor
69 *
70 * The HTT tx MSDU descriptor is created by the host HTT SW for each
71 * tx MSDU. The HTT tx MSDU descriptor contains the information that
72 * the target firmware needs for the FW's tx processing, particularly
73 * for creating the HW msdu descriptor.
74 * The same HTT tx descriptor is used for HL and LL systems, though
75 * a few fields within the tx descriptor are used only by LL or
76 * only by HL.
77 * The HTT tx descriptor is defined in two manners: by a struct with
78 * bitfields, and by a series of [dword offset, bit mask, bit shift]
79 * definitions.
80 * The target should use the struct def, for simplicitly and clarity,
81 * but the host shall use the bit-mast + bit-shift defs, to be endian-
82 * neutral. Specifically, the host shall use the get/set macros built
83 * around the mask + shift defs.
84 */
85struct htt_data_tx_desc_frag {
Peter Ohfbc03a42015-07-15 19:01:19 -070086 union {
87 struct double_word_addr {
88 __le32 paddr;
89 __le32 len;
90 } __packed dword_addr;
91 struct triple_word_addr {
92 __le32 paddr_lo;
93 __le16 paddr_hi;
94 __le16 len_16;
95 } __packed tword_addr;
96 } __packed;
Kalle Valo5e3dd152013-06-12 20:52:10 +030097} __packed;
98
Raja Manid9156b52015-06-22 20:22:27 +053099struct htt_msdu_ext_desc {
Manikanta Pubbisettyb9635192015-07-20 17:56:12 +0530100 __le32 tso_flag[3];
101 __le16 ip_identification;
102 u8 flags;
103 u8 reserved;
Raja Manid9156b52015-06-22 20:22:27 +0530104 struct htt_data_tx_desc_frag frags[6];
105};
106
Manikanta Pubbisettyb9635192015-07-20 17:56:12 +0530107#define HTT_MSDU_EXT_DESC_FLAG_IPV4_CSUM_ENABLE BIT(0)
108#define HTT_MSDU_EXT_DESC_FLAG_UDP_IPV4_CSUM_ENABLE BIT(1)
109#define HTT_MSDU_EXT_DESC_FLAG_UDP_IPV6_CSUM_ENABLE BIT(2)
110#define HTT_MSDU_EXT_DESC_FLAG_TCP_IPV4_CSUM_ENABLE BIT(3)
111#define HTT_MSDU_EXT_DESC_FLAG_TCP_IPV6_CSUM_ENABLE BIT(4)
112
113#define HTT_MSDU_CHECKSUM_ENABLE (HTT_MSDU_EXT_DESC_FLAG_IPV4_CSUM_ENABLE \
114 | HTT_MSDU_EXT_DESC_FLAG_UDP_IPV4_CSUM_ENABLE \
115 | HTT_MSDU_EXT_DESC_FLAG_UDP_IPV6_CSUM_ENABLE \
116 | HTT_MSDU_EXT_DESC_FLAG_TCP_IPV4_CSUM_ENABLE \
117 | HTT_MSDU_EXT_DESC_FLAG_TCP_IPV6_CSUM_ENABLE)
118
Kalle Valo5e3dd152013-06-12 20:52:10 +0300119enum htt_data_tx_desc_flags0 {
120 HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT = 1 << 0,
121 HTT_DATA_TX_DESC_FLAGS0_NO_AGGR = 1 << 1,
122 HTT_DATA_TX_DESC_FLAGS0_NO_ENCRYPT = 1 << 2,
123 HTT_DATA_TX_DESC_FLAGS0_NO_CLASSIFY = 1 << 3,
124 HTT_DATA_TX_DESC_FLAGS0_RSVD0 = 1 << 4
125#define HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE_MASK 0xE0
126#define HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE_LSB 5
127};
128
129enum htt_data_tx_desc_flags1 {
130#define HTT_DATA_TX_DESC_FLAGS1_VDEV_ID_BITS 6
131#define HTT_DATA_TX_DESC_FLAGS1_VDEV_ID_MASK 0x003F
132#define HTT_DATA_TX_DESC_FLAGS1_VDEV_ID_LSB 0
133#define HTT_DATA_TX_DESC_FLAGS1_EXT_TID_BITS 5
134#define HTT_DATA_TX_DESC_FLAGS1_EXT_TID_MASK 0x07C0
135#define HTT_DATA_TX_DESC_FLAGS1_EXT_TID_LSB 6
136 HTT_DATA_TX_DESC_FLAGS1_POSTPONED = 1 << 11,
137 HTT_DATA_TX_DESC_FLAGS1_MORE_IN_BATCH = 1 << 12,
138 HTT_DATA_TX_DESC_FLAGS1_CKSUM_L3_OFFLOAD = 1 << 13,
139 HTT_DATA_TX_DESC_FLAGS1_CKSUM_L4_OFFLOAD = 1 << 14,
140 HTT_DATA_TX_DESC_FLAGS1_RSVD1 = 1 << 15
141};
142
143enum htt_data_tx_ext_tid {
144 HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST = 16,
145 HTT_DATA_TX_EXT_TID_MGMT = 17,
146 HTT_DATA_TX_EXT_TID_INVALID = 31
147};
148
149#define HTT_INVALID_PEERID 0xFFFF
150
151/*
152 * htt_data_tx_desc - used for data tx path
153 *
154 * Note: vdev_id irrelevant for pkt_type == raw and no_classify == 1.
155 * ext_tid: for qos-data frames (0-15), see %HTT_DATA_TX_EXT_TID_
156 * for special kinds of tids
157 * postponed: only for HL hosts. indicates if this is a resend
158 * (HL hosts manage queues on the host )
159 * more_in_batch: only for HL hosts. indicates if more packets are
160 * pending. this allows target to wait and aggregate
Michal Kazior8d6d3622014-11-24 14:58:31 +0100161 * freq: 0 means home channel of given vdev. intended for offchannel
Kalle Valo5e3dd152013-06-12 20:52:10 +0300162 */
163struct htt_data_tx_desc {
164 u8 flags0; /* %HTT_DATA_TX_DESC_FLAGS0_ */
165 __le16 flags1; /* %HTT_DATA_TX_DESC_FLAGS1_ */
166 __le16 len;
167 __le16 id;
168 __le32 frags_paddr;
Michal Kazior8d6d3622014-11-24 14:58:31 +0100169 __le16 peerid;
170 __le16 freq;
Kalle Valo5e3dd152013-06-12 20:52:10 +0300171 u8 prefetch[0]; /* start of frame, for FW classification engine */
172} __packed;
173
174enum htt_rx_ring_flags {
175 HTT_RX_RING_FLAGS_MAC80211_HDR = 1 << 0,
176 HTT_RX_RING_FLAGS_MSDU_PAYLOAD = 1 << 1,
177 HTT_RX_RING_FLAGS_PPDU_START = 1 << 2,
178 HTT_RX_RING_FLAGS_PPDU_END = 1 << 3,
179 HTT_RX_RING_FLAGS_MPDU_START = 1 << 4,
180 HTT_RX_RING_FLAGS_MPDU_END = 1 << 5,
181 HTT_RX_RING_FLAGS_MSDU_START = 1 << 6,
182 HTT_RX_RING_FLAGS_MSDU_END = 1 << 7,
183 HTT_RX_RING_FLAGS_RX_ATTENTION = 1 << 8,
184 HTT_RX_RING_FLAGS_FRAG_INFO = 1 << 9,
185 HTT_RX_RING_FLAGS_UNICAST_RX = 1 << 10,
186 HTT_RX_RING_FLAGS_MULTICAST_RX = 1 << 11,
187 HTT_RX_RING_FLAGS_CTRL_RX = 1 << 12,
188 HTT_RX_RING_FLAGS_MGMT_RX = 1 << 13,
189 HTT_RX_RING_FLAGS_NULL_RX = 1 << 14,
190 HTT_RX_RING_FLAGS_PHY_DATA_RX = 1 << 15
191};
192
Michal Kaziorfe2407a2014-11-27 11:12:43 +0100193#define HTT_RX_RING_SIZE_MIN 128
194#define HTT_RX_RING_SIZE_MAX 2048
195
Kalle Valo5e3dd152013-06-12 20:52:10 +0300196struct htt_rx_ring_setup_ring {
197 __le32 fw_idx_shadow_reg_paddr;
198 __le32 rx_ring_base_paddr;
199 __le16 rx_ring_len; /* in 4-byte words */
200 __le16 rx_ring_bufsize; /* rx skb size - in bytes */
201 __le16 flags; /* %HTT_RX_RING_FLAGS_ */
202 __le16 fw_idx_init_val;
203
204 /* the following offsets are in 4-byte units */
205 __le16 mac80211_hdr_offset;
206 __le16 msdu_payload_offset;
207 __le16 ppdu_start_offset;
208 __le16 ppdu_end_offset;
209 __le16 mpdu_start_offset;
210 __le16 mpdu_end_offset;
211 __le16 msdu_start_offset;
212 __le16 msdu_end_offset;
213 __le16 rx_attention_offset;
214 __le16 frag_info_offset;
215} __packed;
216
217struct htt_rx_ring_setup_hdr {
218 u8 num_rings; /* supported values: 1, 2 */
219 __le16 rsvd0;
220} __packed;
221
222struct htt_rx_ring_setup {
223 struct htt_rx_ring_setup_hdr hdr;
224 struct htt_rx_ring_setup_ring rings[0];
225} __packed;
226
227/*
228 * htt_stats_req - request target to send specified statistics
229 *
230 * @msg_type: hardcoded %HTT_H2T_MSG_TYPE_STATS_REQ
231 * @upload_types: see %htt_dbg_stats_type. this is 24bit field actually
232 * so make sure its little-endian.
233 * @reset_types: see %htt_dbg_stats_type. this is 24bit field actually
234 * so make sure its little-endian.
235 * @cfg_val: stat_type specific configuration
236 * @stat_type: see %htt_dbg_stats_type
237 * @cookie_lsb: used for confirmation message from target->host
238 * @cookie_msb: ditto as %cookie
239 */
240struct htt_stats_req {
241 u8 upload_types[3];
242 u8 rsvd0;
243 u8 reset_types[3];
244 struct {
245 u8 mpdu_bytes;
246 u8 mpdu_num_msdus;
247 u8 msdu_bytes;
248 } __packed;
249 u8 stat_type;
250 __le32 cookie_lsb;
251 __le32 cookie_msb;
252} __packed;
253
254#define HTT_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
255
256/*
257 * htt_oob_sync_req - request out-of-band sync
258 *
259 * The HTT SYNC tells the target to suspend processing of subsequent
260 * HTT host-to-target messages until some other target agent locally
261 * informs the target HTT FW that the current sync counter is equal to
262 * or greater than (in a modulo sense) the sync counter specified in
263 * the SYNC message.
264 *
265 * This allows other host-target components to synchronize their operation
266 * with HTT, e.g. to ensure that tx frames don't get transmitted until a
267 * security key has been downloaded to and activated by the target.
268 * In the absence of any explicit synchronization counter value
269 * specification, the target HTT FW will use zero as the default current
270 * sync value.
271 *
272 * The HTT target FW will suspend its host->target message processing as long
273 * as 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128.
274 */
275struct htt_oob_sync_req {
276 u8 sync_count;
277 __le16 rsvd0;
278} __packed;
279
Kalle Valo5e3dd152013-06-12 20:52:10 +0300280struct htt_aggr_conf {
281 u8 max_num_ampdu_subframes;
Janusz Dziedzicd3856232014-06-02 21:19:46 +0300282 /* amsdu_subframes is limited by 0x1F mask */
283 u8 max_num_amsdu_subframes;
Kalle Valo5e3dd152013-06-12 20:52:10 +0300284} __packed;
285
286#define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
287
288struct htt_mgmt_tx_desc {
289 u8 pad[sizeof(u32) - sizeof(struct htt_cmd_hdr)];
290 __le32 msdu_paddr;
291 __le32 desc_id;
292 __le32 len;
293 __le32 vdev_id;
294 u8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN];
295} __packed;
296
297enum htt_mgmt_tx_status {
298 HTT_MGMT_TX_STATUS_OK = 0,
299 HTT_MGMT_TX_STATUS_RETRY = 1,
300 HTT_MGMT_TX_STATUS_DROP = 2
301};
302
303/*=== target -> host messages ===============================================*/
304
Rajkumar Manoharan8348db22015-03-25 13:12:27 +0200305enum htt_main_t2h_msg_type {
306 HTT_MAIN_T2H_MSG_TYPE_VERSION_CONF = 0x0,
307 HTT_MAIN_T2H_MSG_TYPE_RX_IND = 0x1,
308 HTT_MAIN_T2H_MSG_TYPE_RX_FLUSH = 0x2,
309 HTT_MAIN_T2H_MSG_TYPE_PEER_MAP = 0x3,
310 HTT_MAIN_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
311 HTT_MAIN_T2H_MSG_TYPE_RX_ADDBA = 0x5,
312 HTT_MAIN_T2H_MSG_TYPE_RX_DELBA = 0x6,
313 HTT_MAIN_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
314 HTT_MAIN_T2H_MSG_TYPE_PKTLOG = 0x8,
315 HTT_MAIN_T2H_MSG_TYPE_STATS_CONF = 0x9,
316 HTT_MAIN_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
317 HTT_MAIN_T2H_MSG_TYPE_SEC_IND = 0xb,
318 HTT_MAIN_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
319 HTT_MAIN_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
320 HTT_MAIN_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
321 HTT_MAIN_T2H_MSG_TYPE_RX_PN_IND = 0x10,
322 HTT_MAIN_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
323 HTT_MAIN_T2H_MSG_TYPE_TEST,
324 /* keep this last */
325 HTT_MAIN_T2H_NUM_MSGS
326};
327
328enum htt_10x_t2h_msg_type {
329 HTT_10X_T2H_MSG_TYPE_VERSION_CONF = 0x0,
330 HTT_10X_T2H_MSG_TYPE_RX_IND = 0x1,
331 HTT_10X_T2H_MSG_TYPE_RX_FLUSH = 0x2,
332 HTT_10X_T2H_MSG_TYPE_PEER_MAP = 0x3,
333 HTT_10X_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
334 HTT_10X_T2H_MSG_TYPE_RX_ADDBA = 0x5,
335 HTT_10X_T2H_MSG_TYPE_RX_DELBA = 0x6,
336 HTT_10X_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
337 HTT_10X_T2H_MSG_TYPE_PKTLOG = 0x8,
338 HTT_10X_T2H_MSG_TYPE_STATS_CONF = 0x9,
339 HTT_10X_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
340 HTT_10X_T2H_MSG_TYPE_SEC_IND = 0xb,
341 HTT_10X_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc,
342 HTT_10X_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
343 HTT_10X_T2H_MSG_TYPE_TEST = 0xe,
344 HTT_10X_T2H_MSG_TYPE_CHAN_CHANGE = 0xf,
345 HTT_10X_T2H_MSG_TYPE_AGGR_CONF = 0x11,
346 HTT_10X_T2H_MSG_TYPE_STATS_NOUPLOAD = 0x12,
347 HTT_10X_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0x13,
348 /* keep this last */
349 HTT_10X_T2H_NUM_MSGS
350};
351
352enum htt_tlv_t2h_msg_type {
353 HTT_TLV_T2H_MSG_TYPE_VERSION_CONF = 0x0,
354 HTT_TLV_T2H_MSG_TYPE_RX_IND = 0x1,
355 HTT_TLV_T2H_MSG_TYPE_RX_FLUSH = 0x2,
356 HTT_TLV_T2H_MSG_TYPE_PEER_MAP = 0x3,
357 HTT_TLV_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
358 HTT_TLV_T2H_MSG_TYPE_RX_ADDBA = 0x5,
359 HTT_TLV_T2H_MSG_TYPE_RX_DELBA = 0x6,
360 HTT_TLV_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
361 HTT_TLV_T2H_MSG_TYPE_PKTLOG = 0x8,
362 HTT_TLV_T2H_MSG_TYPE_STATS_CONF = 0x9,
363 HTT_TLV_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
364 HTT_TLV_T2H_MSG_TYPE_SEC_IND = 0xb,
365 HTT_TLV_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* deprecated */
366 HTT_TLV_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
367 HTT_TLV_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
368 HTT_TLV_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
369 HTT_TLV_T2H_MSG_TYPE_RX_PN_IND = 0x10,
370 HTT_TLV_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
371 HTT_TLV_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
Michal Kaziorc545070e2015-01-24 12:14:48 +0200372 /* 0x13 reservd */
Rajkumar Manoharan8348db22015-03-25 13:12:27 +0200373 HTT_TLV_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
374 HTT_TLV_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
375 HTT_TLV_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
376 HTT_TLV_T2H_MSG_TYPE_TEST,
377 /* keep this last */
378 HTT_TLV_T2H_NUM_MSGS
379};
Michal Kaziorc545070e2015-01-24 12:14:48 +0200380
Raja Mani721ad3c2015-06-22 20:22:24 +0530381enum htt_10_4_t2h_msg_type {
382 HTT_10_4_T2H_MSG_TYPE_VERSION_CONF = 0x0,
383 HTT_10_4_T2H_MSG_TYPE_RX_IND = 0x1,
384 HTT_10_4_T2H_MSG_TYPE_RX_FLUSH = 0x2,
385 HTT_10_4_T2H_MSG_TYPE_PEER_MAP = 0x3,
386 HTT_10_4_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
387 HTT_10_4_T2H_MSG_TYPE_RX_ADDBA = 0x5,
388 HTT_10_4_T2H_MSG_TYPE_RX_DELBA = 0x6,
389 HTT_10_4_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
390 HTT_10_4_T2H_MSG_TYPE_PKTLOG = 0x8,
391 HTT_10_4_T2H_MSG_TYPE_STATS_CONF = 0x9,
392 HTT_10_4_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
393 HTT_10_4_T2H_MSG_TYPE_SEC_IND = 0xb,
394 HTT_10_4_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc,
395 HTT_10_4_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
396 HTT_10_4_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
397 HTT_10_4_T2H_MSG_TYPE_CHAN_CHANGE = 0xf,
398 HTT_10_4_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0x10,
399 HTT_10_4_T2H_MSG_TYPE_RX_PN_IND = 0x11,
400 HTT_10_4_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x12,
401 HTT_10_4_T2H_MSG_TYPE_TEST = 0x13,
402 HTT_10_4_T2H_MSG_TYPE_EN_STATS = 0x14,
403 HTT_10_4_T2H_MSG_TYPE_AGGR_CONF = 0x15,
404 HTT_10_4_T2H_MSG_TYPE_TX_FETCH_IND = 0x16,
405 HTT_10_4_T2H_MSG_TYPE_TX_FETCH_CONF = 0x17,
406 HTT_10_4_T2H_MSG_TYPE_STATS_NOUPLOAD = 0x18,
407 /* 0x19 to 0x2f are reserved */
408 HTT_10_4_T2H_MSG_TYPE_TX_LOW_LATENCY_IND = 0x30,
409 /* keep this last */
410 HTT_10_4_T2H_NUM_MSGS
411};
412
Rajkumar Manoharan8348db22015-03-25 13:12:27 +0200413enum htt_t2h_msg_type {
414 HTT_T2H_MSG_TYPE_VERSION_CONF,
415 HTT_T2H_MSG_TYPE_RX_IND,
416 HTT_T2H_MSG_TYPE_RX_FLUSH,
417 HTT_T2H_MSG_TYPE_PEER_MAP,
418 HTT_T2H_MSG_TYPE_PEER_UNMAP,
419 HTT_T2H_MSG_TYPE_RX_ADDBA,
420 HTT_T2H_MSG_TYPE_RX_DELBA,
421 HTT_T2H_MSG_TYPE_TX_COMPL_IND,
422 HTT_T2H_MSG_TYPE_PKTLOG,
423 HTT_T2H_MSG_TYPE_STATS_CONF,
424 HTT_T2H_MSG_TYPE_RX_FRAG_IND,
425 HTT_T2H_MSG_TYPE_SEC_IND,
426 HTT_T2H_MSG_TYPE_RC_UPDATE_IND,
427 HTT_T2H_MSG_TYPE_TX_INSPECT_IND,
428 HTT_T2H_MSG_TYPE_MGMT_TX_COMPLETION,
429 HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND,
430 HTT_T2H_MSG_TYPE_RX_PN_IND,
431 HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND,
432 HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND,
433 HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE,
434 HTT_T2H_MSG_TYPE_CHAN_CHANGE,
435 HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR,
436 HTT_T2H_MSG_TYPE_AGGR_CONF,
437 HTT_T2H_MSG_TYPE_STATS_NOUPLOAD,
Kalle Valo5e3dd152013-06-12 20:52:10 +0300438 HTT_T2H_MSG_TYPE_TEST,
Raja Mani721ad3c2015-06-22 20:22:24 +0530439 HTT_T2H_MSG_TYPE_EN_STATS,
440 HTT_T2H_MSG_TYPE_TX_FETCH_IND,
441 HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
442 HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND,
Kalle Valo5e3dd152013-06-12 20:52:10 +0300443 /* keep this last */
444 HTT_T2H_NUM_MSGS
445};
446
447/*
448 * htt_resp_hdr - header for target-to-host messages
449 *
450 * msg_type: see htt_t2h_msg_type
451 */
452struct htt_resp_hdr {
453 u8 msg_type;
454} __packed;
455
456#define HTT_RESP_HDR_MSG_TYPE_OFFSET 0
457#define HTT_RESP_HDR_MSG_TYPE_MASK 0xff
458#define HTT_RESP_HDR_MSG_TYPE_LSB 0
459
460/* htt_ver_resp - response sent for htt_ver_req */
461struct htt_ver_resp {
462 u8 minor;
463 u8 major;
464 u8 rsvd0;
465} __packed;
466
467struct htt_mgmt_tx_completion {
468 u8 rsvd0;
469 u8 rsvd1;
470 u8 rsvd2;
471 __le32 desc_id;
472 __le32 status;
473} __packed;
474
475#define HTT_RX_INDICATION_INFO0_EXT_TID_MASK (0x3F)
476#define HTT_RX_INDICATION_INFO0_EXT_TID_LSB (0)
477#define HTT_RX_INDICATION_INFO0_FLUSH_VALID (1 << 6)
478#define HTT_RX_INDICATION_INFO0_RELEASE_VALID (1 << 7)
479
480#define HTT_RX_INDICATION_INFO1_FLUSH_START_SEQNO_MASK 0x0000003F
481#define HTT_RX_INDICATION_INFO1_FLUSH_START_SEQNO_LSB 0
482#define HTT_RX_INDICATION_INFO1_FLUSH_END_SEQNO_MASK 0x00000FC0
483#define HTT_RX_INDICATION_INFO1_FLUSH_END_SEQNO_LSB 6
484#define HTT_RX_INDICATION_INFO1_RELEASE_START_SEQNO_MASK 0x0003F000
485#define HTT_RX_INDICATION_INFO1_RELEASE_START_SEQNO_LSB 12
486#define HTT_RX_INDICATION_INFO1_RELEASE_END_SEQNO_MASK 0x00FC0000
487#define HTT_RX_INDICATION_INFO1_RELEASE_END_SEQNO_LSB 18
488#define HTT_RX_INDICATION_INFO1_NUM_MPDU_RANGES_MASK 0xFF000000
489#define HTT_RX_INDICATION_INFO1_NUM_MPDU_RANGES_LSB 24
490
491struct htt_rx_indication_hdr {
492 u8 info0; /* %HTT_RX_INDICATION_INFO0_ */
493 __le16 peer_id;
494 __le32 info1; /* %HTT_RX_INDICATION_INFO1_ */
495} __packed;
496
497#define HTT_RX_INDICATION_INFO0_PHY_ERR_VALID (1 << 0)
498#define HTT_RX_INDICATION_INFO0_LEGACY_RATE_MASK (0x1E)
499#define HTT_RX_INDICATION_INFO0_LEGACY_RATE_LSB (1)
500#define HTT_RX_INDICATION_INFO0_LEGACY_RATE_CCK (1 << 5)
501#define HTT_RX_INDICATION_INFO0_END_VALID (1 << 6)
502#define HTT_RX_INDICATION_INFO0_START_VALID (1 << 7)
503
504#define HTT_RX_INDICATION_INFO1_VHT_SIG_A1_MASK 0x00FFFFFF
505#define HTT_RX_INDICATION_INFO1_VHT_SIG_A1_LSB 0
506#define HTT_RX_INDICATION_INFO1_PREAMBLE_TYPE_MASK 0xFF000000
507#define HTT_RX_INDICATION_INFO1_PREAMBLE_TYPE_LSB 24
508
509#define HTT_RX_INDICATION_INFO2_VHT_SIG_A1_MASK 0x00FFFFFF
510#define HTT_RX_INDICATION_INFO2_VHT_SIG_A1_LSB 0
511#define HTT_RX_INDICATION_INFO2_SERVICE_MASK 0xFF000000
512#define HTT_RX_INDICATION_INFO2_SERVICE_LSB 24
513
514enum htt_rx_legacy_rate {
515 HTT_RX_OFDM_48 = 0,
516 HTT_RX_OFDM_24 = 1,
517 HTT_RX_OFDM_12,
518 HTT_RX_OFDM_6,
519 HTT_RX_OFDM_54,
520 HTT_RX_OFDM_36,
521 HTT_RX_OFDM_18,
522 HTT_RX_OFDM_9,
523
524 /* long preamble */
525 HTT_RX_CCK_11_LP = 0,
526 HTT_RX_CCK_5_5_LP = 1,
527 HTT_RX_CCK_2_LP,
528 HTT_RX_CCK_1_LP,
529 /* short preamble */
530 HTT_RX_CCK_11_SP,
531 HTT_RX_CCK_5_5_SP,
532 HTT_RX_CCK_2_SP
533};
534
535enum htt_rx_legacy_rate_type {
536 HTT_RX_LEGACY_RATE_OFDM = 0,
537 HTT_RX_LEGACY_RATE_CCK
538};
539
540enum htt_rx_preamble_type {
541 HTT_RX_LEGACY = 0x4,
542 HTT_RX_HT = 0x8,
543 HTT_RX_HT_WITH_TXBF = 0x9,
544 HTT_RX_VHT = 0xC,
545 HTT_RX_VHT_WITH_TXBF = 0xD,
546};
547
548/*
549 * Fields: phy_err_valid, phy_err_code, tsf,
550 * usec_timestamp, sub_usec_timestamp
551 * ..are valid only if end_valid == 1.
552 *
553 * Fields: rssi_chains, legacy_rate_type,
554 * legacy_rate_cck, preamble_type, service,
555 * vht_sig_*
556 * ..are valid only if start_valid == 1;
557 */
558struct htt_rx_indication_ppdu {
559 u8 combined_rssi;
560 u8 sub_usec_timestamp;
561 u8 phy_err_code;
562 u8 info0; /* HTT_RX_INDICATION_INFO0_ */
563 struct {
564 u8 pri20_db;
565 u8 ext20_db;
566 u8 ext40_db;
567 u8 ext80_db;
568 } __packed rssi_chains[4];
569 __le32 tsf;
570 __le32 usec_timestamp;
571 __le32 info1; /* HTT_RX_INDICATION_INFO1_ */
572 __le32 info2; /* HTT_RX_INDICATION_INFO2_ */
573} __packed;
574
575enum htt_rx_mpdu_status {
576 HTT_RX_IND_MPDU_STATUS_UNKNOWN = 0x0,
577 HTT_RX_IND_MPDU_STATUS_OK,
578 HTT_RX_IND_MPDU_STATUS_ERR_FCS,
579 HTT_RX_IND_MPDU_STATUS_ERR_DUP,
580 HTT_RX_IND_MPDU_STATUS_ERR_REPLAY,
581 HTT_RX_IND_MPDU_STATUS_ERR_INV_PEER,
582 /* only accept EAPOL frames */
583 HTT_RX_IND_MPDU_STATUS_UNAUTH_PEER,
584 HTT_RX_IND_MPDU_STATUS_OUT_OF_SYNC,
585 /* Non-data in promiscous mode */
586 HTT_RX_IND_MPDU_STATUS_MGMT_CTRL,
587 HTT_RX_IND_MPDU_STATUS_TKIP_MIC_ERR,
588 HTT_RX_IND_MPDU_STATUS_DECRYPT_ERR,
589 HTT_RX_IND_MPDU_STATUS_MPDU_LENGTH_ERR,
590 HTT_RX_IND_MPDU_STATUS_ENCRYPT_REQUIRED_ERR,
591 HTT_RX_IND_MPDU_STATUS_PRIVACY_ERR,
592
593 /*
594 * MISC: discard for unspecified reasons.
595 * Leave this enum value last.
596 */
597 HTT_RX_IND_MPDU_STATUS_ERR_MISC = 0xFF
598};
599
600struct htt_rx_indication_mpdu_range {
601 u8 mpdu_count;
602 u8 mpdu_range_status; /* %htt_rx_mpdu_status */
603 u8 pad0;
604 u8 pad1;
605} __packed;
606
607struct htt_rx_indication_prefix {
608 __le16 fw_rx_desc_bytes;
609 u8 pad0;
610 u8 pad1;
611};
612
613struct htt_rx_indication {
614 struct htt_rx_indication_hdr hdr;
615 struct htt_rx_indication_ppdu ppdu;
616 struct htt_rx_indication_prefix prefix;
617
618 /*
619 * the following fields are both dynamically sized, so
620 * take care addressing them
621 */
622
623 /* the size of this is %fw_rx_desc_bytes */
624 struct fw_rx_desc_base fw_desc;
625
626 /*
627 * %mpdu_ranges starts after &%prefix + roundup(%fw_rx_desc_bytes, 4)
628 * and has %num_mpdu_ranges elements.
629 */
630 struct htt_rx_indication_mpdu_range mpdu_ranges[0];
631} __packed;
632
633static inline struct htt_rx_indication_mpdu_range *
634 htt_rx_ind_get_mpdu_ranges(struct htt_rx_indication *rx_ind)
635{
636 void *ptr = rx_ind;
637
638 ptr += sizeof(rx_ind->hdr)
639 + sizeof(rx_ind->ppdu)
640 + sizeof(rx_ind->prefix)
641 + roundup(__le16_to_cpu(rx_ind->prefix.fw_rx_desc_bytes), 4);
642 return ptr;
643}
644
645enum htt_rx_flush_mpdu_status {
646 HTT_RX_FLUSH_MPDU_DISCARD = 0,
647 HTT_RX_FLUSH_MPDU_REORDER = 1,
648};
649
650/*
651 * htt_rx_flush - discard or reorder given range of mpdus
652 *
653 * Note: host must check if all sequence numbers between
654 * [seq_num_start, seq_num_end-1] are valid.
655 */
656struct htt_rx_flush {
657 __le16 peer_id;
658 u8 tid;
659 u8 rsvd0;
660 u8 mpdu_status; /* %htt_rx_flush_mpdu_status */
661 u8 seq_num_start; /* it is 6 LSBs of 802.11 seq no */
662 u8 seq_num_end; /* it is 6 LSBs of 802.11 seq no */
663};
664
665struct htt_rx_peer_map {
666 u8 vdev_id;
667 __le16 peer_id;
668 u8 addr[6];
669 u8 rsvd0;
670 u8 rsvd1;
671} __packed;
672
673struct htt_rx_peer_unmap {
674 u8 rsvd0;
675 __le16 peer_id;
676} __packed;
677
678enum htt_security_types {
679 HTT_SECURITY_NONE,
680 HTT_SECURITY_WEP128,
681 HTT_SECURITY_WEP104,
682 HTT_SECURITY_WEP40,
683 HTT_SECURITY_TKIP,
684 HTT_SECURITY_TKIP_NOMIC,
685 HTT_SECURITY_AES_CCMP,
686 HTT_SECURITY_WAPI,
687
688 HTT_NUM_SECURITY_TYPES /* keep this last! */
689};
690
691enum htt_security_flags {
692#define HTT_SECURITY_TYPE_MASK 0x7F
693#define HTT_SECURITY_TYPE_LSB 0
694 HTT_SECURITY_IS_UNICAST = 1 << 7
695};
696
697struct htt_security_indication {
698 union {
699 /* dont use bitfields; undefined behaviour */
700 u8 flags; /* %htt_security_flags */
701 struct {
702 u8 security_type:7, /* %htt_security_types */
703 is_unicast:1;
704 } __packed;
705 } __packed;
706 __le16 peer_id;
707 u8 michael_key[8];
708 u8 wapi_rsc[16];
709} __packed;
710
711#define HTT_RX_BA_INFO0_TID_MASK 0x000F
712#define HTT_RX_BA_INFO0_TID_LSB 0
713#define HTT_RX_BA_INFO0_PEER_ID_MASK 0xFFF0
714#define HTT_RX_BA_INFO0_PEER_ID_LSB 4
715
716struct htt_rx_addba {
717 u8 window_size;
718 __le16 info0; /* %HTT_RX_BA_INFO0_ */
719} __packed;
720
721struct htt_rx_delba {
722 u8 rsvd0;
723 __le16 info0; /* %HTT_RX_BA_INFO0_ */
724} __packed;
725
726enum htt_data_tx_status {
727 HTT_DATA_TX_STATUS_OK = 0,
728 HTT_DATA_TX_STATUS_DISCARD = 1,
729 HTT_DATA_TX_STATUS_NO_ACK = 2,
730 HTT_DATA_TX_STATUS_POSTPONE = 3, /* HL only */
731 HTT_DATA_TX_STATUS_DOWNLOAD_FAIL = 128
732};
733
734enum htt_data_tx_flags {
735#define HTT_DATA_TX_STATUS_MASK 0x07
736#define HTT_DATA_TX_STATUS_LSB 0
737#define HTT_DATA_TX_TID_MASK 0x78
738#define HTT_DATA_TX_TID_LSB 3
739 HTT_DATA_TX_TID_INVALID = 1 << 7
740};
741
742#define HTT_TX_COMPL_INV_MSDU_ID 0xFFFF
743
744struct htt_data_tx_completion {
745 union {
746 u8 flags;
747 struct {
748 u8 status:3,
749 tid:4,
750 tid_invalid:1;
751 } __packed;
752 } __packed;
753 u8 num_msdus;
754 u8 rsvd0;
755 __le16 msdus[0]; /* variable length based on %num_msdus */
756} __packed;
757
758struct htt_tx_compl_ind_base {
759 u32 hdr;
760 u16 payload[1/*or more*/];
761} __packed;
762
763struct htt_rc_tx_done_params {
764 u32 rate_code;
765 u32 rate_code_flags;
766 u32 flags;
767 u32 num_enqued; /* 1 for non-AMPDU */
768 u32 num_retries;
769 u32 num_failed; /* for AMPDU */
770 u32 ack_rssi;
771 u32 time_stamp;
772 u32 is_probe;
773};
774
775struct htt_rc_update {
776 u8 vdev_id;
777 __le16 peer_id;
778 u8 addr[6];
779 u8 num_elems;
780 u8 rsvd0;
781 struct htt_rc_tx_done_params params[0]; /* variable length %num_elems */
782} __packed;
783
784/* see htt_rx_indication for similar fields and descriptions */
785struct htt_rx_fragment_indication {
786 union {
787 u8 info0; /* %HTT_RX_FRAG_IND_INFO0_ */
788 struct {
789 u8 ext_tid:5,
790 flush_valid:1;
791 } __packed;
792 } __packed;
793 __le16 peer_id;
794 __le32 info1; /* %HTT_RX_FRAG_IND_INFO1_ */
795 __le16 fw_rx_desc_bytes;
796 __le16 rsvd0;
797
798 u8 fw_msdu_rx_desc[0];
799} __packed;
800
801#define HTT_RX_FRAG_IND_INFO0_EXT_TID_MASK 0x1F
802#define HTT_RX_FRAG_IND_INFO0_EXT_TID_LSB 0
803#define HTT_RX_FRAG_IND_INFO0_FLUSH_VALID_MASK 0x20
804#define HTT_RX_FRAG_IND_INFO0_FLUSH_VALID_LSB 5
805
806#define HTT_RX_FRAG_IND_INFO1_FLUSH_SEQ_NUM_START_MASK 0x0000003F
807#define HTT_RX_FRAG_IND_INFO1_FLUSH_SEQ_NUM_START_LSB 0
808#define HTT_RX_FRAG_IND_INFO1_FLUSH_SEQ_NUM_END_MASK 0x00000FC0
809#define HTT_RX_FRAG_IND_INFO1_FLUSH_SEQ_NUM_END_LSB 6
810
Michal Kaziorc545070e2015-01-24 12:14:48 +0200811struct htt_rx_pn_ind {
812 __le16 peer_id;
813 u8 tid;
814 u8 seqno_start;
815 u8 seqno_end;
816 u8 pn_ie_count;
817 u8 reserved;
818 u8 pn_ies[0];
819} __packed;
820
821struct htt_rx_offload_msdu {
822 __le16 msdu_len;
823 __le16 peer_id;
824 u8 vdev_id;
825 u8 tid;
826 u8 fw_desc;
827 u8 payload[0];
828} __packed;
829
830struct htt_rx_offload_ind {
831 u8 reserved;
832 __le16 msdu_count;
833} __packed;
834
835struct htt_rx_in_ord_msdu_desc {
836 __le32 msdu_paddr;
837 __le16 msdu_len;
838 u8 fw_desc;
839 u8 reserved;
840} __packed;
841
842struct htt_rx_in_ord_ind {
843 u8 info;
844 __le16 peer_id;
845 u8 vdev_id;
846 u8 reserved;
847 __le16 msdu_count;
848 struct htt_rx_in_ord_msdu_desc msdu_descs[0];
849} __packed;
850
851#define HTT_RX_IN_ORD_IND_INFO_TID_MASK 0x0000001f
852#define HTT_RX_IN_ORD_IND_INFO_TID_LSB 0
853#define HTT_RX_IN_ORD_IND_INFO_OFFLOAD_MASK 0x00000020
854#define HTT_RX_IN_ORD_IND_INFO_OFFLOAD_LSB 5
855#define HTT_RX_IN_ORD_IND_INFO_FRAG_MASK 0x00000040
856#define HTT_RX_IN_ORD_IND_INFO_FRAG_LSB 6
857
Kalle Valo5e3dd152013-06-12 20:52:10 +0300858/*
859 * target -> host test message definition
860 *
861 * The following field definitions describe the format of the test
862 * message sent from the target to the host.
863 * The message consists of a 4-octet header, followed by a variable
864 * number of 32-bit integer values, followed by a variable number
865 * of 8-bit character values.
866 *
867 * |31 16|15 8|7 0|
868 * |-----------------------------------------------------------|
869 * | num chars | num ints | msg type |
870 * |-----------------------------------------------------------|
871 * | int 0 |
872 * |-----------------------------------------------------------|
873 * | int 1 |
874 * |-----------------------------------------------------------|
875 * | ... |
876 * |-----------------------------------------------------------|
877 * | char 3 | char 2 | char 1 | char 0 |
878 * |-----------------------------------------------------------|
879 * | | | ... | char 4 |
880 * |-----------------------------------------------------------|
881 * - MSG_TYPE
882 * Bits 7:0
883 * Purpose: identifies this as a test message
884 * Value: HTT_MSG_TYPE_TEST
885 * - NUM_INTS
886 * Bits 15:8
887 * Purpose: indicate how many 32-bit integers follow the message header
888 * - NUM_CHARS
889 * Bits 31:16
890 * Purpose: indicate how many 8-bit charaters follow the series of integers
891 */
892struct htt_rx_test {
893 u8 num_ints;
894 __le16 num_chars;
895
896 /* payload consists of 2 lists:
897 * a) num_ints * sizeof(__le32)
898 * b) num_chars * sizeof(u8) aligned to 4bytes */
899 u8 payload[0];
900} __packed;
901
902static inline __le32 *htt_rx_test_get_ints(struct htt_rx_test *rx_test)
903{
904 return (__le32 *)rx_test->payload;
905}
906
907static inline u8 *htt_rx_test_get_chars(struct htt_rx_test *rx_test)
908{
909 return rx_test->payload + (rx_test->num_ints * sizeof(__le32));
910}
911
912/*
913 * target -> host packet log message
914 *
915 * The following field definitions describe the format of the packet log
916 * message sent from the target to the host.
917 * The message consists of a 4-octet header,followed by a variable number
918 * of 32-bit character values.
919 *
920 * |31 24|23 16|15 8|7 0|
921 * |-----------------------------------------------------------|
922 * | | | | msg type |
923 * |-----------------------------------------------------------|
924 * | payload |
925 * |-----------------------------------------------------------|
926 * - MSG_TYPE
927 * Bits 7:0
928 * Purpose: identifies this as a test message
929 * Value: HTT_MSG_TYPE_PACKETLOG
930 */
931struct htt_pktlog_msg {
932 u8 pad[3];
Rajkumar Manoharanbfdd7932014-10-03 08:02:40 +0300933 u8 payload[0];
Kalle Valo5e3dd152013-06-12 20:52:10 +0300934} __packed;
935
936struct htt_dbg_stats_rx_reorder_stats {
937 /* Non QoS MPDUs received */
938 __le32 deliver_non_qos;
939
940 /* MPDUs received in-order */
941 __le32 deliver_in_order;
942
943 /* Flush due to reorder timer expired */
944 __le32 deliver_flush_timeout;
945
946 /* Flush due to move out of window */
947 __le32 deliver_flush_oow;
948
949 /* Flush due to DELBA */
950 __le32 deliver_flush_delba;
951
952 /* MPDUs dropped due to FCS error */
953 __le32 fcs_error;
954
955 /* MPDUs dropped due to monitor mode non-data packet */
956 __le32 mgmt_ctrl;
957
958 /* MPDUs dropped due to invalid peer */
959 __le32 invalid_peer;
960
961 /* MPDUs dropped due to duplication (non aggregation) */
962 __le32 dup_non_aggr;
963
964 /* MPDUs dropped due to processed before */
965 __le32 dup_past;
966
967 /* MPDUs dropped due to duplicate in reorder queue */
968 __le32 dup_in_reorder;
969
970 /* Reorder timeout happened */
971 __le32 reorder_timeout;
972
973 /* invalid bar ssn */
974 __le32 invalid_bar_ssn;
975
976 /* reorder reset due to bar ssn */
977 __le32 ssn_reset;
978};
979
980struct htt_dbg_stats_wal_tx_stats {
981 /* Num HTT cookies queued to dispatch list */
982 __le32 comp_queued;
983
984 /* Num HTT cookies dispatched */
985 __le32 comp_delivered;
986
987 /* Num MSDU queued to WAL */
988 __le32 msdu_enqued;
989
990 /* Num MPDU queue to WAL */
991 __le32 mpdu_enqued;
992
993 /* Num MSDUs dropped by WMM limit */
994 __le32 wmm_drop;
995
996 /* Num Local frames queued */
997 __le32 local_enqued;
998
999 /* Num Local frames done */
1000 __le32 local_freed;
1001
1002 /* Num queued to HW */
1003 __le32 hw_queued;
1004
1005 /* Num PPDU reaped from HW */
1006 __le32 hw_reaped;
1007
1008 /* Num underruns */
1009 __le32 underrun;
1010
1011 /* Num PPDUs cleaned up in TX abort */
1012 __le32 tx_abort;
1013
1014 /* Num MPDUs requed by SW */
1015 __le32 mpdus_requed;
1016
1017 /* excessive retries */
1018 __le32 tx_ko;
1019
1020 /* data hw rate code */
1021 __le32 data_rc;
1022
1023 /* Scheduler self triggers */
1024 __le32 self_triggers;
1025
1026 /* frames dropped due to excessive sw retries */
1027 __le32 sw_retry_failure;
1028
1029 /* illegal rate phy errors */
1030 __le32 illgl_rate_phy_err;
1031
1032 /* wal pdev continous xretry */
1033 __le32 pdev_cont_xretry;
1034
1035 /* wal pdev continous xretry */
1036 __le32 pdev_tx_timeout;
1037
1038 /* wal pdev resets */
1039 __le32 pdev_resets;
1040
1041 __le32 phy_underrun;
1042
1043 /* MPDU is more than txop limit */
1044 __le32 txop_ovf;
1045} __packed;
1046
1047struct htt_dbg_stats_wal_rx_stats {
1048 /* Cnts any change in ring routing mid-ppdu */
1049 __le32 mid_ppdu_route_change;
1050
1051 /* Total number of statuses processed */
1052 __le32 status_rcvd;
1053
1054 /* Extra frags on rings 0-3 */
1055 __le32 r0_frags;
1056 __le32 r1_frags;
1057 __le32 r2_frags;
1058 __le32 r3_frags;
1059
1060 /* MSDUs / MPDUs delivered to HTT */
1061 __le32 htt_msdus;
1062 __le32 htt_mpdus;
1063
1064 /* MSDUs / MPDUs delivered to local stack */
1065 __le32 loc_msdus;
1066 __le32 loc_mpdus;
1067
1068 /* AMSDUs that have more MSDUs than the status ring size */
1069 __le32 oversize_amsdu;
1070
1071 /* Number of PHY errors */
1072 __le32 phy_errs;
1073
1074 /* Number of PHY errors drops */
1075 __le32 phy_err_drop;
1076
1077 /* Number of mpdu errors - FCS, MIC, ENC etc. */
1078 __le32 mpdu_errs;
1079} __packed;
1080
1081struct htt_dbg_stats_wal_peer_stats {
1082 __le32 dummy; /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
1083} __packed;
1084
1085struct htt_dbg_stats_wal_pdev_txrx {
1086 struct htt_dbg_stats_wal_tx_stats tx_stats;
1087 struct htt_dbg_stats_wal_rx_stats rx_stats;
1088 struct htt_dbg_stats_wal_peer_stats peer_stats;
1089} __packed;
1090
1091struct htt_dbg_stats_rx_rate_info {
1092 __le32 mcs[10];
1093 __le32 sgi[10];
1094 __le32 nss[4];
1095 __le32 stbc[10];
1096 __le32 bw[3];
1097 __le32 pream[6];
1098 __le32 ldpc;
1099 __le32 txbf;
1100};
1101
1102/*
1103 * htt_dbg_stats_status -
1104 * present - The requested stats have been delivered in full.
1105 * This indicates that either the stats information was contained
1106 * in its entirety within this message, or else this message
1107 * completes the delivery of the requested stats info that was
1108 * partially delivered through earlier STATS_CONF messages.
1109 * partial - The requested stats have been delivered in part.
1110 * One or more subsequent STATS_CONF messages with the same
1111 * cookie value will be sent to deliver the remainder of the
1112 * information.
1113 * error - The requested stats could not be delivered, for example due
1114 * to a shortage of memory to construct a message holding the
1115 * requested stats.
1116 * invalid - The requested stat type is either not recognized, or the
1117 * target is configured to not gather the stats type in question.
1118 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1119 * series_done - This special value indicates that no further stats info
1120 * elements are present within a series of stats info elems
1121 * (within a stats upload confirmation message).
1122 */
1123enum htt_dbg_stats_status {
1124 HTT_DBG_STATS_STATUS_PRESENT = 0,
1125 HTT_DBG_STATS_STATUS_PARTIAL = 1,
1126 HTT_DBG_STATS_STATUS_ERROR = 2,
1127 HTT_DBG_STATS_STATUS_INVALID = 3,
1128 HTT_DBG_STATS_STATUS_SERIES_DONE = 7
1129};
1130
1131/*
1132 * target -> host statistics upload
1133 *
1134 * The following field definitions describe the format of the HTT target
1135 * to host stats upload confirmation message.
1136 * The message contains a cookie echoed from the HTT host->target stats
1137 * upload request, which identifies which request the confirmation is
1138 * for, and a series of tag-length-value stats information elements.
1139 * The tag-length header for each stats info element also includes a
1140 * status field, to indicate whether the request for the stat type in
1141 * question was fully met, partially met, unable to be met, or invalid
1142 * (if the stat type in question is disabled in the target).
1143 * A special value of all 1's in this status field is used to indicate
1144 * the end of the series of stats info elements.
1145 *
1146 *
1147 * |31 16|15 8|7 5|4 0|
1148 * |------------------------------------------------------------|
1149 * | reserved | msg type |
1150 * |------------------------------------------------------------|
1151 * | cookie LSBs |
1152 * |------------------------------------------------------------|
1153 * | cookie MSBs |
1154 * |------------------------------------------------------------|
1155 * | stats entry length | reserved | S |stat type|
1156 * |------------------------------------------------------------|
1157 * | |
1158 * | type-specific stats info |
1159 * | |
1160 * |------------------------------------------------------------|
1161 * | stats entry length | reserved | S |stat type|
1162 * |------------------------------------------------------------|
1163 * | |
1164 * | type-specific stats info |
1165 * | |
1166 * |------------------------------------------------------------|
1167 * | n/a | reserved | 111 | n/a |
1168 * |------------------------------------------------------------|
1169 * Header fields:
1170 * - MSG_TYPE
1171 * Bits 7:0
1172 * Purpose: identifies this is a statistics upload confirmation message
1173 * Value: 0x9
1174 * - COOKIE_LSBS
1175 * Bits 31:0
1176 * Purpose: Provide a mechanism to match a target->host stats confirmation
1177 * message with its preceding host->target stats request message.
1178 * Value: LSBs of the opaque cookie specified by the host-side requestor
1179 * - COOKIE_MSBS
1180 * Bits 31:0
1181 * Purpose: Provide a mechanism to match a target->host stats confirmation
1182 * message with its preceding host->target stats request message.
1183 * Value: MSBs of the opaque cookie specified by the host-side requestor
1184 *
1185 * Stats Information Element tag-length header fields:
1186 * - STAT_TYPE
1187 * Bits 4:0
1188 * Purpose: identifies the type of statistics info held in the
1189 * following information element
1190 * Value: htt_dbg_stats_type
1191 * - STATUS
1192 * Bits 7:5
1193 * Purpose: indicate whether the requested stats are present
1194 * Value: htt_dbg_stats_status, including a special value (0x7) to mark
1195 * the completion of the stats entry series
1196 * - LENGTH
1197 * Bits 31:16
1198 * Purpose: indicate the stats information size
1199 * Value: This field specifies the number of bytes of stats information
1200 * that follows the element tag-length header.
1201 * It is expected but not required that this length is a multiple of
1202 * 4 bytes. Even if the length is not an integer multiple of 4, the
1203 * subsequent stats entry header will begin on a 4-byte aligned
1204 * boundary.
1205 */
1206
1207#define HTT_STATS_CONF_ITEM_INFO_STAT_TYPE_MASK 0x1F
1208#define HTT_STATS_CONF_ITEM_INFO_STAT_TYPE_LSB 0
1209#define HTT_STATS_CONF_ITEM_INFO_STATUS_MASK 0xE0
1210#define HTT_STATS_CONF_ITEM_INFO_STATUS_LSB 5
1211
1212struct htt_stats_conf_item {
1213 union {
1214 u8 info;
1215 struct {
1216 u8 stat_type:5; /* %HTT_DBG_STATS_ */
1217 u8 status:3; /* %HTT_DBG_STATS_STATUS_ */
1218 } __packed;
1219 } __packed;
1220 u8 pad;
1221 __le16 length;
1222 u8 payload[0]; /* roundup(length, 4) long */
1223} __packed;
1224
1225struct htt_stats_conf {
1226 u8 pad[3];
1227 __le32 cookie_lsb;
1228 __le32 cookie_msb;
1229
1230 /* each item has variable length! */
1231 struct htt_stats_conf_item items[0];
1232} __packed;
1233
1234static inline struct htt_stats_conf_item *htt_stats_conf_next_item(
1235 const struct htt_stats_conf_item *item)
1236{
1237 return (void *)item + sizeof(*item) + roundup(item->length, 4);
1238}
Kalle Valo8cc7f262014-09-14 12:50:39 +03001239
Kalle Valo5e3dd152013-06-12 20:52:10 +03001240/*
1241 * host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
1242 *
1243 * The following field definitions describe the format of the HTT host
1244 * to target frag_desc/msdu_ext bank configuration message.
1245 * The message contains the based address and the min and max id of the
1246 * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
1247 * MSDU_EXT/FRAG_DESC.
1248 * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
1249 * For QCA988X HW the firmware will use fragment_desc_ptr but in WIFI2.0
1250 * the hardware does the mapping/translation.
1251 *
1252 * Total banks that can be configured is configured to 16.
1253 *
1254 * This should be called before any TX has be initiated by the HTT
1255 *
1256 * |31 16|15 8|7 5|4 0|
1257 * |------------------------------------------------------------|
1258 * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
1259 * |------------------------------------------------------------|
1260 * | BANK0_BASE_ADDRESS |
1261 * |------------------------------------------------------------|
1262 * | ... |
1263 * |------------------------------------------------------------|
1264 * | BANK15_BASE_ADDRESS |
1265 * |------------------------------------------------------------|
1266 * | BANK0_MAX_ID | BANK0_MIN_ID |
1267 * |------------------------------------------------------------|
1268 * | ... |
1269 * |------------------------------------------------------------|
1270 * | BANK15_MAX_ID | BANK15_MIN_ID |
1271 * |------------------------------------------------------------|
1272 * Header fields:
1273 * - MSG_TYPE
1274 * Bits 7:0
1275 * Value: 0x6
1276 * - BANKx_BASE_ADDRESS
1277 * Bits 31:0
1278 * Purpose: Provide a mechanism to specify the base address of the MSDU_EXT
1279 * bank physical/bus address.
1280 * - BANKx_MIN_ID
1281 * Bits 15:0
1282 * Purpose: Provide a mechanism to specify the min index that needs to
1283 * mapped.
1284 * - BANKx_MAX_ID
1285 * Bits 31:16
1286 * Purpose: Provide a mechanism to specify the max index that needs to
1287 *
1288 */
1289struct htt_frag_desc_bank_id {
1290 __le16 bank_min_id;
1291 __le16 bank_max_id;
1292} __packed;
1293
1294/* real is 16 but it wouldn't fit in the max htt message size
1295 * so we use a conservatively safe value for now */
1296#define HTT_FRAG_DESC_BANK_MAX 4
1297
1298#define HTT_FRAG_DESC_BANK_CFG_INFO_PDEV_ID_MASK 0x03
1299#define HTT_FRAG_DESC_BANK_CFG_INFO_PDEV_ID_LSB 0
1300#define HTT_FRAG_DESC_BANK_CFG_INFO_SWAP (1 << 2)
1301
1302struct htt_frag_desc_bank_cfg {
1303 u8 info; /* HTT_FRAG_DESC_BANK_CFG_INFO_ */
1304 u8 num_banks;
1305 u8 desc_size;
1306 __le32 bank_base_addrs[HTT_FRAG_DESC_BANK_MAX];
1307 struct htt_frag_desc_bank_id bank_id[HTT_FRAG_DESC_BANK_MAX];
1308} __packed;
1309
1310union htt_rx_pn_t {
1311 /* WEP: 24-bit PN */
1312 u32 pn24;
1313
1314 /* TKIP or CCMP: 48-bit PN */
1315 u_int64_t pn48;
1316
1317 /* WAPI: 128-bit PN */
1318 u_int64_t pn128[2];
1319};
1320
1321struct htt_cmd {
1322 struct htt_cmd_hdr hdr;
1323 union {
1324 struct htt_ver_req ver_req;
1325 struct htt_mgmt_tx_desc mgmt_tx;
1326 struct htt_data_tx_desc data_tx;
1327 struct htt_rx_ring_setup rx_setup;
1328 struct htt_stats_req stats_req;
1329 struct htt_oob_sync_req oob_sync_req;
1330 struct htt_aggr_conf aggr_conf;
1331 struct htt_frag_desc_bank_cfg frag_desc_bank_cfg;
1332 };
1333} __packed;
1334
1335struct htt_resp {
1336 struct htt_resp_hdr hdr;
1337 union {
1338 struct htt_ver_resp ver_resp;
1339 struct htt_mgmt_tx_completion mgmt_tx_completion;
1340 struct htt_data_tx_completion data_tx_completion;
1341 struct htt_rx_indication rx_ind;
1342 struct htt_rx_fragment_indication rx_frag_ind;
1343 struct htt_rx_peer_map peer_map;
1344 struct htt_rx_peer_unmap peer_unmap;
1345 struct htt_rx_flush rx_flush;
1346 struct htt_rx_addba rx_addba;
1347 struct htt_rx_delba rx_delba;
1348 struct htt_security_indication security_indication;
1349 struct htt_rc_update rc_update;
1350 struct htt_rx_test rx_test;
1351 struct htt_pktlog_msg pktlog_msg;
1352 struct htt_stats_conf stats_conf;
Michal Kaziorc545070e2015-01-24 12:14:48 +02001353 struct htt_rx_pn_ind rx_pn_ind;
1354 struct htt_rx_offload_ind rx_offload_ind;
1355 struct htt_rx_in_ord_ind rx_in_ord_ind;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001356 };
1357} __packed;
1358
Kalle Valo5e3dd152013-06-12 20:52:10 +03001359/*** host side structures follow ***/
1360
1361struct htt_tx_done {
1362 u32 msdu_id;
1363 bool discard;
1364 bool no_ack;
Sujith Manoharan55314fc2015-04-01 22:53:21 +03001365 bool success;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001366};
1367
1368struct htt_peer_map_event {
1369 u8 vdev_id;
1370 u16 peer_id;
1371 u8 addr[ETH_ALEN];
1372};
1373
1374struct htt_peer_unmap_event {
1375 u16 peer_id;
1376};
1377
Michal Kaziora16942e2014-02-27 18:50:04 +02001378struct ath10k_htt_txbuf {
1379 struct htt_data_tx_desc_frag frags[2];
1380 struct ath10k_htc_hdr htc_hdr;
1381 struct htt_cmd_hdr cmd_hdr;
1382 struct htt_data_tx_desc cmd_tx;
1383} __packed;
1384
Kalle Valo5e3dd152013-06-12 20:52:10 +03001385struct ath10k_htt {
1386 struct ath10k *ar;
1387 enum ath10k_htc_ep_id eid;
1388
Kalle Valo5e3dd152013-06-12 20:52:10 +03001389 u8 target_version_major;
1390 u8 target_version_minor;
1391 struct completion target_version_received;
Rajkumar Manoharan8348db22015-03-25 13:12:27 +02001392 enum ath10k_fw_htt_op_version op_version;
1393
1394 const enum htt_t2h_msg_type *t2h_msg_types;
1395 u32 t2h_msg_types_max;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001396
1397 struct {
1398 /*
1399 * Ring of network buffer objects - This ring is
1400 * used exclusively by the host SW. This ring
1401 * mirrors the dev_addrs_ring that is shared
1402 * between the host SW and the MAC HW. The host SW
1403 * uses this netbufs ring to locate the network
1404 * buffer objects whose data buffers the HW has
1405 * filled.
1406 */
1407 struct sk_buff **netbufs_ring;
Michal Kaziorc545070e2015-01-24 12:14:48 +02001408
1409 /* This is used only with firmware supporting IN_ORD_IND.
1410 *
1411 * With Full Rx Reorder the HTT Rx Ring is more of a temporary
1412 * buffer ring from which buffer addresses are copied by the
1413 * firmware to MAC Rx ring. Firmware then delivers IN_ORD_IND
1414 * pointing to specific (re-ordered) buffers.
1415 *
1416 * FIXME: With kernel generic hashing functions there's a lot
1417 * of hash collisions for sk_buffs.
1418 */
1419 bool in_ord_rx;
1420 DECLARE_HASHTABLE(skb_table, 4);
1421
Kalle Valo5e3dd152013-06-12 20:52:10 +03001422 /*
1423 * Ring of buffer addresses -
1424 * This ring holds the "physical" device address of the
1425 * rx buffers the host SW provides for the MAC HW to
1426 * fill.
1427 */
1428 __le32 *paddrs_ring;
1429
1430 /*
1431 * Base address of ring, as a "physical" device address
1432 * rather than a CPU address.
1433 */
1434 dma_addr_t base_paddr;
1435
1436 /* how many elems in the ring (power of 2) */
1437 int size;
1438
1439 /* size - 1 */
1440 unsigned size_mask;
1441
1442 /* how many rx buffers to keep in the ring */
1443 int fill_level;
1444
1445 /* how many rx buffers (full+empty) are in the ring */
1446 int fill_cnt;
1447
1448 /*
1449 * alloc_idx - where HTT SW has deposited empty buffers
1450 * This is allocated in consistent mem, so that the FW can
1451 * read this variable, and program the HW's FW_IDX reg with
1452 * the value of this shadow register.
1453 */
1454 struct {
1455 __le32 *vaddr;
1456 dma_addr_t paddr;
1457 } alloc_idx;
1458
1459 /* where HTT SW has processed bufs filled by rx MAC DMA */
1460 struct {
1461 unsigned msdu_payld;
1462 } sw_rd_idx;
1463
1464 /*
1465 * refill_retry_timer - timer triggered when the ring is
1466 * not refilled to the level expected
1467 */
1468 struct timer_list refill_retry_timer;
1469
1470 /* Protects access to all rx ring buffer state variables */
1471 spinlock_t lock;
1472 } rx_ring;
1473
1474 unsigned int prefetch_len;
1475
Michal Kazior89d6d832015-01-24 12:14:51 +02001476 /* Protects access to pending_tx, num_pending_tx */
Kalle Valo5e3dd152013-06-12 20:52:10 +03001477 spinlock_t tx_lock;
1478 int max_num_pending_tx;
1479 int num_pending_tx;
Michal Kazior89d6d832015-01-24 12:14:51 +02001480 struct idr pending_tx;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001481 wait_queue_head_t empty_tx_wq;
Michal Kaziora16942e2014-02-27 18:50:04 +02001482 struct dma_pool *tx_pool;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001483
1484 /* set if host-fw communication goes haywire
1485 * used to avoid further failures */
1486 bool rx_confused;
Michal Kazior6e712d42013-09-24 10:18:36 +02001487 struct tasklet_struct rx_replenish_task;
Michal Kazior6c5151a2014-02-27 18:50:04 +02001488
1489 /* This is used to group tx/rx completions separately and process them
1490 * in batches to reduce cache stalls */
1491 struct tasklet_struct txrx_compl_task;
1492 struct sk_buff_head tx_compl_q;
1493 struct sk_buff_head rx_compl_q;
Michal Kaziorc545070e2015-01-24 12:14:48 +02001494 struct sk_buff_head rx_in_ord_compl_q;
Janusz Dziedzic6df92a32014-03-24 21:24:57 +01001495
1496 /* rx_status template */
1497 struct ieee80211_rx_status rx_status;
Raja Manid9156b52015-06-22 20:22:27 +05301498
1499 struct {
1500 dma_addr_t paddr;
1501 struct htt_msdu_ext_desc *vaddr;
1502 } frag_desc;
Kalle Valo5e3dd152013-06-12 20:52:10 +03001503};
1504
1505#define RX_HTT_HDR_STATUS_LEN 64
1506
1507/* This structure layout is programmed via rx ring setup
1508 * so that FW knows how to transfer the rx descriptor to the host.
1509 * Buffers like this are placed on the rx ring. */
1510struct htt_rx_desc {
1511 union {
1512 /* This field is filled on the host using the msdu buffer
1513 * from htt_rx_indication */
1514 struct fw_rx_desc_base fw_desc;
1515 u32 pad;
1516 } __packed;
1517 struct {
1518 struct rx_attention attention;
1519 struct rx_frag_info frag_info;
1520 struct rx_mpdu_start mpdu_start;
1521 struct rx_msdu_start msdu_start;
1522 struct rx_msdu_end msdu_end;
1523 struct rx_mpdu_end mpdu_end;
1524 struct rx_ppdu_start ppdu_start;
1525 struct rx_ppdu_end ppdu_end;
1526 } __packed;
1527 u8 rx_hdr_status[RX_HTT_HDR_STATUS_LEN];
1528 u8 msdu_payload[0];
1529};
1530
1531#define HTT_RX_DESC_ALIGN 8
1532
1533#define HTT_MAC_ADDR_LEN 6
1534
1535/*
1536 * FIX THIS
1537 * Should be: sizeof(struct htt_host_rx_desc) + max rx MSDU size,
1538 * rounded up to a cache line size.
1539 */
1540#define HTT_RX_BUF_SIZE 1920
1541#define HTT_RX_MSDU_SIZE (HTT_RX_BUF_SIZE - (int)sizeof(struct htt_rx_desc))
1542
Michal Kazior6e712d42013-09-24 10:18:36 +02001543/* Refill a bunch of RX buffers for each refill round so that FW/HW can handle
1544 * aggregated traffic more nicely. */
1545#define ATH10K_HTT_MAX_NUM_REFILL 16
1546
Kalle Valo5e3dd152013-06-12 20:52:10 +03001547/*
1548 * DMA_MAP expects the buffer to be an integral number of cache lines.
1549 * Rather than checking the actual cache line size, this code makes a
1550 * conservative estimate of what the cache line size could be.
1551 */
1552#define HTT_LOG2_MAX_CACHE_LINE_SIZE 7 /* 2^7 = 128 */
1553#define HTT_MAX_CACHE_LINE_SIZE_MASK ((1 << HTT_LOG2_MAX_CACHE_LINE_SIZE) - 1)
1554
Michal Kazior95bf21f2014-05-16 17:15:39 +03001555int ath10k_htt_connect(struct ath10k_htt *htt);
1556int ath10k_htt_init(struct ath10k *ar);
1557int ath10k_htt_setup(struct ath10k_htt *htt);
Kalle Valo5e3dd152013-06-12 20:52:10 +03001558
Michal Kazior95bf21f2014-05-16 17:15:39 +03001559int ath10k_htt_tx_alloc(struct ath10k_htt *htt);
1560void ath10k_htt_tx_free(struct ath10k_htt *htt);
1561
1562int ath10k_htt_rx_alloc(struct ath10k_htt *htt);
Michal Kaziorc545070e2015-01-24 12:14:48 +02001563int ath10k_htt_rx_ring_refill(struct ath10k *ar);
Michal Kazior95bf21f2014-05-16 17:15:39 +03001564void ath10k_htt_rx_free(struct ath10k_htt *htt);
1565
Kalle Valo5e3dd152013-06-12 20:52:10 +03001566void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb);
1567void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
1568int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt);
Kalle Valoa3d135e2013-09-03 11:44:10 +03001569int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie);
Raja Manid9156b52015-06-22 20:22:27 +05301570int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt);
Kalle Valo5e3dd152013-06-12 20:52:10 +03001571int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt);
Janusz Dziedzicd3856232014-06-02 21:19:46 +03001572int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
1573 u8 max_subfrms_ampdu,
1574 u8 max_subfrms_amsdu);
Kalle Valo5e3dd152013-06-12 20:52:10 +03001575
1576void __ath10k_htt_tx_dec_pending(struct ath10k_htt *htt);
Michal Kazior89d6d832015-01-24 12:14:51 +02001577int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt, struct sk_buff *skb);
Kalle Valo5e3dd152013-06-12 20:52:10 +03001578void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id);
1579int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *);
1580int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *);
Michal Kazior6c5151a2014-02-27 18:50:04 +02001581
Kalle Valo5e3dd152013-06-12 20:52:10 +03001582#endif