forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/net/ethernet/qlogic/qed/qed_ll2.h
....@@ -1,33 +1,7 @@
1
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
12 /* QLogic qed NIC Driver
23 * Copyright (c) 2015-2017 QLogic Corporation
3
- *
4
- * This software is available to you under a choice of one of two
5
- * licenses. You may choose to be licensed under the terms of the GNU
6
- * General Public License (GPL) Version 2, available from the file
7
- * COPYING in the main directory of this source tree, or the
8
- * OpenIB.org BSD license below:
9
- *
10
- * Redistribution and use in source and binary forms, with or
11
- * without modification, are permitted provided that the following
12
- * conditions are met:
13
- *
14
- * - Redistributions of source code must retain the above
15
- * copyright notice, this list of conditions and the following
16
- * disclaimer.
17
- *
18
- * - Redistributions in binary form must reproduce the above
19
- * copyright notice, this list of conditions and the following
20
- * disclaimer in the documentation and /or other materials
21
- * provided with the distribution.
22
- *
23
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
4
+ * Copyright (c) 2019-2020 Marvell International Ltd.
315 */
326
337 #ifndef _QED_LL2_H
....@@ -46,6 +20,18 @@
4620 #include "qed_sp.h"
4721
4822 #define QED_MAX_NUM_OF_LL2_CONNECTIONS (4)
23
+/* LL2 queues handles will be split as follows:
24
+ * first will be legacy queues, and then the ctx based queues.
25
+ */
26
+#define QED_MAX_NUM_OF_LL2_CONNS_PF (4)
27
+#define QED_MAX_NUM_OF_LEGACY_LL2_CONNS_PF (3)
28
+
29
+#define QED_MAX_NUM_OF_CTX_LL2_CONNS_PF \
30
+ (QED_MAX_NUM_OF_LL2_CONNS_PF - QED_MAX_NUM_OF_LEGACY_LL2_CONNS_PF)
31
+
32
+#define QED_LL2_LEGACY_CONN_BASE_PF 0
33
+#define QED_LL2_CTX_CONN_BASE_PF QED_MAX_NUM_OF_LEGACY_LL2_CONNS_PF
34
+
4935
5036 struct qed_ll2_rx_packet {
5137 struct list_head list_entry;
....@@ -70,7 +56,7 @@
7056 struct core_tx_bd *txq_bd;
7157 dma_addr_t tx_frag;
7258 u16 frag_len;
73
- } bds_set[1];
59
+ } bds_set[];
7460 };
7561
7662 struct qed_ll2_rx_queue {
....@@ -79,13 +65,15 @@
7965 struct qed_chain rxq_chain;
8066 struct qed_chain rcq_chain;
8167 u8 rx_sb_index;
82
- bool b_cb_registred;
68
+ u8 ctx_based;
69
+ bool b_cb_registered;
8370 __le16 *p_fw_cons;
8471 struct list_head active_descq;
8572 struct list_head free_descq;
8673 struct list_head posting_descq;
8774 struct qed_ll2_rx_packet *descq_array;
8875 void __iomem *set_prod_addr;
76
+ struct core_pwm_prod_update_data db_data;
8977 };
9078
9179 struct qed_ll2_tx_queue {
....@@ -93,20 +81,21 @@
9381 spinlock_t lock;
9482 struct qed_chain txq_chain;
9583 u8 tx_sb_index;
96
- bool b_cb_registred;
84
+ bool b_cb_registered;
9785 __le16 *p_fw_cons;
9886 struct list_head active_descq;
9987 struct list_head free_descq;
10088 struct list_head sending_descq;
101
- void *descq_mem; /* memory for variable sized qed_ll2_tx_packet*/
102
- struct qed_ll2_tx_packet *cur_send_packet;
103
- struct qed_ll2_tx_packet cur_completing_packet;
10489 u16 cur_completing_bd_idx;
10590 void __iomem *doorbell_addr;
91
+ struct core_db_data db_msg;
10692 u16 bds_idx;
10793 u16 cur_send_frag_num;
10894 u16 cur_completing_frag_num;
10995 bool b_completing_packet;
96
+ void *descq_mem; /* memory for variable sized qed_ll2_tx_packet*/
97
+ struct qed_ll2_tx_packet *cur_send_packet;
98
+ struct qed_ll2_tx_packet cur_completing_packet;
11099 };
111100
112101 struct qed_ll2_info {
....@@ -122,11 +111,13 @@
122111 enum core_tx_dest tx_dest;
123112 u8 tx_stats_en;
124113 bool main_func_queue;
114
+ struct qed_ll2_cbs cbs;
125115 struct qed_ll2_rx_queue rx_queue;
126116 struct qed_ll2_tx_queue tx_queue;
127
- struct qed_ll2_cbs cbs;
128117 };
129118
119
+extern const struct qed_ll2_ops qed_ll2_ops_pass;
120
+
130121 /**
131122 * @brief qed_ll2_acquire_connection - allocate resources,
132123 * starts rx & tx (if relevant) queues pair. Provides