aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorPetri Gynther <pgynther@google.com>2015-02-23 14:00:46 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-24 11:39:04 -0500
commit51a966a7185c86df9a7ab1d59d4d1ca6b938ebb6 (patch)
treeb2805c38d1c0187dccabce0d6f15de7bc4baf119 /drivers/net
parent014012a49148d6968afabb0e8d638fad5f65b72d (diff)
net: bcmgenet: rename bcmgenet_hw_params->bds_cnt and GENET_DEFAULT_BD_CNT
bcmgenet_hw_params->bds_cnt and GENET_DEFAULT_BD_CNT are used only in Tx init. Rename them accordingly: - bcmgenet_hw_params->bds_cnt => bcmgenet_hw_params->tx_bds_per_q - GENET_DEFAULT_BD_CNT => GENET_Q16_TX_BD_CNT Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.c29
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.h2
2 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 6e3d83b709ad..51300532ec26 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -54,8 +54,8 @@
54/* Default highest priority queue for multi queue support */ 54/* Default highest priority queue for multi queue support */
55#define GENET_Q0_PRIORITY 0 55#define GENET_Q0_PRIORITY 0
56 56
57#define GENET_DEFAULT_BD_CNT \ 57#define GENET_Q16_TX_BD_CNT \
58 (TOTAL_DESC - priv->hw_params->tx_queues * priv->hw_params->bds_cnt) 58 (TOTAL_DESC - priv->hw_params->tx_queues * priv->hw_params->tx_bds_per_q)
59 59
60#define RX_BUF_LENGTH 2048 60#define RX_BUF_LENGTH 2048
61#define SKB_ALIGNMENT 32 61#define SKB_ALIGNMENT 32
@@ -1782,7 +1782,7 @@ static int bcmgenet_init_rx_ring(struct bcmgenet_priv *priv,
1782 * with queue 0 being the highest priority queue. 1782 * with queue 0 being the highest priority queue.
1783 * 1783 *
1784 * Queue 16 is the default Tx queue with 1784 * Queue 16 is the default Tx queue with
1785 * GENET_DEFAULT_BD_CNT = 256 - 4 * 32 = 128 descriptors. 1785 * GENET_Q16_TX_BD_CNT = 256 - 4 * 32 = 128 descriptors.
1786 * 1786 *
1787 * The transmit control block pool is then partitioned as follows: 1787 * The transmit control block pool is then partitioned as follows:
1788 * - Tx queue 0 uses tx_cbs[0..31] 1788 * - Tx queue 0 uses tx_cbs[0..31]
@@ -1811,9 +1811,9 @@ static void bcmgenet_init_tx_queues(struct net_device *dev)
1811 1811
1812 /* Initialize Tx priority queues */ 1812 /* Initialize Tx priority queues */
1813 for (i = 0; i < priv->hw_params->tx_queues; i++) { 1813 for (i = 0; i < priv->hw_params->tx_queues; i++) {
1814 bcmgenet_init_tx_ring(priv, i, priv->hw_params->bds_cnt, 1814 bcmgenet_init_tx_ring(priv, i, priv->hw_params->tx_bds_per_q,
1815 i * priv->hw_params->bds_cnt, 1815 i * priv->hw_params->tx_bds_per_q,
1816 (i + 1) * priv->hw_params->bds_cnt); 1816 (i + 1) * priv->hw_params->tx_bds_per_q);
1817 ring_cfg |= (1 << i); 1817 ring_cfg |= (1 << i);
1818 dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT)); 1818 dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
1819 dma_priority[DMA_PRIO_REG_INDEX(i)] |= 1819 dma_priority[DMA_PRIO_REG_INDEX(i)] |=
@@ -1821,9 +1821,9 @@ static void bcmgenet_init_tx_queues(struct net_device *dev)
1821 } 1821 }
1822 1822
1823 /* Initialize Tx default queue 16 */ 1823 /* Initialize Tx default queue 16 */
1824 bcmgenet_init_tx_ring(priv, DESC_INDEX, GENET_DEFAULT_BD_CNT, 1824 bcmgenet_init_tx_ring(priv, DESC_INDEX, GENET_Q16_TX_BD_CNT,
1825 priv->hw_params->tx_queues * 1825 priv->hw_params->tx_queues *
1826 priv->hw_params->bds_cnt, 1826 priv->hw_params->tx_bds_per_q,
1827 TOTAL_DESC); 1827 TOTAL_DESC);
1828 ring_cfg |= (1 << DESC_INDEX); 1828 ring_cfg |= (1 << DESC_INDEX);
1829 dma_ctrl |= (1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT)); 1829 dma_ctrl |= (1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT));
@@ -2427,8 +2427,8 @@ static const struct net_device_ops bcmgenet_netdev_ops = {
2427static struct bcmgenet_hw_params bcmgenet_hw_params[] = { 2427static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
2428 [GENET_V1] = { 2428 [GENET_V1] = {
2429 .tx_queues = 0, 2429 .tx_queues = 0,
2430 .tx_bds_per_q = 0,
2430 .rx_queues = 0, 2431 .rx_queues = 0,
2431 .bds_cnt = 0,
2432 .bp_in_en_shift = 16, 2432 .bp_in_en_shift = 16,
2433 .bp_in_mask = 0xffff, 2433 .bp_in_mask = 0xffff,
2434 .hfb_filter_cnt = 16, 2434 .hfb_filter_cnt = 16,
@@ -2440,8 +2440,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
2440 }, 2440 },
2441 [GENET_V2] = { 2441 [GENET_V2] = {
2442 .tx_queues = 4, 2442 .tx_queues = 4,
2443 .tx_bds_per_q = 32,
2443 .rx_queues = 4, 2444 .rx_queues = 4,
2444 .bds_cnt = 32,
2445 .bp_in_en_shift = 16, 2445 .bp_in_en_shift = 16,
2446 .bp_in_mask = 0xffff, 2446 .bp_in_mask = 0xffff,
2447 .hfb_filter_cnt = 16, 2447 .hfb_filter_cnt = 16,
@@ -2456,8 +2456,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
2456 }, 2456 },
2457 [GENET_V3] = { 2457 [GENET_V3] = {
2458 .tx_queues = 4, 2458 .tx_queues = 4,
2459 .tx_bds_per_q = 32,
2459 .rx_queues = 4, 2460 .rx_queues = 4,
2460 .bds_cnt = 32,
2461 .bp_in_en_shift = 17, 2461 .bp_in_en_shift = 17,
2462 .bp_in_mask = 0x1ffff, 2462 .bp_in_mask = 0x1ffff,
2463 .hfb_filter_cnt = 48, 2463 .hfb_filter_cnt = 48,
@@ -2472,8 +2472,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
2472 }, 2472 },
2473 [GENET_V4] = { 2473 [GENET_V4] = {
2474 .tx_queues = 4, 2474 .tx_queues = 4,
2475 .tx_bds_per_q = 32,
2475 .rx_queues = 4, 2476 .rx_queues = 4,
2476 .bds_cnt = 32,
2477 .bp_in_en_shift = 17, 2477 .bp_in_en_shift = 17,
2478 .bp_in_mask = 0x1ffff, 2478 .bp_in_mask = 0x1ffff,
2479 .hfb_filter_cnt = 48, 2479 .hfb_filter_cnt = 48,
@@ -2573,14 +2573,15 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv)
2573#endif 2573#endif
2574 2574
2575 pr_debug("Configuration for version: %d\n" 2575 pr_debug("Configuration for version: %d\n"
2576 "TXq: %1d, RXq: %1d, BDs: %1d\n" 2576 "TXq: %1d, TXqBDs: %1d, RXq: %1d\n"
2577 "BP << en: %2d, BP msk: 0x%05x\n" 2577 "BP << en: %2d, BP msk: 0x%05x\n"
2578 "HFB count: %2d, QTAQ msk: 0x%05x\n" 2578 "HFB count: %2d, QTAQ msk: 0x%05x\n"
2579 "TBUF: 0x%04x, HFB: 0x%04x, HFBreg: 0x%04x\n" 2579 "TBUF: 0x%04x, HFB: 0x%04x, HFBreg: 0x%04x\n"
2580 "RDMA: 0x%05x, TDMA: 0x%05x\n" 2580 "RDMA: 0x%05x, TDMA: 0x%05x\n"
2581 "Words/BD: %d\n", 2581 "Words/BD: %d\n",
2582 priv->version, 2582 priv->version,
2583 params->tx_queues, params->rx_queues, params->bds_cnt, 2583 params->tx_queues, params->tx_bds_per_q,
2584 params->rx_queues,
2584 params->bp_in_en_shift, params->bp_in_mask, 2585 params->bp_in_en_shift, params->bp_in_mask,
2585 params->hfb_filter_cnt, params->qtag_mask, 2586 params->hfb_filter_cnt, params->qtag_mask,
2586 params->tbuf_offset, params->hfb_offset, 2587 params->tbuf_offset, params->hfb_offset,
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
index b36ddec0cc0a..3a8a90f95365 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
@@ -503,8 +503,8 @@ enum bcmgenet_version {
503 */ 503 */
504struct bcmgenet_hw_params { 504struct bcmgenet_hw_params {
505 u8 tx_queues; 505 u8 tx_queues;
506 u8 tx_bds_per_q;
506 u8 rx_queues; 507 u8 rx_queues;
507 u8 bds_cnt;
508 u8 bp_in_en_shift; 508 u8 bp_in_en_shift;
509 u32 bp_in_mask; 509 u32 bp_in_mask;
510 u8 hfb_filter_cnt; 510 u8 hfb_filter_cnt;