net: bcmgenet: rework Rx queue init
authorPetri Gynther <pgynther@google.com>
Fri, 6 Mar 2015 21:45:00 +0000 (13:45 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Mar 2015 03:32:40 +0000 (22:32 -0500)
commit6f5a272c99108d9f8450c454a4baede9e7cc643f
tree15d42d2a90c8441aceb6efdf950f013c68b6ee39
parentae00ec9548f7020734eef340a5f1d96720551713
net: bcmgenet: rework Rx queue init

In preparation for supporting multiple Rx queues:
1. Move the initialization of priv->num_rx_bds, priv->rx_bds, and
   priv->rx_cbs from bcmgenet_init_rx_ring() to bcmgenet_init_dma()
   since they are not specific to a single Rx queue. Mimics the Tx
   init model where priv->num_tx_bds, priv->tx_bds, and priv->tx_cbs
   are initialized in bcmgenet_init_dma().
2. Program DMA_MBUF_DONE_THRESH = 1 so that future Rx queues Q0-Q15
   will get per-packet Rx interrupt.
3. Group DMA_START_ADDR, RDMA_READ_PTR, RDMA_WRITE_PTR, and DMA_END_ADDR
   initialization together. Mimics the Tx init model.
4. There is 1-to-1 mapping between RxCBs and RxBDs.
   Precalculate RxCB->bd_addr so that it can be used in the future.

Signed-off-by: Petri Gynther <pgynther@google.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c