mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 19:41:34 +07:00
qed: hw_init() to receive parameter-struct
We'll soon need additional information, so start by changing the infrastructure to receive the initializing variables via a parameter struct. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1226337ad9
commit
c0c2d0b49e
@ -1106,25 +1106,20 @@ static void qed_reset_mb_shadow(struct qed_hwfn *p_hwfn,
|
|||||||
p_hwfn->mcp_info->mfw_mb_cur, p_hwfn->mcp_info->mfw_mb_length);
|
p_hwfn->mcp_info->mfw_mb_cur, p_hwfn->mcp_info->mfw_mb_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
int qed_hw_init(struct qed_dev *cdev,
|
int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
|
||||||
struct qed_tunn_start_params *p_tunn,
|
|
||||||
bool b_hw_start,
|
|
||||||
enum qed_int_mode int_mode,
|
|
||||||
bool allow_npar_tx_switch,
|
|
||||||
const u8 *bin_fw_data)
|
|
||||||
{
|
{
|
||||||
u32 load_code, param, drv_mb_param;
|
u32 load_code, param, drv_mb_param;
|
||||||
bool b_default_mtu = true;
|
bool b_default_mtu = true;
|
||||||
struct qed_hwfn *p_hwfn;
|
struct qed_hwfn *p_hwfn;
|
||||||
int rc = 0, mfw_rc, i;
|
int rc = 0, mfw_rc, i;
|
||||||
|
|
||||||
if ((int_mode == QED_INT_MODE_MSI) && (cdev->num_hwfns > 1)) {
|
if ((p_params->int_mode == QED_INT_MODE_MSI) && (cdev->num_hwfns > 1)) {
|
||||||
DP_NOTICE(cdev, "MSI mode is not supported for CMT devices\n");
|
DP_NOTICE(cdev, "MSI mode is not supported for CMT devices\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_PF(cdev)) {
|
if (IS_PF(cdev)) {
|
||||||
rc = qed_init_fw_data(cdev, bin_fw_data);
|
rc = qed_init_fw_data(cdev, p_params->bin_fw_data);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -1181,11 +1176,15 @@ int qed_hw_init(struct qed_dev *cdev,
|
|||||||
/* Fall into */
|
/* Fall into */
|
||||||
case FW_MSG_CODE_DRV_LOAD_FUNCTION:
|
case FW_MSG_CODE_DRV_LOAD_FUNCTION:
|
||||||
rc = qed_hw_init_pf(p_hwfn, p_hwfn->p_main_ptt,
|
rc = qed_hw_init_pf(p_hwfn, p_hwfn->p_main_ptt,
|
||||||
p_tunn, p_hwfn->hw_info.hw_mode,
|
p_params->p_tunn,
|
||||||
b_hw_start, int_mode,
|
p_hwfn->hw_info.hw_mode,
|
||||||
allow_npar_tx_switch);
|
p_params->b_hw_start,
|
||||||
|
p_params->int_mode,
|
||||||
|
p_params->allow_npar_tx_switch);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
DP_NOTICE(p_hwfn,
|
||||||
|
"Unexpected load code [0x%08x]", load_code);
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -82,26 +82,31 @@ int qed_resc_alloc(struct qed_dev *cdev);
|
|||||||
*/
|
*/
|
||||||
void qed_resc_setup(struct qed_dev *cdev);
|
void qed_resc_setup(struct qed_dev *cdev);
|
||||||
|
|
||||||
|
struct qed_hw_init_params {
|
||||||
|
/* Tunneling parameters */
|
||||||
|
struct qed_tunn_start_params *p_tunn;
|
||||||
|
|
||||||
|
bool b_hw_start;
|
||||||
|
|
||||||
|
/* Interrupt mode [msix, inta, etc.] to use */
|
||||||
|
enum qed_int_mode int_mode;
|
||||||
|
|
||||||
|
/* NPAR tx switching to be used for vports for tx-switching */
|
||||||
|
bool allow_npar_tx_switch;
|
||||||
|
|
||||||
|
/* Binary fw data pointer in binary fw file */
|
||||||
|
const u8 *bin_fw_data;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief qed_hw_init -
|
* @brief qed_hw_init -
|
||||||
*
|
*
|
||||||
* @param cdev
|
* @param cdev
|
||||||
* @param p_tunn
|
* @param p_params
|
||||||
* @param b_hw_start
|
|
||||||
* @param int_mode - interrupt mode [msix, inta, etc.] to use.
|
|
||||||
* @param allow_npar_tx_switch - npar tx switching to be used
|
|
||||||
* for vports configured for tx-switching.
|
|
||||||
* @param bin_fw_data - binary fw data pointer in binary fw file.
|
|
||||||
* Pass NULL if not using binary fw file.
|
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
int qed_hw_init(struct qed_dev *cdev,
|
int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params);
|
||||||
struct qed_tunn_start_params *p_tunn,
|
|
||||||
bool b_hw_start,
|
|
||||||
enum qed_int_mode int_mode,
|
|
||||||
bool allow_npar_tx_switch,
|
|
||||||
const u8 *bin_fw_data);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief qed_hw_timers_stop_all - stop the timers HW block
|
* @brief qed_hw_timers_stop_all - stop the timers HW block
|
||||||
|
@ -901,6 +901,7 @@ static void qed_update_pf_params(struct qed_dev *cdev,
|
|||||||
static int qed_slowpath_start(struct qed_dev *cdev,
|
static int qed_slowpath_start(struct qed_dev *cdev,
|
||||||
struct qed_slowpath_params *params)
|
struct qed_slowpath_params *params)
|
||||||
{
|
{
|
||||||
|
struct qed_hw_init_params hw_init_params;
|
||||||
struct qed_tunn_start_params tunn_info;
|
struct qed_tunn_start_params tunn_info;
|
||||||
struct qed_mcp_drv_version drv_version;
|
struct qed_mcp_drv_version drv_version;
|
||||||
const u8 *data = NULL;
|
const u8 *data = NULL;
|
||||||
@ -966,9 +967,14 @@ static int qed_slowpath_start(struct qed_dev *cdev,
|
|||||||
tunn_info.tunn_clss_ipgre = QED_TUNN_CLSS_MAC_VLAN;
|
tunn_info.tunn_clss_ipgre = QED_TUNN_CLSS_MAC_VLAN;
|
||||||
|
|
||||||
/* Start the slowpath */
|
/* Start the slowpath */
|
||||||
rc = qed_hw_init(cdev, &tunn_info, true,
|
memset(&hw_init_params, 0, sizeof(hw_init_params));
|
||||||
cdev->int_params.out.int_mode,
|
hw_init_params.p_tunn = &tunn_info;
|
||||||
true, data);
|
hw_init_params.b_hw_start = true;
|
||||||
|
hw_init_params.int_mode = cdev->int_params.out.int_mode;
|
||||||
|
hw_init_params.allow_npar_tx_switch = true;
|
||||||
|
hw_init_params.bin_fw_data = data;
|
||||||
|
|
||||||
|
rc = qed_hw_init(cdev, &hw_init_params);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto err2;
|
goto err2;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user