sfc: make mem_bar a function rather than a constant

Support using BAR 0 on SFC9250, even though the driver doesn't bind to such
 devices yet.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Edward Cree
2017-12-18 16:55:50 +00:00
committed by David S. Miller
parent 59436c9ee1
commit 03714bbb22
5 changed files with 35 additions and 12 deletions

View File

@@ -242,6 +242,14 @@ static int siena_dimension_resources(struct efx_nic *efx)
return 0;
}
/* On all Falcon-architecture NICs, PFs use BAR 0 for I/O space and BAR 2(&3)
* for memory.
*/
static unsigned int siena_mem_bar(struct efx_nic *efx)
{
return 2;
}
static unsigned int siena_mem_map_size(struct efx_nic *efx)
{
return FR_CZ_MC_TREG_SMEM +
@@ -950,7 +958,7 @@ fail:
const struct efx_nic_type siena_a0_nic_type = {
.is_vf = false,
.mem_bar = EFX_MEM_BAR,
.mem_bar = siena_mem_bar,
.mem_map_size = siena_mem_map_size,
.probe = siena_probe_nic,
.remove = siena_remove_nic,