18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* Huawei HiNIC PCI Express Linux driver 38c2ecf20Sopenharmony_ci * Copyright(c) 2017 Huawei Technologies Co., Ltd 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef HINIC_DEBUGFS_H 78c2ecf20Sopenharmony_ci#define HINIC_DEBUGFS_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include "hinic_dev.h" 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define TBL_ID_FUNC_CFG_SM_NODE 11 128c2ecf20Sopenharmony_ci#define TBL_ID_FUNC_CFG_SM_INST 1 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#define HINIC_FUNCTION_CONFIGURE_TABLE_SIZE 64 158c2ecf20Sopenharmony_ci#define HINIC_FUNCTION_CONFIGURE_TABLE 1 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_cistruct hinic_cmd_lt_rd { 188c2ecf20Sopenharmony_ci u8 status; 198c2ecf20Sopenharmony_ci u8 version; 208c2ecf20Sopenharmony_ci u8 rsvd0[6]; 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci unsigned char node; 238c2ecf20Sopenharmony_ci unsigned char inst; 248c2ecf20Sopenharmony_ci unsigned char entry_size; 258c2ecf20Sopenharmony_ci unsigned char rsvd; 268c2ecf20Sopenharmony_ci unsigned int lt_index; 278c2ecf20Sopenharmony_ci unsigned int offset; 288c2ecf20Sopenharmony_ci unsigned int len; 298c2ecf20Sopenharmony_ci unsigned char data[100]; 308c2ecf20Sopenharmony_ci}; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_cistruct tag_sml_funcfg_tbl { 338c2ecf20Sopenharmony_ci union { 348c2ecf20Sopenharmony_ci struct { 358c2ecf20Sopenharmony_ci u32 rsvd0 :8; 368c2ecf20Sopenharmony_ci u32 nic_rx_mode :5; 378c2ecf20Sopenharmony_ci u32 rsvd1 :18; 388c2ecf20Sopenharmony_ci u32 valid :1; 398c2ecf20Sopenharmony_ci } bs; 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci u32 value; 428c2ecf20Sopenharmony_ci } dw0; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci union { 458c2ecf20Sopenharmony_ci struct { 468c2ecf20Sopenharmony_ci u32 vlan_id :12; 478c2ecf20Sopenharmony_ci u32 vlan_mode :3; 488c2ecf20Sopenharmony_ci u32 fast_recycled_mode :1; 498c2ecf20Sopenharmony_ci u32 mtu :16; 508c2ecf20Sopenharmony_ci } bs; 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci u32 value; 538c2ecf20Sopenharmony_ci } dw1; 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci u32 dw2; 568c2ecf20Sopenharmony_ci u32 dw3; 578c2ecf20Sopenharmony_ci u32 dw4; 588c2ecf20Sopenharmony_ci u32 dw5; 598c2ecf20Sopenharmony_ci u32 dw6; 608c2ecf20Sopenharmony_ci u32 dw7; 618c2ecf20Sopenharmony_ci u32 dw8; 628c2ecf20Sopenharmony_ci u32 dw9; 638c2ecf20Sopenharmony_ci u32 dw10; 648c2ecf20Sopenharmony_ci u32 dw11; 658c2ecf20Sopenharmony_ci u32 dw12; 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci union { 688c2ecf20Sopenharmony_ci struct { 698c2ecf20Sopenharmony_ci u32 rsvd2 :15; 708c2ecf20Sopenharmony_ci u32 cfg_q_num :9; 718c2ecf20Sopenharmony_ci u32 cfg_rq_depth :6; 728c2ecf20Sopenharmony_ci u32 vhd_type :2; 738c2ecf20Sopenharmony_ci } bs; 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci u32 value; 768c2ecf20Sopenharmony_ci } dw13; 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci u32 dw14; 798c2ecf20Sopenharmony_ci u32 dw15; 808c2ecf20Sopenharmony_ci}; 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ciint hinic_sq_debug_add(struct hinic_dev *dev, u16 sq_id); 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_civoid hinic_sq_debug_rem(struct hinic_sq *sq); 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ciint hinic_rq_debug_add(struct hinic_dev *dev, u16 rq_id); 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_civoid hinic_rq_debug_rem(struct hinic_rq *rq); 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ciint hinic_func_table_debug_add(struct hinic_dev *dev); 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_civoid hinic_func_table_debug_rem(struct hinic_dev *dev); 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_civoid hinic_sq_dbgfs_init(struct hinic_dev *nic_dev); 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_civoid hinic_sq_dbgfs_uninit(struct hinic_dev *nic_dev); 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_civoid hinic_rq_dbgfs_init(struct hinic_dev *nic_dev); 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_civoid hinic_rq_dbgfs_uninit(struct hinic_dev *nic_dev); 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_civoid hinic_func_tbl_dbgfs_init(struct hinic_dev *nic_dev); 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_civoid hinic_func_tbl_dbgfs_uninit(struct hinic_dev *nic_dev); 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_civoid hinic_dbg_init(struct hinic_dev *nic_dev); 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_civoid hinic_dbg_uninit(struct hinic_dev *nic_dev); 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_civoid hinic_dbg_register_debugfs(const char *debugfs_dir_name); 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_civoid hinic_dbg_unregister_debugfs(void); 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci#endif 115