netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: <linux-net-drivers@solarflare.com>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Subject: [PATCH v2 net-next 10/15] sfc: commonise FC advertising
Date: Mon, 29 Jun 2020 14:35:25 +0100	[thread overview]
Message-ID: <f3ad7330-b61e-634b-2e0a-bf4919e5463d@solarflare.com> (raw)
In-Reply-To: <3750523f-1c2f-628d-1f71-39b355cf6661@solarflare.com>

Signed-off-by: Edward Cree <ecree@solarflare.com>
---
 drivers/net/ethernet/sfc/efx.c        | 24 ------------------------
 drivers/net/ethernet/sfc/efx.h        |  3 ---
 drivers/net/ethernet/sfc/efx_common.c | 24 ++++++++++++++++++++++++
 drivers/net/ethernet/sfc/efx_common.h |  3 +++
 4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 256807c28ff7..474cfce5c042 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -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)
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index 66dcab140449..8aadec02407c 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -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;
diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
index 1799ff9a45d9..02459d90afb0 100644
--- a/drivers/net/ethernet/sfc/efx_common.c
+++ b/drivers/net/ethernet/sfc/efx_common.c
@@ -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");
diff --git a/drivers/net/ethernet/sfc/efx_common.h b/drivers/net/ethernet/sfc/efx_common.h
index fa2fc681e7f9..c522a5be43d2 100644
--- a/drivers/net/ethernet/sfc/efx_common.h
+++ b/drivers/net/ethernet/sfc/efx_common.h
@@ -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);
 


  parent reply	other threads:[~2020-06-29 19:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29 13:30 [PATCH v2 net-next 00/15] sfc: prerequisites for EF100 driver, part 1 Edward Cree
2020-06-29 13:32 ` [PATCH v2 net-next 01/15] sfc: update MCDI protocol headers Edward Cree
2020-06-29 13:32 ` [PATCH v2 net-next 02/15] sfc: determine flag word automatically in efx_has_cap() Edward Cree
2020-06-29 13:33 ` [PATCH v2 net-next 03/15] sfc: extend bitfield macros up to POPULATE_DWORD_13 Edward Cree
2020-06-29 13:33 ` [PATCH v2 net-next 04/15] sfc: don't try to create more channels than we can have VIs Edward Cree
2020-06-29 13:34 ` [PATCH v2 net-next 05/15] sfc: refactor EF10 stats handling Edward Cree
2020-06-29 13:34 ` [PATCH v2 net-next 06/15] sfc: split up nic.h Edward Cree
2020-06-29 13:34 ` [PATCH v2 net-next 07/15] sfc: commonise ethtool link handling functions Edward Cree
2020-06-29 13:35 ` [PATCH v2 net-next 08/15] sfc: commonise ethtool NFC and RXFH/RSS functions Edward Cree
2020-06-29 13:35 ` [PATCH v2 net-next 09/15] sfc: commonise other ethtool bits Edward Cree
2020-06-29 13:35 ` Edward Cree [this message]
2020-06-29 13:35 ` [PATCH v2 net-next 11/15] sfc: track which BAR is mapped Edward Cree
2020-06-29 13:35 ` [PATCH v2 net-next 12/15] sfc: commonise PCI error handlers Edward Cree
2020-06-29 13:36 ` [PATCH v2 net-next 14/15] sfc: commonise ARFS handling Edward Cree
2020-06-29 13:36 ` [PATCH v2 net-next 15/15] sfc: extend common GRO interface to support CHECKSUM_COMPLETE Edward Cree
2020-06-29 13:39 ` [PATCH v2 net-next 13/15] sfc: commonise drain event handling Edward Cree
2020-06-30  0:30 ` [PATCH v2 net-next 00/15] sfc: prerequisites for EF100 driver, part 1 Jakub Kicinski
2020-06-30  0:38   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3ad7330-b61e-634b-2e0a-bf4919e5463d@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).