History

net: phy: add genphy_c45_read_status

Similar to genphy_read_status() for Clause 22 add a generic read_status function for Clause 45.

Heiner Kallweit committed 7 years ago

Commit 70fa3a91 parent 3b845d82 files · +34 −0Browse files

Unified · Split

2 files
  1. drivers/net/phy/phy-c45.c +33 −0
  2. include/linux/phy.h +1 −0
drivers/net/phy/phy-c45.c+33−0
@@ -454,6 +454,39 @@ int genphy_c45_pma_read_abilities(struct phy_device *phydev) · 453 unmodified lines
454}454}
455EXPORT_SYMBOL_GPL(genphy_c45_pma_read_abilities);455EXPORT_SYMBOL_GPL(genphy_c45_pma_read_abilities);
456 456
457/**
458 * genphy_c45_read_status - read PHY status
459 * @phydev: target phy_device struct
460 *
461 * Reads status from PHY and sets phy_device members accordingly.
462 */
463int genphy_c45_read_status(struct phy_device *phydev)
464{
465 int ret;
466
467 ret = genphy_c45_read_link(phydev);
468 if (ret)
469 return ret;
470
471 phydev->speed = SPEED_UNKNOWN;
472 phydev->duplex = DUPLEX_UNKNOWN;
473 phydev->pause = 0;
474 phydev->asym_pause = 0;
475
476 if (phydev->autoneg == AUTONEG_ENABLE) {
477 ret = genphy_c45_read_lpa(phydev);
478 if (ret)
479 return ret;
480
481 phy_resolve_aneg_linkmode(phydev);
482 } else {
483 ret = genphy_c45_read_pma(phydev);
484 }
485
486 return ret;
487}
488EXPORT_SYMBOL_GPL(genphy_c45_read_status);
489
457/* The gen10g_* functions are the old Clause 45 stub */490/* The gen10g_* functions are the old Clause 45 stub */
458 491
459int gen10g_config_aneg(struct phy_device *phydev)492int gen10g_config_aneg(struct phy_device *phydev)
include/linux/phy.h+1−0
@@ -1107,6 +1107,7 @@ int genphy_c45_an_config_aneg(struct phy_device *phydev); · 1106 unmodified lines
1107int genphy_c45_an_disable_aneg(struct phy_device *phydev);1107int genphy_c45_an_disable_aneg(struct phy_device *phydev);
1108int genphy_c45_read_mdix(struct phy_device *phydev);1108int genphy_c45_read_mdix(struct phy_device *phydev);
1109int genphy_c45_pma_read_abilities(struct phy_device *phydev);1109int genphy_c45_pma_read_abilities(struct phy_device *phydev);
1110int genphy_c45_read_status(struct phy_device *phydev);
1110 1111
1111/* The gen10g_* functions are the old Clause 45 stub */1112/* The gen10g_* functions are the old Clause 45 stub */
1112int gen10g_config_aneg(struct phy_device *phydev);1113int gen10g_config_aneg(struct phy_device *phydev);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t