aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c12
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c23
2 files changed, 28 insertions, 7 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index ad95324dc042..64392ec410a3 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -942,6 +942,12 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params,
942 const u8 max_num_of_cos = (port) ? DCBX_E3B0_MAX_NUM_COS_PORT1 : 942 const u8 max_num_of_cos = (port) ? DCBX_E3B0_MAX_NUM_COS_PORT1 :
943 DCBX_E3B0_MAX_NUM_COS_PORT0; 943 DCBX_E3B0_MAX_NUM_COS_PORT0;
944 944
945 if (pri >= max_num_of_cos) {
946 DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid "
947 "parameter Illegal strict priority\n");
948 return -EINVAL;
949 }
950
945 if (sp_pri_to_cos[pri] != DCBX_INVALID_COS) { 951 if (sp_pri_to_cos[pri] != DCBX_INVALID_COS) {
946 DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " 952 DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid "
947 "parameter There can't be two COS's with " 953 "parameter There can't be two COS's with "
@@ -949,12 +955,6 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params,
949 return -EINVAL; 955 return -EINVAL;
950 } 956 }
951 957
952 if (pri > max_num_of_cos) {
953 DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid "
954 "parameter Illegal strict priority\n");
955 return -EINVAL;
956 }
957
958 sp_pri_to_cos[pri] = cos_entry; 958 sp_pri_to_cos[pri] = cos_entry;
959 return 0; 959 return 0;
960 960
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index e077d2508727..6af310195bae 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -9122,13 +9122,34 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp)
9122 return bnx2x_prev_mcp_done(bp); 9122 return bnx2x_prev_mcp_done(bp);
9123} 9123}
9124 9124
9125/* previous driver DMAE transaction may have occurred when pre-boot stage ended
9126 * and boot began, or when kdump kernel was loaded. Either case would invalidate
9127 * the addresses of the transaction, resulting in was-error bit set in the pci
9128 * causing all hw-to-host pcie transactions to timeout. If this happened we want
9129 * to clear the interrupt which detected this from the pglueb and the was done
9130 * bit
9131 */
9132static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
9133{
9134 u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);
9135 if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) {
9136 BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing");
9137 REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, 1 << BP_FUNC(bp));
9138 }
9139}
9140
9125static int __devinit bnx2x_prev_unload(struct bnx2x *bp) 9141static int __devinit bnx2x_prev_unload(struct bnx2x *bp)
9126{ 9142{
9127 int time_counter = 10; 9143 int time_counter = 10;
9128 u32 rc, fw, hw_lock_reg, hw_lock_val; 9144 u32 rc, fw, hw_lock_reg, hw_lock_val;
9129 BNX2X_DEV_INFO("Entering Previous Unload Flow\n"); 9145 BNX2X_DEV_INFO("Entering Previous Unload Flow\n");
9130 9146
9131 /* Release previously held locks */ 9147 /* clear hw from errors which may have resulted from an interrupted
9148 * dmae transaction.
9149 */
9150 bnx2x_prev_interrupted_dmae(bp);
9151
9152 /* Release previously held locks */
9132 hw_lock_reg = (BP_FUNC(bp) <= 5) ? 9153 hw_lock_reg = (BP_FUNC(bp) <= 5) ?
9133 (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) : 9154 (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) :
9134 (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8); 9155 (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8);