Documentation/networking/sfp-phylink.rst
Source file repositories/reference/linux-study-clean/Documentation/networking/sfp-phylink.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/networking/sfp-phylink.rst- Extension
.rst- Size
- 14293 bytes
- Lines
- 406
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/phylink.h
Detected Declarations
function foo_ethtool_set_link_ksettingsfunction foo_ethtool_get_link_ksettings
Annotated Snippet
.. SPDX-License-Identifier: GPL-2.0
=======
phylink
=======
Overview
========
phylink is a mechanism to support hot-pluggable networking modules
directly connected to a MAC without needing to re-initialise the
adapter on hot-plug events.
phylink supports conventional phylib-based setups, fixed link setups
and SFP (Small Formfactor Pluggable) modules at present.
Modes of operation
==================
phylink has several modes of operation, which depend on the firmware
settings.
1. PHY mode
In PHY mode, we use phylib to read the current link settings from
the PHY, and pass them to the MAC driver. We expect the MAC driver
to configure exactly the modes that are specified without any
negotiation being enabled on the link.
2. Fixed mode
Fixed mode is the same as PHY mode as far as the MAC driver is
concerned.
3. In-band mode
In-band mode is used with 802.3z, SGMII and similar interface modes,
and we are expecting to use and honor the in-band negotiation or
control word sent across the serdes channel.
By example, what this means is that:
.. code-block:: none
ð {
phy = <&phy>;
phy-mode = "sgmii";
};
does not use in-band SGMII signalling. The PHY is expected to follow
exactly the settings given to it in its :c:func:`mac_config` function.
The link should be forced up or down appropriately in the
:c:func:`mac_link_up` and :c:func:`mac_link_down` functions.
.. code-block:: none
ð {
managed = "in-band-status";
phy = <&phy>;
phy-mode = "sgmii";
};
uses in-band mode, where results from the PHY's negotiation are passed
to the MAC through the SGMII control word, and the MAC is expected to
acknowledge the control word. The :c:func:`mac_link_up` and
:c:func:`mac_link_down` functions must not force the MAC side link
up and down.
Rough guide to converting a network driver to sfp/phylink
=========================================================
Annotation
- Immediate include surface: `linux/phylink.h`.
- Detected declarations: `function foo_ethtool_set_link_ksettings`, `function foo_ethtool_get_link_ksettings`.
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
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.