.. | .. |
---|
837 | 837 | |
---|
838 | 838 | switch (cos_entry) { |
---|
839 | 839 | case 0: |
---|
840 | | - nig_reg_adress_crd_weight = |
---|
841 | | - (port) ? NIG_REG_P1_TX_ARB_CREDIT_WEIGHT_0 : |
---|
842 | | - NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_0; |
---|
843 | | - pbf_reg_adress_crd_weight = (port) ? |
---|
844 | | - PBF_REG_COS0_WEIGHT_P1 : PBF_REG_COS0_WEIGHT_P0; |
---|
845 | | - break; |
---|
| 840 | + nig_reg_adress_crd_weight = |
---|
| 841 | + (port) ? NIG_REG_P1_TX_ARB_CREDIT_WEIGHT_0 : |
---|
| 842 | + NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_0; |
---|
| 843 | + pbf_reg_adress_crd_weight = (port) ? |
---|
| 844 | + PBF_REG_COS0_WEIGHT_P1 : PBF_REG_COS0_WEIGHT_P0; |
---|
| 845 | + break; |
---|
846 | 846 | case 1: |
---|
847 | | - nig_reg_adress_crd_weight = (port) ? |
---|
848 | | - NIG_REG_P1_TX_ARB_CREDIT_WEIGHT_1 : |
---|
849 | | - NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_1; |
---|
850 | | - pbf_reg_adress_crd_weight = (port) ? |
---|
851 | | - PBF_REG_COS1_WEIGHT_P1 : PBF_REG_COS1_WEIGHT_P0; |
---|
852 | | - break; |
---|
| 847 | + nig_reg_adress_crd_weight = (port) ? |
---|
| 848 | + NIG_REG_P1_TX_ARB_CREDIT_WEIGHT_1 : |
---|
| 849 | + NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_1; |
---|
| 850 | + pbf_reg_adress_crd_weight = (port) ? |
---|
| 851 | + PBF_REG_COS1_WEIGHT_P1 : PBF_REG_COS1_WEIGHT_P0; |
---|
| 852 | + break; |
---|
853 | 853 | case 2: |
---|
854 | | - nig_reg_adress_crd_weight = (port) ? |
---|
855 | | - NIG_REG_P1_TX_ARB_CREDIT_WEIGHT_2 : |
---|
856 | | - NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_2; |
---|
| 854 | + nig_reg_adress_crd_weight = (port) ? |
---|
| 855 | + NIG_REG_P1_TX_ARB_CREDIT_WEIGHT_2 : |
---|
| 856 | + NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_2; |
---|
857 | 857 | |
---|
858 | | - pbf_reg_adress_crd_weight = (port) ? |
---|
859 | | - PBF_REG_COS2_WEIGHT_P1 : PBF_REG_COS2_WEIGHT_P0; |
---|
860 | | - break; |
---|
| 858 | + pbf_reg_adress_crd_weight = (port) ? |
---|
| 859 | + PBF_REG_COS2_WEIGHT_P1 : PBF_REG_COS2_WEIGHT_P0; |
---|
| 860 | + break; |
---|
861 | 861 | case 3: |
---|
862 | | - if (port) |
---|
| 862 | + if (port) |
---|
863 | 863 | return -EINVAL; |
---|
864 | | - nig_reg_adress_crd_weight = |
---|
865 | | - NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_3; |
---|
866 | | - pbf_reg_adress_crd_weight = |
---|
867 | | - PBF_REG_COS3_WEIGHT_P0; |
---|
868 | | - break; |
---|
| 864 | + nig_reg_adress_crd_weight = NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_3; |
---|
| 865 | + pbf_reg_adress_crd_weight = PBF_REG_COS3_WEIGHT_P0; |
---|
| 866 | + break; |
---|
869 | 867 | case 4: |
---|
870 | | - if (port) |
---|
871 | | - return -EINVAL; |
---|
872 | | - nig_reg_adress_crd_weight = |
---|
873 | | - NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_4; |
---|
874 | | - pbf_reg_adress_crd_weight = PBF_REG_COS4_WEIGHT_P0; |
---|
875 | | - break; |
---|
| 868 | + if (port) |
---|
| 869 | + return -EINVAL; |
---|
| 870 | + nig_reg_adress_crd_weight = NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_4; |
---|
| 871 | + pbf_reg_adress_crd_weight = PBF_REG_COS4_WEIGHT_P0; |
---|
| 872 | + break; |
---|
876 | 873 | case 5: |
---|
877 | | - if (port) |
---|
878 | | - return -EINVAL; |
---|
879 | | - nig_reg_adress_crd_weight = |
---|
880 | | - NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_5; |
---|
881 | | - pbf_reg_adress_crd_weight = PBF_REG_COS5_WEIGHT_P0; |
---|
882 | | - break; |
---|
| 874 | + if (port) |
---|
| 875 | + return -EINVAL; |
---|
| 876 | + nig_reg_adress_crd_weight = NIG_REG_P0_TX_ARB_CREDIT_WEIGHT_5; |
---|
| 877 | + pbf_reg_adress_crd_weight = PBF_REG_COS5_WEIGHT_P0; |
---|
| 878 | + break; |
---|
883 | 879 | } |
---|
884 | 880 | |
---|
885 | 881 | REG_WR(bp, nig_reg_adress_crd_weight, cos_bw_nig); |
---|
.. | .. |
---|
966 | 962 | if (pri >= max_num_of_cos) { |
---|
967 | 963 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " |
---|
968 | 964 | "parameter Illegal strict priority\n"); |
---|
969 | | - return -EINVAL; |
---|
| 965 | + return -EINVAL; |
---|
970 | 966 | } |
---|
971 | 967 | |
---|
972 | 968 | if (sp_pri_to_cos[pri] != DCBX_INVALID_COS) { |
---|
.. | .. |
---|
1845 | 1841 | bnx2x_bits_en(bp, emac_base + EMAC_REG_EMAC_TX_MODE, |
---|
1846 | 1842 | EMAC_TX_MODE_RESET); |
---|
1847 | 1843 | |
---|
1848 | | - /* pause enable/disable */ |
---|
1849 | | - bnx2x_bits_dis(bp, emac_base + EMAC_REG_EMAC_RX_MODE, |
---|
1850 | | - EMAC_RX_MODE_FLOW_EN); |
---|
| 1844 | + /* pause enable/disable */ |
---|
| 1845 | + bnx2x_bits_dis(bp, emac_base + EMAC_REG_EMAC_RX_MODE, |
---|
| 1846 | + EMAC_RX_MODE_FLOW_EN); |
---|
1851 | 1847 | |
---|
1852 | | - bnx2x_bits_dis(bp, emac_base + EMAC_REG_EMAC_TX_MODE, |
---|
1853 | | - (EMAC_TX_MODE_EXT_PAUSE_EN | |
---|
1854 | | - EMAC_TX_MODE_FLOW_EN)); |
---|
1855 | | - if (!(params->feature_config_flags & |
---|
1856 | | - FEATURE_CONFIG_PFC_ENABLED)) { |
---|
1857 | | - if (vars->flow_ctrl & BNX2X_FLOW_CTRL_RX) |
---|
1858 | | - bnx2x_bits_en(bp, emac_base + |
---|
1859 | | - EMAC_REG_EMAC_RX_MODE, |
---|
1860 | | - EMAC_RX_MODE_FLOW_EN); |
---|
| 1848 | + bnx2x_bits_dis(bp, emac_base + EMAC_REG_EMAC_TX_MODE, |
---|
| 1849 | + (EMAC_TX_MODE_EXT_PAUSE_EN | |
---|
| 1850 | + EMAC_TX_MODE_FLOW_EN)); |
---|
| 1851 | + if (!(params->feature_config_flags & |
---|
| 1852 | + FEATURE_CONFIG_PFC_ENABLED)) { |
---|
| 1853 | + if (vars->flow_ctrl & BNX2X_FLOW_CTRL_RX) |
---|
| 1854 | + bnx2x_bits_en(bp, emac_base + |
---|
| 1855 | + EMAC_REG_EMAC_RX_MODE, |
---|
| 1856 | + EMAC_RX_MODE_FLOW_EN); |
---|
1861 | 1857 | |
---|
1862 | | - if (vars->flow_ctrl & BNX2X_FLOW_CTRL_TX) |
---|
1863 | | - bnx2x_bits_en(bp, emac_base + |
---|
1864 | | - EMAC_REG_EMAC_TX_MODE, |
---|
1865 | | - (EMAC_TX_MODE_EXT_PAUSE_EN | |
---|
1866 | | - EMAC_TX_MODE_FLOW_EN)); |
---|
1867 | | - } else |
---|
1868 | | - bnx2x_bits_en(bp, emac_base + EMAC_REG_EMAC_TX_MODE, |
---|
1869 | | - EMAC_TX_MODE_FLOW_EN); |
---|
| 1858 | + if (vars->flow_ctrl & BNX2X_FLOW_CTRL_TX) |
---|
| 1859 | + bnx2x_bits_en(bp, emac_base + |
---|
| 1860 | + EMAC_REG_EMAC_TX_MODE, |
---|
| 1861 | + (EMAC_TX_MODE_EXT_PAUSE_EN | |
---|
| 1862 | + EMAC_TX_MODE_FLOW_EN)); |
---|
| 1863 | + } else |
---|
| 1864 | + bnx2x_bits_en(bp, emac_base + EMAC_REG_EMAC_TX_MODE, |
---|
| 1865 | + EMAC_TX_MODE_FLOW_EN); |
---|
1870 | 1866 | |
---|
1871 | 1867 | /* KEEP_VLAN_TAG, promiscuous */ |
---|
1872 | 1868 | val = REG_RD(bp, emac_base + EMAC_REG_EMAC_RX_MODE); |
---|
.. | .. |
---|
3089 | 3085 | u8 xfer_cnt, |
---|
3090 | 3086 | u32 *data_array) |
---|
3091 | 3087 | { |
---|
| 3088 | + u64 t0, delta; |
---|
3092 | 3089 | u32 val, i; |
---|
3093 | 3090 | int rc = 0; |
---|
3094 | 3091 | |
---|
.. | .. |
---|
3118 | 3115 | REG_WR(bp, MCP_REG_MCPR_IMC_COMMAND, val); |
---|
3119 | 3116 | |
---|
3120 | 3117 | /* Poll for completion */ |
---|
3121 | | - i = 0; |
---|
| 3118 | + t0 = ktime_get_ns(); |
---|
3122 | 3119 | val = REG_RD(bp, MCP_REG_MCPR_IMC_COMMAND); |
---|
3123 | 3120 | while (((val >> MCPR_IMC_COMMAND_IMC_STATUS_BITSHIFT) & 0x3) != 1) { |
---|
3124 | | - udelay(10); |
---|
3125 | | - val = REG_RD(bp, MCP_REG_MCPR_IMC_COMMAND); |
---|
3126 | | - if (i++ > 1000) { |
---|
3127 | | - DP(NETIF_MSG_LINK, "wr 0 byte timed out after %d try\n", |
---|
3128 | | - i); |
---|
| 3121 | + delta = ktime_get_ns() - t0; |
---|
| 3122 | + if (delta > 10 * NSEC_PER_MSEC) { |
---|
| 3123 | + DP(NETIF_MSG_LINK, "wr 0 byte timed out after %Lu ns\n", |
---|
| 3124 | + delta); |
---|
3129 | 3125 | rc = -EFAULT; |
---|
3130 | 3126 | break; |
---|
3131 | 3127 | } |
---|
| 3128 | + usleep_range(10, 20); |
---|
| 3129 | + val = REG_RD(bp, MCP_REG_MCPR_IMC_COMMAND); |
---|
3132 | 3130 | } |
---|
3133 | 3131 | if (rc == -EFAULT) |
---|
3134 | 3132 | return rc; |
---|
.. | .. |
---|
3142 | 3140 | REG_WR(bp, MCP_REG_MCPR_IMC_COMMAND, val); |
---|
3143 | 3141 | |
---|
3144 | 3142 | /* Poll for completion */ |
---|
3145 | | - i = 0; |
---|
| 3143 | + t0 = ktime_get_ns(); |
---|
3146 | 3144 | val = REG_RD(bp, MCP_REG_MCPR_IMC_COMMAND); |
---|
3147 | 3145 | while (((val >> MCPR_IMC_COMMAND_IMC_STATUS_BITSHIFT) & 0x3) != 1) { |
---|
3148 | | - udelay(10); |
---|
3149 | | - val = REG_RD(bp, MCP_REG_MCPR_IMC_COMMAND); |
---|
3150 | | - if (i++ > 1000) { |
---|
3151 | | - DP(NETIF_MSG_LINK, "rd op timed out after %d try\n", i); |
---|
| 3146 | + delta = ktime_get_ns() - t0; |
---|
| 3147 | + if (delta > 10 * NSEC_PER_MSEC) { |
---|
| 3148 | + DP(NETIF_MSG_LINK, "rd op timed out after %Lu ns\n", |
---|
| 3149 | + delta); |
---|
3152 | 3150 | rc = -EFAULT; |
---|
3153 | 3151 | break; |
---|
3154 | 3152 | } |
---|
| 3153 | + usleep_range(10, 20); |
---|
| 3154 | + val = REG_RD(bp, MCP_REG_MCPR_IMC_COMMAND); |
---|
3155 | 3155 | } |
---|
3156 | 3156 | if (rc == -EFAULT) |
---|
3157 | 3157 | return rc; |
---|
.. | .. |
---|
4712 | 4712 | LINK_STATUS_SPEED_AND_DUPLEX_MASK) { |
---|
4713 | 4713 | case LINK_10THD: |
---|
4714 | 4714 | vars->duplex = DUPLEX_HALF; |
---|
4715 | | - /* Fall thru */ |
---|
| 4715 | + fallthrough; |
---|
4716 | 4716 | case LINK_10TFD: |
---|
4717 | 4717 | vars->line_speed = SPEED_10; |
---|
4718 | 4718 | break; |
---|
4719 | 4719 | |
---|
4720 | 4720 | case LINK_100TXHD: |
---|
4721 | 4721 | vars->duplex = DUPLEX_HALF; |
---|
4722 | | - /* Fall thru */ |
---|
| 4722 | + fallthrough; |
---|
4723 | 4723 | case LINK_100T4: |
---|
4724 | 4724 | case LINK_100TXFD: |
---|
4725 | 4725 | vars->line_speed = SPEED_100; |
---|
.. | .. |
---|
4727 | 4727 | |
---|
4728 | 4728 | case LINK_1000THD: |
---|
4729 | 4729 | vars->duplex = DUPLEX_HALF; |
---|
4730 | | - /* Fall thru */ |
---|
| 4730 | + fallthrough; |
---|
4731 | 4731 | case LINK_1000TFD: |
---|
4732 | 4732 | vars->line_speed = SPEED_1000; |
---|
4733 | 4733 | break; |
---|
4734 | 4734 | |
---|
4735 | 4735 | case LINK_2500THD: |
---|
4736 | 4736 | vars->duplex = DUPLEX_HALF; |
---|
4737 | | - /* Fall thru */ |
---|
| 4737 | + fallthrough; |
---|
4738 | 4738 | case LINK_2500TFD: |
---|
4739 | 4739 | vars->line_speed = SPEED_2500; |
---|
4740 | 4740 | break; |
---|
.. | .. |
---|
5615 | 5615 | return 0; |
---|
5616 | 5616 | } |
---|
5617 | 5617 | |
---|
5618 | | -static int bnx2x_link_settings_status(struct bnx2x_phy *phy, |
---|
5619 | | - struct link_params *params, |
---|
5620 | | - struct link_vars *vars) |
---|
| 5618 | +static u8 bnx2x_link_settings_status(struct bnx2x_phy *phy, |
---|
| 5619 | + struct link_params *params, |
---|
| 5620 | + struct link_vars *vars) |
---|
5621 | 5621 | { |
---|
5622 | 5622 | struct bnx2x *bp = params->bp; |
---|
5623 | 5623 | |
---|
.. | .. |
---|
5689 | 5689 | return rc; |
---|
5690 | 5690 | } |
---|
5691 | 5691 | |
---|
5692 | | -static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, |
---|
| 5692 | +static u8 bnx2x_warpcore_read_status(struct bnx2x_phy *phy, |
---|
5693 | 5693 | struct link_params *params, |
---|
5694 | 5694 | struct link_vars *vars) |
---|
5695 | 5695 | { |
---|
.. | .. |
---|
6339 | 6339 | */ |
---|
6340 | 6340 | if (!vars->link_up) |
---|
6341 | 6341 | break; |
---|
6342 | | - /* else: fall through */ |
---|
| 6342 | + fallthrough; |
---|
6343 | 6343 | case LED_MODE_ON: |
---|
6344 | 6344 | if (((params->phy[EXT_PHY1].type == |
---|
6345 | 6345 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727) || |
---|
.. | .. |
---|
6478 | 6478 | MDIO_REG_BANK_GP_STATUS, |
---|
6479 | 6479 | MDIO_GP_STATUS_TOP_AN_STATUS1, |
---|
6480 | 6480 | &gp_status); |
---|
6481 | | - /* Link is up only if both local phy and external phy are up */ |
---|
6482 | | - if (!(gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS)) |
---|
6483 | | - return -ESRCH; |
---|
| 6481 | + /* Link is up only if both local phy and external phy are up */ |
---|
| 6482 | + if (!(gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS)) |
---|
| 6483 | + return -ESRCH; |
---|
6484 | 6484 | } |
---|
6485 | 6485 | /* In XGXS loopback mode, do not check external PHY */ |
---|
6486 | 6486 | if (params->loopback_mode == LOOPBACK_XGXS) |
---|
.. | .. |
---|
6878 | 6878 | case PORT_HW_CFG_PHY_SELECTION_FIRST_PHY_PRIORITY: |
---|
6879 | 6879 | /* In this option, the first PHY makes sure to pass the |
---|
6880 | 6880 | * traffic through itself only. |
---|
6881 | | - * Its not clear how to reset the link on the second phy |
---|
| 6881 | + * It's not clear how to reset the link on the second |
---|
| 6882 | + * phy. |
---|
6882 | 6883 | */ |
---|
6883 | 6884 | active_external_phy = EXT_PHY1; |
---|
6884 | 6885 | break; |
---|
.. | .. |
---|
7293 | 7294 | DP(NETIF_MSG_LINK, |
---|
7294 | 7295 | "XAUI workaround has completed\n"); |
---|
7295 | 7296 | return 0; |
---|
7296 | | - } |
---|
7297 | | - usleep_range(3000, 6000); |
---|
| 7297 | + } |
---|
| 7298 | + usleep_range(3000, 6000); |
---|
7298 | 7299 | } |
---|
7299 | 7300 | break; |
---|
7300 | 7301 | } |
---|
.. | .. |
---|
7368 | 7369 | } |
---|
7369 | 7370 | } |
---|
7370 | 7371 | |
---|
7371 | | -static int bnx2x_8073_config_init(struct bnx2x_phy *phy, |
---|
7372 | | - struct link_params *params, |
---|
7373 | | - struct link_vars *vars) |
---|
| 7372 | +static void bnx2x_8073_config_init(struct bnx2x_phy *phy, |
---|
| 7373 | + struct link_params *params, |
---|
| 7374 | + struct link_vars *vars) |
---|
7374 | 7375 | { |
---|
7375 | 7376 | struct bnx2x *bp = params->bp; |
---|
7376 | 7377 | u16 val = 0, tmp1; |
---|
.. | .. |
---|
7431 | 7432 | if (params->loopback_mode == LOOPBACK_EXT) { |
---|
7432 | 7433 | bnx2x_807x_force_10G(bp, phy); |
---|
7433 | 7434 | DP(NETIF_MSG_LINK, "Forced speed 10G on 807X\n"); |
---|
7434 | | - return 0; |
---|
| 7435 | + return; |
---|
7435 | 7436 | } else { |
---|
7436 | 7437 | bnx2x_cl45_write(bp, phy, |
---|
7437 | 7438 | MDIO_PMA_DEVAD, MDIO_PMA_REG_BCM_CTRL, 0x0002); |
---|
.. | .. |
---|
7513 | 7514 | bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_CTRL, 0x1200); |
---|
7514 | 7515 | DP(NETIF_MSG_LINK, "807x Autoneg Restart: Advertise 1G=%x, 10G=%x\n", |
---|
7515 | 7516 | ((val & (1<<5)) > 0), ((val & (1<<7)) > 0)); |
---|
7516 | | - return 0; |
---|
7517 | 7517 | } |
---|
7518 | 7518 | |
---|
7519 | 7519 | static u8 bnx2x_8073_read_status(struct bnx2x_phy *phy, |
---|
.. | .. |
---|
7680 | 7680 | /******************************************************************/ |
---|
7681 | 7681 | /* BCM8705 PHY SECTION */ |
---|
7682 | 7682 | /******************************************************************/ |
---|
7683 | | -static int bnx2x_8705_config_init(struct bnx2x_phy *phy, |
---|
7684 | | - struct link_params *params, |
---|
7685 | | - struct link_vars *vars) |
---|
| 7683 | +static void bnx2x_8705_config_init(struct bnx2x_phy *phy, |
---|
| 7684 | + struct link_params *params, |
---|
| 7685 | + struct link_vars *vars) |
---|
7686 | 7686 | { |
---|
7687 | 7687 | struct bnx2x *bp = params->bp; |
---|
7688 | 7688 | DP(NETIF_MSG_LINK, "init 8705\n"); |
---|
.. | .. |
---|
7704 | 7704 | MDIO_WIS_DEVAD, MDIO_WIS_REG_LASI_CNTL, 0x1); |
---|
7705 | 7705 | /* BCM8705 doesn't have microcode, hence the 0 */ |
---|
7706 | 7706 | bnx2x_save_spirom_version(bp, params->port, params->shmem_base, 0); |
---|
7707 | | - return 0; |
---|
7708 | 7707 | } |
---|
7709 | 7708 | |
---|
7710 | 7709 | static u8 bnx2x_8705_read_status(struct bnx2x_phy *phy, |
---|
.. | .. |
---|
8891 | 8890 | /******************************************************************/ |
---|
8892 | 8891 | /* BCM8706 PHY SECTION */ |
---|
8893 | 8892 | /******************************************************************/ |
---|
8894 | | -static u8 bnx2x_8706_config_init(struct bnx2x_phy *phy, |
---|
8895 | | - struct link_params *params, |
---|
8896 | | - struct link_vars *vars) |
---|
| 8893 | +static void bnx2x_8706_config_init(struct bnx2x_phy *phy, |
---|
| 8894 | + struct link_params *params, |
---|
| 8895 | + struct link_vars *vars) |
---|
8897 | 8896 | { |
---|
8898 | 8897 | u32 tx_en_mode; |
---|
8899 | 8898 | u16 cnt, val, tmp1; |
---|
.. | .. |
---|
8993 | 8992 | bnx2x_cl45_write(bp, phy, |
---|
8994 | 8993 | MDIO_PMA_DEVAD, MDIO_PMA_REG_DIGITAL_CTRL, tmp1); |
---|
8995 | 8994 | } |
---|
8996 | | - |
---|
8997 | | - return 0; |
---|
8998 | 8995 | } |
---|
8999 | 8996 | |
---|
9000 | | -static int bnx2x_8706_read_status(struct bnx2x_phy *phy, |
---|
9001 | | - struct link_params *params, |
---|
9002 | | - struct link_vars *vars) |
---|
| 8997 | +static u8 bnx2x_8706_read_status(struct bnx2x_phy *phy, |
---|
| 8998 | + struct link_params *params, |
---|
| 8999 | + struct link_vars *vars) |
---|
9003 | 9000 | { |
---|
9004 | 9001 | return bnx2x_8706_8726_read_status(phy, params, vars); |
---|
9005 | 9002 | } |
---|
.. | .. |
---|
9074 | 9071 | } |
---|
9075 | 9072 | |
---|
9076 | 9073 | |
---|
9077 | | -static int bnx2x_8726_config_init(struct bnx2x_phy *phy, |
---|
9078 | | - struct link_params *params, |
---|
9079 | | - struct link_vars *vars) |
---|
| 9074 | +static void bnx2x_8726_config_init(struct bnx2x_phy *phy, |
---|
| 9075 | + struct link_params *params, |
---|
| 9076 | + struct link_vars *vars) |
---|
9080 | 9077 | { |
---|
9081 | 9078 | struct bnx2x *bp = params->bp; |
---|
9082 | 9079 | DP(NETIF_MSG_LINK, "Initializing BCM8726\n"); |
---|
.. | .. |
---|
9154 | 9151 | MDIO_PMA_REG_8726_TX_CTRL2, |
---|
9155 | 9152 | phy->tx_preemphasis[1]); |
---|
9156 | 9153 | } |
---|
9157 | | - |
---|
9158 | | - return 0; |
---|
9159 | | - |
---|
9160 | 9154 | } |
---|
9161 | 9155 | |
---|
9162 | 9156 | static void bnx2x_8726_link_reset(struct bnx2x_phy *phy, |
---|
.. | .. |
---|
9292 | 9286 | } |
---|
9293 | 9287 | } |
---|
9294 | 9288 | |
---|
9295 | | -static int bnx2x_8727_config_init(struct bnx2x_phy *phy, |
---|
9296 | | - struct link_params *params, |
---|
9297 | | - struct link_vars *vars) |
---|
| 9289 | +static void bnx2x_8727_config_init(struct bnx2x_phy *phy, |
---|
| 9290 | + struct link_params *params, |
---|
| 9291 | + struct link_vars *vars) |
---|
9298 | 9292 | { |
---|
9299 | 9293 | u32 tx_en_mode; |
---|
9300 | 9294 | u16 tmp1, mod_abs, tmp2; |
---|
.. | .. |
---|
9374 | 9368 | MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER, |
---|
9375 | 9369 | (tmp2 & 0x7fff)); |
---|
9376 | 9370 | } |
---|
9377 | | - |
---|
9378 | | - return 0; |
---|
9379 | 9371 | } |
---|
9380 | 9372 | |
---|
9381 | 9373 | static void bnx2x_8727_handle_mod_abs(struct bnx2x_phy *phy, |
---|
.. | .. |
---|
9950 | 9942 | return 0; |
---|
9951 | 9943 | } |
---|
9952 | 9944 | |
---|
9953 | | -static int bnx2x_8481_config_init(struct bnx2x_phy *phy, |
---|
9954 | | - struct link_params *params, |
---|
9955 | | - struct link_vars *vars) |
---|
| 9945 | +static void bnx2x_8481_config_init(struct bnx2x_phy *phy, |
---|
| 9946 | + struct link_params *params, |
---|
| 9947 | + struct link_vars *vars) |
---|
9956 | 9948 | { |
---|
9957 | 9949 | struct bnx2x *bp = params->bp; |
---|
9958 | 9950 | /* Restore normal power mode*/ |
---|
.. | .. |
---|
9964 | 9956 | bnx2x_wait_reset_complete(bp, phy, params); |
---|
9965 | 9957 | |
---|
9966 | 9958 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 1<<15); |
---|
9967 | | - return bnx2x_848xx_cmn_config_init(phy, params, vars); |
---|
| 9959 | + bnx2x_848xx_cmn_config_init(phy, params, vars); |
---|
9968 | 9960 | } |
---|
9969 | 9961 | |
---|
9970 | 9962 | #define PHY848xx_CMDHDLR_WAIT 300 |
---|
.. | .. |
---|
10214 | 10206 | return reset_gpios; |
---|
10215 | 10207 | } |
---|
10216 | 10208 | |
---|
10217 | | -static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy, |
---|
10218 | | - struct link_params *params) |
---|
| 10209 | +static void bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy, |
---|
| 10210 | + struct link_params *params) |
---|
10219 | 10211 | { |
---|
10220 | 10212 | struct bnx2x *bp = params->bp; |
---|
10221 | 10213 | u8 reset_gpios; |
---|
.. | .. |
---|
10243 | 10235 | udelay(10); |
---|
10244 | 10236 | DP(NETIF_MSG_LINK, "84833 hw reset on pin values 0x%x\n", |
---|
10245 | 10237 | reset_gpios); |
---|
10246 | | - |
---|
10247 | | - return 0; |
---|
10248 | 10238 | } |
---|
10249 | 10239 | |
---|
10250 | 10240 | static int bnx2x_8483x_disable_eee(struct bnx2x_phy *phy, |
---|
.. | .. |
---|
10287 | 10277 | } |
---|
10288 | 10278 | |
---|
10289 | 10279 | #define PHY84833_CONSTANT_LATENCY 1193 |
---|
10290 | | -static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, |
---|
10291 | | - struct link_params *params, |
---|
10292 | | - struct link_vars *vars) |
---|
| 10280 | +static void bnx2x_848x3_config_init(struct bnx2x_phy *phy, |
---|
| 10281 | + struct link_params *params, |
---|
| 10282 | + struct link_vars *vars) |
---|
10293 | 10283 | { |
---|
10294 | 10284 | struct bnx2x *bp = params->bp; |
---|
10295 | 10285 | u8 port, initialize = 1; |
---|
.. | .. |
---|
10434 | 10424 | if (rc) { |
---|
10435 | 10425 | DP(NETIF_MSG_LINK, "Failed to configure EEE timers\n"); |
---|
10436 | 10426 | bnx2x_8483x_disable_eee(phy, params, vars); |
---|
10437 | | - return rc; |
---|
| 10427 | + return; |
---|
10438 | 10428 | } |
---|
10439 | 10429 | |
---|
10440 | 10430 | if ((phy->req_duplex == DUPLEX_FULL) && |
---|
.. | .. |
---|
10446 | 10436 | rc = bnx2x_8483x_disable_eee(phy, params, vars); |
---|
10447 | 10437 | if (rc) { |
---|
10448 | 10438 | DP(NETIF_MSG_LINK, "Failed to set EEE advertisement\n"); |
---|
10449 | | - return rc; |
---|
| 10439 | + return; |
---|
10450 | 10440 | } |
---|
10451 | 10441 | } else { |
---|
10452 | 10442 | vars->eee_status &= ~SHMEM_EEE_SUPPORTED_MASK; |
---|
.. | .. |
---|
10485 | 10475 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, |
---|
10486 | 10476 | (u16)~MDIO_84833_SUPER_ISOLATE); |
---|
10487 | 10477 | } |
---|
10488 | | - return rc; |
---|
10489 | 10478 | } |
---|
10490 | 10479 | |
---|
10491 | 10480 | static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy, |
---|
.. | .. |
---|
11042 | 11031 | } |
---|
11043 | 11032 | } |
---|
11044 | 11033 | |
---|
11045 | | -static int bnx2x_54618se_config_init(struct bnx2x_phy *phy, |
---|
11046 | | - struct link_params *params, |
---|
11047 | | - struct link_vars *vars) |
---|
| 11034 | +static void bnx2x_54618se_config_init(struct bnx2x_phy *phy, |
---|
| 11035 | + struct link_params *params, |
---|
| 11036 | + struct link_vars *vars) |
---|
11048 | 11037 | { |
---|
11049 | 11038 | struct bnx2x *bp = params->bp; |
---|
11050 | 11039 | u8 port; |
---|
.. | .. |
---|
11244 | 11233 | |
---|
11245 | 11234 | bnx2x_cl22_write(bp, phy, |
---|
11246 | 11235 | MDIO_PMA_REG_CTRL, autoneg_val); |
---|
11247 | | - |
---|
11248 | | - return 0; |
---|
11249 | 11236 | } |
---|
11250 | 11237 | |
---|
11251 | 11238 | |
---|
.. | .. |
---|
11469 | 11456 | MDIO_XS_DEVAD, MDIO_XS_SFX7101_XGXS_TEST1, 0x100); |
---|
11470 | 11457 | } |
---|
11471 | 11458 | |
---|
11472 | | -static int bnx2x_7101_config_init(struct bnx2x_phy *phy, |
---|
11473 | | - struct link_params *params, |
---|
11474 | | - struct link_vars *vars) |
---|
| 11459 | +static void bnx2x_7101_config_init(struct bnx2x_phy *phy, |
---|
| 11460 | + struct link_params *params, |
---|
| 11461 | + struct link_vars *vars) |
---|
11475 | 11462 | { |
---|
11476 | 11463 | u16 fw_ver1, fw_ver2, val; |
---|
11477 | 11464 | struct bnx2x *bp = params->bp; |
---|
.. | .. |
---|
11506 | 11493 | MDIO_PMA_DEVAD, MDIO_PMA_REG_7101_VER2, &fw_ver2); |
---|
11507 | 11494 | bnx2x_save_spirom_version(bp, params->port, |
---|
11508 | 11495 | (u32)(fw_ver1<<16 | fw_ver2), phy->ver_addr); |
---|
11509 | | - return 0; |
---|
11510 | 11496 | } |
---|
11511 | 11497 | |
---|
11512 | 11498 | static u8 bnx2x_7101_read_status(struct bnx2x_phy *phy, |
---|
.. | .. |
---|
11640 | 11626 | .speed_cap_mask = 0, |
---|
11641 | 11627 | .req_duplex = 0, |
---|
11642 | 11628 | .rsrv = 0, |
---|
11643 | | - .config_init = (config_init_t)NULL, |
---|
11644 | | - .read_status = (read_status_t)NULL, |
---|
11645 | | - .link_reset = (link_reset_t)NULL, |
---|
11646 | | - .config_loopback = (config_loopback_t)NULL, |
---|
11647 | | - .format_fw_ver = (format_fw_ver_t)NULL, |
---|
11648 | | - .hw_reset = (hw_reset_t)NULL, |
---|
11649 | | - .set_link_led = (set_link_led_t)NULL, |
---|
11650 | | - .phy_specific_func = (phy_specific_func_t)NULL |
---|
| 11629 | + .config_init = NULL, |
---|
| 11630 | + .read_status = NULL, |
---|
| 11631 | + .link_reset = NULL, |
---|
| 11632 | + .config_loopback = NULL, |
---|
| 11633 | + .format_fw_ver = NULL, |
---|
| 11634 | + .hw_reset = NULL, |
---|
| 11635 | + .set_link_led = NULL, |
---|
| 11636 | + .phy_specific_func = NULL |
---|
11651 | 11637 | }; |
---|
11652 | 11638 | |
---|
11653 | 11639 | static const struct bnx2x_phy phy_serdes = { |
---|
.. | .. |
---|
11675 | 11661 | .speed_cap_mask = 0, |
---|
11676 | 11662 | .req_duplex = 0, |
---|
11677 | 11663 | .rsrv = 0, |
---|
11678 | | - .config_init = (config_init_t)bnx2x_xgxs_config_init, |
---|
11679 | | - .read_status = (read_status_t)bnx2x_link_settings_status, |
---|
11680 | | - .link_reset = (link_reset_t)bnx2x_int_link_reset, |
---|
11681 | | - .config_loopback = (config_loopback_t)NULL, |
---|
11682 | | - .format_fw_ver = (format_fw_ver_t)NULL, |
---|
11683 | | - .hw_reset = (hw_reset_t)NULL, |
---|
11684 | | - .set_link_led = (set_link_led_t)NULL, |
---|
11685 | | - .phy_specific_func = (phy_specific_func_t)NULL |
---|
| 11664 | + .config_init = bnx2x_xgxs_config_init, |
---|
| 11665 | + .read_status = bnx2x_link_settings_status, |
---|
| 11666 | + .link_reset = bnx2x_int_link_reset, |
---|
| 11667 | + .config_loopback = NULL, |
---|
| 11668 | + .format_fw_ver = NULL, |
---|
| 11669 | + .hw_reset = NULL, |
---|
| 11670 | + .set_link_led = NULL, |
---|
| 11671 | + .phy_specific_func = NULL |
---|
11686 | 11672 | }; |
---|
11687 | 11673 | |
---|
11688 | 11674 | static const struct bnx2x_phy phy_xgxs = { |
---|
.. | .. |
---|
11711 | 11697 | .speed_cap_mask = 0, |
---|
11712 | 11698 | .req_duplex = 0, |
---|
11713 | 11699 | .rsrv = 0, |
---|
11714 | | - .config_init = (config_init_t)bnx2x_xgxs_config_init, |
---|
11715 | | - .read_status = (read_status_t)bnx2x_link_settings_status, |
---|
11716 | | - .link_reset = (link_reset_t)bnx2x_int_link_reset, |
---|
11717 | | - .config_loopback = (config_loopback_t)bnx2x_set_xgxs_loopback, |
---|
11718 | | - .format_fw_ver = (format_fw_ver_t)NULL, |
---|
11719 | | - .hw_reset = (hw_reset_t)NULL, |
---|
11720 | | - .set_link_led = (set_link_led_t)NULL, |
---|
11721 | | - .phy_specific_func = (phy_specific_func_t)bnx2x_xgxs_specific_func |
---|
| 11700 | + .config_init = bnx2x_xgxs_config_init, |
---|
| 11701 | + .read_status = bnx2x_link_settings_status, |
---|
| 11702 | + .link_reset = bnx2x_int_link_reset, |
---|
| 11703 | + .config_loopback = bnx2x_set_xgxs_loopback, |
---|
| 11704 | + .format_fw_ver = NULL, |
---|
| 11705 | + .hw_reset = NULL, |
---|
| 11706 | + .set_link_led = NULL, |
---|
| 11707 | + .phy_specific_func = bnx2x_xgxs_specific_func |
---|
11722 | 11708 | }; |
---|
11723 | 11709 | static const struct bnx2x_phy phy_warpcore = { |
---|
11724 | 11710 | .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT, |
---|
.. | .. |
---|
11749 | 11735 | .speed_cap_mask = 0, |
---|
11750 | 11736 | /* req_duplex = */0, |
---|
11751 | 11737 | /* rsrv = */0, |
---|
11752 | | - .config_init = (config_init_t)bnx2x_warpcore_config_init, |
---|
11753 | | - .read_status = (read_status_t)bnx2x_warpcore_read_status, |
---|
11754 | | - .link_reset = (link_reset_t)bnx2x_warpcore_link_reset, |
---|
11755 | | - .config_loopback = (config_loopback_t)bnx2x_set_warpcore_loopback, |
---|
11756 | | - .format_fw_ver = (format_fw_ver_t)NULL, |
---|
11757 | | - .hw_reset = (hw_reset_t)bnx2x_warpcore_hw_reset, |
---|
11758 | | - .set_link_led = (set_link_led_t)NULL, |
---|
11759 | | - .phy_specific_func = (phy_specific_func_t)NULL |
---|
| 11738 | + .config_init = bnx2x_warpcore_config_init, |
---|
| 11739 | + .read_status = bnx2x_warpcore_read_status, |
---|
| 11740 | + .link_reset = bnx2x_warpcore_link_reset, |
---|
| 11741 | + .config_loopback = bnx2x_set_warpcore_loopback, |
---|
| 11742 | + .format_fw_ver = NULL, |
---|
| 11743 | + .hw_reset = bnx2x_warpcore_hw_reset, |
---|
| 11744 | + .set_link_led = NULL, |
---|
| 11745 | + .phy_specific_func = NULL |
---|
11760 | 11746 | }; |
---|
11761 | 11747 | |
---|
11762 | 11748 | |
---|
.. | .. |
---|
11780 | 11766 | .speed_cap_mask = 0, |
---|
11781 | 11767 | .req_duplex = 0, |
---|
11782 | 11768 | .rsrv = 0, |
---|
11783 | | - .config_init = (config_init_t)bnx2x_7101_config_init, |
---|
11784 | | - .read_status = (read_status_t)bnx2x_7101_read_status, |
---|
11785 | | - .link_reset = (link_reset_t)bnx2x_common_ext_link_reset, |
---|
11786 | | - .config_loopback = (config_loopback_t)bnx2x_7101_config_loopback, |
---|
11787 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_7101_format_ver, |
---|
11788 | | - .hw_reset = (hw_reset_t)bnx2x_7101_hw_reset, |
---|
11789 | | - .set_link_led = (set_link_led_t)bnx2x_7101_set_link_led, |
---|
11790 | | - .phy_specific_func = (phy_specific_func_t)NULL |
---|
| 11769 | + .config_init = bnx2x_7101_config_init, |
---|
| 11770 | + .read_status = bnx2x_7101_read_status, |
---|
| 11771 | + .link_reset = bnx2x_common_ext_link_reset, |
---|
| 11772 | + .config_loopback = bnx2x_7101_config_loopback, |
---|
| 11773 | + .format_fw_ver = bnx2x_7101_format_ver, |
---|
| 11774 | + .hw_reset = bnx2x_7101_hw_reset, |
---|
| 11775 | + .set_link_led = bnx2x_7101_set_link_led, |
---|
| 11776 | + .phy_specific_func = NULL |
---|
11791 | 11777 | }; |
---|
11792 | 11778 | static const struct bnx2x_phy phy_8073 = { |
---|
11793 | 11779 | .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073, |
---|
.. | .. |
---|
11811 | 11797 | .speed_cap_mask = 0, |
---|
11812 | 11798 | .req_duplex = 0, |
---|
11813 | 11799 | .rsrv = 0, |
---|
11814 | | - .config_init = (config_init_t)bnx2x_8073_config_init, |
---|
11815 | | - .read_status = (read_status_t)bnx2x_8073_read_status, |
---|
11816 | | - .link_reset = (link_reset_t)bnx2x_8073_link_reset, |
---|
11817 | | - .config_loopback = (config_loopback_t)NULL, |
---|
11818 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_format_ver, |
---|
11819 | | - .hw_reset = (hw_reset_t)NULL, |
---|
11820 | | - .set_link_led = (set_link_led_t)NULL, |
---|
11821 | | - .phy_specific_func = (phy_specific_func_t)bnx2x_8073_specific_func |
---|
| 11800 | + .config_init = bnx2x_8073_config_init, |
---|
| 11801 | + .read_status = bnx2x_8073_read_status, |
---|
| 11802 | + .link_reset = bnx2x_8073_link_reset, |
---|
| 11803 | + .config_loopback = NULL, |
---|
| 11804 | + .format_fw_ver = bnx2x_format_ver, |
---|
| 11805 | + .hw_reset = NULL, |
---|
| 11806 | + .set_link_led = NULL, |
---|
| 11807 | + .phy_specific_func = bnx2x_8073_specific_func |
---|
11822 | 11808 | }; |
---|
11823 | 11809 | static const struct bnx2x_phy phy_8705 = { |
---|
11824 | 11810 | .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705, |
---|
.. | .. |
---|
11839 | 11825 | .speed_cap_mask = 0, |
---|
11840 | 11826 | .req_duplex = 0, |
---|
11841 | 11827 | .rsrv = 0, |
---|
11842 | | - .config_init = (config_init_t)bnx2x_8705_config_init, |
---|
11843 | | - .read_status = (read_status_t)bnx2x_8705_read_status, |
---|
11844 | | - .link_reset = (link_reset_t)bnx2x_common_ext_link_reset, |
---|
11845 | | - .config_loopback = (config_loopback_t)NULL, |
---|
11846 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_null_format_ver, |
---|
11847 | | - .hw_reset = (hw_reset_t)NULL, |
---|
11848 | | - .set_link_led = (set_link_led_t)NULL, |
---|
11849 | | - .phy_specific_func = (phy_specific_func_t)NULL |
---|
| 11828 | + .config_init = bnx2x_8705_config_init, |
---|
| 11829 | + .read_status = bnx2x_8705_read_status, |
---|
| 11830 | + .link_reset = bnx2x_common_ext_link_reset, |
---|
| 11831 | + .config_loopback = NULL, |
---|
| 11832 | + .format_fw_ver = bnx2x_null_format_ver, |
---|
| 11833 | + .hw_reset = NULL, |
---|
| 11834 | + .set_link_led = NULL, |
---|
| 11835 | + .phy_specific_func = NULL |
---|
11850 | 11836 | }; |
---|
11851 | 11837 | static const struct bnx2x_phy phy_8706 = { |
---|
11852 | 11838 | .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706, |
---|
.. | .. |
---|
11868 | 11854 | .speed_cap_mask = 0, |
---|
11869 | 11855 | .req_duplex = 0, |
---|
11870 | 11856 | .rsrv = 0, |
---|
11871 | | - .config_init = (config_init_t)bnx2x_8706_config_init, |
---|
11872 | | - .read_status = (read_status_t)bnx2x_8706_read_status, |
---|
11873 | | - .link_reset = (link_reset_t)bnx2x_common_ext_link_reset, |
---|
11874 | | - .config_loopback = (config_loopback_t)NULL, |
---|
11875 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_format_ver, |
---|
11876 | | - .hw_reset = (hw_reset_t)NULL, |
---|
11877 | | - .set_link_led = (set_link_led_t)NULL, |
---|
11878 | | - .phy_specific_func = (phy_specific_func_t)NULL |
---|
| 11857 | + .config_init = bnx2x_8706_config_init, |
---|
| 11858 | + .read_status = bnx2x_8706_read_status, |
---|
| 11859 | + .link_reset = bnx2x_common_ext_link_reset, |
---|
| 11860 | + .config_loopback = NULL, |
---|
| 11861 | + .format_fw_ver = bnx2x_format_ver, |
---|
| 11862 | + .hw_reset = NULL, |
---|
| 11863 | + .set_link_led = NULL, |
---|
| 11864 | + .phy_specific_func = NULL |
---|
11879 | 11865 | }; |
---|
11880 | 11866 | |
---|
11881 | 11867 | static const struct bnx2x_phy phy_8726 = { |
---|
.. | .. |
---|
11900 | 11886 | .speed_cap_mask = 0, |
---|
11901 | 11887 | .req_duplex = 0, |
---|
11902 | 11888 | .rsrv = 0, |
---|
11903 | | - .config_init = (config_init_t)bnx2x_8726_config_init, |
---|
11904 | | - .read_status = (read_status_t)bnx2x_8726_read_status, |
---|
11905 | | - .link_reset = (link_reset_t)bnx2x_8726_link_reset, |
---|
11906 | | - .config_loopback = (config_loopback_t)bnx2x_8726_config_loopback, |
---|
11907 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_format_ver, |
---|
11908 | | - .hw_reset = (hw_reset_t)NULL, |
---|
11909 | | - .set_link_led = (set_link_led_t)NULL, |
---|
11910 | | - .phy_specific_func = (phy_specific_func_t)NULL |
---|
| 11889 | + .config_init = bnx2x_8726_config_init, |
---|
| 11890 | + .read_status = bnx2x_8726_read_status, |
---|
| 11891 | + .link_reset = bnx2x_8726_link_reset, |
---|
| 11892 | + .config_loopback = bnx2x_8726_config_loopback, |
---|
| 11893 | + .format_fw_ver = bnx2x_format_ver, |
---|
| 11894 | + .hw_reset = NULL, |
---|
| 11895 | + .set_link_led = NULL, |
---|
| 11896 | + .phy_specific_func = NULL |
---|
11911 | 11897 | }; |
---|
11912 | 11898 | |
---|
11913 | 11899 | static const struct bnx2x_phy phy_8727 = { |
---|
.. | .. |
---|
11931 | 11917 | .speed_cap_mask = 0, |
---|
11932 | 11918 | .req_duplex = 0, |
---|
11933 | 11919 | .rsrv = 0, |
---|
11934 | | - .config_init = (config_init_t)bnx2x_8727_config_init, |
---|
11935 | | - .read_status = (read_status_t)bnx2x_8727_read_status, |
---|
11936 | | - .link_reset = (link_reset_t)bnx2x_8727_link_reset, |
---|
11937 | | - .config_loopback = (config_loopback_t)NULL, |
---|
11938 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_format_ver, |
---|
11939 | | - .hw_reset = (hw_reset_t)bnx2x_8727_hw_reset, |
---|
11940 | | - .set_link_led = (set_link_led_t)bnx2x_8727_set_link_led, |
---|
11941 | | - .phy_specific_func = (phy_specific_func_t)bnx2x_8727_specific_func |
---|
| 11920 | + .config_init = bnx2x_8727_config_init, |
---|
| 11921 | + .read_status = bnx2x_8727_read_status, |
---|
| 11922 | + .link_reset = bnx2x_8727_link_reset, |
---|
| 11923 | + .config_loopback = NULL, |
---|
| 11924 | + .format_fw_ver = bnx2x_format_ver, |
---|
| 11925 | + .hw_reset = bnx2x_8727_hw_reset, |
---|
| 11926 | + .set_link_led = bnx2x_8727_set_link_led, |
---|
| 11927 | + .phy_specific_func = bnx2x_8727_specific_func |
---|
11942 | 11928 | }; |
---|
11943 | 11929 | static const struct bnx2x_phy phy_8481 = { |
---|
11944 | 11930 | .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481, |
---|
.. | .. |
---|
11966 | 11952 | .speed_cap_mask = 0, |
---|
11967 | 11953 | .req_duplex = 0, |
---|
11968 | 11954 | .rsrv = 0, |
---|
11969 | | - .config_init = (config_init_t)bnx2x_8481_config_init, |
---|
11970 | | - .read_status = (read_status_t)bnx2x_848xx_read_status, |
---|
11971 | | - .link_reset = (link_reset_t)bnx2x_8481_link_reset, |
---|
11972 | | - .config_loopback = (config_loopback_t)NULL, |
---|
11973 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver, |
---|
11974 | | - .hw_reset = (hw_reset_t)bnx2x_8481_hw_reset, |
---|
11975 | | - .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, |
---|
11976 | | - .phy_specific_func = (phy_specific_func_t)NULL |
---|
| 11955 | + .config_init = bnx2x_8481_config_init, |
---|
| 11956 | + .read_status = bnx2x_848xx_read_status, |
---|
| 11957 | + .link_reset = bnx2x_8481_link_reset, |
---|
| 11958 | + .config_loopback = NULL, |
---|
| 11959 | + .format_fw_ver = bnx2x_848xx_format_ver, |
---|
| 11960 | + .hw_reset = bnx2x_8481_hw_reset, |
---|
| 11961 | + .set_link_led = bnx2x_848xx_set_link_led, |
---|
| 11962 | + .phy_specific_func = NULL |
---|
11977 | 11963 | }; |
---|
11978 | 11964 | |
---|
11979 | 11965 | static const struct bnx2x_phy phy_84823 = { |
---|
.. | .. |
---|
12003 | 11989 | .speed_cap_mask = 0, |
---|
12004 | 11990 | .req_duplex = 0, |
---|
12005 | 11991 | .rsrv = 0, |
---|
12006 | | - .config_init = (config_init_t)bnx2x_848x3_config_init, |
---|
12007 | | - .read_status = (read_status_t)bnx2x_848xx_read_status, |
---|
12008 | | - .link_reset = (link_reset_t)bnx2x_848x3_link_reset, |
---|
12009 | | - .config_loopback = (config_loopback_t)NULL, |
---|
12010 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver, |
---|
12011 | | - .hw_reset = (hw_reset_t)NULL, |
---|
12012 | | - .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, |
---|
12013 | | - .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func |
---|
| 11992 | + .config_init = bnx2x_848x3_config_init, |
---|
| 11993 | + .read_status = bnx2x_848xx_read_status, |
---|
| 11994 | + .link_reset = bnx2x_848x3_link_reset, |
---|
| 11995 | + .config_loopback = NULL, |
---|
| 11996 | + .format_fw_ver = bnx2x_848xx_format_ver, |
---|
| 11997 | + .hw_reset = NULL, |
---|
| 11998 | + .set_link_led = bnx2x_848xx_set_link_led, |
---|
| 11999 | + .phy_specific_func = bnx2x_848xx_specific_func |
---|
12014 | 12000 | }; |
---|
12015 | 12001 | |
---|
12016 | 12002 | static const struct bnx2x_phy phy_84833 = { |
---|
.. | .. |
---|
12038 | 12024 | .speed_cap_mask = 0, |
---|
12039 | 12025 | .req_duplex = 0, |
---|
12040 | 12026 | .rsrv = 0, |
---|
12041 | | - .config_init = (config_init_t)bnx2x_848x3_config_init, |
---|
12042 | | - .read_status = (read_status_t)bnx2x_848xx_read_status, |
---|
12043 | | - .link_reset = (link_reset_t)bnx2x_848x3_link_reset, |
---|
12044 | | - .config_loopback = (config_loopback_t)NULL, |
---|
12045 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver, |
---|
12046 | | - .hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy, |
---|
12047 | | - .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, |
---|
12048 | | - .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func |
---|
| 12027 | + .config_init = bnx2x_848x3_config_init, |
---|
| 12028 | + .read_status = bnx2x_848xx_read_status, |
---|
| 12029 | + .link_reset = bnx2x_848x3_link_reset, |
---|
| 12030 | + .config_loopback = NULL, |
---|
| 12031 | + .format_fw_ver = bnx2x_848xx_format_ver, |
---|
| 12032 | + .hw_reset = bnx2x_84833_hw_reset_phy, |
---|
| 12033 | + .set_link_led = bnx2x_848xx_set_link_led, |
---|
| 12034 | + .phy_specific_func = bnx2x_848xx_specific_func |
---|
12049 | 12035 | }; |
---|
12050 | 12036 | |
---|
12051 | 12037 | static const struct bnx2x_phy phy_84834 = { |
---|
.. | .. |
---|
12072 | 12058 | .speed_cap_mask = 0, |
---|
12073 | 12059 | .req_duplex = 0, |
---|
12074 | 12060 | .rsrv = 0, |
---|
12075 | | - .config_init = (config_init_t)bnx2x_848x3_config_init, |
---|
12076 | | - .read_status = (read_status_t)bnx2x_848xx_read_status, |
---|
12077 | | - .link_reset = (link_reset_t)bnx2x_848x3_link_reset, |
---|
12078 | | - .config_loopback = (config_loopback_t)NULL, |
---|
12079 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver, |
---|
12080 | | - .hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy, |
---|
12081 | | - .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, |
---|
12082 | | - .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func |
---|
| 12061 | + .config_init = bnx2x_848x3_config_init, |
---|
| 12062 | + .read_status = bnx2x_848xx_read_status, |
---|
| 12063 | + .link_reset = bnx2x_848x3_link_reset, |
---|
| 12064 | + .config_loopback = NULL, |
---|
| 12065 | + .format_fw_ver = bnx2x_848xx_format_ver, |
---|
| 12066 | + .hw_reset = bnx2x_84833_hw_reset_phy, |
---|
| 12067 | + .set_link_led = bnx2x_848xx_set_link_led, |
---|
| 12068 | + .phy_specific_func = bnx2x_848xx_specific_func |
---|
12083 | 12069 | }; |
---|
12084 | 12070 | |
---|
12085 | 12071 | static const struct bnx2x_phy phy_84858 = { |
---|
.. | .. |
---|
12106 | 12092 | .speed_cap_mask = 0, |
---|
12107 | 12093 | .req_duplex = 0, |
---|
12108 | 12094 | .rsrv = 0, |
---|
12109 | | - .config_init = (config_init_t)bnx2x_848x3_config_init, |
---|
12110 | | - .read_status = (read_status_t)bnx2x_848xx_read_status, |
---|
12111 | | - .link_reset = (link_reset_t)bnx2x_848x3_link_reset, |
---|
12112 | | - .config_loopback = (config_loopback_t)NULL, |
---|
12113 | | - .format_fw_ver = (format_fw_ver_t)bnx2x_8485x_format_ver, |
---|
12114 | | - .hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy, |
---|
12115 | | - .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, |
---|
12116 | | - .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func |
---|
| 12095 | + .config_init = bnx2x_848x3_config_init, |
---|
| 12096 | + .read_status = bnx2x_848xx_read_status, |
---|
| 12097 | + .link_reset = bnx2x_848x3_link_reset, |
---|
| 12098 | + .config_loopback = NULL, |
---|
| 12099 | + .format_fw_ver = bnx2x_8485x_format_ver, |
---|
| 12100 | + .hw_reset = bnx2x_84833_hw_reset_phy, |
---|
| 12101 | + .set_link_led = bnx2x_848xx_set_link_led, |
---|
| 12102 | + .phy_specific_func = bnx2x_848xx_specific_func |
---|
12117 | 12103 | }; |
---|
12118 | 12104 | |
---|
12119 | 12105 | static const struct bnx2x_phy phy_54618se = { |
---|
.. | .. |
---|
12140 | 12126 | .speed_cap_mask = 0, |
---|
12141 | 12127 | /* req_duplex = */0, |
---|
12142 | 12128 | /* rsrv = */0, |
---|
12143 | | - .config_init = (config_init_t)bnx2x_54618se_config_init, |
---|
12144 | | - .read_status = (read_status_t)bnx2x_54618se_read_status, |
---|
12145 | | - .link_reset = (link_reset_t)bnx2x_54618se_link_reset, |
---|
12146 | | - .config_loopback = (config_loopback_t)bnx2x_54618se_config_loopback, |
---|
12147 | | - .format_fw_ver = (format_fw_ver_t)NULL, |
---|
12148 | | - .hw_reset = (hw_reset_t)NULL, |
---|
12149 | | - .set_link_led = (set_link_led_t)bnx2x_5461x_set_link_led, |
---|
12150 | | - .phy_specific_func = (phy_specific_func_t)bnx2x_54618se_specific_func |
---|
| 12129 | + .config_init = bnx2x_54618se_config_init, |
---|
| 12130 | + .read_status = bnx2x_54618se_read_status, |
---|
| 12131 | + .link_reset = bnx2x_54618se_link_reset, |
---|
| 12132 | + .config_loopback = bnx2x_54618se_config_loopback, |
---|
| 12133 | + .format_fw_ver = NULL, |
---|
| 12134 | + .hw_reset = NULL, |
---|
| 12135 | + .set_link_led = bnx2x_5461x_set_link_led, |
---|
| 12136 | + .phy_specific_func = bnx2x_54618se_specific_func |
---|
12151 | 12137 | }; |
---|
12152 | 12138 | /*****************************************************************/ |
---|
12153 | 12139 | /* */ |
---|
.. | .. |
---|
12522 | 12508 | switch (link_config & PORT_FEATURE_LINK_SPEED_MASK) { |
---|
12523 | 12509 | case PORT_FEATURE_LINK_SPEED_10M_HALF: |
---|
12524 | 12510 | phy->req_duplex = DUPLEX_HALF; |
---|
12525 | | - /* fall through */ |
---|
| 12511 | + fallthrough; |
---|
12526 | 12512 | case PORT_FEATURE_LINK_SPEED_10M_FULL: |
---|
12527 | 12513 | phy->req_line_speed = SPEED_10; |
---|
12528 | 12514 | break; |
---|
12529 | 12515 | case PORT_FEATURE_LINK_SPEED_100M_HALF: |
---|
12530 | 12516 | phy->req_duplex = DUPLEX_HALF; |
---|
12531 | | - /* fall through */ |
---|
| 12517 | + fallthrough; |
---|
12532 | 12518 | case PORT_FEATURE_LINK_SPEED_100M_FULL: |
---|
12533 | 12519 | phy->req_line_speed = SPEED_100; |
---|
12534 | 12520 | break; |
---|
.. | .. |
---|
12675 | 12661 | struct link_vars *vars) |
---|
12676 | 12662 | { |
---|
12677 | 12663 | struct bnx2x *bp = params->bp; |
---|
12678 | | - vars->link_up = 1; |
---|
12679 | | - vars->line_speed = SPEED_10000; |
---|
12680 | | - vars->duplex = DUPLEX_FULL; |
---|
12681 | | - vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE; |
---|
12682 | | - vars->mac_type = MAC_TYPE_BMAC; |
---|
| 12664 | + vars->link_up = 1; |
---|
| 12665 | + vars->line_speed = SPEED_10000; |
---|
| 12666 | + vars->duplex = DUPLEX_FULL; |
---|
| 12667 | + vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE; |
---|
| 12668 | + vars->mac_type = MAC_TYPE_BMAC; |
---|
12683 | 12669 | |
---|
12684 | | - vars->phy_flags = PHY_XGXS_FLAG; |
---|
| 12670 | + vars->phy_flags = PHY_XGXS_FLAG; |
---|
12685 | 12671 | |
---|
12686 | | - bnx2x_xgxs_deassert(params); |
---|
| 12672 | + bnx2x_xgxs_deassert(params); |
---|
12687 | 12673 | |
---|
12688 | | - /* Set bmac loopback */ |
---|
12689 | | - bnx2x_bmac_enable(params, vars, 1, 1); |
---|
| 12674 | + /* Set bmac loopback */ |
---|
| 12675 | + bnx2x_bmac_enable(params, vars, 1, 1); |
---|
12690 | 12676 | |
---|
12691 | | - REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0); |
---|
| 12677 | + REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port * 4, 0); |
---|
12692 | 12678 | } |
---|
12693 | 12679 | |
---|
12694 | 12680 | static void bnx2x_init_emac_loopback(struct link_params *params, |
---|
12695 | 12681 | struct link_vars *vars) |
---|
12696 | 12682 | { |
---|
12697 | 12683 | struct bnx2x *bp = params->bp; |
---|
12698 | | - vars->link_up = 1; |
---|
12699 | | - vars->line_speed = SPEED_1000; |
---|
12700 | | - vars->duplex = DUPLEX_FULL; |
---|
12701 | | - vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE; |
---|
12702 | | - vars->mac_type = MAC_TYPE_EMAC; |
---|
| 12684 | + vars->link_up = 1; |
---|
| 12685 | + vars->line_speed = SPEED_1000; |
---|
| 12686 | + vars->duplex = DUPLEX_FULL; |
---|
| 12687 | + vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE; |
---|
| 12688 | + vars->mac_type = MAC_TYPE_EMAC; |
---|
12703 | 12689 | |
---|
12704 | | - vars->phy_flags = PHY_XGXS_FLAG; |
---|
| 12690 | + vars->phy_flags = PHY_XGXS_FLAG; |
---|
12705 | 12691 | |
---|
12706 | | - bnx2x_xgxs_deassert(params); |
---|
12707 | | - /* Set bmac loopback */ |
---|
12708 | | - bnx2x_emac_enable(params, vars, 1); |
---|
12709 | | - bnx2x_emac_program(params, vars); |
---|
12710 | | - REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0); |
---|
| 12692 | + bnx2x_xgxs_deassert(params); |
---|
| 12693 | + /* Set bmac loopback */ |
---|
| 12694 | + bnx2x_emac_enable(params, vars, 1); |
---|
| 12695 | + bnx2x_emac_program(params, vars); |
---|
| 12696 | + REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port * 4, 0); |
---|
12711 | 12697 | } |
---|
12712 | 12698 | |
---|
12713 | 12699 | static void bnx2x_init_xmac_loopback(struct link_params *params, |
---|
.. | .. |
---|
13073 | 13059 | REG_WR(bp, NIG_REG_EGRESS_EMAC0_OUT_EN + port*4, 0); |
---|
13074 | 13060 | } |
---|
13075 | 13061 | |
---|
13076 | | - if (!CHIP_IS_E3(bp)) { |
---|
13077 | | - bnx2x_set_bmac_rx(bp, params->chip_id, port, 0); |
---|
13078 | | - } else { |
---|
13079 | | - bnx2x_set_xmac_rxtx(params, 0); |
---|
13080 | | - bnx2x_set_umac_rxtx(params, 0); |
---|
13081 | | - } |
---|
| 13062 | + if (!CHIP_IS_E3(bp)) { |
---|
| 13063 | + bnx2x_set_bmac_rx(bp, params->chip_id, port, 0); |
---|
| 13064 | + } else { |
---|
| 13065 | + bnx2x_set_xmac_rxtx(params, 0); |
---|
| 13066 | + bnx2x_set_umac_rxtx(params, 0); |
---|
| 13067 | + } |
---|
13082 | 13068 | /* Disable emac */ |
---|
13083 | 13069 | if (!CHIP_IS_E3(bp)) |
---|
13084 | 13070 | REG_WR(bp, NIG_REG_NIG_EMAC0_EN + port*4, 0); |
---|