• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 1999-2019, Broadcom.
4  *
5  *      Unless you and Broadcom execute a separate written software license
6  * agreement governing use of this software, this software is licensed to you
7  * under the terms of the GNU General Public License version 2 (the "GPL"),
8  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
9  * following added to such license:
10  *
11  *      As a special exception, the copyright holders of this software give you
12  * permission to link this software with independent modules, and to copy and
13  * distribute the resulting executable under terms of your choice, provided that
14  * you also meet, for each linked independent module, the terms and conditions of
15  * the license of that module.  An independent module is a module which is not
16  * derived from this software.  The special exception does not apply to any
17  * modifications of the software.
18  *
19  *      Notwithstanding the above, under no circumstances may you combine this
20  * software in any way with any other Broadcom software provided under a license
21  * other than the GPL, without Broadcom's express prior written consent.
22  *
23  *
24  * <<Broadcom-WL-IPTag/Open:>>
25  *
26  * $Id: wlfc_proto.h 735303 2017-12-08 06:20:29Z $
27  *
28  */
29 
30 /** WL flow control for PROP_TXSTATUS. Related to host AMPDU reordering. */
31 
32 #ifndef __wlfc_proto_definitions_h__
33 #define __wlfc_proto_definitions_h__
34 
35 	/* Use TLV to convey WLFC information.
36 	 ---------------------------------------------------------------------------
37 	| Type |  Len | value                    | Description
38 	 ---------------------------------------------------------------------------
39 	|  1   |   1  | (handle)                 | MAC OPEN
40 	 ---------------------------------------------------------------------------
41 	|  2   |   1  | (handle)                 | MAC CLOSE
42 	 ---------------------------------------------------------------------------
43 	|  3   |   2  | (count, handle, prec_bmp)| Set the credit depth for a MAC dstn
44 	 ---------------------------------------------------------------------------
45 	|  4   |   4+ | see pkttag comments      | TXSTATUS
46 	|      |   12 | TX status & timestamps   | Present only when pkt timestamp is enabled
47 	 ---------------------------------------------------------------------------
48 	|  5   |   4  | see pkttag comments      | PKKTTAG [host->firmware]
49 	 ---------------------------------------------------------------------------
50 	|  6   |   8  | (handle, ifid, MAC)      | MAC ADD
51 	 ---------------------------------------------------------------------------
52 	|  7   |   8  | (handle, ifid, MAC)      | MAC DEL
53 	 ---------------------------------------------------------------------------
54 	|  8   |   1  | (rssi)                   | RSSI - RSSI value for the packet.
55 	 ---------------------------------------------------------------------------
56 	|  9   |   1  | (interface ID)           | Interface OPEN
57 	 ---------------------------------------------------------------------------
58 	|  10  |   1  | (interface ID)           | Interface CLOSE
59 	 ---------------------------------------------------------------------------
60 	|  11  |   8  | fifo credit returns map  | FIFO credits back to the host
61 	|      |      |                          |
62 	|      |      |                          | --------------------------------------
63 	|      |      |                          | | ac0 | ac1 | ac2 | ac3 | bcmc | atim |
64 	|      |      |                          | --------------------------------------
65 	|      |      |                          |
66 	 ---------------------------------------------------------------------------
67 	|  12  |   2  | MAC handle,              | Host provides a bitmap of pending
68 	|      |      | AC[0-3] traffic bitmap   | unicast traffic for MAC-handle dstn.
69 	|      |      |                          | [host->firmware]
70 	 ---------------------------------------------------------------------------
71 	|  13  |   3  | (count, handle, prec_bmp)| One time request for packet to a specific
72 	|      |      |                          | MAC destination.
73 	 ---------------------------------------------------------------------------
74 	|  15  |  12  | (pkttag, timestamps)     | Send TX timestamp at reception from host
75 	 ---------------------------------------------------------------------------
76 	|  16  |  12  | (pkttag, timestamps)     | Send WLAN RX timestamp along with RX frame
77 	 ---------------------------------------------------------------------------
78 	| 255  |  N/A |  N/A                     | FILLER - This is a special type
79 	|      |      |                          | that has no length or value.
80 	|      |      |                          | Typically used for padding.
81 	 ---------------------------------------------------------------------------
82 	*/
83 
84 typedef enum {
85 	WLFC_CTL_TYPE_MAC_OPEN = 1,
86 	WLFC_CTL_TYPE_MAC_CLOSE	= 2,
87 	WLFC_CTL_TYPE_MAC_REQUEST_CREDIT = 3,
88 	WLFC_CTL_TYPE_TXSTATUS = 4,
89 	WLFC_CTL_TYPE_PKTTAG = 5,	/** host<->dongle */
90 
91 	WLFC_CTL_TYPE_MACDESC_ADD = 6,
92 	WLFC_CTL_TYPE_MACDESC_DEL = 7,
93 	WLFC_CTL_TYPE_RSSI = 8,
94 
95 	WLFC_CTL_TYPE_INTERFACE_OPEN = 9,
96 	WLFC_CTL_TYPE_INTERFACE_CLOSE = 10,
97 
98 	WLFC_CTL_TYPE_FIFO_CREDITBACK = 11,
99 
100 	WLFC_CTL_TYPE_PENDING_TRAFFIC_BMP = 12,	/** host->dongle */
101 	WLFC_CTL_TYPE_MAC_REQUEST_PACKET = 13,
102 	WLFC_CTL_TYPE_HOST_REORDER_RXPKTS = 14,
103 
104 	WLFC_CTL_TYPE_TX_ENTRY_STAMP = 15,
105 	WLFC_CTL_TYPE_RX_STAMP = 16,
106 	WLFC_CTL_TYPE_TX_STATUS_STAMP = 17,	/** obsolete */
107 
108 	WLFC_CTL_TYPE_TRANS_ID = 18,
109 	WLFC_CTL_TYPE_COMP_TXSTATUS = 19,
110 
111 	WLFC_CTL_TYPE_TID_OPEN = 20,
112 	WLFC_CTL_TYPE_TID_CLOSE = 21,
113 	WLFC_CTL_TYPE_UPD_FLR_WEIGHT = 22,
114 	WLFC_CTL_TYPE_ENAB_FFSCH = 23,
115 	WLFC_CTL_TYPE_UPDATE_FLAGS = 24,	/* clear the flags set in flowring */
116 	WLFC_CTL_TYPE_CLEAR_SUPPR = 25,		/* free the supression info in the flowring */
117 
118 	WLFC_CTL_TYPE_FLOWID_OPEN = 26,
119 	WLFC_CTL_TYPE_FLOWID_CLOSE = 27,
120 
121 	WLFC_CTL_TYPE_FILLER = 255
122 } wlfc_ctl_type_t;
123 
124 #define WLFC_CTL_VALUE_LEN_FLOWID		2
125 
126 #define WLFC_CTL_VALUE_LEN_MACDESC		8	/** handle, interface, MAC */
127 
128 #define WLFC_CTL_VALUE_LEN_MAC			1	/** MAC-handle */
129 #define WLFC_CTL_VALUE_LEN_RSSI			1
130 
131 #define WLFC_CTL_VALUE_LEN_INTERFACE		1
132 #define WLFC_CTL_VALUE_LEN_PENDING_TRAFFIC_BMP	2
133 
134 #define WLFC_CTL_VALUE_LEN_TXSTATUS		4
135 #define WLFC_CTL_VALUE_LEN_PKTTAG		4
136 #define WLFC_CTL_VALUE_LEN_TIMESTAMP		12	/** 4-byte rate info + 2 TSF */
137 
138 #define WLFC_CTL_VALUE_LEN_SEQ			2
139 
140 /* Reset the flags set for the corresponding flowring of the SCB which is de-inited */
141 /* FLOW_RING_FLAG_LAST_TIM | FLOW_RING_FLAG_INFORM_PKTPEND | FLOW_RING_FLAG_PKT_REQ */
142 #define WLFC_RESET_ALL_FLAGS			0
143 #define WLFC_CTL_VALUE_LEN_FLAGS		7	/** flags, MAC */
144 
145 /* free the data stored to be used for suppressed packets in future */
146 #define WLFC_CTL_VALUE_LEN_SUPR			7	/** tid, MAC */
147 
148 /* The high bits of ratespec report in timestamp are used for various status */
149 #define WLFC_TSFLAGS_RX_RETRY		(1 << 31)
150 #define WLFC_TSFLAGS_PM_ENABLED		(1 << 30)
151 #define WLFC_TSFLAGS_MASK		(WLFC_TSFLAGS_RX_RETRY | WLFC_TSFLAGS_PM_ENABLED)
152 
153 /* enough space to host all 4 ACs, bc/mc and atim fifo credit */
154 #define WLFC_CTL_VALUE_LEN_FIFO_CREDITBACK	6
155 
156 #define WLFC_CTL_VALUE_LEN_REQUEST_CREDIT	3	/* credit, MAC-handle, prec_bitmap */
157 #define WLFC_CTL_VALUE_LEN_REQUEST_PACKET	3	/* credit, MAC-handle, prec_bitmap */
158 
159 #define WLFC_PKTFLAG_PKTFROMHOST	0x01
160 #define WLFC_PKTFLAG_PKT_REQUESTED	0x02
161 #define WLFC_PKTFLAG_PKT_SENDTOHOST	0x04
162 
163 #define WL_TXSTATUS_STATUS_MASK			0xff /* allow 8 bits */
164 #define WL_TXSTATUS_STATUS_SHIFT		24
165 
166 #define WL_TXSTATUS_SET_STATUS(x, status)	((x)  = \
167 	((x) & ~(WL_TXSTATUS_STATUS_MASK << WL_TXSTATUS_STATUS_SHIFT)) | \
168 	(((status) & WL_TXSTATUS_STATUS_MASK) << WL_TXSTATUS_STATUS_SHIFT))
169 #define WL_TXSTATUS_GET_STATUS(x)	(((x) >> WL_TXSTATUS_STATUS_SHIFT) & \
170 	WL_TXSTATUS_STATUS_MASK)
171 
172 /**
173  * Bit 31 of the 32-bit packet tag is defined as 'generation ID'. It is set by the host to the
174  * "current" generation, and by the firmware to the "expected" generation, toggling on suppress. The
175  * firmware accepts a packet when the generation matches; on reset (startup) both "current" and
176  * "expected" are set to 0.
177  */
178 #define WL_TXSTATUS_GENERATION_MASK		1 /* allow 1 bit */
179 #define WL_TXSTATUS_GENERATION_SHIFT		31
180 
181 #define WL_TXSTATUS_SET_GENERATION(x, gen)	((x) = \
182 	((x) & ~(WL_TXSTATUS_GENERATION_MASK << WL_TXSTATUS_GENERATION_SHIFT)) | \
183 	(((gen) & WL_TXSTATUS_GENERATION_MASK) << WL_TXSTATUS_GENERATION_SHIFT))
184 
185 #define WL_TXSTATUS_GET_GENERATION(x)	(((x) >> WL_TXSTATUS_GENERATION_SHIFT) & \
186 	WL_TXSTATUS_GENERATION_MASK)
187 
188 #define WL_TXSTATUS_FLAGS_MASK			0xf /* allow 4 bits only */
189 #define WL_TXSTATUS_FLAGS_SHIFT			27
190 
191 #define WL_TXSTATUS_SET_FLAGS(x, flags)	((x)  = \
192 	((x) & ~(WL_TXSTATUS_FLAGS_MASK << WL_TXSTATUS_FLAGS_SHIFT)) | \
193 	(((flags) & WL_TXSTATUS_FLAGS_MASK) << WL_TXSTATUS_FLAGS_SHIFT))
194 #define WL_TXSTATUS_GET_FLAGS(x)		(((x) >> WL_TXSTATUS_FLAGS_SHIFT) & \
195 	WL_TXSTATUS_FLAGS_MASK)
196 
197 #define WL_TXSTATUS_FIFO_MASK			0x7 /* allow 3 bits for FIFO ID */
198 #define WL_TXSTATUS_FIFO_SHIFT			24
199 
200 #define WL_TXSTATUS_SET_FIFO(x, flags)	((x)  = \
201 	((x) & ~(WL_TXSTATUS_FIFO_MASK << WL_TXSTATUS_FIFO_SHIFT)) | \
202 	(((flags) & WL_TXSTATUS_FIFO_MASK) << WL_TXSTATUS_FIFO_SHIFT))
203 #define WL_TXSTATUS_GET_FIFO(x)		(((x) >> WL_TXSTATUS_FIFO_SHIFT) & WL_TXSTATUS_FIFO_MASK)
204 
205 #define WL_TXSTATUS_PKTID_MASK			0xffffff /* allow 24 bits */
206 #define WL_TXSTATUS_SET_PKTID(x, num)	((x) = \
207 	((x) & ~WL_TXSTATUS_PKTID_MASK) | (num))
208 #define WL_TXSTATUS_GET_PKTID(x)		((x) & WL_TXSTATUS_PKTID_MASK)
209 
210 #define WL_TXSTATUS_HSLOT_MASK			0xffff /* allow 16 bits */
211 #define WL_TXSTATUS_HSLOT_SHIFT			8
212 
213 #define WL_TXSTATUS_SET_HSLOT(x, hslot)	((x)  = \
214 	((x) & ~(WL_TXSTATUS_HSLOT_MASK << WL_TXSTATUS_HSLOT_SHIFT)) | \
215 	(((hslot) & WL_TXSTATUS_HSLOT_MASK) << WL_TXSTATUS_HSLOT_SHIFT))
216 #define WL_TXSTATUS_GET_HSLOT(x)	(((x) >> WL_TXSTATUS_HSLOT_SHIFT)& \
217 	WL_TXSTATUS_HSLOT_MASK)
218 
219 #define WL_TXSTATUS_FREERUNCTR_MASK		0xff /* allow 8 bits */
220 
221 #define WL_TXSTATUS_SET_FREERUNCTR(x, ctr)	((x)  = \
222 	((x) & ~(WL_TXSTATUS_FREERUNCTR_MASK)) | \
223 	((ctr) & WL_TXSTATUS_FREERUNCTR_MASK))
224 #define WL_TXSTATUS_GET_FREERUNCTR(x)		((x)& WL_TXSTATUS_FREERUNCTR_MASK)
225 
226 /* AMSDU part of d11 seq number */
227 #define WL_SEQ_AMSDU_MASK             0x1 /* allow 1 bit */
228 #define WL_SEQ_AMSDU_SHIFT            14
229 #define WL_SEQ_SET_AMSDU(x, val)      ((x) = \
230 	((x) & ~(WL_SEQ_AMSDU_MASK << WL_SEQ_AMSDU_SHIFT)) | \
231 	(((val) & WL_SEQ_AMSDU_MASK) << WL_SEQ_AMSDU_SHIFT)) /**< sets a single AMSDU bit */
232 /** returns TRUE if ring item is AMSDU (seq = d11 seq nr) */
233 #define WL_SEQ_IS_AMSDU(x)   (((x) >> WL_SEQ_AMSDU_SHIFT) & \
234 	WL_SEQ_AMSDU_MASK)
235 
236 /* indicates last_suppr_seq is valid */
237 #define WL_SEQ_VALIDSUPPR_MASK		0x1 /* allow 1 bit */
238 #define WL_SEQ_VALIDSUPPR_SHIFT		12
239 #define WL_SEQ_SET_VALIDSUPPR(x, val)	((x) = \
240 	((x) & ~(WL_SEQ_VALIDSUPPR_MASK << WL_SEQ_VALIDSUPPR_SHIFT)) | \
241 	(((val) & WL_SEQ_VALIDSUPPR_MASK) << WL_SEQ_VALIDSUPPR_SHIFT))
242 #define WL_SEQ_GET_VALIDSUPPR(x)	(((x) >> WL_SEQ_VALIDSUPPR_SHIFT) & \
243 	WL_SEQ_VALIDSUPPR_MASK)
244 
245 #define WL_SEQ_FROMFW_MASK		0x1 /* allow 1 bit */
246 #define WL_SEQ_FROMFW_SHIFT		13
247 #define WL_SEQ_SET_FROMFW(x, val)	((x) = \
248 	((x) & ~(WL_SEQ_FROMFW_MASK << WL_SEQ_FROMFW_SHIFT)) | \
249 	(((val) & WL_SEQ_FROMFW_MASK) << WL_SEQ_FROMFW_SHIFT))
250 /** Set when firmware assigns D11 sequence number to packet */
251 #define SET_WL_HAS_ASSIGNED_SEQ(x)	WL_SEQ_SET_FROMFW((x), 1)
252 
253 /** returns TRUE if packet has been assigned a d11 seq number by the WL firmware layer */
254 #define GET_WL_HAS_ASSIGNED_SEQ(x)	(((x) >> WL_SEQ_FROMFW_SHIFT) & WL_SEQ_FROMFW_MASK)
255 
256 /**
257  * Proptxstatus related.
258  *
259  * When a packet is suppressed by WL or the D11 core, the packet has to be retried. Assigning
260  * a new d11 sequence number for the packet when retrying would cause the peer to be unable to
261  * reorder the packets within an AMPDU. So, suppressed packet from bus layer (DHD for SDIO and
262  * pciedev for PCIE) is re-using d11 seq number, so FW should not assign a new one.
263  */
264 #define WL_SEQ_FROMDRV_MASK		0x1 /* allow 1 bit */
265 #define WL_SEQ_FROMDRV_SHIFT		12
266 
267 /**
268  * Proptxstatus, host or fw PCIe layer requests WL layer to reuse d11 seq no. Bit is reset by WL
269  * subsystem when it reuses the seq number.
270  */
271 #define WL_SEQ_SET_REUSE(x, val)	((x) = \
272 	((x) & ~(WL_SEQ_FROMDRV_MASK << WL_SEQ_FROMDRV_SHIFT)) | \
273 	(((val) & WL_SEQ_FROMDRV_MASK) << WL_SEQ_FROMDRV_SHIFT))
274 #define SET_WL_TO_REUSE_SEQ(x)   WL_SEQ_SET_REUSE((x), 1)
275 #define RESET_WL_TO_REUSE_SEQ(x) WL_SEQ_SET_REUSE((x), 0)
276 
277 /** Proptxstatus, related to reuse of d11 seq numbers when retransmitting */
278 #define IS_WL_TO_REUSE_SEQ(x)	(((x) >> WL_SEQ_FROMDRV_SHIFT) & \
279 	WL_SEQ_FROMDRV_MASK)
280 
281 #define WL_SEQ_NUM_MASK			0xfff /* allow 12 bit */
282 #define WL_SEQ_NUM_SHIFT		0
283 /** Proptxstatus, sets d11seq no in pkt tag, related to reuse of d11seq no when retransmitting */
284 #define WL_SEQ_SET_NUM(x, val)	((x) = \
285 	((x) & ~(WL_SEQ_NUM_MASK << WL_SEQ_NUM_SHIFT)) | \
286 	(((val) & WL_SEQ_NUM_MASK) << WL_SEQ_NUM_SHIFT))
287 /** Proptxstatus, gets d11seq no from pkt tag, related to reuse of d11seq no when retransmitting */
288 #define WL_SEQ_GET_NUM(x)	(((x) >> WL_SEQ_NUM_SHIFT) & \
289 	WL_SEQ_NUM_MASK)
290 
291 #define WL_SEQ_AMSDU_SUPPR_MASK	((WL_SEQ_FROMDRV_MASK << WL_SEQ_FROMDRV_SHIFT) | \
292 				(WL_SEQ_AMSDU_MASK << WL_SEQ_AMSDU_SHIFT) | \
293 				(WL_SEQ_NUM_MASK << WL_SEQ_NUM_SHIFT))
294 
295 /* 32 STA should be enough??, 6 bits; Must be power of 2 */
296 #define WLFC_MAC_DESC_TABLE_SIZE	32
297 #define WLFC_MAX_IFNUM				16
298 #define WLFC_MAC_DESC_ID_INVALID	0xff
299 
300 /* b[7:5] -reuse guard, b[4:0] -value */
301 #define WLFC_MAC_DESC_GET_LOOKUP_INDEX(x) ((x) & 0x1f)
302 
303 #define WLFC_PKTFLAG_SET_PKTREQUESTED(x)	(x) |= \
304 	(WLFC_PKTFLAG_PKT_REQUESTED << WL_TXSTATUS_FLAGS_SHIFT)
305 
306 #define WLFC_PKTFLAG_CLR_PKTREQUESTED(x)	(x) &= \
307 	~(WLFC_PKTFLAG_PKT_REQUESTED << WL_TXSTATUS_FLAGS_SHIFT)
308 
309 #define WLFC_MAX_PENDING_DATALEN	120
310 
311 /* host is free to discard the packet */
312 #define WLFC_CTL_PKTFLAG_DISCARD	0
313 /* D11 suppressed a packet */
314 #define WLFC_CTL_PKTFLAG_D11SUPPRESS	1
315 /* WL firmware suppressed a packet because MAC is
316 	already in PSMode (short time window)
317 */
318 #define WLFC_CTL_PKTFLAG_WLSUPPRESS	2
319 /* Firmware tossed this packet */
320 #define WLFC_CTL_PKTFLAG_TOSSED_BYWLC	3
321 /* Firmware tossed after retries */
322 #define WLFC_CTL_PKTFLAG_DISCARD_NOACK	4
323 /* Firmware wrongly reported suppressed previously,now fixing to acked */
324 #define WLFC_CTL_PKTFLAG_SUPPRESS_ACKED	5
325 /* Firmware send this packet expired, lifetime expiration */
326 #define WLFC_CTL_PKTFLAG_EXPIRED	6
327 /* Firmware drop this packet for any other reason  */
328 #define WLFC_CTL_PKTFLAG_DROPPED	7
329 /* Firmware free this packet  */
330 #define WLFC_CTL_PKTFLAG_MKTFREE	8
331 #define WLFC_CTL_PKTFLAG_MASK		(0x0f)	/* For 4-bit mask with one extra bit */
332 
333 #ifdef PROP_TXSTATUS_DEBUG
334 #define WLFC_DBGMESG(x) printf x
335 /* wlfc-breadcrumb */
336 #define WLFC_BREADCRUMB(x) do {if ((x) == NULL) \
337 	{printf("WLFC: %s():%d:caller:%p\n", \
338 	__FUNCTION__, __LINE__, CALL_SITE);}} while (0)
339 #define WLFC_WHEREIS(s) printf("WLFC: at %s():%d, %s\n", __FUNCTION__, __LINE__, (s))
340 #else
341 #define WLFC_DBGMESG(x)
342 #define WLFC_BREADCRUMB(x)
343 #define WLFC_WHEREIS(s)
344 #endif /* PROP_TXSTATUS_DEBUG */
345 
346 /* AMPDU host reorder packet flags */
347 #define WLHOST_REORDERDATA_MAXFLOWS		256
348 #define WLHOST_REORDERDATA_LEN		 10
349 #define WLHOST_REORDERDATA_TOTLEN	(WLHOST_REORDERDATA_LEN + 1 + 1) /* +tag +len */
350 
351 #define WLHOST_REORDERDATA_FLOWID_OFFSET		0
352 #define WLHOST_REORDERDATA_MAXIDX_OFFSET		2
353 #define WLHOST_REORDERDATA_FLAGS_OFFSET			4
354 #define WLHOST_REORDERDATA_CURIDX_OFFSET		6
355 #define WLHOST_REORDERDATA_EXPIDX_OFFSET		8
356 
357 #define WLHOST_REORDERDATA_DEL_FLOW		0x01
358 #define WLHOST_REORDERDATA_FLUSH_ALL		0x02
359 #define WLHOST_REORDERDATA_CURIDX_VALID		0x04
360 #define WLHOST_REORDERDATA_EXPIDX_VALID		0x08
361 #define WLHOST_REORDERDATA_NEW_HOLE		0x10
362 
363 /* transaction id data len byte 0: rsvd, byte 1: seqnumber, byte 2-5 will be used for timestampe */
364 #define WLFC_CTL_TRANS_ID_LEN			6
365 #define WLFC_TYPE_TRANS_ID_LEN			6
366 
367 #define WLFC_MODE_HANGER	1 /* use hanger */
368 #define WLFC_MODE_AFQ		2 /* use afq (At Firmware Queue) */
369 #define WLFC_IS_OLD_DEF(x) ((x & 1) || (x & 2))
370 
371 #define WLFC_MODE_AFQ_SHIFT		2	/* afq bit */
372 #define WLFC_SET_AFQ(x, val)	((x) = \
373 	((x) & ~(1 << WLFC_MODE_AFQ_SHIFT)) | \
374 	(((val) & 1) << WLFC_MODE_AFQ_SHIFT))
375 /** returns TRUE if firmware supports 'at firmware queue' feature */
376 #define WLFC_GET_AFQ(x)	(((x) >> WLFC_MODE_AFQ_SHIFT) & 1)
377 
378 #define WLFC_MODE_REUSESEQ_SHIFT	3	/* seq reuse bit */
379 #define WLFC_SET_REUSESEQ(x, val)	((x) = \
380 	((x) & ~(1 << WLFC_MODE_REUSESEQ_SHIFT)) | \
381 	(((val) & 1) << WLFC_MODE_REUSESEQ_SHIFT))
382 
383 /** returns TRUE if 'd11 sequence reuse' has been agreed upon between host and dongle */
384 #if defined(BCMPCIEDEV_ENABLED) && !defined(ROM_ENAB_RUNTIME_CHECK)
385 /* GET_REUSESEQ is always TRUE in pciedev */
386 #define WLFC_GET_REUSESEQ(x)	(TRUE)
387 #else
388 #define WLFC_GET_REUSESEQ(x)	(((x) >> WLFC_MODE_REUSESEQ_SHIFT) & 1)
389 #endif /* defined(BCMPCIEDEV_ENABLED) && !defined(ROM_ENAB_RUNTIME_CHECK) */
390 
391 #define WLFC_MODE_REORDERSUPP_SHIFT	4	/* host reorder suppress pkt bit */
392 #define WLFC_SET_REORDERSUPP(x, val)	((x) = \
393 	((x) & ~(1 << WLFC_MODE_REORDERSUPP_SHIFT)) | \
394 	(((val) & 1) << WLFC_MODE_REORDERSUPP_SHIFT))
395 /** returns TRUE if 'reorder suppress' has been agreed upon between host and dongle */
396 #define WLFC_GET_REORDERSUPP(x)	(((x) >> WLFC_MODE_REORDERSUPP_SHIFT) & 1)
397 
398 #define FLOW_RING_CREATE	1
399 #define FLOW_RING_DELETE	2
400 #define FLOW_RING_FLUSH		3
401 #define FLOW_RING_OPEN		4
402 #define FLOW_RING_CLOSED	5
403 #define FLOW_RING_FLUSHED	6
404 #define FLOW_RING_TIM_SET	7
405 #define FLOW_RING_TIM_RESET	8
406 #define FLOW_RING_FLUSH_TXFIFO	9
407 #define FLOW_RING_GET_PKT_MAX	10
408 #define FLOW_RING_RESET_WEIGHT	11
409 #define FLOW_RING_UPD_PRIOMAP	12
410 
411 /* bit 7, indicating if is TID(1) or AC(0) mapped info in tid field) */
412 #define PCIEDEV_IS_AC_TID_MAP_MASK	0x80
413 
414 #endif /* __wlfc_proto_definitions_h__ */
415