Commit 85691efd authored by Vikram Narayanan's avatar Vikram Narayanan

lcd/ixgbe: Handle mdio45_probe inside LCD

mdio45_probe calls the read callback multiple times. So handle it inside the
LCD.
Signed-off-by: Vikram Narayanan's avatarVikram Narayanan <vikram186@gmail.com>
parent 607f74c1
......@@ -305,6 +305,33 @@ s32 ixgbe_write_i2c_combined_generic_unlocked(struct ixgbe_hw *hw,
return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, false);
}
int _mdio45_probe(struct mdio_if_info *mdio, int prtad)
{
int mmd, stat2, devs1, devs2;
/* Assume PHY must have at least one of PMA/PMD, WIS, PCS, PHY
* XS or DTE XS; give up if none is present. */
for (mmd = 1; mmd <= 5; mmd++) {
/* Is this MMD present? */
stat2 = mdio->mdio_read(mdio->dev, prtad, mmd, MDIO_STAT2);
if (stat2 < 0 ||
(stat2 & MDIO_STAT2_DEVPRST) != MDIO_STAT2_DEVPRST_VAL)
continue;
/* It should tell us about all the other MMDs */
devs1 = mdio->mdio_read(mdio->dev, prtad, mmd, MDIO_DEVS1);
devs2 = mdio->mdio_read(mdio->dev, prtad, mmd, MDIO_DEVS2);
if (devs1 < 0 || devs2 < 0)
continue;
mdio->prtad = prtad;
mdio->mmds = devs1 | (devs2 << 16);
return 0;
}
return -ENODEV;
}
/**
* ixgbe_identify_phy_generic - Get physical layer module
* @hw: pointer to hardware structure
......@@ -326,11 +353,12 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
if (hw->phy.type == ixgbe_phy_unknown) {
for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) {
hw->phy.mdio.prtad = phy_addr;
if (mdio45_probe(&hw->phy.mdio, phy_addr) == 0) {
if (_mdio45_probe(&hw->phy.mdio, phy_addr) == 0) {
ixgbe_get_phy_id(hw);
hw->phy.type =
ixgbe_get_phy_type_from_id(hw->phy.id);
LIBLCD_MSG("%s, phy_type %d", __func__, hw->phy.type);
if (hw->phy.type == ixgbe_phy_unknown) {
hw->phy.ops.read_reg(hw,
MDIO_PMA_EXTABLE,
......
......@@ -31,7 +31,6 @@ int rtnl_is_locked(void) { LIBLCD_MSG("================>$$$$$$ Dummy %s called",
void synchronize_irq(unsigned int irq) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
int mdio45_probe(struct mdio_if_info *mdio, int prtad) { dump_stack(); LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); return 0; }
void napi_gro_flush(struct napi_struct *napi, bool flush_old) { LIBLCD_MSG("================>$$$$$$ Dummy %s called", __func__); }
......
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