sfc: commonise FC advertising
authorEdward Cree <ecree@solarflare.com>
Mon, 29 Jun 2020 13:35:25 +0000 (14:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Jun 2020 00:37:48 +0000 (17:37 -0700)
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/efx.h
drivers/net/ethernet/sfc/efx_common.c
drivers/net/ethernet/sfc/efx_common.h

index 256807c28ff7c596631f4d09fdf536d33ff32821..474cfce5c04274a48c95e0cd9b9da2866d299842 100644 (file)
@@ -133,30 +133,6 @@ static int efx_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **xdpfs,
  *
  **************************************************************************/
 
-/* Equivalent to efx_link_set_advertising with all-zeroes, except does not
- * force the Autoneg bit on.
- */
-void efx_link_clear_advertising(struct efx_nic *efx)
-{
-       bitmap_zero(efx->link_advertising, __ETHTOOL_LINK_MODE_MASK_NBITS);
-       efx->wanted_fc &= ~(EFX_FC_TX | EFX_FC_RX);
-}
-
-void efx_link_set_wanted_fc(struct efx_nic *efx, u8 wanted_fc)
-{
-       efx->wanted_fc = wanted_fc;
-       if (efx->link_advertising[0]) {
-               if (wanted_fc & EFX_FC_RX)
-                       efx->link_advertising[0] |= (ADVERTISED_Pause |
-                                                    ADVERTISED_Asym_Pause);
-               else
-                       efx->link_advertising[0] &= ~(ADVERTISED_Pause |
-                                                     ADVERTISED_Asym_Pause);
-               if (wanted_fc & EFX_FC_TX)
-                       efx->link_advertising[0] ^= ADVERTISED_Asym_Pause;
-       }
-}
-
 static void efx_fini_port(struct efx_nic *efx);
 
 static int efx_probe_port(struct efx_nic *efx)
index 66dcab1404498694636ec7f8bca271bf0c3cd1e5..8aadec02407cc4ef5fa53d07d372c6ae14b69469 100644 (file)
@@ -216,9 +216,6 @@ static inline void efx_schedule_channel_irq(struct efx_channel *channel)
        efx_schedule_channel(channel);
 }
 
-void efx_link_clear_advertising(struct efx_nic *efx);
-void efx_link_set_wanted_fc(struct efx_nic *efx, u8);
-
 static inline void efx_device_detach_sync(struct efx_nic *efx)
 {
        struct net_device *dev = efx->net_dev;
index 1799ff9a45d93fcabe713e1a1ada5df44ae3b15c..02459d90afb048957780828936b2b2afaa32bee4 100644 (file)
@@ -383,6 +383,30 @@ static void efx_stop_datapath(struct efx_nic *efx)
  *
  **************************************************************************/
 
+/* Equivalent to efx_link_set_advertising with all-zeroes, except does not
+ * force the Autoneg bit on.
+ */
+void efx_link_clear_advertising(struct efx_nic *efx)
+{
+       bitmap_zero(efx->link_advertising, __ETHTOOL_LINK_MODE_MASK_NBITS);
+       efx->wanted_fc &= ~(EFX_FC_TX | EFX_FC_RX);
+}
+
+void efx_link_set_wanted_fc(struct efx_nic *efx, u8 wanted_fc)
+{
+       efx->wanted_fc = wanted_fc;
+       if (efx->link_advertising[0]) {
+               if (wanted_fc & EFX_FC_RX)
+                       efx->link_advertising[0] |= (ADVERTISED_Pause |
+                                                    ADVERTISED_Asym_Pause);
+               else
+                       efx->link_advertising[0] &= ~(ADVERTISED_Pause |
+                                                     ADVERTISED_Asym_Pause);
+               if (wanted_fc & EFX_FC_TX)
+                       efx->link_advertising[0] ^= ADVERTISED_Asym_Pause;
+       }
+}
+
 static void efx_start_port(struct efx_nic *efx)
 {
        netif_dbg(efx, ifup, efx->net_dev, "start port\n");
index fa2fc681e7f9983330beec454d1fd37399fc4b1d..c522a5be43d23f5a5346d714c5415a0703f0669f 100644 (file)
@@ -18,6 +18,9 @@ int efx_init_struct(struct efx_nic *efx, struct pci_dev *pci_dev,
                    struct net_device *net_dev);
 void efx_fini_struct(struct efx_nic *efx);
 
+void efx_link_clear_advertising(struct efx_nic *efx);
+void efx_link_set_wanted_fc(struct efx_nic *efx, u8);
+
 void efx_start_all(struct efx_nic *efx);
 void efx_stop_all(struct efx_nic *efx);