mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 01:11:14 +00:00
1b2fefb244
Refreshed patches, removed upstreamed patch: generic/pending: 001-v5.4-pinctrl-qcom-fix-wrong-write-in-update_dual_edge.patch.patch Run tested: qemu-x86-64 Build tested: x86/64, ath79/nand, imx6, sunxi/a53 Signed-off-by: Petr Štetiar <ynezz@true.cz>
62 lines
2.4 KiB
Diff
62 lines
2.4 KiB
Diff
From 1ffb57beaefe23ceeb526bc238351f7725502571 Mon Sep 17 00:00:00 2001
|
|
From: Ioana Radulescu <ruxandra.radulescu@nxp.com>
|
|
Date: Mon, 16 Sep 2019 21:04:49 +0300
|
|
Subject: [PATCH] dpaa2-eth: Add helper functions
|
|
|
|
Add convenient helper functions that determines whether Rx/Tx pause
|
|
frames are enabled based on link state flags received from firmware.
|
|
|
|
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
|
|
---
|
|
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 3 +--
|
|
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h | 11 +++++++++++
|
|
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c | 5 ++---
|
|
3 files changed, 14 insertions(+), 5 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
|
|
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
|
|
@@ -1276,8 +1276,7 @@ static int link_state_update(struct dpaa
|
|
* Rx FQ taildrop configuration as well. We configure taildrop
|
|
* only when pause frame generation is disabled.
|
|
*/
|
|
- tx_pause = !!(state.options & DPNI_LINK_OPT_PAUSE) ^
|
|
- !!(state.options & DPNI_LINK_OPT_ASYM_PAUSE);
|
|
+ tx_pause = dpaa2_eth_tx_pause_enabled(state.options);
|
|
dpaa2_eth_set_rx_taildrop(priv, !tx_pause);
|
|
|
|
/* Chech link state; speed / duplex changes are not treated yet */
|
|
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
|
|
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
|
|
@@ -495,6 +495,17 @@ enum dpaa2_eth_rx_dist {
|
|
(dpaa2_eth_cmp_dpni_ver((priv), DPNI_PAUSE_VER_MAJOR, \
|
|
DPNI_PAUSE_VER_MINOR) >= 0)
|
|
|
|
+static inline bool dpaa2_eth_tx_pause_enabled(u64 link_options)
|
|
+{
|
|
+ return !!(link_options & DPNI_LINK_OPT_PAUSE) ^
|
|
+ !!(link_options & DPNI_LINK_OPT_ASYM_PAUSE);
|
|
+}
|
|
+
|
|
+static inline bool dpaa2_eth_rx_pause_enabled(u64 link_options)
|
|
+{
|
|
+ return !!(link_options & DPNI_LINK_OPT_PAUSE);
|
|
+}
|
|
+
|
|
static inline
|
|
unsigned int dpaa2_eth_needed_headroom(struct dpaa2_eth_priv *priv,
|
|
struct sk_buff *skb)
|
|
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
|
|
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
|
|
@@ -99,9 +99,8 @@ static void dpaa2_eth_get_pauseparam(str
|
|
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
|
|
u64 link_options = priv->link_state.options;
|
|
|
|
- pause->rx_pause = !!(link_options & DPNI_LINK_OPT_PAUSE);
|
|
- pause->tx_pause = pause->rx_pause ^
|
|
- !!(link_options & DPNI_LINK_OPT_ASYM_PAUSE);
|
|
+ pause->rx_pause = dpaa2_eth_rx_pause_enabled(link_options);
|
|
+ pause->tx_pause = dpaa2_eth_tx_pause_enabled(link_options);
|
|
pause->autoneg = AUTONEG_DISABLE;
|
|
}
|
|
|