| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Huawei HiNIC PCI Express Linux driver |
|---|
| 3 | 4 | * 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 | | - * |
|---|
| 14 | 5 | */ |
|---|
| 15 | 6 | |
|---|
| 16 | 7 | #ifndef HINIC_HW_WQ_H |
|---|
| .. | .. |
|---|
| 35 | 26 | int block_idx; |
|---|
| 36 | 27 | |
|---|
| 37 | 28 | u16 wqebb_size; |
|---|
| 38 | | - u16 wq_page_size; |
|---|
| 29 | + u32 wq_page_size; |
|---|
| 39 | 30 | u16 q_depth; |
|---|
| 40 | 31 | u16 max_wqe_size; |
|---|
| 41 | 32 | u16 num_wqebbs_per_page; |
|---|
| 42 | | - |
|---|
| 33 | + u16 wqebbs_per_page_shift; |
|---|
| 34 | + u16 wqebb_size_shift; |
|---|
| 43 | 35 | /* The addresses are 64 bit in the HW */ |
|---|
| 44 | 36 | u64 block_paddr; |
|---|
| 45 | 37 | void **shadow_block_vaddr; |
|---|
| .. | .. |
|---|
| 84 | 76 | |
|---|
| 85 | 77 | int hinic_wqs_cmdq_alloc(struct hinic_cmdq_pages *cmdq_pages, |
|---|
| 86 | 78 | 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, |
|---|
| 88 | 80 | u16 q_depth, u16 max_wqe_size); |
|---|
| 89 | 81 | |
|---|
| 90 | 82 | void hinic_wqs_cmdq_free(struct hinic_cmdq_pages *cmdq_pages, |
|---|
| .. | .. |
|---|
| 96 | 88 | void hinic_wqs_free(struct hinic_wqs *wqs); |
|---|
| 97 | 89 | |
|---|
| 98 | 90 | 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, |
|---|
| 100 | 92 | u16 max_wqe_size); |
|---|
| 101 | 93 | |
|---|
| 102 | 94 | void hinic_wq_free(struct hinic_wqs *wqs, struct hinic_wq *wq); |
|---|
| .. | .. |
|---|
| 104 | 96 | struct hinic_hw_wqe *hinic_get_wqe(struct hinic_wq *wq, unsigned int wqe_size, |
|---|
| 105 | 97 | u16 *prod_idx); |
|---|
| 106 | 98 | |
|---|
| 99 | +void hinic_return_wqe(struct hinic_wq *wq, unsigned int wqe_size); |
|---|
| 100 | + |
|---|
| 107 | 101 | void hinic_put_wqe(struct hinic_wq *wq, unsigned int wqe_size); |
|---|
| 108 | 102 | |
|---|
| 109 | 103 | struct hinic_hw_wqe *hinic_read_wqe(struct hinic_wq *wq, unsigned int wqe_size, |
|---|