Commit 659bc5c4 authored by Eilon Greenstein's avatar Eilon Greenstein Committed by David S. Miller

bnx2x: Using macro for phy address

Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ef70b9c
This diff is collapsed.
...@@ -88,10 +88,14 @@ struct link_params { ...@@ -88,10 +88,14 @@ struct link_params {
u32 lane_config; u32 lane_config;
u32 ext_phy_config; u32 ext_phy_config;
#define XGXS_EXT_PHY_TYPE(ext_phy_config) (ext_phy_config & \ #define XGXS_EXT_PHY_TYPE(ext_phy_config) \
PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) ((ext_phy_config) & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK)
#define SERDES_EXT_PHY_TYPE(ext_phy_config) (ext_phy_config & \ #define XGXS_EXT_PHY_ADDR(ext_phy_config) \
PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK) (((ext_phy_config) & PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> \
PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT)
#define SERDES_EXT_PHY_TYPE(ext_phy_config) \
((ext_phy_config) & PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK)
/* Phy register parameter */ /* Phy register parameter */
u32 chip_id; u32 chip_id;
......
...@@ -8546,9 +8546,7 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) ...@@ -8546,9 +8546,7 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp)
else if ((ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE) && else if ((ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE) &&
(ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) (ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN))
bp->mdio.prtad = bp->mdio.prtad =
(bp->link_params.ext_phy_config & XGXS_EXT_PHY_ADDR(bp->link_params.ext_phy_config);
PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >>
PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT;
val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_upper); val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_upper);
val = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_lower); val = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_lower);
...@@ -9549,9 +9547,7 @@ static int bnx2x_set_eeprom(struct net_device *dev, ...@@ -9549,9 +9547,7 @@ static int bnx2x_set_eeprom(struct net_device *dev,
if (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config) == if (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config) ==
PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101) { PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101) {
u8 ext_phy_addr = u8 ext_phy_addr =
(bp->link_params.ext_phy_config & XGXS_EXT_PHY_ADDR(bp->link_params.ext_phy_config);
PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >>
PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT;
/* DSP Remove Download Mode */ /* DSP Remove Download Mode */
bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_0, bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_0,
......
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