diff options
author | Matei Pavaluca <matei.pavaluca@freescale.com> | 2014-10-27 10:42:44 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-29 14:33:16 -0400 |
commit | 45b679c9a3ccd9e34f28e6ec677b812a860eb8eb (patch) | |
tree | 2be284741c04e285cc42a11b2a021c045bc44bd5 /drivers/net/ethernet/freescale/gianfar_ethtool.c | |
parent | 43ef8d29eebb6f533f11439d48a927426c5a1918 (diff) | |
download | op-kernel-dev-45b679c9a3ccd9e34f28e6ec677b812a860eb8eb.zip op-kernel-dev-45b679c9a3ccd9e34f28e6ec677b812a860eb8eb.tar.gz |
gianfar: Implement PAUSE frame generation support
The hardware can automatically generate pause frames when the number
of free buffers drops under a certain threshold, but in order to do this,
the address of the last free buffer needs to be written to a specific
register for each RX queue.
This has to be done in 'gfar_clean_rx_ring' which is called for each
RX queue. In order not to impact performance, by adding a register write
for each incoming packet, this operation is done only when the PAUSE frame
transmission is enabled.
Whenever the link is readjusted, this capability is turned on or off.
Signed-off-by: Matei Pavaluca <matei.pavaluca@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar_ethtool.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 76d7070..3e1a9c1 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -579,8 +579,13 @@ static int gfar_spauseparam(struct net_device *dev, u32 tempval; tempval = gfar_read(®s->maccfg1); tempval &= ~(MACCFG1_TX_FLOW | MACCFG1_RX_FLOW); - if (priv->tx_pause_en) + + priv->tx_actual_en = 0; + if (priv->tx_pause_en) { + priv->tx_actual_en = 1; tempval |= MACCFG1_TX_FLOW; + } + if (priv->rx_pause_en) tempval |= MACCFG1_RX_FLOW; gfar_write(®s->maccfg1, tempval); |