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

sfc: determine flag word automatically in efx_has_cap()

Now that we have an _OFST definition for each individual flag bit,
 callers of efx_has_cap() don't need to specify which flag word it's
 in; we can just use the flag name directly in MCDI_CAPABILITY_OFST.
Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0dc95084
...@@ -332,10 +332,9 @@ void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev); ...@@ -332,10 +332,9 @@ void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
#define MCDI_CAPABILITY_OFST(field) \ #define MCDI_CAPABILITY_OFST(field) \
MC_CMD_GET_CAPABILITIES_V4_OUT_ ## field ## _OFST MC_CMD_GET_CAPABILITIES_V4_OUT_ ## field ## _OFST
/* field is FLAGS1 or FLAGS2 */ #define efx_has_cap(efx, field) \
#define efx_has_cap(efx, flag, field) \
efx->type->check_caps(efx, \ efx->type->check_caps(efx, \
MCDI_CAPABILITY(flag), \ MCDI_CAPABILITY(field), \
MCDI_CAPABILITY_OFST(field)) MCDI_CAPABILITY_OFST(field))
void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len); void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len);
......
...@@ -828,7 +828,7 @@ static int efx_mcdi_filter_insert_def(struct efx_nic *efx, ...@@ -828,7 +828,7 @@ static int efx_mcdi_filter_insert_def(struct efx_nic *efx,
efx_filter_set_uc_def(&spec); efx_filter_set_uc_def(&spec);
if (encap_type) { if (encap_type) {
if (efx_has_cap(efx, VXLAN_NVGRE, FLAGS1)) if (efx_has_cap(efx, VXLAN_NVGRE))
efx_filter_set_encap_type(&spec, encap_type); efx_filter_set_encap_type(&spec, encap_type);
else else
/* /*
...@@ -1304,7 +1304,7 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining) ...@@ -1304,7 +1304,7 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining)
rc = efx_mcdi_filter_table_probe_matches(efx, table, false); rc = efx_mcdi_filter_table_probe_matches(efx, table, false);
if (rc) if (rc)
goto fail; goto fail;
if (efx_has_cap(efx, VXLAN_NVGRE, FLAGS1)) if (efx_has_cap(efx, VXLAN_NVGRE))
rc = efx_mcdi_filter_table_probe_matches(efx, table, true); rc = efx_mcdi_filter_table_probe_matches(efx, table, true);
if (rc) if (rc)
goto fail; goto fail;
...@@ -1927,7 +1927,7 @@ static int efx_mcdi_filter_alloc_rss_context(struct efx_nic *efx, bool exclusive ...@@ -1927,7 +1927,7 @@ static int efx_mcdi_filter_alloc_rss_context(struct efx_nic *efx, bool exclusive
return 0; return 0;
} }
if (efx_has_cap(efx, RX_RSS_LIMITED, FLAGS1)) if (efx_has_cap(efx, RX_RSS_LIMITED))
return -EOPNOTSUPP; return -EOPNOTSUPP;
MCDI_SET_DWORD(inbuf, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID, MCDI_SET_DWORD(inbuf, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID,
...@@ -1948,7 +1948,7 @@ static int efx_mcdi_filter_alloc_rss_context(struct efx_nic *efx, bool exclusive ...@@ -1948,7 +1948,7 @@ static int efx_mcdi_filter_alloc_rss_context(struct efx_nic *efx, bool exclusive
if (context_size) if (context_size)
*context_size = rss_spread; *context_size = rss_spread;
if (efx_has_cap(efx, ADDITIONAL_RSS_MODES, FLAGS1)) if (efx_has_cap(efx, ADDITIONAL_RSS_MODES))
efx_mcdi_set_rss_context_flags(efx, ctx); efx_mcdi_set_rss_context_flags(efx, ctx);
return 0; return 0;
......
...@@ -352,7 +352,7 @@ static int efx_phc_enable(struct ptp_clock_info *ptp, ...@@ -352,7 +352,7 @@ static int efx_phc_enable(struct ptp_clock_info *ptp,
bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx) bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx)
{ {
return efx_has_cap(efx, TX_MAC_TIMESTAMPING, FLAGS2); return efx_has_cap(efx, TX_MAC_TIMESTAMPING);
} }
/* PTP 'extra' channel is still a traffic channel, but we only create TX queues /* PTP 'extra' channel is still a traffic channel, but we only create TX queues
......
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