diff options
author | Ricardo Ribalda <ricardo.ribalda@gmail.com> | 2013-10-01 06:17:10 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-01 16:31:35 (GMT) |
commit | 7167cf0e8cd10287b7912b9ffcccd9616f382922 (patch) | |
tree | 76ec0f2285b407f56c192e5b3c9f842abf29336d /drivers | |
parent | 45906723578f768d029ba7774cd97b435f2c5125 (diff) | |
download | linux-fsl-qoriq-7167cf0e8cd10287b7912b9ffcccd9616f382922.tar.xz |
ll_temac: Reset dma descriptors indexes on ndo_open
The dma descriptors indexes are only initialized on the probe function.
If a packet is on the buffer when temac_stop is called, the dma
descriptors indexes can be left on a incorrect state where no other
package can be sent.
So an interface could be left in an usable state after ifdow/ifup.
This patch makes sure that the descriptors indexes are in a proper
status when the device is open.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/xilinx/ll_temac_main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index b88121f..0029148 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -297,6 +297,12 @@ static int temac_dma_bd_init(struct net_device *ndev) lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1))); lp->dma_out(lp, TX_CURDESC_PTR, lp->tx_bd_p); + /* Init descriptor indexes */ + lp->tx_bd_ci = 0; + lp->tx_bd_next = 0; + lp->tx_bd_tail = 0; + lp->rx_bd_ci = 0; + return 0; out: |