Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/sfxge/common/ef10_phy.c
Show First 20 Lines • Show All 604 Lines • ▼ Show 20 Lines | ef10_bist_poll( | ||||
__in efx_bist_type_t type, | __in efx_bist_type_t type, | ||||
__out efx_bist_result_t *resultp, | __out efx_bist_result_t *resultp, | ||||
__out_opt __drv_when(count > 0, __notnull) | __out_opt __drv_when(count > 0, __notnull) | ||||
uint32_t *value_maskp, | uint32_t *value_maskp, | ||||
__out_ecount_opt(count) __drv_when(count > 0, __notnull) | __out_ecount_opt(count) __drv_when(count > 0, __notnull) | ||||
unsigned long *valuesp, | unsigned long *valuesp, | ||||
__in size_t count) | __in size_t count) | ||||
{ | { | ||||
/* | |||||
* MCDI_CTL_SDU_LEN_MAX_V1 is large enough cover all BIST results, | |||||
* whilst not wasting stack. | |||||
*/ | |||||
uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, MCDI_CTL_SDU_LEN_MAX_V1)]; | |||||
efx_nic_cfg_t *encp = &(enp->en_nic_cfg); | efx_nic_cfg_t *encp = &(enp->en_nic_cfg); | ||||
efx_mcdi_req_t req; | efx_mcdi_req_t req; | ||||
uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, | |||||
MCDI_CTL_SDU_LEN_MAX)]; | |||||
uint32_t value_mask = 0; | uint32_t value_mask = 0; | ||||
uint32_t result; | uint32_t result; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_LEN <= | |||||
MCDI_CTL_SDU_LEN_MAX_V1); | |||||
EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_SFT9001_LEN <= | |||||
MCDI_CTL_SDU_LEN_MAX_V1); | |||||
EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MRSFP_LEN <= | |||||
MCDI_CTL_SDU_LEN_MAX_V1); | |||||
EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MEM_LEN <= | |||||
MCDI_CTL_SDU_LEN_MAX_V1); | |||||
_NOTE(ARGUNUSED(type)) | _NOTE(ARGUNUSED(type)) | ||||
(void) memset(payload, 0, sizeof (payload)); | (void) memset(payload, 0, sizeof (payload)); | ||||
req.emr_cmd = MC_CMD_POLL_BIST; | req.emr_cmd = MC_CMD_POLL_BIST; | ||||
req.emr_in_buf = payload; | req.emr_in_buf = payload; | ||||
req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; | req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; | ||||
req.emr_out_buf = payload; | req.emr_out_buf = payload; | ||||
req.emr_out_length = MCDI_CTL_SDU_LEN_MAX; | req.emr_out_length = MCDI_CTL_SDU_LEN_MAX_V1; | ||||
efx_mcdi_execute(enp, &req); | efx_mcdi_execute(enp, &req); | ||||
if (req.emr_rc != 0) { | if (req.emr_rc != 0) { | ||||
rc = req.emr_rc; | rc = req.emr_rc; | ||||
goto fail1; | goto fail1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |