| 1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
| 2 |
/* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved. */ |
| 3 |
|
| 4 |
#ifndef _HINIC3_HW_COMM_H_ |
| 5 |
#define _HINIC3_HW_COMM_H_ |
| 6 |
|
| 7 |
#include "hinic3_hw_intf.h" |
| 8 |
|
| 9 |
struct hinic3_hwdev; |
| 10 |
|
| 11 |
#define HINIC3_WQ_PAGE_SIZE_ORDER 8 |
| 12 |
|
| 13 |
struct hinic3_interrupt_info { |
| 14 |
u32 lli_set; |
| 15 |
u32 interrupt_coalesc_set; |
| 16 |
u16 msix_index; |
| 17 |
u8 lli_credit_limit; |
| 18 |
u8 lli_timer_cfg; |
| 19 |
u8 pending_limit; |
| 20 |
u8 coalesc_timer_cfg; |
| 21 |
u8 resend_timer_cfg; |
| 22 |
}; |
| 23 |
|
| 24 |
int hinic3_set_interrupt_cfg_direct(struct hinic3_hwdev *hwdev, |
| 25 |
const struct hinic3_interrupt_info *info); |
| 26 |
int hinic3_set_interrupt_cfg(struct hinic3_hwdev *hwdev, |
| 27 |
struct hinic3_interrupt_info info); |
| 28 |
int hinic3_func_reset(struct hinic3_hwdev *hwdev, u16 func_id, u64 reset_flag); |
| 29 |
|
| 30 |
int hinic3_get_comm_features(struct hinic3_hwdev *hwdev, u64 *s_feature, |
| 31 |
u16 size); |
| 32 |
int hinic3_set_comm_features(struct hinic3_hwdev *hwdev, u64 *s_feature, |
| 33 |
u16 size); |
| 34 |
int hinic3_get_global_attr(struct hinic3_hwdev *hwdev, |
| 35 |
struct comm_global_attr *attr); |
| 36 |
int hinic3_set_func_svc_used_state(struct hinic3_hwdev *hwdev, u16 svc_type, |
| 37 |
u8 state); |
| 38 |
int hinic3_set_dma_attr_tbl(struct hinic3_hwdev *hwdev, u8 entry_idx, u8 st, |
| 39 |
u8 at, u8 ph, u8 no_snooping, u8 tph_en); |
| 40 |
|
| 41 |
int hinic3_set_wq_page_size(struct hinic3_hwdev *hwdev, u16 func_idx, |
| 42 |
u32 page_size); |
| 43 |
int hinic3_set_cmdq_depth(struct hinic3_hwdev *hwdev, u16 cmdq_depth); |
| 44 |
int hinic3_func_rx_tx_flush(struct hinic3_hwdev *hwdev); |
| 45 |
int hinic3_set_bdf_ctxt(struct hinic3_hwdev *hwdev, |
| 46 |
struct comm_cmd_bdf_info *bdf_info); |
| 47 |
void hinic3_sync_time_to_fw(struct hinic3_hwdev *hwdev); |
| 48 |
|
| 49 |
int hinic3_set_root_ctxt(struct hinic3_hwdev *hwdev, u32 rq_depth, u32 sq_depth, |
| 50 |
int rx_buf_sz); |
| 51 |
int hinic3_clean_root_ctxt(struct hinic3_hwdev *hwdev); |
| 52 |
|
| 53 |
#endif |