diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2010-10-05 23:34:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-06 17:10:41 -0400 |
commit | f85582f8c48addd8166727ef692d88b0ff618c5e (patch) | |
tree | 5ea8ef71ae9ca5e67793350b3533f146116bd177 /drivers/net/bnx2x/bnx2x_main.c | |
parent | c2bff63fad94eeecf59e4ba8e4cb51688ccae1ec (diff) |
bnx2x: code beautify
This patch does not include any functional changes.
The changes are: empty lines, indentation and comments.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_main.c | 275 |
1 files changed, 141 insertions, 134 deletions
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index a686a4c15710..7a9556b5b55d 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -56,7 +56,6 @@ | |||
56 | #include "bnx2x_init_ops.h" | 56 | #include "bnx2x_init_ops.h" |
57 | #include "bnx2x_cmn.h" | 57 | #include "bnx2x_cmn.h" |
58 | 58 | ||
59 | |||
60 | #include <linux/firmware.h> | 59 | #include <linux/firmware.h> |
61 | #include "bnx2x_fw_file_hdr.h" | 60 | #include "bnx2x_fw_file_hdr.h" |
62 | /* FW files */ | 61 | /* FW files */ |
@@ -1325,7 +1324,6 @@ static bool bnx2x_trylock_hw_lock(struct bnx2x *bp, u32 resource) | |||
1325 | return false; | 1324 | return false; |
1326 | } | 1325 | } |
1327 | 1326 | ||
1328 | |||
1329 | #ifdef BCM_CNIC | 1327 | #ifdef BCM_CNIC |
1330 | static void bnx2x_cnic_cfc_comp(struct bnx2x *bp, int cid); | 1328 | static void bnx2x_cnic_cfc_comp(struct bnx2x *bp, int cid); |
1331 | #endif | 1329 | #endif |
@@ -1754,12 +1752,12 @@ void bnx2x_calc_fc_adv(struct bnx2x *bp) | |||
1754 | MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) { | 1752 | MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) { |
1755 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE: | 1753 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE: |
1756 | bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause | | 1754 | bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause | |
1757 | ADVERTISED_Pause); | 1755 | ADVERTISED_Pause); |
1758 | break; | 1756 | break; |
1759 | 1757 | ||
1760 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH: | 1758 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH: |
1761 | bp->port.advertising[cfg_idx] |= (ADVERTISED_Asym_Pause | | 1759 | bp->port.advertising[cfg_idx] |= (ADVERTISED_Asym_Pause | |
1762 | ADVERTISED_Pause); | 1760 | ADVERTISED_Pause); |
1763 | break; | 1761 | break; |
1764 | 1762 | ||
1765 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_ASYMMETRIC: | 1763 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_ASYMMETRIC: |
@@ -1768,12 +1766,11 @@ void bnx2x_calc_fc_adv(struct bnx2x *bp) | |||
1768 | 1766 | ||
1769 | default: | 1767 | default: |
1770 | bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause | | 1768 | bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause | |
1771 | ADVERTISED_Pause); | 1769 | ADVERTISED_Pause); |
1772 | break; | 1770 | break; |
1773 | } | 1771 | } |
1774 | } | 1772 | } |
1775 | 1773 | ||
1776 | |||
1777 | u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) | 1774 | u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) |
1778 | { | 1775 | { |
1779 | if (!BP_NOMCP(bp)) { | 1776 | if (!BP_NOMCP(bp)) { |
@@ -1952,6 +1949,7 @@ static void bnx2x_init_vn_minmax(struct bnx2x *bp, int vn) | |||
1952 | vn_max_rate = ((vn_cfg & FUNC_MF_CFG_MAX_BW_MASK) >> | 1949 | vn_max_rate = ((vn_cfg & FUNC_MF_CFG_MAX_BW_MASK) >> |
1953 | FUNC_MF_CFG_MAX_BW_SHIFT) * 100; | 1950 | FUNC_MF_CFG_MAX_BW_SHIFT) * 100; |
1954 | } | 1951 | } |
1952 | |||
1955 | DP(NETIF_MSG_IFUP, | 1953 | DP(NETIF_MSG_IFUP, |
1956 | "func %d: vn_min_rate %d vn_max_rate %d vn_weight_sum %d\n", | 1954 | "func %d: vn_min_rate %d vn_max_rate %d vn_weight_sum %d\n", |
1957 | func, vn_min_rate, vn_max_rate, bp->vn_weight_sum); | 1955 | func, vn_min_rate, vn_max_rate, bp->vn_weight_sum); |
@@ -1991,6 +1989,7 @@ static void bnx2x_init_vn_minmax(struct bnx2x *bp, int vn) | |||
1991 | XSTORM_FAIRNESS_PER_VN_VARS_OFFSET(func) + i * 4, | 1989 | XSTORM_FAIRNESS_PER_VN_VARS_OFFSET(func) + i * 4, |
1992 | ((u32 *)(&m_fair_vn))[i]); | 1990 | ((u32 *)(&m_fair_vn))[i]); |
1993 | } | 1991 | } |
1992 | |||
1994 | static int bnx2x_get_cmng_fns_mode(struct bnx2x *bp) | 1993 | static int bnx2x_get_cmng_fns_mode(struct bnx2x *bp) |
1995 | { | 1994 | { |
1996 | if (CHIP_REV_IS_SLOW(bp)) | 1995 | if (CHIP_REV_IS_SLOW(bp)) |
@@ -2625,13 +2624,13 @@ static inline void bnx2x_sp_prod_update(struct bnx2x *bp) | |||
2625 | wmb(); | 2624 | wmb(); |
2626 | 2625 | ||
2627 | REG_WR16(bp, BAR_XSTRORM_INTMEM + XSTORM_SPQ_PROD_OFFSET(func), | 2626 | REG_WR16(bp, BAR_XSTRORM_INTMEM + XSTORM_SPQ_PROD_OFFSET(func), |
2628 | bp->spq_prod_idx); | 2627 | bp->spq_prod_idx); |
2629 | mmiowb(); | 2628 | mmiowb(); |
2630 | } | 2629 | } |
2631 | 2630 | ||
2632 | /* the slow path queue is odd since completions arrive on the fastpath ring */ | 2631 | /* the slow path queue is odd since completions arrive on the fastpath ring */ |
2633 | int bnx2x_sp_post(struct bnx2x *bp, int command, int cid, | 2632 | int bnx2x_sp_post(struct bnx2x *bp, int command, int cid, |
2634 | u32 data_hi, u32 data_lo, int common) | 2633 | u32 data_hi, u32 data_lo, int common) |
2635 | { | 2634 | { |
2636 | struct eth_spe *spe; | 2635 | struct eth_spe *spe; |
2637 | u16 type; | 2636 | u16 type; |
@@ -3055,6 +3054,7 @@ static inline void bnx2x_attn_int_deasserted3(struct bnx2x *bp, u32 attn) | |||
3055 | #define RESET_DONE_FLAG_MASK (~LOAD_COUNTER_MASK) | 3054 | #define RESET_DONE_FLAG_MASK (~LOAD_COUNTER_MASK) |
3056 | #define RESET_DONE_FLAG_SHIFT LOAD_COUNTER_BITS | 3055 | #define RESET_DONE_FLAG_SHIFT LOAD_COUNTER_BITS |
3057 | #define CHIP_PARITY_SUPPORTED(bp) (CHIP_IS_E1(bp) || CHIP_IS_E1H(bp)) | 3056 | #define CHIP_PARITY_SUPPORTED(bp) (CHIP_IS_E1(bp) || CHIP_IS_E1H(bp)) |
3057 | |||
3058 | /* | 3058 | /* |
3059 | * should be run under rtnl lock | 3059 | * should be run under rtnl lock |
3060 | */ | 3060 | */ |
@@ -4376,7 +4376,6 @@ gunzip_nomem1: | |||
4376 | static void bnx2x_gunzip_end(struct bnx2x *bp) | 4376 | static void bnx2x_gunzip_end(struct bnx2x *bp) |
4377 | { | 4377 | { |
4378 | kfree(bp->strm->workspace); | 4378 | kfree(bp->strm->workspace); |
4379 | |||
4380 | kfree(bp->strm); | 4379 | kfree(bp->strm); |
4381 | bp->strm = NULL; | 4380 | bp->strm = NULL; |
4382 | 4381 | ||
@@ -4641,6 +4640,7 @@ static void enable_blocks_attention(struct bnx2x *bp) | |||
4641 | REG_WR(bp, CCM_REG_CCM_INT_MASK, 0); | 4640 | REG_WR(bp, CCM_REG_CCM_INT_MASK, 0); |
4642 | /* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_0, 0); */ | 4641 | /* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_0, 0); */ |
4643 | /* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_1, 0); */ | 4642 | /* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_1, 0); */ |
4643 | |||
4644 | if (CHIP_REV_IS_FPGA(bp)) | 4644 | if (CHIP_REV_IS_FPGA(bp)) |
4645 | REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0, 0x580000); | 4645 | REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0, 0x580000); |
4646 | else if (CHIP_IS_E2(bp)) | 4646 | else if (CHIP_IS_E2(bp)) |
@@ -4672,29 +4672,29 @@ static const struct { | |||
4672 | {PXP2_REG_PXP2_PRTY_MASK_1, 0x7f}, | 4672 | {PXP2_REG_PXP2_PRTY_MASK_1, 0x7f}, |
4673 | {HC_REG_HC_PRTY_MASK, 0x7}, | 4673 | {HC_REG_HC_PRTY_MASK, 0x7}, |
4674 | {MISC_REG_MISC_PRTY_MASK, 0x1}, | 4674 | {MISC_REG_MISC_PRTY_MASK, 0x1}, |
4675 | {QM_REG_QM_PRTY_MASK, 0x0}, | 4675 | {QM_REG_QM_PRTY_MASK, 0x0}, |
4676 | {DORQ_REG_DORQ_PRTY_MASK, 0x0}, | 4676 | {DORQ_REG_DORQ_PRTY_MASK, 0x0}, |
4677 | {GRCBASE_UPB + PB_REG_PB_PRTY_MASK, 0x0}, | 4677 | {GRCBASE_UPB + PB_REG_PB_PRTY_MASK, 0x0}, |
4678 | {GRCBASE_XPB + PB_REG_PB_PRTY_MASK, 0x0}, | 4678 | {GRCBASE_XPB + PB_REG_PB_PRTY_MASK, 0x0}, |
4679 | {SRC_REG_SRC_PRTY_MASK, 0x4}, /* bit 2 */ | 4679 | {SRC_REG_SRC_PRTY_MASK, 0x4}, /* bit 2 */ |
4680 | {CDU_REG_CDU_PRTY_MASK, 0x0}, | 4680 | {CDU_REG_CDU_PRTY_MASK, 0x0}, |
4681 | {CFC_REG_CFC_PRTY_MASK, 0x0}, | 4681 | {CFC_REG_CFC_PRTY_MASK, 0x0}, |
4682 | {DBG_REG_DBG_PRTY_MASK, 0x0}, | 4682 | {DBG_REG_DBG_PRTY_MASK, 0x0}, |
4683 | {DMAE_REG_DMAE_PRTY_MASK, 0x0}, | 4683 | {DMAE_REG_DMAE_PRTY_MASK, 0x0}, |
4684 | {BRB1_REG_BRB1_PRTY_MASK, 0x0}, | 4684 | {BRB1_REG_BRB1_PRTY_MASK, 0x0}, |
4685 | {PRS_REG_PRS_PRTY_MASK, (1<<6)},/* bit 6 */ | 4685 | {PRS_REG_PRS_PRTY_MASK, (1<<6)},/* bit 6 */ |
4686 | {TSDM_REG_TSDM_PRTY_MASK, 0x18},/* bit 3,4 */ | 4686 | {TSDM_REG_TSDM_PRTY_MASK, 0x18}, /* bit 3,4 */ |
4687 | {CSDM_REG_CSDM_PRTY_MASK, 0x8}, /* bit 3 */ | 4687 | {CSDM_REG_CSDM_PRTY_MASK, 0x8}, /* bit 3 */ |
4688 | {USDM_REG_USDM_PRTY_MASK, 0x38},/* bit 3,4,5 */ | 4688 | {USDM_REG_USDM_PRTY_MASK, 0x38}, /* bit 3,4,5 */ |
4689 | {XSDM_REG_XSDM_PRTY_MASK, 0x8}, /* bit 3 */ | 4689 | {XSDM_REG_XSDM_PRTY_MASK, 0x8}, /* bit 3 */ |
4690 | {TSEM_REG_TSEM_PRTY_MASK_0, 0x0}, | 4690 | {TSEM_REG_TSEM_PRTY_MASK_0, 0x0}, |
4691 | {TSEM_REG_TSEM_PRTY_MASK_1, 0x0}, | 4691 | {TSEM_REG_TSEM_PRTY_MASK_1, 0x0}, |
4692 | {USEM_REG_USEM_PRTY_MASK_0, 0x0}, | 4692 | {USEM_REG_USEM_PRTY_MASK_0, 0x0}, |
4693 | {USEM_REG_USEM_PRTY_MASK_1, 0x0}, | 4693 | {USEM_REG_USEM_PRTY_MASK_1, 0x0}, |
4694 | {CSEM_REG_CSEM_PRTY_MASK_0, 0x0}, | 4694 | {CSEM_REG_CSEM_PRTY_MASK_0, 0x0}, |
4695 | {CSEM_REG_CSEM_PRTY_MASK_1, 0x0}, | 4695 | {CSEM_REG_CSEM_PRTY_MASK_1, 0x0}, |
4696 | {XSEM_REG_XSEM_PRTY_MASK_0, 0x0}, | 4696 | {XSEM_REG_XSEM_PRTY_MASK_0, 0x0}, |
4697 | {XSEM_REG_XSEM_PRTY_MASK_1, 0x0} | 4697 | {XSEM_REG_XSEM_PRTY_MASK_1, 0x0} |
4698 | }; | 4698 | }; |
4699 | 4699 | ||
4700 | static void enable_blocks_parity(struct bnx2x *bp) | 4700 | static void enable_blocks_parity(struct bnx2x *bp) |
@@ -4906,7 +4906,6 @@ static int bnx2x_init_hw_common(struct bnx2x *bp, u32 load_code) | |||
4906 | 4906 | ||
4907 | bnx2x_ilt_init_page_size(bp, INITOP_SET); | 4907 | bnx2x_ilt_init_page_size(bp, INITOP_SET); |
4908 | 4908 | ||
4909 | |||
4910 | if (CHIP_REV_IS_FPGA(bp) && CHIP_IS_E1H(bp)) | 4909 | if (CHIP_REV_IS_FPGA(bp) && CHIP_IS_E1H(bp)) |
4911 | REG_WR(bp, PXP2_REG_PGL_TAGS_LIMIT, 0x1); | 4910 | REG_WR(bp, PXP2_REG_PGL_TAGS_LIMIT, 0x1); |
4912 | 4911 | ||
@@ -5003,6 +5002,7 @@ static int bnx2x_init_hw_common(struct bnx2x *bp, u32 load_code) | |||
5003 | 5002 | ||
5004 | if (CHIP_MODE_IS_4_PORT(bp)) | 5003 | if (CHIP_MODE_IS_4_PORT(bp)) |
5005 | bnx2x_init_block(bp, QM_4PORT_BLOCK, COMMON_STAGE); | 5004 | bnx2x_init_block(bp, QM_4PORT_BLOCK, COMMON_STAGE); |
5005 | |||
5006 | /* QM queues pointers table */ | 5006 | /* QM queues pointers table */ |
5007 | bnx2x_qm_init_ptr_table(bp, bp->qm_cid_count, INITOP_SET); | 5007 | bnx2x_qm_init_ptr_table(bp, bp->qm_cid_count, INITOP_SET); |
5008 | 5008 | ||
@@ -5036,6 +5036,7 @@ static int bnx2x_init_hw_common(struct bnx2x *bp, u32 load_code) | |||
5036 | #endif | 5036 | #endif |
5037 | if (!CHIP_IS_E1(bp)) | 5037 | if (!CHIP_IS_E1(bp)) |
5038 | REG_WR(bp, PRS_REG_E1HOV_MODE, IS_MF(bp)); | 5038 | REG_WR(bp, PRS_REG_E1HOV_MODE, IS_MF(bp)); |
5039 | |||
5039 | if (CHIP_IS_E2(bp)) { | 5040 | if (CHIP_IS_E2(bp)) { |
5040 | /* Bit-map indicating which L2 hdrs may appear after the | 5041 | /* Bit-map indicating which L2 hdrs may appear after the |
5041 | basic Ethernet header */ | 5042 | basic Ethernet header */ |
@@ -5081,6 +5082,7 @@ static int bnx2x_init_hw_common(struct bnx2x *bp, u32 load_code) | |||
5081 | REG_WR(bp, SRC_REG_SOFT_RST, 1); | 5082 | REG_WR(bp, SRC_REG_SOFT_RST, 1); |
5082 | for (i = SRC_REG_KEYRSS0_0; i <= SRC_REG_KEYRSS1_9; i += 4) | 5083 | for (i = SRC_REG_KEYRSS0_0; i <= SRC_REG_KEYRSS1_9; i += 4) |
5083 | REG_WR(bp, i, random32()); | 5084 | REG_WR(bp, i, random32()); |
5085 | |||
5084 | bnx2x_init_block(bp, SRCH_BLOCK, COMMON_STAGE); | 5086 | bnx2x_init_block(bp, SRCH_BLOCK, COMMON_STAGE); |
5085 | #ifdef BCM_CNIC | 5087 | #ifdef BCM_CNIC |
5086 | REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672); | 5088 | REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672); |
@@ -5467,6 +5469,7 @@ static int bnx2x_init_hw_func(struct bnx2x *bp) | |||
5467 | set the size */ | 5469 | set the size */ |
5468 | } | 5470 | } |
5469 | bnx2x_ilt_init_op(bp, INITOP_SET); | 5471 | bnx2x_ilt_init_op(bp, INITOP_SET); |
5472 | |||
5470 | #ifdef BCM_CNIC | 5473 | #ifdef BCM_CNIC |
5471 | bnx2x_src_init_t2(bp, bp->t2, bp->t2_mapping, SRC_CONN_NUM); | 5474 | bnx2x_src_init_t2(bp, bp->t2, bp->t2_mapping, SRC_CONN_NUM); |
5472 | 5475 | ||
@@ -5692,6 +5695,7 @@ static int bnx2x_init_hw_func(struct bnx2x *bp) | |||
5692 | bnx2x_init_block(bp, DMAE_BLOCK, FUNC0_STAGE + func); | 5695 | bnx2x_init_block(bp, DMAE_BLOCK, FUNC0_STAGE + func); |
5693 | 5696 | ||
5694 | bnx2x_phy_probe(&bp->link_params); | 5697 | bnx2x_phy_probe(&bp->link_params); |
5698 | |||
5695 | return 0; | 5699 | return 0; |
5696 | } | 5700 | } |
5697 | 5701 | ||
@@ -5826,6 +5830,7 @@ void bnx2x_free_mem(struct bnx2x *bp) | |||
5826 | bnx2x_ilt_mem_op(bp, ILT_MEMOP_FREE); | 5830 | bnx2x_ilt_mem_op(bp, ILT_MEMOP_FREE); |
5827 | 5831 | ||
5828 | BNX2X_FREE(bp->ilt->lines); | 5832 | BNX2X_FREE(bp->ilt->lines); |
5833 | |||
5829 | #ifdef BCM_CNIC | 5834 | #ifdef BCM_CNIC |
5830 | if (CHIP_IS_E2(bp)) | 5835 | if (CHIP_IS_E2(bp)) |
5831 | BNX2X_PCI_FREE(bp->cnic_sb.e2_sb, bp->cnic_sb_mapping, | 5836 | BNX2X_PCI_FREE(bp->cnic_sb.e2_sb, bp->cnic_sb_mapping, |
@@ -5833,8 +5838,10 @@ void bnx2x_free_mem(struct bnx2x *bp) | |||
5833 | else | 5838 | else |
5834 | BNX2X_PCI_FREE(bp->cnic_sb.e1x_sb, bp->cnic_sb_mapping, | 5839 | BNX2X_PCI_FREE(bp->cnic_sb.e1x_sb, bp->cnic_sb_mapping, |
5835 | sizeof(struct host_hc_status_block_e1x)); | 5840 | sizeof(struct host_hc_status_block_e1x)); |
5841 | |||
5836 | BNX2X_PCI_FREE(bp->t2, bp->t2_mapping, SRC_T2_SZ); | 5842 | BNX2X_PCI_FREE(bp->t2, bp->t2_mapping, SRC_T2_SZ); |
5837 | #endif | 5843 | #endif |
5844 | |||
5838 | BNX2X_PCI_FREE(bp->spq, bp->spq_mapping, BCM_PAGE_SIZE); | 5845 | BNX2X_PCI_FREE(bp->spq, bp->spq_mapping, BCM_PAGE_SIZE); |
5839 | 5846 | ||
5840 | BNX2X_PCI_FREE(bp->eq_ring, bp->eq_mapping, | 5847 | BNX2X_PCI_FREE(bp->eq_ring, bp->eq_mapping, |
@@ -5862,7 +5869,6 @@ static inline void set_sb_shortcuts(struct bnx2x *bp, int index) | |||
5862 | 5869 | ||
5863 | int bnx2x_alloc_mem(struct bnx2x *bp) | 5870 | int bnx2x_alloc_mem(struct bnx2x *bp) |
5864 | { | 5871 | { |
5865 | |||
5866 | #define BNX2X_PCI_ALLOC(x, y, size) \ | 5872 | #define BNX2X_PCI_ALLOC(x, y, size) \ |
5867 | do { \ | 5873 | do { \ |
5868 | x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \ | 5874 | x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \ |
@@ -5951,6 +5957,7 @@ int bnx2x_alloc_mem(struct bnx2x *bp) | |||
5951 | sizeof(struct bnx2x_slowpath)); | 5957 | sizeof(struct bnx2x_slowpath)); |
5952 | 5958 | ||
5953 | bp->context.size = sizeof(union cdu_context) * bp->l2_cid_count; | 5959 | bp->context.size = sizeof(union cdu_context) * bp->l2_cid_count; |
5960 | |||
5954 | BNX2X_PCI_ALLOC(bp->context.vcxt, &bp->context.cxt_mapping, | 5961 | BNX2X_PCI_ALLOC(bp->context.vcxt, &bp->context.cxt_mapping, |
5955 | bp->context.size); | 5962 | bp->context.size); |
5956 | 5963 | ||
@@ -5997,7 +6004,7 @@ int bnx2x_func_stop(struct bnx2x *bp) | |||
5997 | } | 6004 | } |
5998 | 6005 | ||
5999 | /** | 6006 | /** |
6000 | * Sets a MAC in a CAM for a few L2 Clients for E1x chip | 6007 | * Sets a MAC in a CAM for a few L2 Clients for E1x chips |
6001 | * | 6008 | * |
6002 | * @param bp driver descriptor | 6009 | * @param bp driver descriptor |
6003 | * @param set set or clear an entry (1 or 0) | 6010 | * @param set set or clear an entry (1 or 0) |
@@ -6007,8 +6014,8 @@ int bnx2x_func_stop(struct bnx2x *bp) | |||
6007 | * @param is_bcast is the set MAC a broadcast address (for E1 only) | 6014 | * @param is_bcast is the set MAC a broadcast address (for E1 only) |
6008 | */ | 6015 | */ |
6009 | static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, u8 *mac, | 6016 | static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, u8 *mac, |
6010 | u32 cl_bit_vec, u8 cam_offset, | 6017 | u32 cl_bit_vec, u8 cam_offset, |
6011 | u8 is_bcast) | 6018 | u8 is_bcast) |
6012 | { | 6019 | { |
6013 | struct mac_configuration_cmd *config = | 6020 | struct mac_configuration_cmd *config = |
6014 | (struct mac_configuration_cmd *)bnx2x_sp(bp, mac_config); | 6021 | (struct mac_configuration_cmd *)bnx2x_sp(bp, mac_config); |
@@ -6060,9 +6067,8 @@ static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, u8 *mac, | |||
6060 | bnx2x_wait_ramrod(bp, 0, 0, &bp->set_mac_pending, ramrod_flags); | 6067 | bnx2x_wait_ramrod(bp, 0, 0, &bp->set_mac_pending, ramrod_flags); |
6061 | } | 6068 | } |
6062 | 6069 | ||
6063 | |||
6064 | int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx, | 6070 | int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx, |
6065 | int *state_p, int flags) | 6071 | int *state_p, int flags) |
6066 | { | 6072 | { |
6067 | /* can take a while if any port is running */ | 6073 | /* can take a while if any port is running */ |
6068 | int cnt = 5000; | 6074 | int cnt = 5000; |
@@ -6220,7 +6226,6 @@ static void bnx2x_invlidate_e1_mc_list(struct bnx2x *bp) | |||
6220 | 6226 | ||
6221 | } | 6227 | } |
6222 | 6228 | ||
6223 | |||
6224 | #ifdef BCM_CNIC | 6229 | #ifdef BCM_CNIC |
6225 | /** | 6230 | /** |
6226 | * Set iSCSI MAC(s) at the next enties in the CAM after the ETH | 6231 | * Set iSCSI MAC(s) at the next enties in the CAM after the ETH |
@@ -6564,6 +6569,7 @@ void bnx2x_ilt_set_info(struct bnx2x *bp) | |||
6564 | ilt_client->flags = (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM); | 6569 | ilt_client->flags = (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM); |
6565 | #endif | 6570 | #endif |
6566 | } | 6571 | } |
6572 | |||
6567 | int bnx2x_setup_client(struct bnx2x *bp, struct bnx2x_fastpath *fp, | 6573 | int bnx2x_setup_client(struct bnx2x *bp, struct bnx2x_fastpath *fp, |
6568 | int is_leading) | 6574 | int is_leading) |
6569 | { | 6575 | { |
@@ -6949,7 +6955,6 @@ void bnx2x_disable_close_the_gate(struct bnx2x *bp) | |||
6949 | } | 6955 | } |
6950 | } | 6956 | } |
6951 | 6957 | ||
6952 | |||
6953 | /* Close gates #2, #3 and #4: */ | 6958 | /* Close gates #2, #3 and #4: */ |
6954 | static void bnx2x_set_234_gates(struct bnx2x *bp, bool close) | 6959 | static void bnx2x_set_234_gates(struct bnx2x *bp, bool close) |
6955 | { | 6960 | { |
@@ -6995,15 +7000,13 @@ static void bnx2x_clp_reset_prep(struct bnx2x *bp, u32 *magic_val) | |||
6995 | static void bnx2x_clp_reset_done(struct bnx2x *bp, u32 magic_val) | 7000 | static void bnx2x_clp_reset_done(struct bnx2x *bp, u32 magic_val) |
6996 | { | 7001 | { |
6997 | /* Restore the `magic' bit value... */ | 7002 | /* Restore the `magic' bit value... */ |
6998 | /* u32 val = SHMEM_RD(bp, mf_cfg.shared_mf_config.clp_mb); | ||
6999 | SHMEM_WR(bp, mf_cfg.shared_mf_config.clp_mb, | ||
7000 | (val & (~SHARED_MF_CLP_MAGIC)) | magic_val); */ | ||
7001 | u32 val = MF_CFG_RD(bp, shared_mf_config.clp_mb); | 7003 | u32 val = MF_CFG_RD(bp, shared_mf_config.clp_mb); |
7002 | MF_CFG_WR(bp, shared_mf_config.clp_mb, | 7004 | MF_CFG_WR(bp, shared_mf_config.clp_mb, |
7003 | (val & (~SHARED_MF_CLP_MAGIC)) | magic_val); | 7005 | (val & (~SHARED_MF_CLP_MAGIC)) | magic_val); |
7004 | } | 7006 | } |
7005 | 7007 | ||
7006 | /* Prepares for MCP reset: takes care of CLP configurations. | 7008 | /** |
7009 | * Prepares for MCP reset: takes care of CLP configurations. | ||
7007 | * | 7010 | * |
7008 | * @param bp | 7011 | * @param bp |
7009 | * @param magic_val Old value of 'magic' bit. | 7012 | * @param magic_val Old value of 'magic' bit. |
@@ -7532,7 +7535,6 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
7532 | bp->fw_seq = | 7535 | bp->fw_seq = |
7533 | (SHMEM_RD(bp, func_mb[bp->pf_num].drv_mb_header) & | 7536 | (SHMEM_RD(bp, func_mb[bp->pf_num].drv_mb_header) & |
7534 | DRV_MSG_SEQ_NUMBER_MASK); | 7537 | DRV_MSG_SEQ_NUMBER_MASK); |
7535 | |||
7536 | } else | 7538 | } else |
7537 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | 7539 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); |
7538 | } | 7540 | } |
@@ -7651,7 +7653,8 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) | |||
7651 | } | 7653 | } |
7652 | bp->link_params.feature_config_flags |= | 7654 | bp->link_params.feature_config_flags |= |
7653 | (val >= REQ_BC_VER_4_VRFY_FIRST_PHY_OPT_MDL) ? | 7655 | (val >= REQ_BC_VER_4_VRFY_FIRST_PHY_OPT_MDL) ? |
7654 | FEATURE_CONFIG_BC_SUPPORTS_OPT_MDL_VRFY : 0; | 7656 | FEATURE_CONFIG_BC_SUPPORTS_OPT_MDL_VRFY : 0; |
7657 | |||
7655 | bp->link_params.feature_config_flags |= | 7658 | bp->link_params.feature_config_flags |= |
7656 | (val >= REQ_BC_VER_4_VRFY_SPECIFIC_PHY_OPT_MDL) ? | 7659 | (val >= REQ_BC_VER_4_VRFY_SPECIFIC_PHY_OPT_MDL) ? |
7657 | FEATURE_CONFIG_BC_SUPPORTS_DUAL_PHY_OPT_MDL_VRFY : 0; | 7660 | FEATURE_CONFIG_BC_SUPPORTS_DUAL_PHY_OPT_MDL_VRFY : 0; |
@@ -7768,7 +7771,7 @@ static void __devinit bnx2x_link_settings_supported(struct bnx2x *bp, | |||
7768 | SHMEM_RD(bp, | 7771 | SHMEM_RD(bp, |
7769 | dev_info.port_hw_config[port].external_phy_config2)); | 7772 | dev_info.port_hw_config[port].external_phy_config2)); |
7770 | return; | 7773 | return; |
7771 | } | 7774 | } |
7772 | 7775 | ||
7773 | switch (switch_cfg) { | 7776 | switch (switch_cfg) { |
7774 | case SWITCH_CFG_1G: | 7777 | case SWITCH_CFG_1G: |
@@ -7781,7 +7784,6 @@ static void __devinit bnx2x_link_settings_supported(struct bnx2x *bp, | |||
7781 | bp->port.phy_addr = REG_RD(bp, NIG_REG_XGXS0_CTRL_PHY_ADDR + | 7784 | bp->port.phy_addr = REG_RD(bp, NIG_REG_XGXS0_CTRL_PHY_ADDR + |
7782 | port*0x18); | 7785 | port*0x18); |
7783 | BNX2X_DEV_INFO("phy_addr 0x%x\n", bp->port.phy_addr); | 7786 | BNX2X_DEV_INFO("phy_addr 0x%x\n", bp->port.phy_addr); |
7784 | |||
7785 | break; | 7787 | break; |
7786 | 7788 | ||
7787 | default: | 7789 | default: |
@@ -7810,7 +7812,7 @@ static void __devinit bnx2x_link_settings_supported(struct bnx2x *bp, | |||
7810 | if (!(bp->link_params.speed_cap_mask[idx] & | 7812 | if (!(bp->link_params.speed_cap_mask[idx] & |
7811 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) | 7813 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) |
7812 | bp->port.supported[idx] &= ~(SUPPORTED_1000baseT_Half | | 7814 | bp->port.supported[idx] &= ~(SUPPORTED_1000baseT_Half | |
7813 | SUPPORTED_1000baseT_Full); | 7815 | SUPPORTED_1000baseT_Full); |
7814 | 7816 | ||
7815 | if (!(bp->link_params.speed_cap_mask[idx] & | 7817 | if (!(bp->link_params.speed_cap_mask[idx] & |
7816 | PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G)) | 7818 | PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G)) |
@@ -7844,41 +7846,41 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp) | |||
7844 | bp->link_params.req_duplex[idx] = DUPLEX_FULL; | 7846 | bp->link_params.req_duplex[idx] = DUPLEX_FULL; |
7845 | link_config = bp->port.link_config[idx]; | 7847 | link_config = bp->port.link_config[idx]; |
7846 | switch (link_config & PORT_FEATURE_LINK_SPEED_MASK) { | 7848 | switch (link_config & PORT_FEATURE_LINK_SPEED_MASK) { |
7847 | case PORT_FEATURE_LINK_SPEED_AUTO: | 7849 | case PORT_FEATURE_LINK_SPEED_AUTO: |
7848 | if (bp->port.supported[idx] & SUPPORTED_Autoneg) { | 7850 | if (bp->port.supported[idx] & SUPPORTED_Autoneg) { |
7849 | bp->link_params.req_line_speed[idx] = | 7851 | bp->link_params.req_line_speed[idx] = |
7850 | SPEED_AUTO_NEG; | 7852 | SPEED_AUTO_NEG; |
7851 | bp->port.advertising[idx] |= | 7853 | bp->port.advertising[idx] |= |
7852 | bp->port.supported[idx]; | 7854 | bp->port.supported[idx]; |
7853 | } else { | 7855 | } else { |
7854 | /* force 10G, no AN */ | 7856 | /* force 10G, no AN */ |
7855 | bp->link_params.req_line_speed[idx] = | 7857 | bp->link_params.req_line_speed[idx] = |
7856 | SPEED_10000; | 7858 | SPEED_10000; |
7857 | bp->port.advertising[idx] |= | 7859 | bp->port.advertising[idx] |= |
7858 | (ADVERTISED_10000baseT_Full | | 7860 | (ADVERTISED_10000baseT_Full | |
7859 | ADVERTISED_FIBRE); | 7861 | ADVERTISED_FIBRE); |
7860 | continue; | 7862 | continue; |
7861 | } | 7863 | } |
7862 | break; | 7864 | break; |
7863 | 7865 | ||
7864 | case PORT_FEATURE_LINK_SPEED_10M_FULL: | 7866 | case PORT_FEATURE_LINK_SPEED_10M_FULL: |
7865 | if (bp->port.supported[idx] & SUPPORTED_10baseT_Full) { | 7867 | if (bp->port.supported[idx] & SUPPORTED_10baseT_Full) { |
7866 | bp->link_params.req_line_speed[idx] = | 7868 | bp->link_params.req_line_speed[idx] = |
7867 | SPEED_10; | 7869 | SPEED_10; |
7868 | bp->port.advertising[idx] |= | 7870 | bp->port.advertising[idx] |= |
7869 | (ADVERTISED_10baseT_Full | | 7871 | (ADVERTISED_10baseT_Full | |
7870 | ADVERTISED_TP); | 7872 | ADVERTISED_TP); |
7871 | } else { | 7873 | } else { |
7872 | BNX2X_ERROR("NVRAM config error. " | 7874 | BNX2X_ERROR("NVRAM config error. " |
7873 | "Invalid link_config 0x%x" | 7875 | "Invalid link_config 0x%x" |
7874 | " speed_cap_mask 0x%x\n", | 7876 | " speed_cap_mask 0x%x\n", |
7875 | link_config, | 7877 | link_config, |
7876 | bp->link_params.speed_cap_mask[idx]); | 7878 | bp->link_params.speed_cap_mask[idx]); |
7877 | return; | 7879 | return; |
7878 | } | 7880 | } |
7879 | break; | 7881 | break; |
7880 | 7882 | ||
7881 | case PORT_FEATURE_LINK_SPEED_10M_HALF: | 7883 | case PORT_FEATURE_LINK_SPEED_10M_HALF: |
7882 | if (bp->port.supported[idx] & SUPPORTED_10baseT_Half) { | 7884 | if (bp->port.supported[idx] & SUPPORTED_10baseT_Half) { |
7883 | bp->link_params.req_line_speed[idx] = | 7885 | bp->link_params.req_line_speed[idx] = |
7884 | SPEED_10; | 7886 | SPEED_10; |
@@ -7886,70 +7888,74 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp) | |||
7886 | DUPLEX_HALF; | 7888 | DUPLEX_HALF; |
7887 | bp->port.advertising[idx] |= | 7889 | bp->port.advertising[idx] |= |
7888 | (ADVERTISED_10baseT_Half | | 7890 | (ADVERTISED_10baseT_Half | |
7889 | ADVERTISED_TP); | 7891 | ADVERTISED_TP); |
7890 | } else { | 7892 | } else { |
7891 | BNX2X_ERROR("NVRAM config error. " | 7893 | BNX2X_ERROR("NVRAM config error. " |
7892 | "Invalid link_config 0x%x" | 7894 | "Invalid link_config 0x%x" |
7893 | " speed_cap_mask 0x%x\n", | 7895 | " speed_cap_mask 0x%x\n", |
7894 | link_config, | 7896 | link_config, |
7895 | bp->link_params.speed_cap_mask[idx]); | 7897 | bp->link_params.speed_cap_mask[idx]); |
7896 | return; | 7898 | return; |
7897 | } | 7899 | } |
7898 | break; | 7900 | break; |
7899 | 7901 | ||
7900 | case PORT_FEATURE_LINK_SPEED_100M_FULL: | 7902 | case PORT_FEATURE_LINK_SPEED_100M_FULL: |
7901 | if (bp->port.supported[idx] & SUPPORTED_100baseT_Full) { | 7903 | if (bp->port.supported[idx] & |
7904 | SUPPORTED_100baseT_Full) { | ||
7902 | bp->link_params.req_line_speed[idx] = | 7905 | bp->link_params.req_line_speed[idx] = |
7903 | SPEED_100; | 7906 | SPEED_100; |
7904 | bp->port.advertising[idx] |= | 7907 | bp->port.advertising[idx] |= |
7905 | (ADVERTISED_100baseT_Full | | 7908 | (ADVERTISED_100baseT_Full | |
7906 | ADVERTISED_TP); | 7909 | ADVERTISED_TP); |
7907 | } else { | 7910 | } else { |
7908 | BNX2X_ERROR("NVRAM config error. " | 7911 | BNX2X_ERROR("NVRAM config error. " |
7909 | "Invalid link_config 0x%x" | 7912 | "Invalid link_config 0x%x" |
7910 | " speed_cap_mask 0x%x\n", | 7913 | " speed_cap_mask 0x%x\n", |
7911 | link_config, | 7914 | link_config, |
7912 | bp->link_params.speed_cap_mask[idx]); | 7915 | bp->link_params.speed_cap_mask[idx]); |
7913 | return; | 7916 | return; |
7914 | } | 7917 | } |
7915 | break; | 7918 | break; |
7916 | 7919 | ||
7917 | case PORT_FEATURE_LINK_SPEED_100M_HALF: | 7920 | case PORT_FEATURE_LINK_SPEED_100M_HALF: |
7918 | if (bp->port.supported[idx] & SUPPORTED_100baseT_Half) { | 7921 | if (bp->port.supported[idx] & |
7919 | bp->link_params.req_line_speed[idx] = SPEED_100; | 7922 | SUPPORTED_100baseT_Half) { |
7920 | bp->link_params.req_duplex[idx] = DUPLEX_HALF; | 7923 | bp->link_params.req_line_speed[idx] = |
7924 | SPEED_100; | ||
7925 | bp->link_params.req_duplex[idx] = | ||
7926 | DUPLEX_HALF; | ||
7921 | bp->port.advertising[idx] |= | 7927 | bp->port.advertising[idx] |= |
7922 | (ADVERTISED_100baseT_Half | | 7928 | (ADVERTISED_100baseT_Half | |
7923 | ADVERTISED_TP); | 7929 | ADVERTISED_TP); |
7924 | } else { | 7930 | } else { |
7925 | BNX2X_ERROR("NVRAM config error. " | 7931 | BNX2X_ERROR("NVRAM config error. " |
7926 | "Invalid link_config 0x%x" | 7932 | "Invalid link_config 0x%x" |
7927 | " speed_cap_mask 0x%x\n", | 7933 | " speed_cap_mask 0x%x\n", |
7928 | link_config, | 7934 | link_config, |
7929 | bp->link_params.speed_cap_mask[idx]); | 7935 | bp->link_params.speed_cap_mask[idx]); |
7930 | return; | 7936 | return; |
7931 | } | 7937 | } |
7932 | break; | 7938 | break; |
7933 | 7939 | ||
7934 | case PORT_FEATURE_LINK_SPEED_1G: | 7940 | case PORT_FEATURE_LINK_SPEED_1G: |
7935 | if (bp->port.supported[idx] & | 7941 | if (bp->port.supported[idx] & |
7936 | SUPPORTED_1000baseT_Full) { | 7942 | SUPPORTED_1000baseT_Full) { |
7937 | bp->link_params.req_line_speed[idx] = | 7943 | bp->link_params.req_line_speed[idx] = |
7938 | SPEED_1000; | 7944 | SPEED_1000; |
7939 | bp->port.advertising[idx] |= | 7945 | bp->port.advertising[idx] |= |
7940 | (ADVERTISED_1000baseT_Full | | 7946 | (ADVERTISED_1000baseT_Full | |
7941 | ADVERTISED_TP); | 7947 | ADVERTISED_TP); |
7942 | } else { | 7948 | } else { |
7943 | BNX2X_ERROR("NVRAM config error. " | 7949 | BNX2X_ERROR("NVRAM config error. " |
7944 | "Invalid link_config 0x%x" | 7950 | "Invalid link_config 0x%x" |
7945 | " speed_cap_mask 0x%x\n", | 7951 | " speed_cap_mask 0x%x\n", |
7946 | link_config, | 7952 | link_config, |
7947 | bp->link_params.speed_cap_mask[idx]); | 7953 | bp->link_params.speed_cap_mask[idx]); |
7948 | return; | 7954 | return; |
7949 | } | 7955 | } |
7950 | break; | 7956 | break; |
7951 | 7957 | ||
7952 | case PORT_FEATURE_LINK_SPEED_2_5G: | 7958 | case PORT_FEATURE_LINK_SPEED_2_5G: |
7953 | if (bp->port.supported[idx] & | 7959 | if (bp->port.supported[idx] & |
7954 | SUPPORTED_2500baseX_Full) { | 7960 | SUPPORTED_2500baseX_Full) { |
7955 | bp->link_params.req_line_speed[idx] = | 7961 | bp->link_params.req_line_speed[idx] = |
@@ -7957,19 +7963,19 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp) | |||
7957 | bp->port.advertising[idx] |= | 7963 | bp->port.advertising[idx] |= |
7958 | (ADVERTISED_2500baseX_Full | | 7964 | (ADVERTISED_2500baseX_Full | |
7959 | ADVERTISED_TP); | 7965 | ADVERTISED_TP); |
7960 | } else { | 7966 | } else { |
7961 | BNX2X_ERROR("NVRAM config error. " | 7967 | BNX2X_ERROR("NVRAM config error. " |
7962 | "Invalid link_config 0x%x" | 7968 | "Invalid link_config 0x%x" |
7963 | " speed_cap_mask 0x%x\n", | 7969 | " speed_cap_mask 0x%x\n", |
7964 | link_config, | 7970 | link_config, |
7965 | bp->link_params.speed_cap_mask[idx]); | 7971 | bp->link_params.speed_cap_mask[idx]); |
7966 | return; | 7972 | return; |
7967 | } | 7973 | } |
7968 | break; | 7974 | break; |
7969 | 7975 | ||
7970 | case PORT_FEATURE_LINK_SPEED_10G_CX4: | 7976 | case PORT_FEATURE_LINK_SPEED_10G_CX4: |
7971 | case PORT_FEATURE_LINK_SPEED_10G_KX4: | 7977 | case PORT_FEATURE_LINK_SPEED_10G_KX4: |
7972 | case PORT_FEATURE_LINK_SPEED_10G_KR: | 7978 | case PORT_FEATURE_LINK_SPEED_10G_KR: |
7973 | if (bp->port.supported[idx] & | 7979 | if (bp->port.supported[idx] & |
7974 | SUPPORTED_10000baseT_Full) { | 7980 | SUPPORTED_10000baseT_Full) { |
7975 | bp->link_params.req_line_speed[idx] = | 7981 | bp->link_params.req_line_speed[idx] = |
@@ -7977,24 +7983,26 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp) | |||
7977 | bp->port.advertising[idx] |= | 7983 | bp->port.advertising[idx] |= |
7978 | (ADVERTISED_10000baseT_Full | | 7984 | (ADVERTISED_10000baseT_Full | |
7979 | ADVERTISED_FIBRE); | 7985 | ADVERTISED_FIBRE); |
7980 | } else { | 7986 | } else { |
7981 | BNX2X_ERROR("NVRAM config error. " | 7987 | BNX2X_ERROR("NVRAM config error. " |
7982 | "Invalid link_config 0x%x" | 7988 | "Invalid link_config 0x%x" |
7983 | " speed_cap_mask 0x%x\n", | 7989 | " speed_cap_mask 0x%x\n", |
7984 | link_config, | 7990 | link_config, |
7985 | bp->link_params.speed_cap_mask[idx]); | 7991 | bp->link_params.speed_cap_mask[idx]); |
7986 | return; | 7992 | return; |
7987 | } | 7993 | } |
7988 | break; | 7994 | break; |
7989 | 7995 | ||
7990 | default: | 7996 | default: |
7991 | BNX2X_ERROR("NVRAM config error. " | 7997 | BNX2X_ERROR("NVRAM config error. " |
7992 | "BAD link speed link_config 0x%x\n", | 7998 | "BAD link speed link_config 0x%x\n", |
7993 | link_config); | 7999 | link_config); |
7994 | bp->link_params.req_line_speed[idx] = SPEED_AUTO_NEG; | 8000 | bp->link_params.req_line_speed[idx] = |
7995 | bp->port.advertising[idx] = bp->port.supported[idx]; | 8001 | SPEED_AUTO_NEG; |
7996 | break; | 8002 | bp->port.advertising[idx] = |
7997 | } | 8003 | bp->port.supported[idx]; |
8004 | break; | ||
8005 | } | ||
7998 | 8006 | ||
7999 | bp->link_params.req_flow_ctrl[idx] = (link_config & | 8007 | bp->link_params.req_flow_ctrl[idx] = (link_config & |
8000 | PORT_FEATURE_FLOW_CONTROL_MASK); | 8008 | PORT_FEATURE_FLOW_CONTROL_MASK); |
@@ -8056,14 +8064,14 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) | |||
8056 | bp->wol = (!(bp->flags & NO_WOL_FLAG) && | 8064 | bp->wol = (!(bp->flags & NO_WOL_FLAG) && |
8057 | (config & PORT_FEATURE_WOL_ENABLED)); | 8065 | (config & PORT_FEATURE_WOL_ENABLED)); |
8058 | 8066 | ||
8059 | BNX2X_DEV_INFO("lane_config 0x%08x" | 8067 | BNX2X_DEV_INFO("lane_config 0x%08x " |
8060 | "speed_cap_mask0 0x%08x link_config0 0x%08x\n", | 8068 | "speed_cap_mask0 0x%08x link_config0 0x%08x\n", |
8061 | bp->link_params.lane_config, | 8069 | bp->link_params.lane_config, |
8062 | bp->link_params.speed_cap_mask[0], | 8070 | bp->link_params.speed_cap_mask[0], |
8063 | bp->port.link_config[0]); | 8071 | bp->port.link_config[0]); |
8064 | 8072 | ||
8065 | bp->link_params.switch_cfg = (bp->port.link_config[0] & | 8073 | bp->link_params.switch_cfg = (bp->port.link_config[0] & |
8066 | PORT_FEATURE_CONNECTED_SWITCH_MASK); | 8074 | PORT_FEATURE_CONNECTED_SWITCH_MASK); |
8067 | bnx2x_phy_probe(&bp->link_params); | 8075 | bnx2x_phy_probe(&bp->link_params); |
8068 | bnx2x_link_settings_supported(bp, bp->link_params.switch_cfg); | 8076 | bnx2x_link_settings_supported(bp, bp->link_params.switch_cfg); |
8069 | 8077 | ||
@@ -8458,12 +8466,10 @@ void bnx2x_set_rx_mode(struct net_device *dev) | |||
8458 | 8466 | ||
8459 | if (dev->flags & IFF_PROMISC) | 8467 | if (dev->flags & IFF_PROMISC) |
8460 | rx_mode = BNX2X_RX_MODE_PROMISC; | 8468 | rx_mode = BNX2X_RX_MODE_PROMISC; |
8461 | |||
8462 | else if ((dev->flags & IFF_ALLMULTI) || | 8469 | else if ((dev->flags & IFF_ALLMULTI) || |
8463 | ((netdev_mc_count(dev) > BNX2X_MAX_MULTICAST) && | 8470 | ((netdev_mc_count(dev) > BNX2X_MAX_MULTICAST) && |
8464 | CHIP_IS_E1(bp))) | 8471 | CHIP_IS_E1(bp))) |
8465 | rx_mode = BNX2X_RX_MODE_ALLMULTI; | 8472 | rx_mode = BNX2X_RX_MODE_ALLMULTI; |
8466 | |||
8467 | else { /* some multicasts */ | 8473 | else { /* some multicasts */ |
8468 | if (CHIP_IS_E1(bp)) { | 8474 | if (CHIP_IS_E1(bp)) { |
8469 | /* | 8475 | /* |
@@ -8503,12 +8509,10 @@ void bnx2x_set_rx_mode(struct net_device *dev) | |||
8503 | } | 8509 | } |
8504 | } | 8510 | } |
8505 | 8511 | ||
8506 | |||
8507 | bp->rx_mode = rx_mode; | 8512 | bp->rx_mode = rx_mode; |
8508 | bnx2x_set_storm_rx_mode(bp); | 8513 | bnx2x_set_storm_rx_mode(bp); |
8509 | } | 8514 | } |
8510 | 8515 | ||
8511 | |||
8512 | /* called with rtnl_lock */ | 8516 | /* called with rtnl_lock */ |
8513 | static int bnx2x_mdio_read(struct net_device *netdev, int prtad, | 8517 | static int bnx2x_mdio_read(struct net_device *netdev, int prtad, |
8514 | int devad, u16 addr) | 8518 | int devad, u16 addr) |
@@ -8999,6 +9003,7 @@ static inline int bnx2x_set_qm_cid_count(struct bnx2x *bp, int l2_cid_count) | |||
8999 | #endif | 9003 | #endif |
9000 | return roundup(cid_count, QM_CID_ROUND); | 9004 | return roundup(cid_count, QM_CID_ROUND); |
9001 | } | 9005 | } |
9006 | |||
9002 | static int __devinit bnx2x_init_one(struct pci_dev *pdev, | 9007 | static int __devinit bnx2x_init_one(struct pci_dev *pdev, |
9003 | const struct pci_device_id *ent) | 9008 | const struct pci_device_id *ent) |
9004 | { | 9009 | { |
@@ -9026,6 +9031,7 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
9026 | } | 9031 | } |
9027 | 9032 | ||
9028 | cid_count += CNIC_CONTEXT_USE; | 9033 | cid_count += CNIC_CONTEXT_USE; |
9034 | |||
9029 | /* dev zeroed in init_etherdev */ | 9035 | /* dev zeroed in init_etherdev */ |
9030 | dev = alloc_etherdev_mq(sizeof(*bp), cid_count); | 9036 | dev = alloc_etherdev_mq(sizeof(*bp), cid_count); |
9031 | if (!dev) { | 9037 | if (!dev) { |
@@ -9117,6 +9123,7 @@ static void __devexit bnx2x_remove_one(struct pci_dev *pdev) | |||
9117 | 9123 | ||
9118 | /* Disable MSI/MSI-X */ | 9124 | /* Disable MSI/MSI-X */ |
9119 | bnx2x_disable_msi(bp); | 9125 | bnx2x_disable_msi(bp); |
9126 | |||
9120 | /* Make sure RESET task is not scheduled before continuing */ | 9127 | /* Make sure RESET task is not scheduled before continuing */ |
9121 | cancel_delayed_work_sync(&bp->reset_task); | 9128 | cancel_delayed_work_sync(&bp->reset_task); |
9122 | 9129 | ||