From c68f27a2a48f7c0276d4032e4ca8f11d4cb5ea9d Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Fri, 6 Oct 2017 23:31:05 -0700 Subject: [PATCH] net/qede/base: semantic changes - Move define CRC8_TABLE_SIZE to header file - Move/relocate ecore_vf_start() - Other semantic changes Signed-off-by: Rasesh Mody --- drivers/net/qede/base/ecore.h | 2 ++ drivers/net/qede/base/ecore_dcbx.c | 8 ++--- drivers/net/qede/base/ecore_dev.c | 34 ++++++++++----------- drivers/net/qede/base/ecore_init_fw_funcs.c | 1 - drivers/net/qede/base/ecore_mcp.c | 4 +-- drivers/net/qede/base/ecore_spq.c | 4 +-- 6 files changed, 27 insertions(+), 26 deletions(-) diff --git a/drivers/net/qede/base/ecore.h b/drivers/net/qede/base/ecore.h index dc09847c60..5eff6aa169 100644 --- a/drivers/net/qede/base/ecore.h +++ b/drivers/net/qede/base/ecore.h @@ -871,6 +871,8 @@ struct ecore_dev { #define NUM_OF_ENG_PFS(dev) (ECORE_IS_BB(dev) ? MAX_NUM_PFS_BB \ : MAX_NUM_PFS_K2) +#define CRC8_TABLE_SIZE 256 + /** * @brief ecore_concrete_to_sw_fid - get the sw function id from * the concrete value. diff --git a/drivers/net/qede/base/ecore_dcbx.c b/drivers/net/qede/base/ecore_dcbx.c index af8a239250..edb711e429 100644 --- a/drivers/net/qede/base/ecore_dcbx.c +++ b/drivers/net/qede/base/ecore_dcbx.c @@ -318,14 +318,14 @@ static enum _ecore_status_t ecore_dcbx_process_mib_info(struct ecore_hwfn *p_hwfn) { struct dcbx_app_priority_feature *p_app; - enum _ecore_status_t rc = ECORE_SUCCESS; - struct ecore_dcbx_results data = { 0 }; struct dcbx_app_priority_entry *p_tbl; + struct ecore_dcbx_results data = { 0 }; struct dcbx_ets_feature *p_ets; struct ecore_hw_info *p_info; u32 pri_tc_tbl, flags; u8 dcbx_version; int num_entries; + enum _ecore_status_t rc = ECORE_SUCCESS; flags = p_hwfn->p_dcbx_info->operational.flags; dcbx_version = GET_MFW_FIELD(flags, DCBX_CONFIG_VERSION); @@ -363,9 +363,9 @@ ecore_dcbx_copy_mib(struct ecore_hwfn *p_hwfn, struct ecore_dcbx_mib_meta_data *p_data, enum ecore_mib_read_type type) { - enum _ecore_status_t rc = ECORE_SUCCESS; u32 prefix_seq_num, suffix_seq_num; int read_count = 0; + enum _ecore_status_t rc = ECORE_SUCCESS; /* The data is considered to be valid only if both sequence numbers are * the same. @@ -859,7 +859,7 @@ static enum _ecore_status_t ecore_dcbx_read_mib(struct ecore_hwfn *p_hwfn, DP_ERR(p_hwfn, "MIB read err, unknown mib type %d\n", type); } - return rc; + return ECORE_SUCCESS; } /* diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c index c81048a245..412af07365 100644 --- a/drivers/net/qede/base/ecore_dev.c +++ b/drivers/net/qede/base/ecore_dev.c @@ -2283,19 +2283,6 @@ static void ecore_reset_mb_shadow(struct ecore_hwfn *p_hwfn, p_hwfn->mcp_info->mfw_mb_length); } -enum _ecore_status_t ecore_vf_start(struct ecore_hwfn *p_hwfn, - struct ecore_hw_init_params *p_params) -{ - if (p_params->p_tunn) { - ecore_vf_set_vf_start_tunn_update_param(p_params->p_tunn); - ecore_vf_pf_tunnel_param_update(p_hwfn, p_params->p_tunn); - } - - p_hwfn->b_int_enabled = 1; - - return ECORE_SUCCESS; -} - static void ecore_pglueb_clear_err(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt) { @@ -2327,6 +2314,19 @@ ecore_fill_load_req_params(struct ecore_load_req_params *p_load_req, } } +enum _ecore_status_t ecore_vf_start(struct ecore_hwfn *p_hwfn, + struct ecore_hw_init_params *p_params) +{ + if (p_params->p_tunn) { + ecore_vf_set_vf_start_tunn_update_param(p_params->p_tunn); + ecore_vf_pf_tunnel_param_update(p_hwfn, p_params->p_tunn); + } + + p_hwfn->b_int_enabled = 1; + + return ECORE_SUCCESS; +} + enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev, struct ecore_hw_init_params *p_params) { @@ -4414,11 +4414,11 @@ ecore_chain_alloc_pbl(struct ecore_dev *p_dev, struct ecore_chain *p_chain, struct ecore_chain_ext_pbl *ext_pbl) { - void *p_virt = OSAL_NULL; - u8 *p_pbl_virt = OSAL_NULL; - void **pp_virt_addr_tbl = OSAL_NULL; - dma_addr_t p_phys = 0, p_pbl_phys = 0; u32 page_cnt = p_chain->page_cnt, size, i; + dma_addr_t p_phys = 0, p_pbl_phys = 0; + void **pp_virt_addr_tbl = OSAL_NULL; + u8 *p_pbl_virt = OSAL_NULL; + void *p_virt = OSAL_NULL; size = page_cnt * sizeof(*pp_virt_addr_tbl); pp_virt_addr_tbl = (void **)OSAL_VZALLOC(p_dev, size); diff --git a/drivers/net/qede/base/ecore_init_fw_funcs.c b/drivers/net/qede/base/ecore_init_fw_funcs.c index a739ba8fce..1da80a6515 100644 --- a/drivers/net/qede/base/ecore_init_fw_funcs.c +++ b/drivers/net/qede/base/ecore_init_fw_funcs.c @@ -1769,7 +1769,6 @@ u32 ecore_get_mstorm_eth_vf_prods_offset(struct ecore_hwfn *p_hwfn, #ifndef LINUX_REMOVE #define CRC8_INIT_VALUE 0xFF -#define CRC8_TABLE_SIZE 256 #endif static u8 cdu_crc8_table[CRC8_TABLE_SIZE]; diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c index 3caf08ba0a..028fbb30b7 100644 --- a/drivers/net/qede/base/ecore_mcp.c +++ b/drivers/net/qede/base/ecore_mcp.c @@ -2555,9 +2555,9 @@ ecore_mcp_ov_update_current_config(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, enum ecore_ov_client client) { - enum _ecore_status_t rc; u32 resp = 0, param = 0; u32 drv_mb_param; + enum _ecore_status_t rc; switch (client) { case ECORE_OV_CLIENT_DRV: @@ -2587,9 +2587,9 @@ ecore_mcp_ov_update_driver_state(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, enum ecore_ov_driver_state drv_state) { - enum _ecore_status_t rc; u32 resp = 0, param = 0; u32 drv_mb_param; + enum _ecore_status_t rc; switch (drv_state) { case ECORE_OV_DRIVER_STATE_NOT_LOADED: diff --git a/drivers/net/qede/base/ecore_spq.c b/drivers/net/qede/base/ecore_spq.c index 75adcdaa44..70ffa8cd1c 100644 --- a/drivers/net/qede/base/ecore_spq.c +++ b/drivers/net/qede/base/ecore_spq.c @@ -178,10 +178,10 @@ ecore_spq_fill_entry(struct ecore_hwfn *p_hwfn, struct ecore_spq_entry *p_ent) static void ecore_spq_hw_initialize(struct ecore_hwfn *p_hwfn, struct ecore_spq *p_spq) { - struct ecore_cxt_info cxt_info; struct e4_core_conn_context *p_cxt; - enum _ecore_status_t rc; + struct ecore_cxt_info cxt_info; u16 physical_q; + enum _ecore_status_t rc; cxt_info.iid = p_spq->cid; -- 2.20.1