Commit f92e88db authored by David S. Miller's avatar David S. Miller

Merge branch 'bnx2x-Remove-function-casts'

Kees Cook says:

====================
bnx2x: Remove function casts

In order to make the entire kernel usable under Clang's Control Flow
Integrity protections, function prototype casts need to be avoided
because this will trip CFI checks at runtime (i.e. a mismatch between
the caller's expected function prototype and the destination function's
prototype). Many of these cases can be found with -Wcast-function-type,
which found that bnx2x had a bunch of needless (or at least confusing)
function casts. This series removes them all.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 2e47cb41 548e5ffe
...@@ -5611,7 +5611,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, ...@@ -5611,7 +5611,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy,
return 0; return 0;
} }
static int bnx2x_link_settings_status(struct bnx2x_phy *phy, static u8 bnx2x_link_settings_status(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -5685,7 +5685,7 @@ static int bnx2x_link_settings_status(struct bnx2x_phy *phy, ...@@ -5685,7 +5685,7 @@ static int bnx2x_link_settings_status(struct bnx2x_phy *phy,
return rc; return rc;
} }
static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, static u8 bnx2x_warpcore_read_status(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -7364,7 +7364,7 @@ static void bnx2x_8073_specific_func(struct bnx2x_phy *phy, ...@@ -7364,7 +7364,7 @@ static void bnx2x_8073_specific_func(struct bnx2x_phy *phy,
} }
} }
static int bnx2x_8073_config_init(struct bnx2x_phy *phy, static void bnx2x_8073_config_init(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -7427,7 +7427,7 @@ static int bnx2x_8073_config_init(struct bnx2x_phy *phy, ...@@ -7427,7 +7427,7 @@ static int bnx2x_8073_config_init(struct bnx2x_phy *phy,
if (params->loopback_mode == LOOPBACK_EXT) { if (params->loopback_mode == LOOPBACK_EXT) {
bnx2x_807x_force_10G(bp, phy); bnx2x_807x_force_10G(bp, phy);
DP(NETIF_MSG_LINK, "Forced speed 10G on 807X\n"); DP(NETIF_MSG_LINK, "Forced speed 10G on 807X\n");
return 0; return;
} else { } else {
bnx2x_cl45_write(bp, phy, bnx2x_cl45_write(bp, phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_BCM_CTRL, 0x0002); MDIO_PMA_DEVAD, MDIO_PMA_REG_BCM_CTRL, 0x0002);
...@@ -7509,7 +7509,6 @@ static int bnx2x_8073_config_init(struct bnx2x_phy *phy, ...@@ -7509,7 +7509,6 @@ static int bnx2x_8073_config_init(struct bnx2x_phy *phy,
bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_CTRL, 0x1200); bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_CTRL, 0x1200);
DP(NETIF_MSG_LINK, "807x Autoneg Restart: Advertise 1G=%x, 10G=%x\n", DP(NETIF_MSG_LINK, "807x Autoneg Restart: Advertise 1G=%x, 10G=%x\n",
((val & (1<<5)) > 0), ((val & (1<<7)) > 0)); ((val & (1<<5)) > 0), ((val & (1<<7)) > 0));
return 0;
} }
static u8 bnx2x_8073_read_status(struct bnx2x_phy *phy, static u8 bnx2x_8073_read_status(struct bnx2x_phy *phy,
...@@ -7676,7 +7675,7 @@ static void bnx2x_8073_link_reset(struct bnx2x_phy *phy, ...@@ -7676,7 +7675,7 @@ static void bnx2x_8073_link_reset(struct bnx2x_phy *phy,
/******************************************************************/ /******************************************************************/
/* BCM8705 PHY SECTION */ /* BCM8705 PHY SECTION */
/******************************************************************/ /******************************************************************/
static int bnx2x_8705_config_init(struct bnx2x_phy *phy, static void bnx2x_8705_config_init(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -7700,7 +7699,6 @@ static int bnx2x_8705_config_init(struct bnx2x_phy *phy, ...@@ -7700,7 +7699,6 @@ static int bnx2x_8705_config_init(struct bnx2x_phy *phy,
MDIO_WIS_DEVAD, MDIO_WIS_REG_LASI_CNTL, 0x1); MDIO_WIS_DEVAD, MDIO_WIS_REG_LASI_CNTL, 0x1);
/* BCM8705 doesn't have microcode, hence the 0 */ /* BCM8705 doesn't have microcode, hence the 0 */
bnx2x_save_spirom_version(bp, params->port, params->shmem_base, 0); bnx2x_save_spirom_version(bp, params->port, params->shmem_base, 0);
return 0;
} }
static u8 bnx2x_8705_read_status(struct bnx2x_phy *phy, static u8 bnx2x_8705_read_status(struct bnx2x_phy *phy,
...@@ -8887,7 +8885,7 @@ static u8 bnx2x_8706_8726_read_status(struct bnx2x_phy *phy, ...@@ -8887,7 +8885,7 @@ static u8 bnx2x_8706_8726_read_status(struct bnx2x_phy *phy,
/******************************************************************/ /******************************************************************/
/* BCM8706 PHY SECTION */ /* BCM8706 PHY SECTION */
/******************************************************************/ /******************************************************************/
static u8 bnx2x_8706_config_init(struct bnx2x_phy *phy, static void bnx2x_8706_config_init(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -8989,11 +8987,9 @@ static u8 bnx2x_8706_config_init(struct bnx2x_phy *phy, ...@@ -8989,11 +8987,9 @@ static u8 bnx2x_8706_config_init(struct bnx2x_phy *phy,
bnx2x_cl45_write(bp, phy, bnx2x_cl45_write(bp, phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_DIGITAL_CTRL, tmp1); MDIO_PMA_DEVAD, MDIO_PMA_REG_DIGITAL_CTRL, tmp1);
} }
return 0;
} }
static int bnx2x_8706_read_status(struct bnx2x_phy *phy, static u8 bnx2x_8706_read_status(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -9070,7 +9066,7 @@ static u8 bnx2x_8726_read_status(struct bnx2x_phy *phy, ...@@ -9070,7 +9066,7 @@ static u8 bnx2x_8726_read_status(struct bnx2x_phy *phy,
} }
static int bnx2x_8726_config_init(struct bnx2x_phy *phy, static void bnx2x_8726_config_init(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -9150,9 +9146,6 @@ static int bnx2x_8726_config_init(struct bnx2x_phy *phy, ...@@ -9150,9 +9146,6 @@ static int bnx2x_8726_config_init(struct bnx2x_phy *phy,
MDIO_PMA_REG_8726_TX_CTRL2, MDIO_PMA_REG_8726_TX_CTRL2,
phy->tx_preemphasis[1]); phy->tx_preemphasis[1]);
} }
return 0;
} }
static void bnx2x_8726_link_reset(struct bnx2x_phy *phy, static void bnx2x_8726_link_reset(struct bnx2x_phy *phy,
...@@ -9288,7 +9281,7 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, ...@@ -9288,7 +9281,7 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy,
} }
} }
static int bnx2x_8727_config_init(struct bnx2x_phy *phy, static void bnx2x_8727_config_init(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -9370,8 +9363,6 @@ static int bnx2x_8727_config_init(struct bnx2x_phy *phy, ...@@ -9370,8 +9363,6 @@ static int bnx2x_8727_config_init(struct bnx2x_phy *phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER, MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER,
(tmp2 & 0x7fff)); (tmp2 & 0x7fff));
} }
return 0;
} }
static void bnx2x_8727_handle_mod_abs(struct bnx2x_phy *phy, static void bnx2x_8727_handle_mod_abs(struct bnx2x_phy *phy,
...@@ -9946,7 +9937,7 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, ...@@ -9946,7 +9937,7 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy,
return 0; return 0;
} }
static int bnx2x_8481_config_init(struct bnx2x_phy *phy, static void bnx2x_8481_config_init(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -9960,7 +9951,7 @@ static int bnx2x_8481_config_init(struct bnx2x_phy *phy, ...@@ -9960,7 +9951,7 @@ static int bnx2x_8481_config_init(struct bnx2x_phy *phy,
bnx2x_wait_reset_complete(bp, phy, params); bnx2x_wait_reset_complete(bp, phy, params);
bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 1<<15); bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 1<<15);
return bnx2x_848xx_cmn_config_init(phy, params, vars); bnx2x_848xx_cmn_config_init(phy, params, vars);
} }
#define PHY848xx_CMDHDLR_WAIT 300 #define PHY848xx_CMDHDLR_WAIT 300
...@@ -10210,7 +10201,7 @@ static u8 bnx2x_84833_get_reset_gpios(struct bnx2x *bp, ...@@ -10210,7 +10201,7 @@ static u8 bnx2x_84833_get_reset_gpios(struct bnx2x *bp,
return reset_gpios; return reset_gpios;
} }
static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy, static void bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy,
struct link_params *params) struct link_params *params)
{ {
struct bnx2x *bp = params->bp; struct bnx2x *bp = params->bp;
...@@ -10239,8 +10230,6 @@ static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy, ...@@ -10239,8 +10230,6 @@ static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy,
udelay(10); udelay(10);
DP(NETIF_MSG_LINK, "84833 hw reset on pin values 0x%x\n", DP(NETIF_MSG_LINK, "84833 hw reset on pin values 0x%x\n",
reset_gpios); reset_gpios);
return 0;
} }
static int bnx2x_8483x_disable_eee(struct bnx2x_phy *phy, static int bnx2x_8483x_disable_eee(struct bnx2x_phy *phy,
...@@ -10283,7 +10272,7 @@ static int bnx2x_8483x_enable_eee(struct bnx2x_phy *phy, ...@@ -10283,7 +10272,7 @@ static int bnx2x_8483x_enable_eee(struct bnx2x_phy *phy,
} }
#define PHY84833_CONSTANT_LATENCY 1193 #define PHY84833_CONSTANT_LATENCY 1193
static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, static void bnx2x_848x3_config_init(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -10430,7 +10419,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, ...@@ -10430,7 +10419,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
if (rc) { if (rc) {
DP(NETIF_MSG_LINK, "Failed to configure EEE timers\n"); DP(NETIF_MSG_LINK, "Failed to configure EEE timers\n");
bnx2x_8483x_disable_eee(phy, params, vars); bnx2x_8483x_disable_eee(phy, params, vars);
return rc; return;
} }
if ((phy->req_duplex == DUPLEX_FULL) && if ((phy->req_duplex == DUPLEX_FULL) &&
...@@ -10442,7 +10431,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, ...@@ -10442,7 +10431,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
rc = bnx2x_8483x_disable_eee(phy, params, vars); rc = bnx2x_8483x_disable_eee(phy, params, vars);
if (rc) { if (rc) {
DP(NETIF_MSG_LINK, "Failed to set EEE advertisement\n"); DP(NETIF_MSG_LINK, "Failed to set EEE advertisement\n");
return rc; return;
} }
} else { } else {
vars->eee_status &= ~SHMEM_EEE_SUPPORTED_MASK; vars->eee_status &= ~SHMEM_EEE_SUPPORTED_MASK;
...@@ -10481,7 +10470,6 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, ...@@ -10481,7 +10470,6 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
MDIO_84833_TOP_CFG_XGPHY_STRAP1, MDIO_84833_TOP_CFG_XGPHY_STRAP1,
(u16)~MDIO_84833_SUPER_ISOLATE); (u16)~MDIO_84833_SUPER_ISOLATE);
} }
return rc;
} }
static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy, static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy,
...@@ -11038,7 +11026,7 @@ static void bnx2x_54618se_specific_func(struct bnx2x_phy *phy, ...@@ -11038,7 +11026,7 @@ static void bnx2x_54618se_specific_func(struct bnx2x_phy *phy,
} }
} }
static int bnx2x_54618se_config_init(struct bnx2x_phy *phy, static void bnx2x_54618se_config_init(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -11240,8 +11228,6 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy, ...@@ -11240,8 +11228,6 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy,
bnx2x_cl22_write(bp, phy, bnx2x_cl22_write(bp, phy,
MDIO_PMA_REG_CTRL, autoneg_val); MDIO_PMA_REG_CTRL, autoneg_val);
return 0;
} }
...@@ -11465,7 +11451,7 @@ static void bnx2x_7101_config_loopback(struct bnx2x_phy *phy, ...@@ -11465,7 +11451,7 @@ static void bnx2x_7101_config_loopback(struct bnx2x_phy *phy,
MDIO_XS_DEVAD, MDIO_XS_SFX7101_XGXS_TEST1, 0x100); MDIO_XS_DEVAD, MDIO_XS_SFX7101_XGXS_TEST1, 0x100);
} }
static int bnx2x_7101_config_init(struct bnx2x_phy *phy, static void bnx2x_7101_config_init(struct bnx2x_phy *phy,
struct link_params *params, struct link_params *params,
struct link_vars *vars) struct link_vars *vars)
{ {
...@@ -11502,7 +11488,6 @@ static int bnx2x_7101_config_init(struct bnx2x_phy *phy, ...@@ -11502,7 +11488,6 @@ static int bnx2x_7101_config_init(struct bnx2x_phy *phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_7101_VER2, &fw_ver2); MDIO_PMA_DEVAD, MDIO_PMA_REG_7101_VER2, &fw_ver2);
bnx2x_save_spirom_version(bp, params->port, bnx2x_save_spirom_version(bp, params->port,
(u32)(fw_ver1<<16 | fw_ver2), phy->ver_addr); (u32)(fw_ver1<<16 | fw_ver2), phy->ver_addr);
return 0;
} }
static u8 bnx2x_7101_read_status(struct bnx2x_phy *phy, static u8 bnx2x_7101_read_status(struct bnx2x_phy *phy,
...@@ -11636,14 +11621,14 @@ static const struct bnx2x_phy phy_null = { ...@@ -11636,14 +11621,14 @@ static const struct bnx2x_phy phy_null = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)NULL, .config_init = NULL,
.read_status = (read_status_t)NULL, .read_status = NULL,
.link_reset = (link_reset_t)NULL, .link_reset = NULL,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)NULL, .format_fw_ver = NULL,
.hw_reset = (hw_reset_t)NULL, .hw_reset = NULL,
.set_link_led = (set_link_led_t)NULL, .set_link_led = NULL,
.phy_specific_func = (phy_specific_func_t)NULL .phy_specific_func = NULL
}; };
static const struct bnx2x_phy phy_serdes = { static const struct bnx2x_phy phy_serdes = {
...@@ -11671,14 +11656,14 @@ static const struct bnx2x_phy phy_serdes = { ...@@ -11671,14 +11656,14 @@ static const struct bnx2x_phy phy_serdes = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_xgxs_config_init, .config_init = bnx2x_xgxs_config_init,
.read_status = (read_status_t)bnx2x_link_settings_status, .read_status = bnx2x_link_settings_status,
.link_reset = (link_reset_t)bnx2x_int_link_reset, .link_reset = bnx2x_int_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)NULL, .format_fw_ver = NULL,
.hw_reset = (hw_reset_t)NULL, .hw_reset = NULL,
.set_link_led = (set_link_led_t)NULL, .set_link_led = NULL,
.phy_specific_func = (phy_specific_func_t)NULL .phy_specific_func = NULL
}; };
static const struct bnx2x_phy phy_xgxs = { static const struct bnx2x_phy phy_xgxs = {
...@@ -11707,14 +11692,14 @@ static const struct bnx2x_phy phy_xgxs = { ...@@ -11707,14 +11692,14 @@ static const struct bnx2x_phy phy_xgxs = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_xgxs_config_init, .config_init = bnx2x_xgxs_config_init,
.read_status = (read_status_t)bnx2x_link_settings_status, .read_status = bnx2x_link_settings_status,
.link_reset = (link_reset_t)bnx2x_int_link_reset, .link_reset = bnx2x_int_link_reset,
.config_loopback = (config_loopback_t)bnx2x_set_xgxs_loopback, .config_loopback = bnx2x_set_xgxs_loopback,
.format_fw_ver = (format_fw_ver_t)NULL, .format_fw_ver = NULL,
.hw_reset = (hw_reset_t)NULL, .hw_reset = NULL,
.set_link_led = (set_link_led_t)NULL, .set_link_led = NULL,
.phy_specific_func = (phy_specific_func_t)bnx2x_xgxs_specific_func .phy_specific_func = bnx2x_xgxs_specific_func
}; };
static const struct bnx2x_phy phy_warpcore = { static const struct bnx2x_phy phy_warpcore = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT, .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,
...@@ -11745,14 +11730,14 @@ static const struct bnx2x_phy phy_warpcore = { ...@@ -11745,14 +11730,14 @@ static const struct bnx2x_phy phy_warpcore = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
/* req_duplex = */0, /* req_duplex = */0,
/* rsrv = */0, /* rsrv = */0,
.config_init = (config_init_t)bnx2x_warpcore_config_init, .config_init = bnx2x_warpcore_config_init,
.read_status = (read_status_t)bnx2x_warpcore_read_status, .read_status = bnx2x_warpcore_read_status,
.link_reset = (link_reset_t)bnx2x_warpcore_link_reset, .link_reset = bnx2x_warpcore_link_reset,
.config_loopback = (config_loopback_t)bnx2x_set_warpcore_loopback, .config_loopback = bnx2x_set_warpcore_loopback,
.format_fw_ver = (format_fw_ver_t)NULL, .format_fw_ver = NULL,
.hw_reset = (hw_reset_t)bnx2x_warpcore_hw_reset, .hw_reset = bnx2x_warpcore_hw_reset,
.set_link_led = (set_link_led_t)NULL, .set_link_led = NULL,
.phy_specific_func = (phy_specific_func_t)NULL .phy_specific_func = NULL
}; };
...@@ -11776,14 +11761,14 @@ static const struct bnx2x_phy phy_7101 = { ...@@ -11776,14 +11761,14 @@ static const struct bnx2x_phy phy_7101 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_7101_config_init, .config_init = bnx2x_7101_config_init,
.read_status = (read_status_t)bnx2x_7101_read_status, .read_status = bnx2x_7101_read_status,
.link_reset = (link_reset_t)bnx2x_common_ext_link_reset, .link_reset = bnx2x_common_ext_link_reset,
.config_loopback = (config_loopback_t)bnx2x_7101_config_loopback, .config_loopback = bnx2x_7101_config_loopback,
.format_fw_ver = (format_fw_ver_t)bnx2x_7101_format_ver, .format_fw_ver = bnx2x_7101_format_ver,
.hw_reset = (hw_reset_t)bnx2x_7101_hw_reset, .hw_reset = bnx2x_7101_hw_reset,
.set_link_led = (set_link_led_t)bnx2x_7101_set_link_led, .set_link_led = bnx2x_7101_set_link_led,
.phy_specific_func = (phy_specific_func_t)NULL .phy_specific_func = NULL
}; };
static const struct bnx2x_phy phy_8073 = { static const struct bnx2x_phy phy_8073 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073, .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073,
...@@ -11807,14 +11792,14 @@ static const struct bnx2x_phy phy_8073 = { ...@@ -11807,14 +11792,14 @@ static const struct bnx2x_phy phy_8073 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_8073_config_init, .config_init = bnx2x_8073_config_init,
.read_status = (read_status_t)bnx2x_8073_read_status, .read_status = bnx2x_8073_read_status,
.link_reset = (link_reset_t)bnx2x_8073_link_reset, .link_reset = bnx2x_8073_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver, .format_fw_ver = bnx2x_format_ver,
.hw_reset = (hw_reset_t)NULL, .hw_reset = NULL,
.set_link_led = (set_link_led_t)NULL, .set_link_led = NULL,
.phy_specific_func = (phy_specific_func_t)bnx2x_8073_specific_func .phy_specific_func = bnx2x_8073_specific_func
}; };
static const struct bnx2x_phy phy_8705 = { static const struct bnx2x_phy phy_8705 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705, .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705,
...@@ -11835,14 +11820,14 @@ static const struct bnx2x_phy phy_8705 = { ...@@ -11835,14 +11820,14 @@ static const struct bnx2x_phy phy_8705 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_8705_config_init, .config_init = bnx2x_8705_config_init,
.read_status = (read_status_t)bnx2x_8705_read_status, .read_status = bnx2x_8705_read_status,
.link_reset = (link_reset_t)bnx2x_common_ext_link_reset, .link_reset = bnx2x_common_ext_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_null_format_ver, .format_fw_ver = bnx2x_null_format_ver,
.hw_reset = (hw_reset_t)NULL, .hw_reset = NULL,
.set_link_led = (set_link_led_t)NULL, .set_link_led = NULL,
.phy_specific_func = (phy_specific_func_t)NULL .phy_specific_func = NULL
}; };
static const struct bnx2x_phy phy_8706 = { static const struct bnx2x_phy phy_8706 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706, .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706,
...@@ -11864,14 +11849,14 @@ static const struct bnx2x_phy phy_8706 = { ...@@ -11864,14 +11849,14 @@ static const struct bnx2x_phy phy_8706 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_8706_config_init, .config_init = bnx2x_8706_config_init,
.read_status = (read_status_t)bnx2x_8706_read_status, .read_status = bnx2x_8706_read_status,
.link_reset = (link_reset_t)bnx2x_common_ext_link_reset, .link_reset = bnx2x_common_ext_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver, .format_fw_ver = bnx2x_format_ver,
.hw_reset = (hw_reset_t)NULL, .hw_reset = NULL,
.set_link_led = (set_link_led_t)NULL, .set_link_led = NULL,
.phy_specific_func = (phy_specific_func_t)NULL .phy_specific_func = NULL
}; };
static const struct bnx2x_phy phy_8726 = { static const struct bnx2x_phy phy_8726 = {
...@@ -11896,14 +11881,14 @@ static const struct bnx2x_phy phy_8726 = { ...@@ -11896,14 +11881,14 @@ static const struct bnx2x_phy phy_8726 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_8726_config_init, .config_init = bnx2x_8726_config_init,
.read_status = (read_status_t)bnx2x_8726_read_status, .read_status = bnx2x_8726_read_status,
.link_reset = (link_reset_t)bnx2x_8726_link_reset, .link_reset = bnx2x_8726_link_reset,
.config_loopback = (config_loopback_t)bnx2x_8726_config_loopback, .config_loopback = bnx2x_8726_config_loopback,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver, .format_fw_ver = bnx2x_format_ver,
.hw_reset = (hw_reset_t)NULL, .hw_reset = NULL,
.set_link_led = (set_link_led_t)NULL, .set_link_led = NULL,
.phy_specific_func = (phy_specific_func_t)NULL .phy_specific_func = NULL
}; };
static const struct bnx2x_phy phy_8727 = { static const struct bnx2x_phy phy_8727 = {
...@@ -11927,14 +11912,14 @@ static const struct bnx2x_phy phy_8727 = { ...@@ -11927,14 +11912,14 @@ static const struct bnx2x_phy phy_8727 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_8727_config_init, .config_init = bnx2x_8727_config_init,
.read_status = (read_status_t)bnx2x_8727_read_status, .read_status = bnx2x_8727_read_status,
.link_reset = (link_reset_t)bnx2x_8727_link_reset, .link_reset = bnx2x_8727_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver, .format_fw_ver = bnx2x_format_ver,
.hw_reset = (hw_reset_t)bnx2x_8727_hw_reset, .hw_reset = bnx2x_8727_hw_reset,
.set_link_led = (set_link_led_t)bnx2x_8727_set_link_led, .set_link_led = bnx2x_8727_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_8727_specific_func .phy_specific_func = bnx2x_8727_specific_func
}; };
static const struct bnx2x_phy phy_8481 = { static const struct bnx2x_phy phy_8481 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481, .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481,
...@@ -11962,14 +11947,14 @@ static const struct bnx2x_phy phy_8481 = { ...@@ -11962,14 +11947,14 @@ static const struct bnx2x_phy phy_8481 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_8481_config_init, .config_init = bnx2x_8481_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status, .read_status = bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_8481_link_reset, .link_reset = bnx2x_8481_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver, .format_fw_ver = bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)bnx2x_8481_hw_reset, .hw_reset = bnx2x_8481_hw_reset,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, .set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)NULL .phy_specific_func = NULL
}; };
static const struct bnx2x_phy phy_84823 = { static const struct bnx2x_phy phy_84823 = {
...@@ -11999,14 +11984,14 @@ static const struct bnx2x_phy phy_84823 = { ...@@ -11999,14 +11984,14 @@ static const struct bnx2x_phy phy_84823 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_848x3_config_init, .config_init = bnx2x_848x3_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status, .read_status = bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_848x3_link_reset, .link_reset = bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver, .format_fw_ver = bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)NULL, .hw_reset = NULL,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, .set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func .phy_specific_func = bnx2x_848xx_specific_func
}; };
static const struct bnx2x_phy phy_84833 = { static const struct bnx2x_phy phy_84833 = {
...@@ -12034,14 +12019,14 @@ static const struct bnx2x_phy phy_84833 = { ...@@ -12034,14 +12019,14 @@ static const struct bnx2x_phy phy_84833 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_848x3_config_init, .config_init = bnx2x_848x3_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status, .read_status = bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_848x3_link_reset, .link_reset = bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver, .format_fw_ver = bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy, .hw_reset = bnx2x_84833_hw_reset_phy,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, .set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func .phy_specific_func = bnx2x_848xx_specific_func
}; };
static const struct bnx2x_phy phy_84834 = { static const struct bnx2x_phy phy_84834 = {
...@@ -12068,14 +12053,14 @@ static const struct bnx2x_phy phy_84834 = { ...@@ -12068,14 +12053,14 @@ static const struct bnx2x_phy phy_84834 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_848x3_config_init, .config_init = bnx2x_848x3_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status, .read_status = bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_848x3_link_reset, .link_reset = bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver, .format_fw_ver = bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy, .hw_reset = bnx2x_84833_hw_reset_phy,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, .set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func .phy_specific_func = bnx2x_848xx_specific_func
}; };
static const struct bnx2x_phy phy_84858 = { static const struct bnx2x_phy phy_84858 = {
...@@ -12102,14 +12087,14 @@ static const struct bnx2x_phy phy_84858 = { ...@@ -12102,14 +12087,14 @@ static const struct bnx2x_phy phy_84858 = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
.req_duplex = 0, .req_duplex = 0,
.rsrv = 0, .rsrv = 0,
.config_init = (config_init_t)bnx2x_848x3_config_init, .config_init = bnx2x_848x3_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status, .read_status = bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_848x3_link_reset, .link_reset = bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL, .config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_8485x_format_ver, .format_fw_ver = bnx2x_8485x_format_ver,
.hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy, .hw_reset = bnx2x_84833_hw_reset_phy,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led, .set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func .phy_specific_func = bnx2x_848xx_specific_func
}; };
static const struct bnx2x_phy phy_54618se = { static const struct bnx2x_phy phy_54618se = {
...@@ -12136,14 +12121,14 @@ static const struct bnx2x_phy phy_54618se = { ...@@ -12136,14 +12121,14 @@ static const struct bnx2x_phy phy_54618se = {
.speed_cap_mask = 0, .speed_cap_mask = 0,
/* req_duplex = */0, /* req_duplex = */0,
/* rsrv = */0, /* rsrv = */0,
.config_init = (config_init_t)bnx2x_54618se_config_init, .config_init = bnx2x_54618se_config_init,
.read_status = (read_status_t)bnx2x_54618se_read_status, .read_status = bnx2x_54618se_read_status,
.link_reset = (link_reset_t)bnx2x_54618se_link_reset, .link_reset = bnx2x_54618se_link_reset,
.config_loopback = (config_loopback_t)bnx2x_54618se_config_loopback, .config_loopback = bnx2x_54618se_config_loopback,
.format_fw_ver = (format_fw_ver_t)NULL, .format_fw_ver = NULL,
.hw_reset = (hw_reset_t)NULL, .hw_reset = NULL,
.set_link_led = (set_link_led_t)bnx2x_5461x_set_link_led, .set_link_led = bnx2x_5461x_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_54618se_specific_func .phy_specific_func = bnx2x_54618se_specific_func
}; };
/*****************************************************************/ /*****************************************************************/
/* */ /* */
......
...@@ -127,7 +127,7 @@ struct link_vars; ...@@ -127,7 +127,7 @@ struct link_vars;
struct link_params; struct link_params;
struct bnx2x_phy; struct bnx2x_phy;
typedef u8 (*config_init_t)(struct bnx2x_phy *phy, struct link_params *params, typedef void (*config_init_t)(struct bnx2x_phy *phy, struct link_params *params,
struct link_vars *vars); struct link_vars *vars);
typedef u8 (*read_status_t)(struct bnx2x_phy *phy, struct link_params *params, typedef u8 (*read_status_t)(struct bnx2x_phy *phy, struct link_params *params,
struct link_vars *vars); struct link_vars *vars);
...@@ -135,7 +135,7 @@ typedef void (*link_reset_t)(struct bnx2x_phy *phy, ...@@ -135,7 +135,7 @@ typedef void (*link_reset_t)(struct bnx2x_phy *phy,
struct link_params *params); struct link_params *params);
typedef void (*config_loopback_t)(struct bnx2x_phy *phy, typedef void (*config_loopback_t)(struct bnx2x_phy *phy,
struct link_params *params); struct link_params *params);
typedef u8 (*format_fw_ver_t)(u32 raw, u8 *str, u16 *len); typedef int (*format_fw_ver_t)(u32 raw, u8 *str, u16 *len);
typedef void (*hw_reset_t)(struct bnx2x_phy *phy, struct link_params *params); typedef void (*hw_reset_t)(struct bnx2x_phy *phy, struct link_params *params);
typedef void (*set_link_led_t)(struct bnx2x_phy *phy, typedef void (*set_link_led_t)(struct bnx2x_phy *phy,
struct link_params *params, u8 mode); struct link_params *params, u8 mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment