summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/siena.c
diff options
context:
space:
mode:
authorBen Hutchings2012-10-08 17:56:18 +0200
committerBen Hutchings2013-08-21 20:37:52 +0200
commit319ec6444d723f9f01b96728c163d7eaf75e24d7 (patch)
tree3d17dcbe57acdb7971f21ed11e11acb69b991c9f /drivers/net/ethernet/sfc/siena.c
parentsfc: Move siena_reset_hw() and siena_map_reset_reason() into MCDI module (diff)
downloadkernel-qcow2-linux-319ec6444d723f9f01b96728c163d7eaf75e24d7.tar.gz
kernel-qcow2-linux-319ec6444d723f9f01b96728c163d7eaf75e24d7.tar.xz
kernel-qcow2-linux-319ec6444d723f9f01b96728c163d7eaf75e24d7.zip
sfc: Move efx_mcdi_mac_reconfigure() to siena.c and rename
EF10 does not include a multicast hash filter, so this function is specific to Siena. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/siena.c')
-rw-r--r--drivers/net/ethernet/sfc/siena.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/siena.c b/drivers/net/ethernet/sfc/siena.c
index 6babc8eb984d..1febedb4987c 100644
--- a/drivers/net/ethernet/sfc/siena.c
+++ b/drivers/net/ethernet/sfc/siena.c
@@ -577,6 +577,27 @@ static void siena_stop_nic_stats(struct efx_nic *efx)
efx_mcdi_mac_stats(efx, efx->stats_buffer.dma_addr, 0, 0, 0);
}
+static int siena_mac_reconfigure(struct efx_nic *efx)
+{
+ MCDI_DECLARE_BUF(inbuf, MC_CMD_SET_MCAST_HASH_IN_LEN);
+ int rc;
+
+ BUILD_BUG_ON(MC_CMD_SET_MCAST_HASH_IN_LEN !=
+ MC_CMD_SET_MCAST_HASH_IN_HASH0_OFST +
+ sizeof(efx->multicast_hash));
+
+ WARN_ON(!mutex_is_locked(&efx->mac_lock));
+
+ rc = efx_mcdi_set_mac(efx);
+ if (rc != 0)
+ return rc;
+
+ memcpy(MCDI_PTR(inbuf, SET_MCAST_HASH_IN_HASH0),
+ efx->multicast_hash.byte, sizeof(efx->multicast_hash));
+ return efx_mcdi_rpc(efx, MC_CMD_SET_MCAST_HASH,
+ inbuf, sizeof(inbuf), NULL, 0, NULL);
+}
+
/**************************************************************************
*
* Wake on LAN
@@ -679,7 +700,7 @@ const struct efx_nic_type siena_a0_nic_type = {
.stop_stats = siena_stop_nic_stats,
.set_id_led = efx_mcdi_set_id_led,
.push_irq_moderation = siena_push_irq_moderation,
- .reconfigure_mac = efx_mcdi_mac_reconfigure,
+ .reconfigure_mac = siena_mac_reconfigure,
.check_mac_fault = efx_mcdi_mac_check_fault,
.reconfigure_port = efx_mcdi_phy_reconfigure,
.get_wol = siena_get_wol,