.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ |
---|
1 | 2 | /* QLogic qed NIC Driver |
---|
2 | 3 | * 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. |
---|
31 | 5 | */ |
---|
32 | 6 | |
---|
33 | 7 | #ifndef _QED_LL2_H |
---|
.. | .. |
---|
46 | 20 | #include "qed_sp.h" |
---|
47 | 21 | |
---|
48 | 22 | #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 | + |
---|
49 | 35 | |
---|
50 | 36 | struct qed_ll2_rx_packet { |
---|
51 | 37 | struct list_head list_entry; |
---|
.. | .. |
---|
70 | 56 | struct core_tx_bd *txq_bd; |
---|
71 | 57 | dma_addr_t tx_frag; |
---|
72 | 58 | u16 frag_len; |
---|
73 | | - } bds_set[1]; |
---|
| 59 | + } bds_set[]; |
---|
74 | 60 | }; |
---|
75 | 61 | |
---|
76 | 62 | struct qed_ll2_rx_queue { |
---|
.. | .. |
---|
79 | 65 | struct qed_chain rxq_chain; |
---|
80 | 66 | struct qed_chain rcq_chain; |
---|
81 | 67 | u8 rx_sb_index; |
---|
82 | | - bool b_cb_registred; |
---|
| 68 | + u8 ctx_based; |
---|
| 69 | + bool b_cb_registered; |
---|
83 | 70 | __le16 *p_fw_cons; |
---|
84 | 71 | struct list_head active_descq; |
---|
85 | 72 | struct list_head free_descq; |
---|
86 | 73 | struct list_head posting_descq; |
---|
87 | 74 | struct qed_ll2_rx_packet *descq_array; |
---|
88 | 75 | void __iomem *set_prod_addr; |
---|
| 76 | + struct core_pwm_prod_update_data db_data; |
---|
89 | 77 | }; |
---|
90 | 78 | |
---|
91 | 79 | struct qed_ll2_tx_queue { |
---|
.. | .. |
---|
93 | 81 | spinlock_t lock; |
---|
94 | 82 | struct qed_chain txq_chain; |
---|
95 | 83 | u8 tx_sb_index; |
---|
96 | | - bool b_cb_registred; |
---|
| 84 | + bool b_cb_registered; |
---|
97 | 85 | __le16 *p_fw_cons; |
---|
98 | 86 | struct list_head active_descq; |
---|
99 | 87 | struct list_head free_descq; |
---|
100 | 88 | 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; |
---|
104 | 89 | u16 cur_completing_bd_idx; |
---|
105 | 90 | void __iomem *doorbell_addr; |
---|
| 91 | + struct core_db_data db_msg; |
---|
106 | 92 | u16 bds_idx; |
---|
107 | 93 | u16 cur_send_frag_num; |
---|
108 | 94 | u16 cur_completing_frag_num; |
---|
109 | 95 | 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; |
---|
110 | 99 | }; |
---|
111 | 100 | |
---|
112 | 101 | struct qed_ll2_info { |
---|
.. | .. |
---|
122 | 111 | enum core_tx_dest tx_dest; |
---|
123 | 112 | u8 tx_stats_en; |
---|
124 | 113 | bool main_func_queue; |
---|
| 114 | + struct qed_ll2_cbs cbs; |
---|
125 | 115 | struct qed_ll2_rx_queue rx_queue; |
---|
126 | 116 | struct qed_ll2_tx_queue tx_queue; |
---|
127 | | - struct qed_ll2_cbs cbs; |
---|
128 | 117 | }; |
---|
129 | 118 | |
---|
| 119 | +extern const struct qed_ll2_ops qed_ll2_ops_pass; |
---|
| 120 | + |
---|
130 | 121 | /** |
---|
131 | 122 | * @brief qed_ll2_acquire_connection - allocate resources, |
---|
132 | 123 | * starts rx & tx (if relevant) queues pair. Provides |
---|