@@ -456,7 +456,16 @@ int phy_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
456456}
457457EXPORT_SYMBOL (phy_do_ioctl );
458458
459- /* same as phy_do_ioctl, but ensures that net_device is running */
459+ /**
460+ * phy_do_ioctl_running - generic ndo_do_ioctl implementation but test first
461+ *
462+ * @dev: the net_device struct
463+ * @ifr: &struct ifreq for socket ioctl's
464+ * @cmd: ioctl cmd to execute
465+ *
466+ * Same as phy_do_ioctl, but ensures that net_device is running before
467+ * handling the ioctl.
468+ */
460469int phy_do_ioctl_running (struct net_device * dev , struct ifreq * ifr , int cmd )
461470{
462471 if (!netif_running (dev ))
@@ -466,13 +475,24 @@ int phy_do_ioctl_running(struct net_device *dev, struct ifreq *ifr, int cmd)
466475}
467476EXPORT_SYMBOL (phy_do_ioctl_running );
468477
478+ /**
479+ * phy_queue_state_machine - Trigger the state machine to run soon
480+ *
481+ * @phydev: the phy_device struct
482+ * @jiffies: Run the state machine after these jiffies
483+ */
469484void phy_queue_state_machine (struct phy_device * phydev , unsigned long jiffies )
470485{
471486 mod_delayed_work (system_power_efficient_wq , & phydev -> state_queue ,
472487 jiffies );
473488}
474489EXPORT_SYMBOL (phy_queue_state_machine );
475490
491+ /**
492+ * phy_queue_state_machine - Trigger the state machine to run now
493+ *
494+ * @phydev: the phy_device struct
495+ */
476496static void phy_trigger_machine (struct phy_device * phydev )
477497{
478498 phy_queue_state_machine (phydev , 0 );
@@ -489,6 +509,12 @@ static void phy_abort_cable_test(struct phy_device *phydev)
489509 phydev_err (phydev , "Error while aborting cable test" );
490510}
491511
512+ /**
513+ * phy_ethtool_get_strings - Get the statistic counter names
514+ *
515+ * @phydev: the phy_device struct
516+ * @data: Where to put the strings
517+ */
492518int phy_ethtool_get_strings (struct phy_device * phydev , u8 * data )
493519{
494520 if (!phydev -> drv )
@@ -502,6 +528,11 @@ int phy_ethtool_get_strings(struct phy_device *phydev, u8 *data)
502528}
503529EXPORT_SYMBOL (phy_ethtool_get_strings );
504530
531+ /**
532+ * phy_ethtool_get_sset_count - Get the number of statistic counters
533+ *
534+ * @phydev: the phy_device struct
535+ */
505536int phy_ethtool_get_sset_count (struct phy_device * phydev )
506537{
507538 int ret ;
@@ -523,6 +554,13 @@ int phy_ethtool_get_sset_count(struct phy_device *phydev)
523554}
524555EXPORT_SYMBOL (phy_ethtool_get_sset_count );
525556
557+ /**
558+ * phy_ethtool_get_stats - Get the statistic counters
559+ *
560+ * @phydev: the phy_device struct
561+ * @stats: What counters to get
562+ * @data: Where to store the counters
563+ */
526564int phy_ethtool_get_stats (struct phy_device * phydev ,
527565 struct ethtool_stats * stats , u64 * data )
528566{
@@ -537,6 +575,12 @@ int phy_ethtool_get_stats(struct phy_device *phydev,
537575}
538576EXPORT_SYMBOL (phy_ethtool_get_stats );
539577
578+ /**
579+ * phy_start_cable_test - Start a cable test
580+ *
581+ * @phydev: the phy_device struct
582+ * @extack: extack for reporting useful error messages
583+ */
540584int phy_start_cable_test (struct phy_device * phydev ,
541585 struct netlink_ext_ack * extack )
542586{
@@ -600,6 +644,13 @@ int phy_start_cable_test(struct phy_device *phydev,
600644}
601645EXPORT_SYMBOL (phy_start_cable_test );
602646
647+ /**
648+ * phy_start_cable_test_tdr - Start a raw TDR cable test
649+ *
650+ * @phydev: the phy_device struct
651+ * @extack: extack for reporting useful error messages
652+ * @config: Configuration of the test to run
653+ */
603654int phy_start_cable_test_tdr (struct phy_device * phydev ,
604655 struct netlink_ext_ack * extack ,
605656 const struct phy_tdr_config * config )
@@ -1363,6 +1414,12 @@ int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data)
13631414}
13641415EXPORT_SYMBOL (phy_ethtool_set_eee );
13651416
1417+ /**
1418+ * phy_ethtool_set_wol - Configure Wake On LAN
1419+ *
1420+ * @phydev: target phy_device struct
1421+ * @wol: Configuration requested
1422+ */
13661423int phy_ethtool_set_wol (struct phy_device * phydev , struct ethtool_wolinfo * wol )
13671424{
13681425 if (phydev -> drv && phydev -> drv -> set_wol )
@@ -1372,6 +1429,12 @@ int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol)
13721429}
13731430EXPORT_SYMBOL (phy_ethtool_set_wol );
13741431
1432+ /**
1433+ * phy_ethtool_get_wol - Get the current Wake On LAN configuration
1434+ *
1435+ * @phydev: target phy_device struct
1436+ * @wol: Store the current configuration here
1437+ */
13751438void phy_ethtool_get_wol (struct phy_device * phydev , struct ethtool_wolinfo * wol )
13761439{
13771440 if (phydev -> drv && phydev -> drv -> get_wol )
@@ -1405,6 +1468,10 @@ int phy_ethtool_set_link_ksettings(struct net_device *ndev,
14051468}
14061469EXPORT_SYMBOL (phy_ethtool_set_link_ksettings );
14071470
1471+ /**
1472+ * phy_ethtool_nway_reset - Restart auto negotiation
1473+ * @ndev: Network device to restart autoneg for
1474+ */
14081475int phy_ethtool_nway_reset (struct net_device * ndev )
14091476{
14101477 struct phy_device * phydev = ndev -> phydev ;
0 commit comments