diff options
author | Yaniv Rosner <yanivr@broadcom.com> | 2012-01-16 21:33:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-17 10:44:43 -0500 |
commit | 127302bb42257eef5d357722d670c4ac53327088 (patch) | |
tree | ec2b1def93a1c204c54e2259e9a28502f9b8b7be /drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |
parent | 11b2ec6b739ee90211dc6f6942e2ba3a141434a8 (diff) |
bnx2x: Fix PFC setting on BCM57840
This patch handles the second port of a path in a 4-port device of
BCM57840.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index 3b184c2a8553..cc806378464d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
@@ -2502,7 +2502,7 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2502 | struct bnx2x_nig_brb_pfc_port_params *nig_params) | 2502 | struct bnx2x_nig_brb_pfc_port_params *nig_params) |
2503 | { | 2503 | { |
2504 | u32 xcm_mask = 0, ppp_enable = 0, pause_enable = 0, llfc_out_en = 0; | 2504 | u32 xcm_mask = 0, ppp_enable = 0, pause_enable = 0, llfc_out_en = 0; |
2505 | u32 llfc_enable = 0, xcm0_out_en = 0, p0_hwpfc_enable = 0; | 2505 | u32 llfc_enable = 0, xcm_out_en = 0, hwpfc_enable = 0; |
2506 | u32 pkt_priority_to_cos = 0; | 2506 | u32 pkt_priority_to_cos = 0; |
2507 | struct bnx2x *bp = params->bp; | 2507 | struct bnx2x *bp = params->bp; |
2508 | u8 port = params->port; | 2508 | u8 port = params->port; |
@@ -2516,9 +2516,8 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2516 | * MAC control frames (that are not pause packets) | 2516 | * MAC control frames (that are not pause packets) |
2517 | * will be forwarded to the XCM. | 2517 | * will be forwarded to the XCM. |
2518 | */ | 2518 | */ |
2519 | xcm_mask = REG_RD(bp, | 2519 | xcm_mask = REG_RD(bp, port ? NIG_REG_LLH1_XCM_MASK : |
2520 | port ? NIG_REG_LLH1_XCM_MASK : | 2520 | NIG_REG_LLH0_XCM_MASK); |
2521 | NIG_REG_LLH0_XCM_MASK); | ||
2522 | /* | 2521 | /* |
2523 | * nig params will override non PFC params, since it's possible to | 2522 | * nig params will override non PFC params, since it's possible to |
2524 | * do transition from PFC to SAFC | 2523 | * do transition from PFC to SAFC |
@@ -2533,8 +2532,8 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2533 | ppp_enable = 1; | 2532 | ppp_enable = 1; |
2534 | xcm_mask &= ~(port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : | 2533 | xcm_mask &= ~(port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : |
2535 | NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); | 2534 | NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); |
2536 | xcm0_out_en = 0; | 2535 | xcm_out_en = 0; |
2537 | p0_hwpfc_enable = 1; | 2536 | hwpfc_enable = 1; |
2538 | } else { | 2537 | } else { |
2539 | if (nig_params) { | 2538 | if (nig_params) { |
2540 | llfc_out_en = nig_params->llfc_out_en; | 2539 | llfc_out_en = nig_params->llfc_out_en; |
@@ -2545,7 +2544,7 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2545 | 2544 | ||
2546 | xcm_mask |= (port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : | 2545 | xcm_mask |= (port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : |
2547 | NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); | 2546 | NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); |
2548 | xcm0_out_en = 1; | 2547 | xcm_out_en = 1; |
2549 | } | 2548 | } |
2550 | 2549 | ||
2551 | if (CHIP_IS_E3(bp)) | 2550 | if (CHIP_IS_E3(bp)) |
@@ -2564,13 +2563,16 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2564 | REG_WR(bp, port ? NIG_REG_LLH1_XCM_MASK : | 2563 | REG_WR(bp, port ? NIG_REG_LLH1_XCM_MASK : |
2565 | NIG_REG_LLH0_XCM_MASK, xcm_mask); | 2564 | NIG_REG_LLH0_XCM_MASK, xcm_mask); |
2566 | 2565 | ||
2567 | REG_WR(bp, NIG_REG_LLFC_EGRESS_SRC_ENABLE_0, 0x7); | 2566 | REG_WR(bp, port ? NIG_REG_LLFC_EGRESS_SRC_ENABLE_1 : |
2567 | NIG_REG_LLFC_EGRESS_SRC_ENABLE_0, 0x7); | ||
2568 | 2568 | ||
2569 | /* output enable for RX_XCM # IF */ | 2569 | /* output enable for RX_XCM # IF */ |
2570 | REG_WR(bp, NIG_REG_XCM0_OUT_EN, xcm0_out_en); | 2570 | REG_WR(bp, port ? NIG_REG_XCM1_OUT_EN : |
2571 | NIG_REG_XCM0_OUT_EN, xcm_out_en); | ||
2571 | 2572 | ||
2572 | /* HW PFC TX enable */ | 2573 | /* HW PFC TX enable */ |
2573 | REG_WR(bp, NIG_REG_P0_HWPFC_ENABLE, p0_hwpfc_enable); | 2574 | REG_WR(bp, port ? NIG_REG_P1_HWPFC_ENABLE : |
2575 | NIG_REG_P0_HWPFC_ENABLE, hwpfc_enable); | ||
2574 | 2576 | ||
2575 | if (nig_params) { | 2577 | if (nig_params) { |
2576 | u8 i = 0; | 2578 | u8 i = 0; |