Commit 4ce45e02 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnx2: Add BNX2 prefix to CHIP ID and name macros

for namespace consistency.
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2bc4078e
This diff is collapsed.
...@@ -6854,33 +6854,31 @@ struct bnx2 { ...@@ -6854,33 +6854,31 @@ struct bnx2 {
u32 chip_id; u32 chip_id;
/* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */ /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */
#define CHIP_NUM(bp) (((bp)->chip_id) & 0xffff0000) #define BNX2_CHIP(bp) (((bp)->chip_id) & 0xffff0000)
#define CHIP_NUM_5706 0x57060000 #define BNX2_CHIP_5706 0x57060000
#define CHIP_NUM_5708 0x57080000 #define BNX2_CHIP_5708 0x57080000
#define CHIP_NUM_5709 0x57090000 #define BNX2_CHIP_5709 0x57090000
#define CHIP_REV(bp) (((bp)->chip_id) & 0x0000f000) #define BNX2_CHIP_REV(bp) (((bp)->chip_id) & 0x0000f000)
#define CHIP_REV_Ax 0x00000000 #define BNX2_CHIP_REV_Ax 0x00000000
#define CHIP_REV_Bx 0x00001000 #define BNX2_CHIP_REV_Bx 0x00001000
#define CHIP_REV_Cx 0x00002000 #define BNX2_CHIP_REV_Cx 0x00002000
#define CHIP_METAL(bp) (((bp)->chip_id) & 0x00000ff0) #define BNX2_CHIP_METAL(bp) (((bp)->chip_id) & 0x00000ff0)
#define CHIP_BONDING(bp) (((bp)->chip_id) & 0x0000000f) #define BNX2_CHIP_BOND(bp) (((bp)->chip_id) & 0x0000000f)
#define CHIP_ID(bp) (((bp)->chip_id) & 0xfffffff0) #define BNX2_CHIP_ID(bp) (((bp)->chip_id) & 0xfffffff0)
#define CHIP_ID_5706_A0 0x57060000 #define BNX2_CHIP_ID_5706_A0 0x57060000
#define CHIP_ID_5706_A1 0x57060010 #define BNX2_CHIP_ID_5706_A1 0x57060010
#define CHIP_ID_5706_A2 0x57060020 #define BNX2_CHIP_ID_5706_A2 0x57060020
#define CHIP_ID_5708_A0 0x57080000 #define BNX2_CHIP_ID_5708_A0 0x57080000
#define CHIP_ID_5708_B0 0x57081000 #define BNX2_CHIP_ID_5708_B0 0x57081000
#define CHIP_ID_5708_B1 0x57081010 #define BNX2_CHIP_ID_5708_B1 0x57081010
#define CHIP_ID_5709_A0 0x57090000 #define BNX2_CHIP_ID_5709_A0 0x57090000
#define CHIP_ID_5709_A1 0x57090010 #define BNX2_CHIP_ID_5709_A1 0x57090010
#define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf)
/* A serdes chip will have the first bit of the bond id set. */ /* A serdes chip will have the first bit of the bond id set. */
#define CHIP_BOND_ID_SERDES_BIT 0x01 #define BNX2_CHIP_BOND_SERDES_BIT 0x01
u32 phy_addr; u32 phy_addr;
u32 phy_id; u32 phy_id;
......
...@@ -895,7 +895,7 @@ static int cnic_alloc_context(struct cnic_dev *dev) ...@@ -895,7 +895,7 @@ static int cnic_alloc_context(struct cnic_dev *dev)
{ {
struct cnic_local *cp = dev->cnic_priv; struct cnic_local *cp = dev->cnic_priv;
if (CHIP_NUM(cp) == CHIP_NUM_5709) { if (BNX2_CHIP(cp) == BNX2_CHIP_5709) {
int i, k, arr_size; int i, k, arr_size;
cp->ctx_blk_size = BNX2_PAGE_SIZE; cp->ctx_blk_size = BNX2_PAGE_SIZE;
...@@ -4358,7 +4358,7 @@ static int cnic_setup_5709_context(struct cnic_dev *dev, int valid) ...@@ -4358,7 +4358,7 @@ static int cnic_setup_5709_context(struct cnic_dev *dev, int valid)
int ret = 0, i; int ret = 0, i;
u32 valid_bit = valid ? BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID : 0; u32 valid_bit = valid ? BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID : 0;
if (CHIP_NUM(cp) != CHIP_NUM_5709) if (BNX2_CHIP(cp) != BNX2_CHIP_5709)
return 0; return 0;
for (i = 0; i < cp->ctx_blks; i++) { for (i = 0; i < cp->ctx_blks; i++) {
...@@ -4526,7 +4526,7 @@ static void cnic_init_bnx2_tx_ring(struct cnic_dev *dev) ...@@ -4526,7 +4526,7 @@ static void cnic_init_bnx2_tx_ring(struct cnic_dev *dev)
cp->tx_cons = *cp->tx_cons_ptr; cp->tx_cons = *cp->tx_cons_ptr;
cid_addr = GET_CID_ADDR(tx_cid); cid_addr = GET_CID_ADDR(tx_cid);
if (CHIP_NUM(cp) == CHIP_NUM_5709) { if (BNX2_CHIP(cp) == BNX2_CHIP_5709) {
u32 cid_addr2 = GET_CID_ADDR(tx_cid + 4) + 0x40; u32 cid_addr2 = GET_CID_ADDR(tx_cid + 4) + 0x40;
for (i = 0; i < PHY_CTX_SIZE; i += 4) for (i = 0; i < PHY_CTX_SIZE; i += 4)
...@@ -4671,7 +4671,7 @@ static void cnic_set_bnx2_mac(struct cnic_dev *dev) ...@@ -4671,7 +4671,7 @@ static void cnic_set_bnx2_mac(struct cnic_dev *dev)
CNIC_WR(dev, BNX2_EMAC_MAC_MATCH5, val); CNIC_WR(dev, BNX2_EMAC_MAC_MATCH5, val);
val = 4 | BNX2_RPM_SORT_USER2_BC_EN; val = 4 | BNX2_RPM_SORT_USER2_BC_EN;
if (CHIP_NUM(cp) != CHIP_NUM_5709) if (BNX2_CHIP(cp) != BNX2_CHIP_5709)
val |= BNX2_RPM_SORT_USER2_PROM_VLAN; val |= BNX2_RPM_SORT_USER2_PROM_VLAN;
CNIC_WR(dev, BNX2_RPM_SORT_USER2, 0x0); CNIC_WR(dev, BNX2_RPM_SORT_USER2, 0x0);
...@@ -4717,7 +4717,7 @@ static int cnic_start_bnx2_hw(struct cnic_dev *dev) ...@@ -4717,7 +4717,7 @@ static int cnic_start_bnx2_hw(struct cnic_dev *dev)
cp->kwq_con_idx = 0; cp->kwq_con_idx = 0;
set_bit(CNIC_LCL_FL_KWQ_INIT, &cp->cnic_local_flags); set_bit(CNIC_LCL_FL_KWQ_INIT, &cp->cnic_local_flags);
if (CHIP_NUM(cp) == CHIP_NUM_5706 || CHIP_NUM(cp) == CHIP_NUM_5708) if (BNX2_CHIP(cp) == BNX2_CHIP_5706 || BNX2_CHIP(cp) == BNX2_CHIP_5708)
cp->kwq_con_idx_ptr = &sblk->status_rx_quick_consumer_index15; cp->kwq_con_idx_ptr = &sblk->status_rx_quick_consumer_index15;
else else
cp->kwq_con_idx_ptr = &sblk->status_cmd_consumer_index; cp->kwq_con_idx_ptr = &sblk->status_cmd_consumer_index;
...@@ -4917,9 +4917,9 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev, ...@@ -4917,9 +4917,9 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev,
if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id))
pbd_e2->parsing_data = (UNICAST_ADDRESS << pbd_e2->parsing_data = (UNICAST_ADDRESS <<
ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT); ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT);
else else
pbd_e1x->global_data = (UNICAST_ADDRESS << pbd_e1x->global_data = (UNICAST_ADDRESS <<
ETH_TX_PARSE_BD_E1X_ETH_ADDR_TYPE_SHIFT); ETH_TX_PARSE_BD_E1X_ETH_ADDR_TYPE_SHIFT);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment