include/linux/phylib_stubs.h
Source file repositories/reference/linux-study-clean/include/linux/phylib_stubs.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/phylib_stubs.h- Extension
.h- Size
- 2700 bytes
- Lines
- 111
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/rtnetlink.h
Detected Declarations
struct ethtool_eth_phy_statsstruct ethtool_link_ext_statsstruct ethtool_phy_statsstruct kernel_hwtstamp_configstruct netlink_ext_ackstruct phy_devicestruct phylib_stubsfunction phy_hwtstamp_getfunction phy_hwtstamp_setfunction phy_ethtool_get_phy_statsfunction phy_ethtool_get_link_ext_statsfunction phy_hwtstamp_getfunction phy_hwtstamp_setfunction phy_ethtool_get_phy_stats
Annotated Snippet
struct phylib_stubs {
int (*hwtstamp_get)(struct phy_device *phydev,
struct kernel_hwtstamp_config *config);
int (*hwtstamp_set)(struct phy_device *phydev,
struct kernel_hwtstamp_config *config,
struct netlink_ext_ack *extack);
void (*get_phy_stats)(struct phy_device *phydev,
struct ethtool_eth_phy_stats *phy_stats,
struct ethtool_phy_stats *phydev_stats);
void (*get_link_ext_stats)(struct phy_device *phydev,
struct ethtool_link_ext_stats *link_stats);
};
static inline int phy_hwtstamp_get(struct phy_device *phydev,
struct kernel_hwtstamp_config *config)
{
/* phylib_register_stubs() and phylib_unregister_stubs()
* also run under rtnl_lock().
*/
ASSERT_RTNL();
if (!phylib_stubs)
return -EOPNOTSUPP;
return phylib_stubs->hwtstamp_get(phydev, config);
}
static inline int phy_hwtstamp_set(struct phy_device *phydev,
struct kernel_hwtstamp_config *config,
struct netlink_ext_ack *extack)
{
/* phylib_register_stubs() and phylib_unregister_stubs()
* also run under rtnl_lock().
*/
ASSERT_RTNL();
if (!phylib_stubs)
return -EOPNOTSUPP;
return phylib_stubs->hwtstamp_set(phydev, config, extack);
}
static inline void phy_ethtool_get_phy_stats(struct phy_device *phydev,
struct ethtool_eth_phy_stats *phy_stats,
struct ethtool_phy_stats *phydev_stats)
{
ASSERT_RTNL();
if (!phylib_stubs)
return;
phylib_stubs->get_phy_stats(phydev, phy_stats, phydev_stats);
}
static inline void phy_ethtool_get_link_ext_stats(struct phy_device *phydev,
struct ethtool_link_ext_stats *link_stats)
{
ASSERT_RTNL();
if (!phylib_stubs)
return;
phylib_stubs->get_link_ext_stats(phydev, link_stats);
}
#else
static inline int phy_hwtstamp_get(struct phy_device *phydev,
struct kernel_hwtstamp_config *config)
{
return -EOPNOTSUPP;
}
static inline int phy_hwtstamp_set(struct phy_device *phydev,
struct kernel_hwtstamp_config *config,
struct netlink_ext_ack *extack)
{
return -EOPNOTSUPP;
}
static inline void phy_ethtool_get_phy_stats(struct phy_device *phydev,
struct ethtool_eth_phy_stats *phy_stats,
struct ethtool_phy_stats *phydev_stats)
{
}
static inline void phy_ethtool_get_link_ext_stats(struct phy_device *phydev,
struct ethtool_link_ext_stats *link_stats)
{
}
Annotation
- Immediate include surface: `linux/rtnetlink.h`.
- Detected declarations: `struct ethtool_eth_phy_stats`, `struct ethtool_link_ext_stats`, `struct ethtool_phy_stats`, `struct kernel_hwtstamp_config`, `struct netlink_ext_ack`, `struct phy_device`, `struct phylib_stubs`, `function phy_hwtstamp_get`, `function phy_hwtstamp_set`, `function phy_ethtool_get_phy_stats`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.