| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
/* Huawei HiNIC PCI Express Linux driver |
| 3 |
* Copyright(c) 2017 Huawei Technologies Co., Ltd |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef HINIC_DEBUGFS_H |
| 7 |
#define HINIC_DEBUGFS_H |
| 8 |
|
| 9 |
#include "hinic_dev.h" |
| 10 |
|
| 11 |
#define TBL_ID_FUNC_CFG_SM_NODE 11 |
| 12 |
#define TBL_ID_FUNC_CFG_SM_INST 1 |
| 13 |
|
| 14 |
#define HINIC_FUNCTION_CONFIGURE_TABLE_SIZE 64 |
| 15 |
|
| 16 |
struct hinic_cmd_lt_rd { |
| 17 |
u8 status; |
| 18 |
u8 version; |
| 19 |
u8 rsvd0[6]; |
| 20 |
|
| 21 |
unsigned char node; |
| 22 |
unsigned char inst; |
| 23 |
unsigned char entry_size; |
| 24 |
unsigned char rsvd; |
| 25 |
unsigned int lt_index; |
| 26 |
unsigned int offset; |
| 27 |
unsigned int len; |
| 28 |
unsigned char data[100]; |
| 29 |
}; |
| 30 |
|
| 31 |
struct tag_sml_funcfg_tbl { |
| 32 |
union { |
| 33 |
struct { |
| 34 |
u32 rsvd0 :8; |
| 35 |
u32 nic_rx_mode :5; |
| 36 |
u32 rsvd1 :18; |
| 37 |
u32 valid :1; |
| 38 |
} bs; |
| 39 |
|
| 40 |
u32 value; |
| 41 |
} dw0; |
| 42 |
|
| 43 |
union { |
| 44 |
struct { |
| 45 |
u32 vlan_id :12; |
| 46 |
u32 vlan_mode :3; |
| 47 |
u32 fast_recycled_mode :1; |
| 48 |
u32 mtu :16; |
| 49 |
} bs; |
| 50 |
|
| 51 |
u32 value; |
| 52 |
} dw1; |
| 53 |
|
| 54 |
u32 dw2; |
| 55 |
u32 dw3; |
| 56 |
u32 dw4; |
| 57 |
u32 dw5; |
| 58 |
u32 dw6; |
| 59 |
u32 dw7; |
| 60 |
u32 dw8; |
| 61 |
u32 dw9; |
| 62 |
u32 dw10; |
| 63 |
u32 dw11; |
| 64 |
u32 dw12; |
| 65 |
|
| 66 |
union { |
| 67 |
struct { |
| 68 |
u32 rsvd2 :15; |
| 69 |
u32 cfg_q_num :9; |
| 70 |
u32 cfg_rq_depth :6; |
| 71 |
u32 vhd_type :2; |
| 72 |
} bs; |
| 73 |
|
| 74 |
u32 value; |
| 75 |
} dw13; |
| 76 |
|
| 77 |
u32 dw14; |
| 78 |
u32 dw15; |
| 79 |
}; |
| 80 |
|
| 81 |
int hinic_sq_debug_add(struct hinic_dev *dev, u16 sq_id); |
| 82 |
|
| 83 |
void hinic_sq_debug_rem(struct hinic_sq *sq); |
| 84 |
|
| 85 |
int hinic_rq_debug_add(struct hinic_dev *dev, u16 rq_id); |
| 86 |
|
| 87 |
void hinic_rq_debug_rem(struct hinic_rq *rq); |
| 88 |
|
| 89 |
int hinic_func_table_debug_add(struct hinic_dev *dev); |
| 90 |
|
| 91 |
void hinic_func_table_debug_rem(struct hinic_dev *dev); |
| 92 |
|
| 93 |
void hinic_sq_dbgfs_init(struct hinic_dev *nic_dev); |
| 94 |
|
| 95 |
void hinic_sq_dbgfs_uninit(struct hinic_dev *nic_dev); |
| 96 |
|
| 97 |
void hinic_rq_dbgfs_init(struct hinic_dev *nic_dev); |
| 98 |
|
| 99 |
void hinic_rq_dbgfs_uninit(struct hinic_dev *nic_dev); |
| 100 |
|
| 101 |
void hinic_func_tbl_dbgfs_init(struct hinic_dev *nic_dev); |
| 102 |
|
| 103 |
void hinic_func_tbl_dbgfs_uninit(struct hinic_dev *nic_dev); |
| 104 |
|
| 105 |
void hinic_dbg_init(struct hinic_dev *nic_dev); |
| 106 |
|
| 107 |
void hinic_dbg_uninit(struct hinic_dev *nic_dev); |
| 108 |
|
| 109 |
void hinic_dbg_register_debugfs(const char *debugfs_dir_name); |
| 110 |
|
| 111 |
void hinic_dbg_unregister_debugfs(void); |
| 112 |
|
| 113 |
#endif |