Commit ca352f00 authored by Igor Russkikh's avatar Igor Russkikh Committed by David S. Miller

net: qed: cleanup debug related declarations

Thats probably a legacy code had double declaration of some fields.
Cleanup this, removing copy and fixing references.
Signed-off-by: default avatarAriel Elior <ariel.elior@marvell.com>
Signed-off-by: default avatarMichal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d8d6c5a7
...@@ -740,12 +740,6 @@ struct qed_dbg_feature { ...@@ -740,12 +740,6 @@ struct qed_dbg_feature {
u32 dumped_dwords; u32 dumped_dwords;
}; };
struct qed_dbg_params {
struct qed_dbg_feature features[DBG_FEATURE_NUM];
u8 engine_for_debug;
bool print_data;
};
struct qed_dev { struct qed_dev {
u32 dp_module; u32 dp_module;
u8 dp_level; u8 dp_level;
...@@ -872,17 +866,18 @@ struct qed_dev { ...@@ -872,17 +866,18 @@ struct qed_dev {
} protocol_ops; } protocol_ops;
void *ops_cookie; void *ops_cookie;
struct qed_dbg_params dbg_params;
#ifdef CONFIG_QED_LL2 #ifdef CONFIG_QED_LL2
struct qed_cb_ll2_info *ll2; struct qed_cb_ll2_info *ll2;
u8 ll2_mac_address[ETH_ALEN]; u8 ll2_mac_address[ETH_ALEN];
#endif #endif
struct qed_dbg_feature dbg_features[DBG_FEATURE_NUM]; struct qed_dbg_feature dbg_features[DBG_FEATURE_NUM];
u8 engine_for_debug;
bool disable_ilt_dump; bool disable_ilt_dump;
DECLARE_HASHTABLE(connections, 10); DECLARE_HASHTABLE(connections, 10);
const struct firmware *firmware; const struct firmware *firmware;
bool print_dbg_data;
u32 rdma_max_sge; u32 rdma_max_sge;
u32 rdma_max_inline; u32 rdma_max_inline;
u32 rdma_max_srq_sge; u32 rdma_max_srq_sge;
......
...@@ -7453,7 +7453,7 @@ static enum dbg_status format_feature(struct qed_hwfn *p_hwfn, ...@@ -7453,7 +7453,7 @@ static enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
enum qed_dbg_features feature_idx) enum qed_dbg_features feature_idx)
{ {
struct qed_dbg_feature *feature = struct qed_dbg_feature *feature =
&p_hwfn->cdev->dbg_params.features[feature_idx]; &p_hwfn->cdev->dbg_features[feature_idx];
u32 text_size_bytes, null_char_pos, i; u32 text_size_bytes, null_char_pos, i;
enum dbg_status rc; enum dbg_status rc;
char *text_buf; char *text_buf;
...@@ -7502,7 +7502,7 @@ static enum dbg_status format_feature(struct qed_hwfn *p_hwfn, ...@@ -7502,7 +7502,7 @@ static enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
text_buf[i] = '\n'; text_buf[i] = '\n';
/* Dump printable feature to log */ /* Dump printable feature to log */
if (p_hwfn->cdev->dbg_params.print_data) if (p_hwfn->cdev->print_dbg_data)
qed_dbg_print_feature(text_buf, text_size_bytes); qed_dbg_print_feature(text_buf, text_size_bytes);
/* Free the old dump_buf and point the dump_buf to the newly allocagted /* Free the old dump_buf and point the dump_buf to the newly allocagted
...@@ -7523,7 +7523,7 @@ static enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn, ...@@ -7523,7 +7523,7 @@ static enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn,
enum qed_dbg_features feature_idx) enum qed_dbg_features feature_idx)
{ {
struct qed_dbg_feature *feature = struct qed_dbg_feature *feature =
&p_hwfn->cdev->dbg_params.features[feature_idx]; &p_hwfn->cdev->dbg_features[feature_idx];
u32 buf_size_dwords; u32 buf_size_dwords;
enum dbg_status rc; enum dbg_status rc;
...@@ -7648,7 +7648,7 @@ static int qed_dbg_nvm_image(struct qed_dev *cdev, void *buffer, ...@@ -7648,7 +7648,7 @@ static int qed_dbg_nvm_image(struct qed_dev *cdev, void *buffer,
enum qed_nvm_images image_id) enum qed_nvm_images image_id)
{ {
struct qed_hwfn *p_hwfn = struct qed_hwfn *p_hwfn =
&cdev->hwfns[cdev->dbg_params.engine_for_debug]; &cdev->hwfns[cdev->engine_for_debug];
u32 len_rounded, i; u32 len_rounded, i;
__be32 val; __be32 val;
int rc; int rc;
...@@ -7780,7 +7780,7 @@ int qed_dbg_all_data(struct qed_dev *cdev, void *buffer) ...@@ -7780,7 +7780,7 @@ int qed_dbg_all_data(struct qed_dev *cdev, void *buffer)
{ {
u8 cur_engine, omit_engine = 0, org_engine; u8 cur_engine, omit_engine = 0, org_engine;
struct qed_hwfn *p_hwfn = struct qed_hwfn *p_hwfn =
&cdev->hwfns[cdev->dbg_params.engine_for_debug]; &cdev->hwfns[cdev->engine_for_debug];
struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
int grc_params[MAX_DBG_GRC_PARAMS], i; int grc_params[MAX_DBG_GRC_PARAMS], i;
u32 offset = 0, feature_size; u32 offset = 0, feature_size;
...@@ -8000,7 +8000,7 @@ int qed_dbg_all_data(struct qed_dev *cdev, void *buffer) ...@@ -8000,7 +8000,7 @@ int qed_dbg_all_data(struct qed_dev *cdev, void *buffer)
int qed_dbg_all_data_size(struct qed_dev *cdev) int qed_dbg_all_data_size(struct qed_dev *cdev)
{ {
struct qed_hwfn *p_hwfn = struct qed_hwfn *p_hwfn =
&cdev->hwfns[cdev->dbg_params.engine_for_debug]; &cdev->hwfns[cdev->engine_for_debug];
u32 regs_len = 0, image_len = 0, ilt_len = 0, total_ilt_len = 0; u32 regs_len = 0, image_len = 0, ilt_len = 0, total_ilt_len = 0;
u8 cur_engine, org_engine; u8 cur_engine, org_engine;
...@@ -8059,9 +8059,9 @@ int qed_dbg_feature(struct qed_dev *cdev, void *buffer, ...@@ -8059,9 +8059,9 @@ int qed_dbg_feature(struct qed_dev *cdev, void *buffer,
enum qed_dbg_features feature, u32 *num_dumped_bytes) enum qed_dbg_features feature, u32 *num_dumped_bytes)
{ {
struct qed_hwfn *p_hwfn = struct qed_hwfn *p_hwfn =
&cdev->hwfns[cdev->dbg_params.engine_for_debug]; &cdev->hwfns[cdev->engine_for_debug];
struct qed_dbg_feature *qed_feature = struct qed_dbg_feature *qed_feature =
&cdev->dbg_params.features[feature]; &cdev->dbg_features[feature];
enum dbg_status dbg_rc; enum dbg_status dbg_rc;
struct qed_ptt *p_ptt; struct qed_ptt *p_ptt;
int rc = 0; int rc = 0;
...@@ -8084,7 +8084,7 @@ int qed_dbg_feature(struct qed_dev *cdev, void *buffer, ...@@ -8084,7 +8084,7 @@ int qed_dbg_feature(struct qed_dev *cdev, void *buffer,
DP_VERBOSE(cdev, QED_MSG_DEBUG, DP_VERBOSE(cdev, QED_MSG_DEBUG,
"copying debugfs feature to external buffer\n"); "copying debugfs feature to external buffer\n");
memcpy(buffer, qed_feature->dump_buf, qed_feature->buf_size); memcpy(buffer, qed_feature->dump_buf, qed_feature->buf_size);
*num_dumped_bytes = cdev->dbg_params.features[feature].dumped_dwords * *num_dumped_bytes = cdev->dbg_features[feature].dumped_dwords *
4; 4;
out: out:
...@@ -8095,7 +8095,7 @@ int qed_dbg_feature(struct qed_dev *cdev, void *buffer, ...@@ -8095,7 +8095,7 @@ int qed_dbg_feature(struct qed_dev *cdev, void *buffer,
int qed_dbg_feature_size(struct qed_dev *cdev, enum qed_dbg_features feature) int qed_dbg_feature_size(struct qed_dev *cdev, enum qed_dbg_features feature)
{ {
struct qed_hwfn *p_hwfn = struct qed_hwfn *p_hwfn =
&cdev->hwfns[cdev->dbg_params.engine_for_debug]; &cdev->hwfns[cdev->engine_for_debug];
struct qed_dbg_feature *qed_feature = &cdev->dbg_features[feature]; struct qed_dbg_feature *qed_feature = &cdev->dbg_features[feature];
struct qed_ptt *p_ptt = qed_ptt_acquire(p_hwfn); struct qed_ptt *p_ptt = qed_ptt_acquire(p_hwfn);
u32 buf_size_dwords; u32 buf_size_dwords;
...@@ -8120,14 +8120,14 @@ int qed_dbg_feature_size(struct qed_dev *cdev, enum qed_dbg_features feature) ...@@ -8120,14 +8120,14 @@ int qed_dbg_feature_size(struct qed_dev *cdev, enum qed_dbg_features feature)
u8 qed_get_debug_engine(struct qed_dev *cdev) u8 qed_get_debug_engine(struct qed_dev *cdev)
{ {
return cdev->dbg_params.engine_for_debug; return cdev->engine_for_debug;
} }
void qed_set_debug_engine(struct qed_dev *cdev, int engine_number) void qed_set_debug_engine(struct qed_dev *cdev, int engine_number)
{ {
DP_VERBOSE(cdev, QED_MSG_DEBUG, "set debug engine to %d\n", DP_VERBOSE(cdev, QED_MSG_DEBUG, "set debug engine to %d\n",
engine_number); engine_number);
cdev->dbg_params.engine_for_debug = engine_number; cdev->engine_for_debug = engine_number;
} }
void qed_dbg_pf_init(struct qed_dev *cdev) void qed_dbg_pf_init(struct qed_dev *cdev)
...@@ -8146,7 +8146,7 @@ void qed_dbg_pf_init(struct qed_dev *cdev) ...@@ -8146,7 +8146,7 @@ void qed_dbg_pf_init(struct qed_dev *cdev)
} }
/* Set the hwfn to be 0 as default */ /* Set the hwfn to be 0 as default */
cdev->dbg_params.engine_for_debug = 0; cdev->engine_for_debug = 0;
} }
void qed_dbg_pf_exit(struct qed_dev *cdev) void qed_dbg_pf_exit(struct qed_dev *cdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment