aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x/bnx2x_ethtool.c
diff options
context:
space:
mode:
authorYaniv Rosner <yaniv.rosner@broadcom.com>2010-09-07 07:40:50 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-07 16:11:53 -0400
commite10bc84d0e96adff7569161e7d825074a119be36 (patch)
tree7a0d1903277f01d0d0dbf41f44261ad413d913c9 /drivers/net/bnx2x/bnx2x_ethtool.c
parentdb40980fcdb560d7992b0511df16cdd3f7e381f3 (diff)
bnx2x: Unify PHY attributes
Start building the infrastructure for dual media by adding new component of PHY which will be used all along the function. Modify function to work with this component instead of the link_params. 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/bnx2x/bnx2x_ethtool.c')
-rw-r--r--drivers/net/bnx2x/bnx2x_ethtool.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index 8b75b05e34c5..2c7e0ab6ccf8 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -811,7 +811,7 @@ static int bnx2x_set_eeprom(struct net_device *dev,
811 struct bnx2x *bp = netdev_priv(dev); 811 struct bnx2x *bp = netdev_priv(dev);
812 int port = BP_PORT(bp); 812 int port = BP_PORT(bp);
813 int rc = 0; 813 int rc = 0;
814 814 u32 ext_phy_config;
815 if (!netif_running(dev)) 815 if (!netif_running(dev))
816 return -EAGAIN; 816 return -EAGAIN;
817 817
@@ -827,6 +827,10 @@ static int bnx2x_set_eeprom(struct net_device *dev,
827 !bp->port.pmf) 827 !bp->port.pmf)
828 return -EINVAL; 828 return -EINVAL;
829 829
830 ext_phy_config =
831 SHMEM_RD(bp,
832 dev_info.port_hw_config[port].external_phy_config);
833
830 if (eeprom->magic == 0x50485950) { 834 if (eeprom->magic == 0x50485950) {
831 /* 'PHYP' (0x50485950): prepare phy for FW upgrade */ 835 /* 'PHYP' (0x50485950): prepare phy for FW upgrade */
832 bnx2x_stats_handle(bp, STATS_EVENT_STOP); 836 bnx2x_stats_handle(bp, STATS_EVENT_STOP);
@@ -834,7 +838,7 @@ static int bnx2x_set_eeprom(struct net_device *dev,
834 bnx2x_acquire_phy_lock(bp); 838 bnx2x_acquire_phy_lock(bp);
835 rc |= bnx2x_link_reset(&bp->link_params, 839 rc |= bnx2x_link_reset(&bp->link_params,
836 &bp->link_vars, 0); 840 &bp->link_vars, 0);
837 if (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config) == 841 if (XGXS_EXT_PHY_TYPE(ext_phy_config) ==
838 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101) 842 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101)
839 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_0, 843 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_0,
840 MISC_REGISTERS_GPIO_HIGH, port); 844 MISC_REGISTERS_GPIO_HIGH, port);
@@ -855,10 +859,8 @@ static int bnx2x_set_eeprom(struct net_device *dev,
855 } 859 }
856 } else if (eeprom->magic == 0x53985943) { 860 } else if (eeprom->magic == 0x53985943) {
857 /* 'PHYC' (0x53985943): PHY FW upgrade completed */ 861 /* 'PHYC' (0x53985943): PHY FW upgrade completed */
858 if (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config) == 862 if (XGXS_EXT_PHY_TYPE(ext_phy_config) ==
859 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101) { 863 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101) {
860 u8 ext_phy_addr =
861 XGXS_EXT_PHY_ADDR(bp->link_params.ext_phy_config);
862 864
863 /* DSP Remove Download Mode */ 865 /* DSP Remove Download Mode */
864 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_0, 866 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_0,
@@ -866,7 +868,8 @@ static int bnx2x_set_eeprom(struct net_device *dev,
866 868
867 bnx2x_acquire_phy_lock(bp); 869 bnx2x_acquire_phy_lock(bp);
868 870
869 bnx2x_sfx7101_sp_sw_reset(bp, port, ext_phy_addr); 871 bnx2x_sfx7101_sp_sw_reset(bp,
872 &bp->link_params.phy[EXT_PHY1]);
870 873
871 /* wait 0.5 sec to allow it to run */ 874 /* wait 0.5 sec to allow it to run */
872 msleep(500); 875 msleep(500);