ethoc: write number of TX buffers in init_ring
authorJonas Bonn <jonas@southpole.se>
Fri, 11 Jun 2010 02:47:36 +0000 (02:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2010 20:28:35 +0000 (13:28 -0700)
This moves the write of the TX_BD_NUM to init_ring together with the
rest of the code setting up the transmission buffers.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethoc.c

index 5904ad284a0115912427297852f95393059bb55f..afeb9938ff8528e4e3c5eff86131670d49f52f48 100644 (file)
@@ -298,6 +298,8 @@ static int ethoc_init_ring(struct ethoc *dev, void* mem_start)
        dev->dty_tx = 0;
        dev->cur_rx = 0;
 
+       ethoc_write(dev, TX_BD_NUM, dev->num_tx);
+
        /* setup transmission buffers */
        bd.addr = mem_start;
        bd.stat = TX_BD_IRQ | TX_BD_CRC;
@@ -676,8 +678,6 @@ static int ethoc_open(struct net_device *dev)
        if (ret)
                return ret;
 
-       ethoc_write(priv, TX_BD_NUM, priv->num_tx);
-
        ethoc_init_ring(priv, (void*)dev->mem_start);
        ethoc_reset(priv);