diff options
author | Michael Chan <mchan@broadcom.com> | 2013-09-02 14:42:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-04 00:27:26 -0400 |
commit | 5bf945a874d13e4e44c61afaeb7714d07fa7baca (patch) | |
tree | c2a04c36ce8cbd8460277bb92ffede024d9ad279 /drivers/net/ethernet/broadcom/cnic.c | |
parent | 5e65789f694f2977fb7169c500b4997772f5278b (diff) |
cnic: Eliminate CNIC_PORT macro and port_mode in local struct.
Use BP_PORT and chip_port_mode directly from bnx2x.h to avoid duplication.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/cnic.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/cnic.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 750b9a621397..435a16760e38 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -1695,7 +1695,7 @@ static int cnic_setup_bnx2x_ctx(struct cnic_dev *dev, struct kwqe *wqes[], | |||
1695 | struct iscsi_context *ictx; | 1695 | struct iscsi_context *ictx; |
1696 | struct regpair context_addr; | 1696 | struct regpair context_addr; |
1697 | int i, j, n = 2, n_max; | 1697 | int i, j, n = 2, n_max; |
1698 | u8 port = CNIC_PORT(cp); | 1698 | u8 port = BP_PORT(bp); |
1699 | 1699 | ||
1700 | ctx->ctx_flags = 0; | 1700 | ctx->ctx_flags = 0; |
1701 | if (!req2->num_additional_wqes) | 1701 | if (!req2->num_additional_wqes) |
@@ -1750,7 +1750,7 @@ static int cnic_setup_bnx2x_ctx(struct cnic_dev *dev, struct kwqe *wqes[], | |||
1750 | ictx->xstorm_st_context.common.ethernet.reserved_vlan_type = | 1750 | ictx->xstorm_st_context.common.ethernet.reserved_vlan_type = |
1751 | ETH_P_8021Q; | 1751 | ETH_P_8021Q; |
1752 | if (BNX2X_CHIP_IS_E2_PLUS(bp) && | 1752 | if (BNX2X_CHIP_IS_E2_PLUS(bp) && |
1753 | cp->port_mode == CHIP_2_PORT_MODE) { | 1753 | bp->common.chip_port_mode == CHIP_2_PORT_MODE) { |
1754 | 1754 | ||
1755 | port = 0; | 1755 | port = 0; |
1756 | } | 1756 | } |
@@ -3050,8 +3050,8 @@ static irqreturn_t cnic_irq(int irq, void *dev_instance) | |||
3050 | static inline void cnic_ack_bnx2x_int(struct cnic_dev *dev, u8 id, u8 storm, | 3050 | static inline void cnic_ack_bnx2x_int(struct cnic_dev *dev, u8 id, u8 storm, |
3051 | u16 index, u8 op, u8 update) | 3051 | u16 index, u8 op, u8 update) |
3052 | { | 3052 | { |
3053 | struct cnic_local *cp = dev->cnic_priv; | 3053 | struct bnx2x *bp = netdev_priv(dev->netdev); |
3054 | u32 hc_addr = (HC_REG_COMMAND_REG + CNIC_PORT(cp) * 32 + | 3054 | u32 hc_addr = (HC_REG_COMMAND_REG + BP_PORT(bp) * 32 + |
3055 | COMMAND_REG_INT_ACK); | 3055 | COMMAND_REG_INT_ACK); |
3056 | struct igu_ack_register igu_ack; | 3056 | struct igu_ack_register igu_ack; |
3057 | 3057 | ||
@@ -4231,7 +4231,7 @@ static int cnic_cm_init_bnx2x_hw(struct cnic_dev *dev) | |||
4231 | struct cnic_local *cp = dev->cnic_priv; | 4231 | struct cnic_local *cp = dev->cnic_priv; |
4232 | struct bnx2x *bp = netdev_priv(dev->netdev); | 4232 | struct bnx2x *bp = netdev_priv(dev->netdev); |
4233 | u32 pfid = cp->pfid; | 4233 | u32 pfid = cp->pfid; |
4234 | u32 port = CNIC_PORT(cp); | 4234 | u32 port = BP_PORT(bp); |
4235 | 4235 | ||
4236 | cnic_init_bnx2x_mac(dev); | 4236 | cnic_init_bnx2x_mac(dev); |
4237 | cnic_bnx2x_set_tcp_options(dev, 0, 1); | 4237 | cnic_bnx2x_set_tcp_options(dev, 0, 1); |
@@ -5090,7 +5090,6 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev) | |||
5090 | u32 pfid; | 5090 | u32 pfid; |
5091 | 5091 | ||
5092 | dev->stats_addr = ethdev->addr_drv_info_to_mcp; | 5092 | dev->stats_addr = ethdev->addr_drv_info_to_mcp; |
5093 | cp->port_mode = bp->common.chip_port_mode; | ||
5094 | cp->pfid = bp->pfid; | 5093 | cp->pfid = bp->pfid; |
5095 | cp->func = bp->pf_num; | 5094 | cp->func = bp->pf_num; |
5096 | 5095 | ||
@@ -5190,7 +5189,7 @@ static void cnic_init_rings(struct cnic_dev *dev) | |||
5190 | off = BAR_USTRORM_INTMEM + | 5189 | off = BAR_USTRORM_INTMEM + |
5191 | (BNX2X_CHIP_IS_E2_PLUS(bp) ? | 5190 | (BNX2X_CHIP_IS_E2_PLUS(bp) ? |
5192 | USTORM_RX_PRODS_E2_OFFSET(cl_qzone_id) : | 5191 | USTORM_RX_PRODS_E2_OFFSET(cl_qzone_id) : |
5193 | USTORM_RX_PRODS_E1X_OFFSET(CNIC_PORT(cp), cli)); | 5192 | USTORM_RX_PRODS_E1X_OFFSET(BP_PORT(bp), cli)); |
5194 | 5193 | ||
5195 | for (i = 0; i < sizeof(struct ustorm_eth_rx_producers) / 4; i++) | 5194 | for (i = 0; i < sizeof(struct ustorm_eth_rx_producers) / 4; i++) |
5196 | CNIC_WR(dev, off + i * 4, ((u32 *) &rx_prods)[i]); | 5195 | CNIC_WR(dev, off + i * 4, ((u32 *) &rx_prods)[i]); |