diff options
author | Zhongzhu Liu <liuzhongzhu@huawei.com> | 2019-08-28 22:23:05 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-29 16:57:43 -0700 |
commit | a582b78dfc33d211ecaadda4cb5765b382d9d682 (patch) | |
tree | 5b5bab3a47e0da9cc5edb0f17702053f5afb44d1 /drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h | |
parent | dpaa2-eth: Add pause frame support (diff) | |
download | linux-dev-a582b78dfc33d211ecaadda4cb5765b382d9d682.tar.xz linux-dev-a582b78dfc33d211ecaadda4cb5765b382d9d682.zip |
net: hns3: code optimization for debugfs related to "dump reg"
For making the code more readable, this patch uses a array to
keep the information about the dumping register, and then uses
it to parse the parameter cmd_buf which passing into
hclge_dbg_dump_reg_cmd().
Also replaces parameter "base" of kstrtouint with 0 in the
hclge_dbg_dump_reg_common(), which makes it more flexible.
Signed-off-by: Zhongzhu Liu <liuzhongzhu@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h index d055fda41775..80e5cc29fc20 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h @@ -4,6 +4,9 @@ #ifndef __HCLGE_DEBUGFS_H #define __HCLGE_DEBUGFS_H +#include <linux/etherdevice.h> +#include "hclge_cmd.h" + #define HCLGE_DBG_BUF_LEN 256 #define HCLGE_DBG_MNG_TBL_MAX 64 @@ -63,11 +66,24 @@ struct hclge_dbg_bitmap_cmd { }; }; +struct hclge_dbg_reg_common_msg { + int msg_num; + int offset; + enum hclge_opcode_type cmd; +}; + struct hclge_dbg_dfx_message { int flag; char message[60]; }; +#define HCLGE_DBG_MAC_REG_TYPE_LEN 32 +struct hclge_dbg_reg_type_info { + const char *reg_type; + struct hclge_dbg_dfx_message *dfx_msg; + struct hclge_dbg_reg_common_msg reg_msg; +}; + #pragma pack() static struct hclge_dbg_dfx_message hclge_dbg_bios_common_reg[] = { |