Commit d802b0ae authored by Edward Cree's avatar Edward Cree Committed by David S. Miller

sfc_ef100: extend ef100_check_caps to cover datapath_caps3

MC_CMD_GET_CAPABILITIES now has a third word of flags; extend the
 efx_has_cap() machinery to cover it.
Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f6573120
...@@ -128,7 +128,7 @@ static void ef100_mcdi_reboot_detected(struct efx_nic *efx) ...@@ -128,7 +128,7 @@ static void ef100_mcdi_reboot_detected(struct efx_nic *efx)
*/ */
static int efx_ef100_init_datapath_caps(struct efx_nic *efx) static int efx_ef100_init_datapath_caps(struct efx_nic *efx)
{ {
MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_CAPABILITIES_V4_OUT_LEN); MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_CAPABILITIES_V7_OUT_LEN);
struct ef100_nic_data *nic_data = efx->nic_data; struct ef100_nic_data *nic_data = efx->nic_data;
u8 vi_window_mode; u8 vi_window_mode;
size_t outlen; size_t outlen;
...@@ -150,6 +150,11 @@ static int efx_ef100_init_datapath_caps(struct efx_nic *efx) ...@@ -150,6 +150,11 @@ static int efx_ef100_init_datapath_caps(struct efx_nic *efx)
GET_CAPABILITIES_OUT_FLAGS1); GET_CAPABILITIES_OUT_FLAGS1);
nic_data->datapath_caps2 = MCDI_DWORD(outbuf, nic_data->datapath_caps2 = MCDI_DWORD(outbuf,
GET_CAPABILITIES_V2_OUT_FLAGS2); GET_CAPABILITIES_V2_OUT_FLAGS2);
if (outlen < MC_CMD_GET_CAPABILITIES_V7_OUT_LEN)
nic_data->datapath_caps3 = 0;
else
nic_data->datapath_caps3 = MCDI_DWORD(outbuf,
GET_CAPABILITIES_V7_OUT_FLAGS3);
vi_window_mode = MCDI_BYTE(outbuf, vi_window_mode = MCDI_BYTE(outbuf,
GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE); GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE);
...@@ -346,6 +351,8 @@ static unsigned int ef100_check_caps(const struct efx_nic *efx, ...@@ -346,6 +351,8 @@ static unsigned int ef100_check_caps(const struct efx_nic *efx,
return nic_data->datapath_caps & BIT_ULL(flag); return nic_data->datapath_caps & BIT_ULL(flag);
case MC_CMD_GET_CAPABILITIES_V8_OUT_FLAGS2_OFST: case MC_CMD_GET_CAPABILITIES_V8_OUT_FLAGS2_OFST:
return nic_data->datapath_caps2 & BIT_ULL(flag); return nic_data->datapath_caps2 & BIT_ULL(flag);
case MC_CMD_GET_CAPABILITIES_V8_OUT_FLAGS3_OFST:
return nic_data->datapath_caps3 & BIT_ULL(flag);
default: default:
return 0; return 0;
} }
......
...@@ -22,6 +22,7 @@ struct ef100_nic_data { ...@@ -22,6 +22,7 @@ struct ef100_nic_data {
struct efx_buffer mcdi_buf; struct efx_buffer mcdi_buf;
u32 datapath_caps; u32 datapath_caps;
u32 datapath_caps2; u32 datapath_caps2;
u32 datapath_caps3;
u16 warm_boot_count; u16 warm_boot_count;
DECLARE_BITMAP(evq_phases, EFX_MAX_CHANNELS); DECLARE_BITMAP(evq_phases, EFX_MAX_CHANNELS);
}; };
......
...@@ -327,10 +327,10 @@ void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev); ...@@ -327,10 +327,10 @@ void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field) EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field)
#define MCDI_CAPABILITY(field) \ #define MCDI_CAPABILITY(field) \
MC_CMD_GET_CAPABILITIES_V4_OUT_ ## field ## _LBN MC_CMD_GET_CAPABILITIES_V8_OUT_ ## field ## _LBN
#define MCDI_CAPABILITY_OFST(field) \ #define MCDI_CAPABILITY_OFST(field) \
MC_CMD_GET_CAPABILITIES_V4_OUT_ ## field ## _OFST MC_CMD_GET_CAPABILITIES_V8_OUT_ ## field ## _OFST
#define efx_has_cap(efx, field) \ #define efx_has_cap(efx, field) \
efx->type->check_caps(efx, \ efx->type->check_caps(efx, \
......
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