forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/ethernet/huawei/hinic/hinic_hw_wq.h
....@@ -1,16 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Huawei HiNIC PCI Express Linux driver
34 * Copyright(c) 2017 Huawei Technologies Co., Ltd
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
- * for more details.
13
- *
145 */
156
167 #ifndef HINIC_HW_WQ_H
....@@ -35,11 +26,12 @@
3526 int block_idx;
3627
3728 u16 wqebb_size;
38
- u16 wq_page_size;
29
+ u32 wq_page_size;
3930 u16 q_depth;
4031 u16 max_wqe_size;
4132 u16 num_wqebbs_per_page;
42
-
33
+ u16 wqebbs_per_page_shift;
34
+ u16 wqebb_size_shift;
4335 /* The addresses are 64 bit in the HW */
4436 u64 block_paddr;
4537 void **shadow_block_vaddr;
....@@ -84,7 +76,7 @@
8476
8577 int hinic_wqs_cmdq_alloc(struct hinic_cmdq_pages *cmdq_pages,
8678 struct hinic_wq *wq, struct hinic_hwif *hwif,
87
- int cmdq_blocks, u16 wqebb_size, u16 wq_page_size,
79
+ int cmdq_blocks, u16 wqebb_size, u32 wq_page_size,
8880 u16 q_depth, u16 max_wqe_size);
8981
9082 void hinic_wqs_cmdq_free(struct hinic_cmdq_pages *cmdq_pages,
....@@ -96,7 +88,7 @@
9688 void hinic_wqs_free(struct hinic_wqs *wqs);
9789
9890 int hinic_wq_allocate(struct hinic_wqs *wqs, struct hinic_wq *wq,
99
- u16 wqebb_size, u16 wq_page_size, u16 q_depth,
91
+ u16 wqebb_size, u32 wq_page_size, u16 q_depth,
10092 u16 max_wqe_size);
10193
10294 void hinic_wq_free(struct hinic_wqs *wqs, struct hinic_wq *wq);
....@@ -104,6 +96,8 @@
10496 struct hinic_hw_wqe *hinic_get_wqe(struct hinic_wq *wq, unsigned int wqe_size,
10597 u16 *prod_idx);
10698
99
+void hinic_return_wqe(struct hinic_wq *wq, unsigned int wqe_size);
100
+
107101 void hinic_put_wqe(struct hinic_wq *wq, unsigned int wqe_size);
108102
109103 struct hinic_hw_wqe *hinic_read_wqe(struct hinic_wq *wq, unsigned int wqe_size,