include/linux/phylink.h
Source file repositories/reference/linux-study-clean/include/linux/phylink.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/phylink.h- Extension
.h- Size
- 33467 bytes
- Lines
- 846
- 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/phy.hlinux/spinlock.hlinux/workqueue.hnet/eee.h
Detected Declarations
struct device_nodestruct ethtool_cmdstruct fwnode_handlestruct net_devicestruct phylinkstruct phylink_link_statestruct phylink_configstruct phylink_mac_opsstruct phylink_pcs_opsstruct phylink_pcsstruct phylink_pcs_opsenum phylink_op_typefunction phylink_autoneg_inbandfunction phylink_get_link_timer_nsfunction phylink_mac_implements_lpi
Annotated Snippet
struct phylink_link_state {
__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising);
phy_interface_t interface;
int speed;
int duplex;
int pause;
int rate_matching;
unsigned int link:1;
unsigned int an_complete:1;
};
enum phylink_op_type {
PHYLINK_NETDEV = 0,
PHYLINK_DEV,
};
/**
* struct phylink_config - PHYLINK configuration structure
* @dev: a pointer to a struct device associated with the MAC
* @type: operation type of PHYLINK instance
* @poll_fixed_state: if true, starts link_poll,
* if MAC link is at %MLO_AN_FIXED mode.
* @mac_managed_pm: if true, indicate the MAC driver is responsible for PHY PM.
* @mac_requires_rxc: if true, the MAC always requires a receive clock from PHY.
* The PHY driver should start the clock signal as soon as
* possible and avoid stopping it during suspend events.
* @default_an_inband: if true, defaults to MLO_AN_INBAND rather than
* MLO_AN_PHY. A fixed-link specification will override.
* @eee_rx_clk_stop_enable: if true, PHY can stop the receive clock during LPI
* @get_fixed_state: callback to execute to determine the fixed link state,
* if MAC link is at %MLO_AN_FIXED mode.
* @supported_interfaces: bitmap describing which PHY_INTERFACE_MODE_xxx
* are supported by the MAC/PCS.
* @lpi_interfaces: bitmap describing which PHY interface modes can support
* LPI signalling.
* @mac_capabilities: MAC pause/speed/duplex capabilities.
* @lpi_capabilities: MAC speeds which can support LPI signalling
* @lpi_timer_default: Default EEE LPI timer setting.
* @eee_enabled_default: If set, EEE will be enabled by phylink at creation time
* @wol_phy_legacy: Use Wake-on-Lan with PHY even if phy_can_wakeup() is false
* @wol_phy_speed_ctrl: Use phy speed control on suspend/resume
* @wol_mac_support: Bitmask of MAC supported %WAKE_* options
*/
struct phylink_config {
struct device *dev;
enum phylink_op_type type;
bool poll_fixed_state;
bool mac_managed_pm;
bool mac_requires_rxc;
bool default_an_inband;
bool eee_rx_clk_stop_enable;
void (*get_fixed_state)(struct phylink_config *config,
struct phylink_link_state *state);
DECLARE_PHY_INTERFACE_MASK(supported_interfaces);
DECLARE_PHY_INTERFACE_MASK(lpi_interfaces);
unsigned long mac_capabilities;
unsigned long lpi_capabilities;
u32 lpi_timer_default;
bool eee_enabled_default;
/* Wake-on-Lan support */
bool wol_phy_legacy;
bool wol_phy_speed_ctrl;
u32 wol_mac_support;
};
void phylink_limit_mac_speed(struct phylink_config *config, u32 max_speed);
/**
* struct phylink_mac_ops - MAC operations structure.
* @mac_get_caps: Get MAC capabilities for interface mode.
* @mac_select_pcs: Select a PCS for the interface mode.
* @mac_prepare: prepare for a major reconfiguration of the interface.
* @mac_config: configure the MAC for the selected mode and state.
* @mac_finish: finish a major reconfiguration of the interface.
* @mac_link_down: take the link down.
* @mac_link_up: allow the link to come up.
* @mac_disable_tx_lpi: disable LPI.
* @mac_enable_tx_lpi: enable and configure LPI.
* @mac_wol_set: configure Wake-on-Lan settings at the MAC.
*
* The individual methods are described more fully below.
*/
struct phylink_mac_ops {
unsigned long (*mac_get_caps)(struct phylink_config *config,
phy_interface_t interface);
struct phylink_pcs *(*mac_select_pcs)(struct phylink_config *config,
phy_interface_t interface);
int (*mac_prepare)(struct phylink_config *config, unsigned int mode,
Annotation
- Immediate include surface: `linux/phy.h`, `linux/spinlock.h`, `linux/workqueue.h`, `net/eee.h`.
- Detected declarations: `struct device_node`, `struct ethtool_cmd`, `struct fwnode_handle`, `struct net_device`, `struct phylink`, `struct phylink_link_state`, `struct phylink_config`, `struct phylink_mac_ops`, `struct phylink_pcs_ops`, `struct phylink_pcs`.
- 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.