sfxge(4): move RxDP config get to EF10 NIC code
Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18144
This commit is contained in:
parent
4f58306ca6
commit
45becd7603
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=341022
@ -1170,6 +1170,11 @@ efx_mcdi_get_clock(
|
||||
__out uint32_t *dpcpu_freqp);
|
||||
|
||||
|
||||
extern __checkReturn efx_rc_t
|
||||
efx_mcdi_get_rxdp_config(
|
||||
__in efx_nic_t *enp,
|
||||
__out uint32_t *end_paddingp);
|
||||
|
||||
extern __checkReturn efx_rc_t
|
||||
efx_mcdi_get_vector_cfg(
|
||||
__in efx_nic_t *enp,
|
||||
|
@ -447,6 +447,64 @@ efx_mcdi_get_clock(
|
||||
fail1:
|
||||
EFSYS_PROBE1(fail1, efx_rc_t, rc);
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
__checkReturn efx_rc_t
|
||||
efx_mcdi_get_rxdp_config(
|
||||
__in efx_nic_t *enp,
|
||||
__out uint32_t *end_paddingp)
|
||||
{
|
||||
efx_mcdi_req_t req;
|
||||
uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN,
|
||||
MC_CMD_GET_RXDP_CONFIG_OUT_LEN)];
|
||||
uint32_t end_padding;
|
||||
efx_rc_t rc;
|
||||
|
||||
memset(payload, 0, sizeof (payload));
|
||||
req.emr_cmd = MC_CMD_GET_RXDP_CONFIG;
|
||||
req.emr_in_buf = payload;
|
||||
req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN;
|
||||
req.emr_out_buf = payload;
|
||||
req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN;
|
||||
|
||||
efx_mcdi_execute(enp, &req);
|
||||
if (req.emr_rc != 0) {
|
||||
rc = req.emr_rc;
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
|
||||
GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) {
|
||||
/* RX DMA end padding is disabled */
|
||||
end_padding = 0;
|
||||
} else {
|
||||
switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
|
||||
GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) {
|
||||
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64:
|
||||
end_padding = 64;
|
||||
break;
|
||||
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128:
|
||||
end_padding = 128;
|
||||
break;
|
||||
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256:
|
||||
end_padding = 256;
|
||||
break;
|
||||
default:
|
||||
rc = ENOTSUP;
|
||||
goto fail2;
|
||||
}
|
||||
}
|
||||
|
||||
*end_paddingp = end_padding;
|
||||
|
||||
return (0);
|
||||
|
||||
fail2:
|
||||
EFSYS_PROBE(fail2);
|
||||
fail1:
|
||||
EFSYS_PROBE1(fail1, efx_rc_t, rc);
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
|
@ -39,64 +39,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#if EFSYS_OPT_MEDFORD2
|
||||
|
||||
static __checkReturn efx_rc_t
|
||||
efx_mcdi_get_rxdp_config(
|
||||
__in efx_nic_t *enp,
|
||||
__out uint32_t *end_paddingp)
|
||||
{
|
||||
efx_mcdi_req_t req;
|
||||
uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN,
|
||||
MC_CMD_GET_RXDP_CONFIG_OUT_LEN)];
|
||||
uint32_t end_padding;
|
||||
efx_rc_t rc;
|
||||
|
||||
memset(payload, 0, sizeof (payload));
|
||||
req.emr_cmd = MC_CMD_GET_RXDP_CONFIG;
|
||||
req.emr_in_buf = payload;
|
||||
req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN;
|
||||
req.emr_out_buf = payload;
|
||||
req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN;
|
||||
|
||||
efx_mcdi_execute(enp, &req);
|
||||
if (req.emr_rc != 0) {
|
||||
rc = req.emr_rc;
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
|
||||
GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) {
|
||||
/* RX DMA end padding is disabled */
|
||||
end_padding = 0;
|
||||
} else {
|
||||
switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
|
||||
GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) {
|
||||
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64:
|
||||
end_padding = 64;
|
||||
break;
|
||||
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128:
|
||||
end_padding = 128;
|
||||
break;
|
||||
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256:
|
||||
end_padding = 256;
|
||||
break;
|
||||
default:
|
||||
rc = ENOTSUP;
|
||||
goto fail2;
|
||||
}
|
||||
}
|
||||
|
||||
*end_paddingp = end_padding;
|
||||
|
||||
return (0);
|
||||
|
||||
fail2:
|
||||
EFSYS_PROBE(fail2);
|
||||
fail1:
|
||||
EFSYS_PROBE1(fail1, efx_rc_t, rc);
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
static __checkReturn efx_rc_t
|
||||
medford2_nic_get_required_pcie_bandwidth(
|
||||
__in efx_nic_t *enp,
|
||||
|
@ -37,64 +37,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#if EFSYS_OPT_MEDFORD
|
||||
|
||||
static __checkReturn efx_rc_t
|
||||
efx_mcdi_get_rxdp_config(
|
||||
__in efx_nic_t *enp,
|
||||
__out uint32_t *end_paddingp)
|
||||
{
|
||||
efx_mcdi_req_t req;
|
||||
uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN,
|
||||
MC_CMD_GET_RXDP_CONFIG_OUT_LEN)];
|
||||
uint32_t end_padding;
|
||||
efx_rc_t rc;
|
||||
|
||||
memset(payload, 0, sizeof (payload));
|
||||
req.emr_cmd = MC_CMD_GET_RXDP_CONFIG;
|
||||
req.emr_in_buf = payload;
|
||||
req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN;
|
||||
req.emr_out_buf = payload;
|
||||
req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN;
|
||||
|
||||
efx_mcdi_execute(enp, &req);
|
||||
if (req.emr_rc != 0) {
|
||||
rc = req.emr_rc;
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
|
||||
GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) {
|
||||
/* RX DMA end padding is disabled */
|
||||
end_padding = 0;
|
||||
} else {
|
||||
switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
|
||||
GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) {
|
||||
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64:
|
||||
end_padding = 64;
|
||||
break;
|
||||
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128:
|
||||
end_padding = 128;
|
||||
break;
|
||||
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256:
|
||||
end_padding = 256;
|
||||
break;
|
||||
default:
|
||||
rc = ENOTSUP;
|
||||
goto fail2;
|
||||
}
|
||||
}
|
||||
|
||||
*end_paddingp = end_padding;
|
||||
|
||||
return (0);
|
||||
|
||||
fail2:
|
||||
EFSYS_PROBE(fail2);
|
||||
fail1:
|
||||
EFSYS_PROBE1(fail1, efx_rc_t, rc);
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
static __checkReturn efx_rc_t
|
||||
medford_nic_get_required_pcie_bandwidth(
|
||||
__in efx_nic_t *enp,
|
||||
|
Loading…
Reference in New Issue
Block a user