aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2.h
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2012-12-06 05:33:09 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-07 12:44:01 -0500
commit2bc4078e92b28375a762d7236c1c9619eecab315 (patch)
tree420fb018df8b016e9e10927d783140f4b9145964 /drivers/net/ethernet/broadcom/bnx2.h
parente503e0662447ce2bd7c0a73c90395c78ebee494c (diff)
bnx2: Add BNX2 prefix to descriptor structures and macros
for namespace consistency. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2.h')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2.h79
1 files changed, 40 insertions, 39 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2.h b/drivers/net/ethernet/broadcom/bnx2.h
index 5f136745ffdd..58caa2266772 100644
--- a/drivers/net/ethernet/broadcom/bnx2.h
+++ b/drivers/net/ethernet/broadcom/bnx2.h
@@ -20,7 +20,7 @@
20/* 20/*
21 * tx_bd definition 21 * tx_bd definition
22 */ 22 */
23struct tx_bd { 23struct bnx2_tx_bd {
24 u32 tx_bd_haddr_hi; 24 u32 tx_bd_haddr_hi;
25 u32 tx_bd_haddr_lo; 25 u32 tx_bd_haddr_lo;
26 u32 tx_bd_mss_nbytes; 26 u32 tx_bd_mss_nbytes;
@@ -48,7 +48,7 @@ struct tx_bd {
48/* 48/*
49 * rx_bd definition 49 * rx_bd definition
50 */ 50 */
51struct rx_bd { 51struct bnx2_rx_bd {
52 u32 rx_bd_haddr_hi; 52 u32 rx_bd_haddr_hi;
53 u32 rx_bd_haddr_lo; 53 u32 rx_bd_haddr_lo;
54 u32 rx_bd_len; 54 u32 rx_bd_len;
@@ -6538,37 +6538,38 @@ struct l2_fhdr {
6538 6538
6539/* Use CPU native page size up to 16K for the ring sizes. */ 6539/* Use CPU native page size up to 16K for the ring sizes. */
6540#if (PAGE_SHIFT > 14) 6540#if (PAGE_SHIFT > 14)
6541#define BCM_PAGE_BITS 14 6541#define BNX2_PAGE_BITS 14
6542#else 6542#else
6543#define BCM_PAGE_BITS PAGE_SHIFT 6543#define BNX2_PAGE_BITS PAGE_SHIFT
6544#endif 6544#endif
6545#define BCM_PAGE_SIZE (1 << BCM_PAGE_BITS) 6545#define BNX2_PAGE_SIZE (1 << BNX2_PAGE_BITS)
6546 6546
6547#define TX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct tx_bd)) 6547#define BNX2_TX_DESC_CNT (BNX2_PAGE_SIZE / sizeof(struct bnx2_tx_bd))
6548#define MAX_TX_DESC_CNT (TX_DESC_CNT - 1) 6548#define BNX2_MAX_TX_DESC_CNT (BNX2_TX_DESC_CNT - 1)
6549 6549
6550#define MAX_RX_RINGS 8 6550#define BNX2_MAX_RX_RINGS 8
6551#define MAX_RX_PG_RINGS 32 6551#define BNX2_MAX_RX_PG_RINGS 32
6552#define RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct rx_bd)) 6552#define BNX2_RX_DESC_CNT (BNX2_PAGE_SIZE / sizeof(struct bnx2_rx_bd))
6553#define MAX_RX_DESC_CNT (RX_DESC_CNT - 1) 6553#define BNX2_MAX_RX_DESC_CNT (BNX2_RX_DESC_CNT - 1)
6554#define MAX_TOTAL_RX_DESC_CNT (MAX_RX_DESC_CNT * MAX_RX_RINGS) 6554#define BNX2_MAX_TOTAL_RX_DESC_CNT (BNX2_MAX_RX_DESC_CNT * BNX2_MAX_RX_RINGS)
6555#define MAX_TOTAL_RX_PG_DESC_CNT (MAX_RX_DESC_CNT * MAX_RX_PG_RINGS) 6555#define BNX2_MAX_TOTAL_RX_PG_DESC_CNT \
6556 (BNX2_MAX_RX_DESC_CNT * BNX2_MAX_RX_PG_RINGS)
6556 6557
6557#define NEXT_TX_BD(x) (((x) & (MAX_TX_DESC_CNT - 1)) == \ 6558#define BNX2_NEXT_TX_BD(x) (((x) & (BNX2_MAX_TX_DESC_CNT - 1)) == \
6558 (MAX_TX_DESC_CNT - 1)) ? \ 6559 (BNX2_MAX_TX_DESC_CNT - 1)) ? \
6559 (x) + 2 : (x) + 1 6560 (x) + 2 : (x) + 1
6560 6561
6561#define TX_RING_IDX(x) ((x) & MAX_TX_DESC_CNT) 6562#define BNX2_TX_RING_IDX(x) ((x) & BNX2_MAX_TX_DESC_CNT)
6562 6563
6563#define NEXT_RX_BD(x) (((x) & (MAX_RX_DESC_CNT - 1)) == \ 6564#define BNX2_NEXT_RX_BD(x) (((x) & (BNX2_MAX_RX_DESC_CNT - 1)) == \
6564 (MAX_RX_DESC_CNT - 1)) ? \ 6565 (BNX2_MAX_RX_DESC_CNT - 1)) ? \
6565 (x) + 2 : (x) + 1 6566 (x) + 2 : (x) + 1
6566 6567
6567#define RX_RING_IDX(x) ((x) & bp->rx_max_ring_idx) 6568#define BNX2_RX_RING_IDX(x) ((x) & bp->rx_max_ring_idx)
6568#define RX_PG_RING_IDX(x) ((x) & bp->rx_max_pg_ring_idx) 6569#define BNX2_RX_PG_RING_IDX(x) ((x) & bp->rx_max_pg_ring_idx)
6569 6570
6570#define RX_RING(x) (((x) & ~MAX_RX_DESC_CNT) >> (BCM_PAGE_BITS - 4)) 6571#define BNX2_RX_RING(x) (((x) & ~BNX2_MAX_RX_DESC_CNT) >> (BNX2_PAGE_BITS - 4))
6571#define RX_IDX(x) ((x) & MAX_RX_DESC_CNT) 6572#define BNX2_RX_IDX(x) ((x) & BNX2_MAX_RX_DESC_CNT)
6572 6573
6573/* Context size. */ 6574/* Context size. */
6574#define CTX_SHIFT 7 6575#define CTX_SHIFT 7
@@ -6609,7 +6610,7 @@ struct l2_fhdr {
6609 * RX ring buffer contains pointer to kmalloc() data only, 6610 * RX ring buffer contains pointer to kmalloc() data only,
6610 * skb are built only after Hardware filled the frame. 6611 * skb are built only after Hardware filled the frame.
6611 */ 6612 */
6612struct sw_bd { 6613struct bnx2_sw_bd {
6613 u8 *data; 6614 u8 *data;
6614 DEFINE_DMA_UNMAP_ADDR(mapping); 6615 DEFINE_DMA_UNMAP_ADDR(mapping);
6615}; 6616};
@@ -6623,23 +6624,23 @@ static inline struct l2_fhdr *get_l2_fhdr(u8 *data)
6623} 6624}
6624 6625
6625 6626
6626struct sw_pg { 6627struct bnx2_sw_pg {
6627 struct page *page; 6628 struct page *page;
6628 DEFINE_DMA_UNMAP_ADDR(mapping); 6629 DEFINE_DMA_UNMAP_ADDR(mapping);
6629}; 6630};
6630 6631
6631struct sw_tx_bd { 6632struct bnx2_sw_tx_bd {
6632 struct sk_buff *skb; 6633 struct sk_buff *skb;
6633 DEFINE_DMA_UNMAP_ADDR(mapping); 6634 DEFINE_DMA_UNMAP_ADDR(mapping);
6634 unsigned short is_gso; 6635 unsigned short is_gso;
6635 unsigned short nr_frags; 6636 unsigned short nr_frags;
6636}; 6637};
6637 6638
6638#define SW_RXBD_RING_SIZE (sizeof(struct sw_bd) * RX_DESC_CNT) 6639#define SW_RXBD_RING_SIZE (sizeof(struct bnx2_sw_bd) * BNX2_RX_DESC_CNT)
6639#define SW_RXPG_RING_SIZE (sizeof(struct sw_pg) * RX_DESC_CNT) 6640#define SW_RXPG_RING_SIZE (sizeof(struct bnx2_sw_pg) * BNX2_RX_DESC_CNT)
6640#define RXBD_RING_SIZE (sizeof(struct rx_bd) * RX_DESC_CNT) 6641#define RXBD_RING_SIZE (sizeof(struct bnx2_rx_bd) * BNX2_RX_DESC_CNT)
6641#define SW_TXBD_RING_SIZE (sizeof(struct sw_tx_bd) * TX_DESC_CNT) 6642#define SW_TXBD_RING_SIZE (sizeof(struct bnx2_sw_tx_bd) * BNX2_TX_DESC_CNT)
6642#define TXBD_RING_SIZE (sizeof(struct tx_bd) * TX_DESC_CNT) 6643#define TXBD_RING_SIZE (sizeof(struct bnx2_tx_bd) * BNX2_TX_DESC_CNT)
6643 6644
6644/* Buffered flash (Atmel: AT45DB011B) specific information */ 6645/* Buffered flash (Atmel: AT45DB011B) specific information */
6645#define SEEPROM_PAGE_BITS 2 6646#define SEEPROM_PAGE_BITS 2
@@ -6720,8 +6721,8 @@ struct bnx2_tx_ring_info {
6720 u32 tx_bidx_addr; 6721 u32 tx_bidx_addr;
6721 u32 tx_bseq_addr; 6722 u32 tx_bseq_addr;
6722 6723
6723 struct tx_bd *tx_desc_ring; 6724 struct bnx2_tx_bd *tx_desc_ring;
6724 struct sw_tx_bd *tx_buf_ring; 6725 struct bnx2_sw_tx_bd *tx_buf_ring;
6725 6726
6726 u16 tx_cons; 6727 u16 tx_cons;
6727 u16 hw_tx_cons; 6728 u16 hw_tx_cons;
@@ -6741,13 +6742,13 @@ struct bnx2_rx_ring_info {
6741 u16 rx_pg_prod; 6742 u16 rx_pg_prod;
6742 u16 rx_pg_cons; 6743 u16 rx_pg_cons;
6743 6744
6744 struct sw_bd *rx_buf_ring; 6745 struct bnx2_sw_bd *rx_buf_ring;
6745 struct rx_bd *rx_desc_ring[MAX_RX_RINGS]; 6746 struct bnx2_rx_bd *rx_desc_ring[BNX2_MAX_RX_RINGS];
6746 struct sw_pg *rx_pg_ring; 6747 struct bnx2_sw_pg *rx_pg_ring;
6747 struct rx_bd *rx_pg_desc_ring[MAX_RX_PG_RINGS]; 6748 struct bnx2_rx_bd *rx_pg_desc_ring[BNX2_MAX_RX_PG_RINGS];
6748 6749
6749 dma_addr_t rx_desc_mapping[MAX_RX_RINGS]; 6750 dma_addr_t rx_desc_mapping[BNX2_MAX_RX_RINGS];
6750 dma_addr_t rx_pg_desc_mapping[MAX_RX_PG_RINGS]; 6751 dma_addr_t rx_pg_desc_mapping[BNX2_MAX_RX_PG_RINGS];
6751}; 6752};
6752 6753
6753struct bnx2_napi { 6754struct bnx2_napi {
@@ -7052,7 +7053,7 @@ struct bnx2_rv2p_fw_file {
7052 7053
7053#define RV2P_P1_FIXUP_PAGE_SIZE_IDX 0 7054#define RV2P_P1_FIXUP_PAGE_SIZE_IDX 0
7054#define RV2P_BD_PAGE_SIZE_MSK 0xffff 7055#define RV2P_BD_PAGE_SIZE_MSK 0xffff
7055#define RV2P_BD_PAGE_SIZE ((BCM_PAGE_SIZE / 16) - 1) 7056#define RV2P_BD_PAGE_SIZE ((BNX2_PAGE_SIZE / 16) - 1)
7056 7057
7057#define RV2P_PROC1 0 7058#define RV2P_PROC1 0
7058#define RV2P_PROC2 1 7059#define RV2P_PROC2 1