forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/dhd_wlfc.h
....@@ -1,13 +1,14 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
21 /*
3
- * Copyright (C) 1999-2019, Broadcom Corporation
4
- *
2
+ * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation
3
+ *
4
+ * Copyright (C) 1999-2017, Broadcom Corporation
5
+ *
56 * Unless you and Broadcom execute a separate written software license
67 * agreement governing use of this software, this software is licensed to you
78 * under the terms of the GNU General Public License version 2 (the "GPL"),
89 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
910 * following added to such license:
10
- *
11
+ *
1112 * As a special exception, the copyright holders of this software give you
1213 * permission to link this software with independent modules, and to copy and
1314 * distribute the resulting executable under terms of your choice, provided that
....@@ -15,7 +16,7 @@
1516 * the license of that module. An independent module is a module which is not
1617 * derived from this software. The special exception does not apply to any
1718 * modifications of the software.
18
- *
19
+ *
1920 * Notwithstanding the above, under no circumstances may you combine this
2021 * software in any way with any other Broadcom software provided under a license
2122 * other than the GPL, without Broadcom's express prior written consent.
....@@ -23,12 +24,11 @@
2324 *
2425 * <<Broadcom-WL-IPTag/Open:>>
2526 *
26
- * $Id: dhd_wlfc.h 606400 2015-12-15 09:59:42Z $
27
+ * $Id: dhd_wlfc.h 690477 2017-03-16 10:17:17Z $
2728 *
2829 */
2930 #ifndef __wlfc_host_driver_definitions_h__
3031 #define __wlfc_host_driver_definitions_h__
31
-
3232
3333 /* #define OOO_DEBUG */
3434
....@@ -85,7 +85,7 @@
8585 void* pkt;
8686 #ifdef PROP_TXSTATUS_DEBUG
8787 uint32 push_time;
88
-#endif
88
+#endif // endif
8989 struct wlfc_hanger_item *next;
9090 } wlfc_hanger_item_t;
9191
....@@ -110,22 +110,17 @@
110110 #define WLFC_PSQ_PREC_COUNT ((AC_COUNT + 1) * 2) /**< 2 for each AC traffic and bc/mc */
111111 #define WLFC_AFQ_PREC_COUNT (AC_COUNT + 1)
112112
113
-#define WLFC_PSQ_LEN 2048
113
+#define WLFC_PSQ_LEN (4096 * 8)
114114
115
-#ifdef BCMDBUS
116
-#define WLFC_FLOWCONTROL_HIWATER 512
117
-#define WLFC_FLOWCONTROL_LOWATER (WLFC_FLOWCONTROL_HIWATER / 4)
118
-#else
119
-#define WLFC_FLOWCONTROL_HIWATER (2048 - 256)
115
+#define WLFC_FLOWCONTROL_HIWATER ((4096 * 8) - 256)
120116 #define WLFC_FLOWCONTROL_LOWATER 256
121
-#endif
122117
123118 #if (WLFC_FLOWCONTROL_HIWATER >= (WLFC_PSQ_LEN - 256))
124119 #undef WLFC_FLOWCONTROL_HIWATER
125120 #define WLFC_FLOWCONTROL_HIWATER (WLFC_PSQ_LEN - 256)
126121 #undef WLFC_FLOWCONTROL_LOWATER
127122 #define WLFC_FLOWCONTROL_LOWATER (WLFC_FLOWCONTROL_HIWATER / 4)
128
-#endif
123
+#endif // endif
129124
130125 #define WLFC_LOG_BUF_SIZE (1024*1024)
131126
....@@ -162,13 +157,12 @@
162157 /** flag. TRUE when remote MAC is in suppressed state */
163158 uint8 suppressed;
164159
165
-
166160 #ifdef PROP_TXSTATUS_DEBUG
167161 uint32 dstncredit_sent_packets;
168162 uint32 dstncredit_acks;
169163 uint32 opened_ct;
170164 uint32 closed_ct;
171
-#endif
165
+#endif // endif
172166 struct wlfc_mac_descriptor* prev;
173167 struct wlfc_mac_descriptor* next;
174168 } wlfc_mac_descriptor_t;
....@@ -207,6 +201,8 @@
207201 uint32 d11_suppress;
208202 uint32 wl_suppress;
209203 uint32 bad_suppress;
204
+ uint32 pkt_dropped;
205
+ uint32 pkt_exptime;
210206 uint32 pkt_freed;
211207 uint32 pkt_free_err;
212208 uint32 psq_wlsup_retx;
....@@ -235,7 +231,7 @@
235231 uint32 dropped_qfull[6];
236232 uint32 signal_only_pkts_sent;
237233 uint32 signal_only_pkts_freed;
238
-#endif
234
+#endif // endif
239235 uint32 cleanup_txq_cnt;
240236 uint32 cleanup_psq_cnt;
241237 uint32 cleanup_fw_cnt;
....@@ -252,8 +248,8 @@
252248 #define WLFC_HOST_FIFO_CREDIT_INC_SENTCTRS(ctx, ac) do {} while (0)
253249 #define WLFC_HOST_FIFO_CREDIT_INC_BACKCTRS(ctx, ac) do {} while (0)
254250 #define WLFC_HOST_FIFO_DROPPEDCTR_INC(ctx, ac) do {} while (0)
255
-#endif
256
-
251
+#endif // endif
252
+#define WLFC_PACKET_BOUND 10
257253 #define WLFC_FCMODE_NONE 0
258254 #define WLFC_FCMODE_IMPLIED_CREDIT 1
259255 #define WLFC_FCMODE_EXPLICIT_CREDIT 2
....@@ -379,7 +375,7 @@
379375 /** This 32-bit goes from host to device for every packet. */
380376 uint32 htod_tag;
381377
382
- /** This 16-bit is original seq number for every suppress packet. */
378
+ /** This 16-bit is original d11seq number for every suppressed packet. */
383379 uint16 htod_seq;
384380
385381 /** This address is mac entry for every packet. */
....@@ -510,7 +506,7 @@
510506 #else
511507 #define DHD_WLFC_CTRINC_MAC_CLOSE(entry) do {} while (0)
512508 #define DHD_WLFC_CTRINC_MAC_OPEN(entry) do {} while (0)
513
-#endif
509
+#endif // endif
514510
515511 #ifdef BCM_OBJECT_TRACE
516512 #define DHD_PKTTAG_SET_SN(tag, val) ((dhd_pkttag_t*)(tag))->sn = (val)