sfc: Move efx_mcdi_mac_reconfigure() to siena.c and rename
authorBen Hutchings <bhutchings@solarflare.com>
Mon, 8 Oct 2012 15:56:18 +0000 (16:56 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Wed, 21 Aug 2013 18:37:52 +0000 (19:37 +0100)
EF10 does not include a multicast hash filter, so this function is
specific to Siena.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/mcdi.h
drivers/net/ethernet/sfc/mcdi_mac.c
drivers/net/ethernet/sfc/siena.c

index e62dc04d101a77527f2ee19143e4d61590b4a1b2..73bc76eabb83d01ff1f73b62fbf4e1687c768ab2 100644 (file)
@@ -199,7 +199,6 @@ extern int efx_mcdi_flush_rxqs(struct efx_nic *efx);
 extern int efx_mcdi_set_mac(struct efx_nic *efx);
 extern int efx_mcdi_mac_stats(struct efx_nic *efx, dma_addr_t dma_addr,
                              u32 dma_len, int enable, int clear);
-extern int efx_mcdi_mac_reconfigure(struct efx_nic *efx);
 extern bool efx_mcdi_mac_check_fault(struct efx_nic *efx);
 extern enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason);
 extern int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method);
index cf16bf13b6f254aca2aa3f18c828091f0f24abba..1b84b90fbef63e4151bda8caae8a3f1879fe494a 100644 (file)
@@ -112,24 +112,3 @@ fail:
                  __func__, enable ? "enable" : "disable", rc);
        return rc;
 }
-
-int efx_mcdi_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);
-}
index 6babc8eb984d379352c112cf14066a61e2632877..1febedb4987cf3c7c2d21b22bca335596ca82fc4 100644 (file)
@@ -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,