Commit 34ccfe6f authored by Daniel Pieczko's avatar Daniel Pieczko Committed by David S. Miller

sfc: add output flag decoding to efx_mcdi_set_workaround

The initial use of this will be to check a flag reporting if an FLR was
performed on other functions when enabling cascaded multicast filters.
Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 832dc9ed
...@@ -387,7 +387,7 @@ static int efx_ef10_probe(struct efx_nic *efx) ...@@ -387,7 +387,7 @@ static int efx_ef10_probe(struct efx_nic *efx)
* First try to enable it, then if we get EPERM, just * First try to enable it, then if we get EPERM, just
* ask if it's already enabled * ask if it's already enabled
*/ */
rc = efx_mcdi_set_workaround(efx, MC_CMD_WORKAROUND_BUG35388, true); rc = efx_mcdi_set_workaround(efx, MC_CMD_WORKAROUND_BUG35388, true, NULL);
if (rc == 0) { if (rc == 0) {
nic_data->workaround_35388 = true; nic_data->workaround_35388 = true;
} else if (rc == -EPERM) { } else if (rc == -EPERM) {
...@@ -2291,8 +2291,9 @@ static int efx_ef10_ev_init(struct efx_channel *channel) ...@@ -2291,8 +2291,9 @@ static int efx_ef10_ev_init(struct efx_channel *channel)
if (implemented & MC_CMD_GET_WORKAROUNDS_OUT_BUG26807 && if (implemented & MC_CMD_GET_WORKAROUNDS_OUT_BUG26807 &&
!nic_data->workaround_26807) { !nic_data->workaround_26807) {
rc = efx_mcdi_set_workaround(efx, MC_CMD_WORKAROUND_BUG26807, rc = efx_mcdi_set_workaround(efx,
true); MC_CMD_WORKAROUND_BUG26807,
true, NULL);
if (!rc) if (!rc)
nic_data->workaround_26807 = true; nic_data->workaround_26807 = true;
else if (rc == -EPERM) else if (rc == -EPERM)
......
...@@ -1779,15 +1779,31 @@ int efx_mcdi_wol_filter_reset(struct efx_nic *efx) ...@@ -1779,15 +1779,31 @@ int efx_mcdi_wol_filter_reset(struct efx_nic *efx)
return rc; return rc;
} }
int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled) int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled,
unsigned int *flags)
{ {
MCDI_DECLARE_BUF(inbuf, MC_CMD_WORKAROUND_IN_LEN); MCDI_DECLARE_BUF(inbuf, MC_CMD_WORKAROUND_IN_LEN);
MCDI_DECLARE_BUF(outbuf, MC_CMD_WORKAROUND_EXT_OUT_LEN);
size_t outlen;
int rc;
BUILD_BUG_ON(MC_CMD_WORKAROUND_OUT_LEN != 0); BUILD_BUG_ON(MC_CMD_WORKAROUND_OUT_LEN != 0);
MCDI_SET_DWORD(inbuf, WORKAROUND_IN_TYPE, type); MCDI_SET_DWORD(inbuf, WORKAROUND_IN_TYPE, type);
MCDI_SET_DWORD(inbuf, WORKAROUND_IN_ENABLED, enabled); MCDI_SET_DWORD(inbuf, WORKAROUND_IN_ENABLED, enabled);
return efx_mcdi_rpc(efx, MC_CMD_WORKAROUND, inbuf, sizeof(inbuf), rc = efx_mcdi_rpc(efx, MC_CMD_WORKAROUND, inbuf, sizeof(inbuf),
NULL, 0, NULL); outbuf, sizeof(outbuf), &outlen);
if (rc)
return rc;
if (!flags)
return 0;
if (outlen >= MC_CMD_WORKAROUND_EXT_OUT_LEN)
*flags = MCDI_DWORD(outbuf, WORKAROUND_EXT_OUT_FLAGS);
else
*flags = 0;
return 0;
} }
int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out, int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out,
......
...@@ -346,7 +346,8 @@ void efx_mcdi_mac_pull_stats(struct efx_nic *efx); ...@@ -346,7 +346,8 @@ void efx_mcdi_mac_pull_stats(struct efx_nic *efx);
bool efx_mcdi_mac_check_fault(struct efx_nic *efx); bool efx_mcdi_mac_check_fault(struct efx_nic *efx);
enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason); enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason);
int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method); int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method);
int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled); int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled,
unsigned int *flags);
int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out, int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out,
unsigned int *enabled_out); unsigned int *enabled_out);
......
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