€•Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ"/translations/zh_CN/networking/phy”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/zh_TW/networking/phy”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/it_IT/networking/phy”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ja_JP/networking/phy”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ko_KR/networking/phy”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/pt_BR/networking/phy”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/sp_SP/networking/phy”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒPHY Abstraction Layer”h]”hŒPHY Abstraction Layer”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œdev_flags prior to the call to phy_connect() such that the underlying PHY driver can check for flags and perform specific operations based on them. This is useful if the system has put hardware restrictions on the PHY/controller, of which the PHY needs to be aware.”h]”hX5PHY-specific flags should be set in phydev->dev_flags prior to the call to phy_connect() such that the underlying PHY driver can check for flags and perform specific operations based on them. This is useful if the system has put hardware restrictions on the PHY/controller, of which the PHY needs to be aware.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÅhjœh²hubhÝ)�”}”(hŒ×*interface* is a u32 which specifies the connection type used between the controller and the PHY. Examples are GMII, MII, RGMII, and SGMII. See "PHY interface mode" below. For a full list, see include/linux/phy.h”h]”(j)�”}”(hŒ *interface*”h]”hŒ interface”…”�”}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj-ubhŒÐ is a u32 which specifies the connection type used between the controller and the PHY. Examples are GMII, MII, RGMII, and SGMII. See “PHY interface modeâ€� below. For a full list, see include/linux/phy.h”…”�”}”(hj-h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KËhjœh²hubhÝ)�”}”(hXâNow just make sure that phydev->supported and phydev->advertising have any values pruned from them which don't make sense for your controller (a 10/100 controller may be connected to a gigabit capable PHY, so you would need to mask off SUPPORTED_1000baseT*). See include/linux/ethtool.h for definitions for these bitfields. Note that you should not SET any bits, except the SUPPORTED_Pause and SUPPORTED_AsymPause bits (see below), or the PHY may get put into an unsupported state.”h]”hXäNow just make sure that phydev->supported and phydev->advertising have any values pruned from them which don’t make sense for your controller (a 10/100 controller may be connected to a gigabit capable PHY, so you would need to mask off SUPPORTED_1000baseT*). See include/linux/ethtool.h for definitions for these bitfields. Note that you should not SET any bits, except the SUPPORTED_Pause and SUPPORTED_AsymPause bits (see below), or the PHY may get put into an unsupported state.”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÐhjœh²hubhÝ)�”}”(hXLastly, once the controller is ready to handle network traffic, you call phy_start(phydev). This tells the PAL that you are ready, and configures the PHY to connect to the network. If the MAC interrupt of your network driver also handles PHY status changes, just set phydev->irq to PHY_MAC_INTERRUPT before you call phy_start and use phy_mac_interrupt() from the network driver. If you don't want to use interrupts, set phydev->irq to PHY_POLL. phy_start() enables the PHY interrupts (if applicable) and starts the phylib state machine.”h]”hXLastly, once the controller is ready to handle network traffic, you call phy_start(phydev). This tells the PAL that you are ready, and configures the PHY to connect to the network. If the MAC interrupt of your network driver also handles PHY status changes, just set phydev->irq to PHY_MAC_INTERRUPT before you call phy_start and use phy_mac_interrupt() from the network driver. If you don’t want to use interrupts, set phydev->irq to PHY_POLL. phy_start() enables the PHY interrupts (if applicable) and starts the phylib state machine.”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KØhjœh²hubhÝ)�”}”(hŒ®When you want to disconnect from the network (even if just briefly), you call phy_stop(phydev). This function also stops the phylib state machine and disables PHY interrupts.”h]”hŒ®When you want to disconnect from the network (even if just briefly), you call phy_stop(phydev). This function also stops the phylib state machine and disables PHY interrupts.”…”�”}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Káhjœh²hubeh}”(h]”Œ/letting-the-phy-abstraction-layer-do-everything”ah ]”h"]”Œ/letting the phy abstraction layer do everything”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kªubh¶)�”}”(hhh]”(h»)�”}”(hŒPHY interface modes”h]”hŒPHY interface modes”…”�”}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj{h²hh³hÊh´KæubhÝ)�”}”(hX-The PHY interface mode supplied in the phy_connect() family of functions defines the initial operating mode of the PHY interface. This is not guaranteed to remain constant; there are PHYs which dynamically change their interface mode without software interaction depending on the negotiation results.”h]”hX-The PHY interface mode supplied in the phy_connect() family of functions defines the initial operating mode of the PHY interface. This is not guaranteed to remain constant; there are PHYs which dynamically change their interface mode without software interaction depending on the negotiation results.”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kèhj{h²hubhÝ)�”}”(hŒ0Some of the interface modes are described below:”h]”hŒ0Some of the interface modes are described below:”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kîhj{h²hubhŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hŒ¹``PHY_INTERFACE_MODE_SMII`` This is serial MII, clocked at 125MHz, supporting 100M and 10M speeds. Some details can be found in https://opencores.org/ocsvn/smii/smii/trunk/doc/SMII.pdf ”h]”(hŒterm”“”)�”}”(hŒ``PHY_INTERFACE_MODE_SMII``”h]”hŒliteral”“”)�”}”(hj·h]”hŒPHY_INTERFACE_MODE_SMII”…”�”}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hjµubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´Kóhj¯ubhŒ definition”“”)�”}”(hhh]”hÝ)�”}”(hŒœThis is serial MII, clocked at 125MHz, supporting 100M and 10M speeds. Some details can be found in https://opencores.org/ocsvn/smii/smii/trunk/doc/SMII.pdf”h]”(hŒdThis is serial MII, clocked at 125MHz, supporting 100M and 10M speeds. Some details can be found in ”…”�”}”(hjÓh²hh³Nh´NubhŒ reference”“”)�”}”(hŒ8https://opencores.org/ocsvn/smii/smii/trunk/doc/SMII.pdf”h]”hŒ8https://opencores.org/ocsvn/smii/smii/trunk/doc/SMII.pdf”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jßuh1jÛhjÓubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KñhjÐubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhj¯ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´Kóhjªubj®)�”}”(hX×``PHY_INTERFACE_MODE_1000BASEX`` This defines the 1000BASE-X single-lane serdes link as defined by the 802.3 standard section 36. The link operates at a fixed bit rate of 1.25Gbaud using a 10B/8B encoding scheme, resulting in an underlying data rate of 1Gbps. Embedded in the data stream is a 16-bit control word which is used to negotiate the duplex and pause modes with the remote end. This does not include "up-clocked" variants such as 2.5Gbps speeds (see below.) ”h]”(j´)�”}”(hŒ ``PHY_INTERFACE_MODE_1000BASEX``”h]”jº)�”}”(hjh]”hŒPHY_INTERFACE_MODE_1000BASEX”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´KühjþubjÏ)�”}”(hhh]”hÝ)�”}”(hXµThis defines the 1000BASE-X single-lane serdes link as defined by the 802.3 standard section 36. The link operates at a fixed bit rate of 1.25Gbaud using a 10B/8B encoding scheme, resulting in an underlying data rate of 1Gbps. Embedded in the data stream is a 16-bit control word which is used to negotiate the duplex and pause modes with the remote end. This does not include "up-clocked" variants such as 2.5Gbps speeds (see below.)”h]”hX¹This defines the 1000BASE-X single-lane serdes link as defined by the 802.3 standard section 36. The link operates at a fixed bit rate of 1.25Gbaud using a 10B/8B encoding scheme, resulting in an underlying data rate of 1Gbps. Embedded in the data stream is a 16-bit control word which is used to negotiate the duplex and pause modes with the remote end. This does not include “up-clockedâ€� variants such as 2.5Gbps speeds (see below.)”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Köhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhjþubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´Kühjªh²hubj®)�”}”(hŒ§``PHY_INTERFACE_MODE_2500BASEX`` This defines a variant of 1000BASE-X which is clocked 2.5 times as fast as the 802.3 standard, giving a fixed bit rate of 3.125Gbaud. ”h]”(j´)�”}”(hŒ ``PHY_INTERFACE_MODE_2500BASEX``”h]”jº)�”}”(hj<h]”hŒPHY_INTERFACE_MODE_2500BASEX”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´Mhj6ubjÏ)�”}”(hhh]”hÝ)�”}”(hŒ…This defines a variant of 1000BASE-X which is clocked 2.5 times as fast as the 802.3 standard, giving a fixed bit rate of 3.125Gbaud.”h]”hŒ…This defines a variant of 1000BASE-X which is clocked 2.5 times as fast as the 802.3 standard, giving a fixed bit rate of 3.125Gbaud.”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÿhjQubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhj6ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´Mhjªh²hubj®)�”}”(hXv``PHY_INTERFACE_MODE_SGMII`` This is used for Cisco SGMII, which is a modification of 1000BASE-X as defined by the 802.3 standard. The SGMII link consists of a single serdes lane running at a fixed bit rate of 1.25Gbaud with 10B/8B encoding. The underlying data rate is 1Gbps, with the slower speeds of 100Mbps and 10Mbps being achieved through replication of each data symbol. The 802.3 control word is re-purposed to send the negotiated speed and duplex information from to the MAC, and for the MAC to acknowledge receipt. This does not include "up-clocked" variants such as 2.5Gbps speeds. Note: mismatched SGMII vs 1000BASE-X configuration on a link can successfully pass data in some circumstances, but the 16-bit control word will not be correctly interpreted, which may cause mismatches in duplex, pause or other settings. This is dependent on the MAC and/or PHY behaviour. ”h]”(j´)�”}”(hŒ``PHY_INTERFACE_MODE_SGMII``”h]”jº)�”}”(hjth]”hŒPHY_INTERFACE_MODE_SGMII”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hjrubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´MhjnubjÏ)�”}”(hhh]”(hÝ)�”}”(hX6This is used for Cisco SGMII, which is a modification of 1000BASE-X as defined by the 802.3 standard. The SGMII link consists of a single serdes lane running at a fixed bit rate of 1.25Gbaud with 10B/8B encoding. The underlying data rate is 1Gbps, with the slower speeds of 100Mbps and 10Mbps being achieved through replication of each data symbol. The 802.3 control word is re-purposed to send the negotiated speed and duplex information from to the MAC, and for the MAC to acknowledge receipt. This does not include "up-clocked" variants such as 2.5Gbps speeds.”h]”hX:This is used for Cisco SGMII, which is a modification of 1000BASE-X as defined by the 802.3 standard. The SGMII link consists of a single serdes lane running at a fixed bit rate of 1.25Gbaud with 10B/8B encoding. The underlying data rate is 1Gbps, with the slower speeds of 100Mbps and 10Mbps being achieved through replication of each data symbol. The 802.3 control word is re-purposed to send the negotiated speed and duplex information from to the MAC, and for the MAC to acknowledge receipt. This does not include “up-clockedâ€� variants such as 2.5Gbps speeds.”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhj‰ubhÝ)�”}”(hX Note: mismatched SGMII vs 1000BASE-X configuration on a link can successfully pass data in some circumstances, but the 16-bit control word will not be correctly interpreted, which may cause mismatches in duplex, pause or other settings. This is dependent on the MAC and/or PHY behaviour.”h]”hX Note: mismatched SGMII vs 1000BASE-X configuration on a link can successfully pass data in some circumstances, but the 16-bit control word will not be correctly interpreted, which may cause mismatches in duplex, pause or other settings. This is dependent on the MAC and/or PHY behaviour.”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hj‰ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎhjnubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´Mhjªh²hubj®)�”}”(hX ``PHY_INTERFACE_MODE_5GBASER`` This is the IEEE 802.3 Clause 129 defined 5GBASE-R protocol. It is identical to the 10GBASE-R protocol defined in Clause 49, with the exception that it operates at half the frequency. Please refer to the IEEE standard for the definition. ”h]”(j´)�”}”(hŒ``PHY_INTERFACE_MODE_5GBASER``”h]”jº)�”}”(hjºh]”hŒPHY_INTERFACE_MODE_5GBASER”…”�”}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hj¸ubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´Mhj´ubjÏ)�”}”(hhh]”hÝ)�”}”(hŒíThis is the IEEE 802.3 Clause 129 defined 5GBASE-R protocol. It is identical to the 10GBASE-R protocol defined in Clause 49, with the exception that it operates at half the frequency. Please refer to the IEEE standard for the definition.”h]”hŒíThis is the IEEE 802.3 Clause 129 defined 5GBASE-R protocol. It is identical to the 10GBASE-R protocol defined in Clause 49, with the exception that it operates at half the frequency. Please refer to the IEEE standard for the definition.”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjÏubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhj´ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´Mhjªh²hubj®)�”}”(hX``PHY_INTERFACE_MODE_10GBASER`` This is the IEEE 802.3 Clause 49 defined 10GBASE-R protocol used with various different mediums. Please refer to the IEEE standard for a definition of this. Note: 10GBASE-R is just one protocol that can be used with XFI and SFI. XFI and SFI permit multiple protocols over a single SERDES lane, and also defines the electrical characteristics of the signals with a host compliance board plugged into the host XFP/SFP connector. Therefore, XFI and SFI are not PHY interface types in their own right. ”h]”(j´)�”}”(hŒ``PHY_INTERFACE_MODE_10GBASER``”h]”jº)�”}”(hjòh]”hŒPHY_INTERFACE_MODE_10GBASER”…”�”}”(hjôh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hjðubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´M"hjìubjÏ)�”}”(hhh]”(hÝ)�”}”(hŒœThis is the IEEE 802.3 Clause 49 defined 10GBASE-R protocol used with various different mediums. Please refer to the IEEE standard for a definition of this.”h]”hŒœThis is the IEEE 802.3 Clause 49 defined 10GBASE-R protocol used with various different mediums. Please refer to the IEEE standard for a definition of this.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjubhÝ)�”}”(hXTNote: 10GBASE-R is just one protocol that can be used with XFI and SFI. XFI and SFI permit multiple protocols over a single SERDES lane, and also defines the electrical characteristics of the signals with a host compliance board plugged into the host XFP/SFP connector. Therefore, XFI and SFI are not PHY interface types in their own right.”h]”hXTNote: 10GBASE-R is just one protocol that can be used with XFI and SFI. XFI and SFI permit multiple protocols over a single SERDES lane, and also defines the electrical characteristics of the signals with a host compliance board plugged into the host XFP/SFP connector. Therefore, XFI and SFI are not PHY interface types in their own right.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎhjìubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´M"hjªh²hubj®)�”}”(hX``PHY_INTERFACE_MODE_10GKR`` This is the IEEE 802.3 Clause 49 defined 10GBASE-R with Clause 73 autonegotiation. Please refer to the IEEE standard for further information. Note: due to legacy usage, some 10GBASE-R usage incorrectly makes use of this definition. ”h]”(j´)�”}”(hŒ``PHY_INTERFACE_MODE_10GKR``”h]”jº)�”}”(hj8h]”hŒPHY_INTERFACE_MODE_10GKR”…”�”}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hj6ubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´M*hj2ubjÏ)�”}”(hhh]”(hÝ)�”}”(hŒ�This is the IEEE 802.3 Clause 49 defined 10GBASE-R with Clause 73 autonegotiation. Please refer to the IEEE standard for further information.”h]”hŒ�This is the IEEE 802.3 Clause 49 defined 10GBASE-R with Clause 73 autonegotiation. Please refer to the IEEE standard for further information.”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M%hjMubhÝ)�”}”(hŒYNote: due to legacy usage, some 10GBASE-R usage incorrectly makes use of this definition.”h]”hŒYNote: due to legacy usage, some 10GBASE-R usage incorrectly makes use of this definition.”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M)hjMubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÎhj2ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´M*hjªh²hubj®)�”}”(hX``PHY_INTERFACE_MODE_25GBASER`` This is the IEEE 802.3 PCS Clause 107 defined 25GBASE-R protocol. The PCS is identical to 10GBASE-R, i.e. 64B/66B encoded running 2.5 as fast, giving a fixed bit rate of 25.78125 Gbaud. Please refer to the IEEE standard for further information. ”h]”(j´)�”}”(hŒ``PHY_INTERFACE_MODE_25GBASER``”h]”jº)�”}”(hj~h]”hŒPHY_INTERFACE_MODE_25GBASER”…”�”}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´M0hjxubjÏ)�”}”(hhh]”hÝ)�”}”(hŒôThis is the IEEE 802.3 PCS Clause 107 defined 25GBASE-R protocol. The PCS is identical to 10GBASE-R, i.e. 64B/66B encoded running 2.5 as fast, giving a fixed bit rate of 25.78125 Gbaud. Please refer to the IEEE standard for further information.”h]”hŒôThis is the IEEE 802.3 PCS Clause 107 defined 25GBASE-R protocol. The PCS is identical to 10GBASE-R, i.e. 64B/66B encoded running 2.5 as fast, giving a fixed bit rate of 25.78125 Gbaud. Please refer to the IEEE standard for further information.”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M-hj“ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhjxubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´M0hjªh²hubj®)�”}”(hŒÆ``PHY_INTERFACE_MODE_100BASEX`` This defines IEEE 802.3 Clause 24. The link operates at a fixed data rate of 125Mpbs using a 4B/5B encoding scheme, resulting in an underlying data rate of 100Mpbs. ”h]”(j´)�”}”(hŒ``PHY_INTERFACE_MODE_100BASEX``”h]”jº)�”}”(hj¶h]”hŒPHY_INTERFACE_MODE_100BASEX”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hj´ubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´M5hj°ubjÏ)�”}”(hhh]”hÝ)�”}”(hŒ¥This defines IEEE 802.3 Clause 24. The link operates at a fixed data rate of 125Mpbs using a 4B/5B encoding scheme, resulting in an underlying data rate of 100Mpbs.”h]”hŒ¥This defines IEEE 802.3 Clause 24. The link operates at a fixed data rate of 125Mpbs using a 4B/5B encoding scheme, resulting in an underlying data rate of 100Mpbs.”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M3hjËubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhj°ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´M5hjªh²hubj®)�”}”(hX``PHY_INTERFACE_MODE_QUSGMII`` This defines the Cisco the Quad USGMII mode, which is the Quad variant of the USGMII (Universal SGMII) link. It's very similar to QSGMII, but uses a Packet Control Header (PCH) instead of the 7 bytes preamble to carry not only the port id, but also so-called "extensions". The only documented extension so-far in the specification is the inclusion of timestamps, for PTP-enabled PHYs. This mode isn't compatible with QSGMII, but offers the same capabilities in terms of link speed and negotiation. ”h]”(j´)�”}”(hŒ``PHY_INTERFACE_MODE_QUSGMII``”h]”jº)�”}”(hjîh]”hŒPHY_INTERFACE_MODE_QUSGMII”…”�”}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hjìubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´M>hjèubjÏ)�”}”(hhh]”hÝ)�”}”(hXñThis defines the Cisco the Quad USGMII mode, which is the Quad variant of the USGMII (Universal SGMII) link. It's very similar to QSGMII, but uses a Packet Control Header (PCH) instead of the 7 bytes preamble to carry not only the port id, but also so-called "extensions". The only documented extension so-far in the specification is the inclusion of timestamps, for PTP-enabled PHYs. This mode isn't compatible with QSGMII, but offers the same capabilities in terms of link speed and negotiation.”h]”hXùThis defines the Cisco the Quad USGMII mode, which is the Quad variant of the USGMII (Universal SGMII) link. It’s very similar to QSGMII, but uses a Packet Control Header (PCH) instead of the 7 bytes preamble to carry not only the port id, but also so-called “extensionsâ€�. The only documented extension so-far in the specification is the inclusion of timestamps, for PTP-enabled PHYs. This mode isn’t compatible with QSGMII, but offers the same capabilities in terms of link speed and negotiation.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M8hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhjèubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´M>hjªh²hubj®)�”}”(hXC``PHY_INTERFACE_MODE_1000BASEKX`` This is 1000BASE-X as defined by IEEE 802.3 Clause 36 with Clause 73 autonegotiation. Generally, it will be used with a Clause 70 PMD. To contrast with the 1000BASE-X phy mode used for Clause 38 and 39 PMDs, this interface mode has different autonegotiation and only supports full duplex. ”h]”(j´)�”}”(hŒ!``PHY_INTERFACE_MODE_1000BASEKX``”h]”jº)�”}”(hj&h]”hŒPHY_INTERFACE_MODE_1000BASEKX”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hj$ubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´MDhj ubjÏ)�”}”(hhh]”hÝ)�”}”(hX This is 1000BASE-X as defined by IEEE 802.3 Clause 36 with Clause 73 autonegotiation. Generally, it will be used with a Clause 70 PMD. To contrast with the 1000BASE-X phy mode used for Clause 38 and 39 PMDs, this interface mode has different autonegotiation and only supports full duplex.”h]”hX This is 1000BASE-X as defined by IEEE 802.3 Clause 36 with Clause 73 autonegotiation. Generally, it will be used with a Clause 70 PMD. To contrast with the 1000BASE-X phy mode used for Clause 38 and 39 PMDs, this interface mode has different autonegotiation and only supports full duplex.”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MAhj;ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´MDhjªh²hubj®)�”}”(hŒž``PHY_INTERFACE_MODE_PSGMII`` This is the Penta SGMII mode, it is similar to QSGMII but it combines 5 SGMII lines into a single link compared to 4 on QSGMII. ”h]”(j´)�”}”(hŒ``PHY_INTERFACE_MODE_PSGMII``”h]”jº)�”}”(hj^h]”hŒPHY_INTERFACE_MODE_PSGMII”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hj\ubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´MHhjXubjÏ)�”}”(hhh]”hÝ)�”}”(hŒThis is the Penta SGMII mode, it is similar to QSGMII but it combines 5 SGMII lines into a single link compared to 4 on QSGMII.”h]”hŒThis is the Penta SGMII mode, it is similar to QSGMII but it combines 5 SGMII lines into a single link compared to 4 on QSGMII.”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MGhjsubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhjXubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´MHhjªh²hubj®)�”}”(hXN``PHY_INTERFACE_MODE_10G_QXGMII`` Represents the 10G-QXGMII PHY-MAC interface as defined by the Cisco USXGMII Multiport Copper Interface document. It supports 4 ports over a 10.3125 GHz SerDes lane, each port having speeds of 2.5G / 1G / 100M / 10M achieved through symbol replication. The PCS expects the standard USXGMII code word. ”h]”(j´)�”}”(hŒ!``PHY_INTERFACE_MODE_10G_QXGMII``”h]”jº)�”}”(hj–h]”hŒPHY_INTERFACE_MODE_10G_QXGMII”…”�”}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hj”ubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´MNhj�ubjÏ)�”}”(hhh]”hÝ)�”}”(hX+Represents the 10G-QXGMII PHY-MAC interface as defined by the Cisco USXGMII Multiport Copper Interface document. It supports 4 ports over a 10.3125 GHz SerDes lane, each port having speeds of 2.5G / 1G / 100M / 10M achieved through symbol replication. The PCS expects the standard USXGMII code word.”h]”hX+Represents the 10G-QXGMII PHY-MAC interface as defined by the Cisco USXGMII Multiport Copper Interface document. It supports 4 ports over a 10.3125 GHz SerDes lane, each port having speeds of 2.5G / 1G / 100M / 10M achieved through symbol replication. The PCS expects the standard USXGMII code word.”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MKhj«ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhj�ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´MNhjªh²hubj®)�”}”(hXK``PHY_INTERFACE_MODE_MIILITE`` Non-standard, simplified MII mode, without TXER, RXER, CRS and COL signals as defined for the MII. The absence of COL signal makes half-duplex link modes impossible but does not interfere with BroadR-Reach link modes on Broadcom (and other two-wire Ethernet) PHYs, because they are full-duplex only. ”h]”(j´)�”}”(hŒ``PHY_INTERFACE_MODE_MIILITE``”h]”jº)�”}”(hjÎh]”hŒPHY_INTERFACE_MODE_MIILITE”…”�”}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¹hjÌubah}”(h]”h ]”h"]”h$]”h&]”uh1j³h³hÊh´MUhjÈubjÏ)�”}”(hhh]”hÝ)�”}”(hX+Non-standard, simplified MII mode, without TXER, RXER, CRS and COL signals as defined for the MII. The absence of COL signal makes half-duplex link modes impossible but does not interfere with BroadR-Reach link modes on Broadcom (and other two-wire Ethernet) PHYs, because they are full-duplex only.”h]”hX+Non-standard, simplified MII mode, without TXER, RXER, CRS and COL signals as defined for the MII. The absence of COL signal makes half-duplex link modes impossible but does not interfere with BroadR-Reach link modes on Broadcom (and other two-wire Ethernet) PHYs, because they are full-duplex only.”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MQhjãubah}”(h]”h ]”h"]”h$]”h&]”uh1jÎhjÈubeh}”(h]”h ]”h"]”h$]”h&]”uh1j­h³hÊh´MUhjªh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¨hj{h²hh³hÊh´Nubeh}”(h]”Œphy-interface-modes”ah ]”h"]”Œphy interface modes”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kæubh¶)�”}”(hhh]”(h»)�”}”(hŒPause frames / flow control”h]”hŒPause frames / flow control”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj h²hh³hÊh´MXubhÝ)�”}”(hX‰The PHY does not participate directly in flow control/pause frames except by making sure that the SUPPORTED_Pause and SUPPORTED_AsymPause bits are set in MII_ADVERTISE to indicate towards the link partner that the Ethernet MAC controller supports such a thing. Since flow control/pause frames generation involves the Ethernet MAC driver, it is recommended that this driver takes care of properly indicating advertisement and support for such features by setting the SUPPORTED_Pause and SUPPORTED_AsymPause bits accordingly. This can be done either before or after phy_connect() and/or as a result of implementing the ethtool::set_pauseparam feature.”h]”hX‰The PHY does not participate directly in flow control/pause frames except by making sure that the SUPPORTED_Pause and SUPPORTED_AsymPause bits are set in MII_ADVERTISE to indicate towards the link partner that the Ethernet MAC controller supports such a thing. Since flow control/pause frames generation involves the Ethernet MAC driver, it is recommended that this driver takes care of properly indicating advertisement and support for such features by setting the SUPPORTED_Pause and SUPPORTED_AsymPause bits accordingly. This can be done either before or after phy_connect() and/or as a result of implementing the ethtool::set_pauseparam feature.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MZhj h²hubeh}”(h]”Œpause-frames-flow-control”ah ]”h"]”Œpause frames / flow control”ah$]”h&]”uh1hµhh·h²hh³hÊh´MXubh¶)�”}”(hhh]”(h»)�”}”(hŒKeeping Close Tabs on the PAL”h]”hŒKeeping Close Tabs on the PAL”…”�”}”(hj8 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj5 h²hh³hÊh´MfubhÝ)�”}”(hXÈIt is possible that the PAL's built-in state machine needs a little help to keep your network device and the PHY properly in sync. If so, you can register a helper function when connecting to the PHY, which will be called every second before the state machine reacts to any changes. To do this, you need to manually call phy_attach() and phy_prepare_link(), and then call phy_start_machine() with the second argument set to point to your special handler.”h]”hXÊIt is possible that the PAL’s built-in state machine needs a little help to keep your network device and the PHY properly in sync. If so, you can register a helper function when connecting to the PHY, which will be called every second before the state machine reacts to any changes. To do this, you need to manually call phy_attach() and phy_prepare_link(), and then call phy_start_machine() with the second argument set to point to your special handler.”…”�”}”(hjF h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhhj5 h²hubhÝ)�”}”(hŒÊCurrently there are no examples of how to use this functionality, and testing on it has been limited because the author does not have any drivers which use it (they all use option 1). So Caveat Emptor.”h]”hŒÊCurrently there are no examples of how to use this functionality, and testing on it has been limited because the author does not have any drivers which use it (they all use option 1). So Caveat Emptor.”…”�”}”(hjT h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mphj5 h²hubeh}”(h]”Œkeeping-close-tabs-on-the-pal”ah ]”h"]”Œkeeping close tabs on the pal”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mfubh¶)�”}”(hhh]”(h»)�”}”(hŒDoing it all yourself”h]”hŒDoing it all yourself”…”�”}”(hjm h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjj h²hh³hÊh´MuubhÝ)�”}”(hX�There's a remote chance that the PAL's built-in state machine cannot track the complex interactions between the PHY and your network device. If this is so, you can simply call phy_attach(), and not call phy_start_machine or phy_prepare_link(). This will mean that phydev->state is entirely yours to handle (phy_start and phy_stop toggle between some of the states, so you might need to avoid them).”h]”hX”There’s a remote chance that the PAL’s built-in state machine cannot track the complex interactions between the PHY and your network device. If this is so, you can simply call phy_attach(), and not call phy_start_machine or phy_prepare_link(). This will mean that phydev->state is entirely yours to handle (phy_start and phy_stop toggle between some of the states, so you might need to avoid them).”…”�”}”(hj{ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mwhjj h²hubhÝ)�”}”(hXJAn effort has been made to make sure that useful functionality can be accessed without the state-machine running, and most of these functions are descended from functions which did not interact with a complex state-machine. However, again, no effort has been made so far to test running without the state machine, so tryer beware.”h]”hXJAn effort has been made to make sure that useful functionality can be accessed without the state-machine running, and most of these functions are descended from functions which did not interact with a complex state-machine. However, again, no effort has been made so far to test running without the state machine, so tryer beware.”…”�”}”(hj‰ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M~hjj h²hubhÝ)�”}”(hŒ*Here is a brief rundown of the functions::”h]”hŒ)Here is a brief rundown of the functions:”…”�”}”(hj— h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M„hjj h²hubj«)�”}”(hŒsint phy_read(struct phy_device *phydev, u16 regnum); int phy_write(struct phy_device *phydev, u16 regnum, u16 val);”h]”hŒsint phy_read(struct phy_device *phydev, u16 regnum); int phy_write(struct phy_device *phydev, u16 regnum, u16 val);”…”�”}”hj¥ sbah}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´M†hjj h²hubhÝ)�”}”(hŒUSimple read/write primitives. They invoke the bus's read/write function pointers. ::”h]”hŒTSimple read/write primitives. They invoke the bus’s read/write function pointers.”…”�”}”(hj³ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M‰hjj h²hubj«)�”}”(hŒ1void phy_print_status(struct phy_device *phydev);”h]”hŒ1void phy_print_status(struct phy_device *phydev);”…”�”}”hjÁ sbah}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´M�hjj h²hubhÝ)�”}”(hŒ=A convenience function to print out the PHY status neatly. ::”h]”hŒ:A convenience function to print out the PHY status neatly.”…”�”}”(hjÏ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M�hjj h²hubj«)�”}”(hŒ6void phy_request_interrupt(struct phy_device *phydev);”h]”hŒ6void phy_request_interrupt(struct phy_device *phydev);”…”�”}”hjÝ sbah}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´M’hjj h²hubhÝ)�”}”(hŒ+Requests the IRQ for the PHY interrupts. ::”h]”hŒ(Requests the IRQ for the PHY interrupts.”…”�”}”(hjë h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M”hjj h²hubj«)�”}”(hŒ…struct phy_device * phy_attach(struct net_device *dev, const char *phy_id, phy_interface_t interface);”h]”hŒ…struct phy_device * phy_attach(struct net_device *dev, const char *phy_id, phy_interface_t interface);”…”�”}”hjù sbah}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´M—hjj h²hubhÝ)�”}”(hŒ‚Attaches a network device to a particular PHY, binding the PHY to a generic driver if none was found during bus initialization. ::”h]”hŒAttaches a network device to a particular PHY, binding the PHY to a generic driver if none was found during bus initialization.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mšhjj h²hubj«)�”}”(hŒ.int phy_start_aneg(struct phy_device *phydev);”h]”hŒ.int phy_start_aneg(struct phy_device *phydev);”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´Mžhjj h²hubhÝ)�”}”(hŒ¦Using variables inside the phydev structure, either configures advertising and resets autonegotiation, or disables autonegotiation, and configures forced settings. ::”h]”hŒ£Using variables inside the phydev structure, either configures advertising and resets autonegotiation, or disables autonegotiation, and configures forced settings.”…”�”}”(hj# h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hjj h²hubj«)�”}”(hŒ=static inline int phy_read_status(struct phy_device *phydev);”h]”hŒ=static inline int phy_read_status(struct phy_device *phydev);”…”�”}”hj1 sba•^Dh}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´M¥hjj h²hubhÝ)�”}”(hŒ`Fills the phydev structure with up-to-date information about the current settings in the PHY. ::”h]”hŒ]Fills the phydev structure with up-to-date information about the current settings in the PHY.”…”�”}”(hj? h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M§hjj h²hubj«)�”}”(hŒ�int phy_ethtool_ksettings_set(struct phy_device *phydev, const struct ethtool_link_ksettings *cmd);”h]”hŒ�int phy_ethtool_ksettings_set(struct phy_device *phydev, const struct ethtool_link_ksettings *cmd);”…”�”}”hjM sbah}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´M«hjj h²hubhÝ)�”}”(hŒ!Ethtool convenience functions. ::”h]”hŒEthtool convenience functions.”…”�”}”(hj[ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M®hjj h²hubj«)�”}”(hŒiint phy_mii_ioctl(struct phy_device *phydev, struct mii_ioctl_data *mii_data, int cmd);”h]”hŒiint phy_mii_ioctl(struct phy_device *phydev, struct mii_ioctl_data *mii_data, int cmd);”…”�”}”hji sbah}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´M±hjj h²hubhÝ)�”}”(hŒïThe MII ioctl. Note that this function will completely screw up the state machine if you write registers like BMCR, BMSR, ADVERTISE, etc. Best to use this only to write registers which are not standard, and don't set off a renegotiation.”h]”hŒñThe MII ioctl. Note that this function will completely screw up the state machine if you write registers like BMCR, BMSR, ADVERTISE, etc. Best to use this only to write registers which are not standard, and don’t set off a renegotiation.”…”�”}”(hjw h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M´hjj h²hubeh}”(h]”Œdoing-it-all-yourself”ah ]”h"]”Œdoing it all yourself”ah$]”h&]”uh1hµhh·h²hh³hÊh´Muubh¶)�”}”(hhh]”(h»)�”}”(hŒPHY Device Drivers”h]”hŒPHY Device Drivers”…”�”}”(hj� h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj� h²hh³hÊh´MºubhÝ)�”}”(hŒ½With the PHY Abstraction Layer, adding support for new PHYs is quite easy. In some cases, no work is required at all! However, many PHYs require a little hand-holding to get up-and-running.”h]”hŒ½With the PHY Abstraction Layer, adding support for new PHYs is quite easy. In some cases, no work is required at all! However, many PHYs require a little hand-holding to get up-and-running.”…”�”}”(hjž h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M¼hj� h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒGeneric PHY driver”h]”hŒGeneric PHY driver”…”�”}”(hj¯ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¬ h²hh³hÊh´MÁubhÝ)�”}”(hŒÏIf the desired PHY doesn't have any errata, quirks, or special features you want to support, then it may be best to not add support, and let the PHY Abstraction Layer's Generic PHY Driver do all of the work.”h]”hŒÓIf the desired PHY doesn’t have any errata, quirks, or special features you want to support, then it may be best to not add support, and let the PHY Abstraction Layer’s Generic PHY Driver do all of the work.”…”�”}”(hj½ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÃhj¬ h²hubeh}”(h]”Œgeneric-phy-driver”ah ]”h"]”Œgeneric phy driver”ah$]”h&]”uh1hµhj� h²hh³hÊh´MÁubh¶)�”}”(hhh]”(h»)�”}”(hŒWriting a PHY driver”h]”hŒWriting a PHY driver”…”�”}”(hjÖ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÓ h²hh³hÊh´MÉubhÝ)�”}”(hXlIf you do need to write a PHY driver, the first thing to do is make sure it can be matched with an appropriate PHY device. This is done during bus initialization by reading the device's UID (stored in registers 2 and 3), then comparing it to each driver's phy_id field by ANDing it with each driver's phy_id_mask field. Also, it needs a name. Here's an example::”h]”hXsIf you do need to write a PHY driver, the first thing to do is make sure it can be matched with an appropriate PHY device. This is done during bus initialization by reading the device’s UID (stored in registers 2 and 3), then comparing it to each driver’s phy_id field by ANDing it with each driver’s phy_id_mask field. Also, it needs a name. Here’s an example:”…”�”}”(hjä h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MËhjÓ h²hubj«)�”}”(hŒ©static struct phy_driver dm9161_driver = { .phy_id = 0x0181b880, .name = "Davicom DM9161E", .phy_id_mask = 0x0ffffff0, ... }”h]”hŒ©static struct phy_driver dm9161_driver = { .phy_id = 0x0181b880, .name = "Davicom DM9161E", .phy_id_mask = 0x0ffffff0, ... }”…”�”}”hjò sbah}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´MÒhjÓ h²hubhÝ)�”}”(hŒÆNext, you need to specify what features (speed, duplex, autoneg, etc) your PHY device and driver support. Most PHYs support PHY_BASIC_FEATURES, but you can look in include/mii.h for other features.”h]”hŒÆNext, you need to specify what features (speed, duplex, autoneg, etc) your PHY device and driver support. Most PHYs support PHY_BASIC_FEATURES, but you can look in include/mii.h for other features.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÙhjÓ h²hubhÝ)�”}”(hŒxEach driver consists of a number of function pointers, documented in include/linux/phy.h under the phy_driver structure.”h]”hŒxEach driver consists of a number of function pointers, documented in include/linux/phy.h under the phy_driver structure.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÞhjÓ h²hubhÝ)�”}”(hX·Of these, only config_aneg and read_status are required to be assigned by the driver code. The rest are optional. Also, it is preferred to use the generic phy driver's versions of these two functions if at all possible: genphy_read_status and genphy_config_aneg. If this is not possible, it is likely that you only need to perform some actions before and after invoking these functions, and so your functions will wrap the generic ones.”h]”hX¹Of these, only config_aneg and read_status are required to be assigned by the driver code. The rest are optional. Also, it is preferred to use the generic phy driver’s versions of these two functions if at all possible: genphy_read_status and genphy_config_aneg. If this is not possible, it is likely that you only need to perform some actions before and after invoking these functions, and so your functions will wrap the generic ones.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MáhjÓ h²hubhÝ)�”}”(hŒ£Feel free to look at the Marvell, Cicada, and Davicom drivers in drivers/net/phy/ for examples (the lxt and qsemi drivers have not been tested as of this writing).”h]”hŒ£Feel free to look at the Marvell, Cicada, and Davicom drivers in drivers/net/phy/ for examples (the lxt and qsemi drivers have not been tested as of this writing).”…”�”}”(hj* h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MêhjÓ h²hubhÝ)�”}”(hX The PHY's MMD register accesses are handled by the PAL framework by default, but can be overridden by a specific PHY driver if required. This could be the case if a PHY was released for manufacturing before the MMD PHY register definitions were standardized by the IEEE. Most modern PHYs will be able to use the generic PAL framework for accessing the PHY's MMD registers. An example of such usage is for Energy Efficient Ethernet support, implemented in the PAL. This support uses the PAL to access MMD registers for EEE query and configuration if the PHY supports the IEEE standard access mechanisms, or can use the PHY's specific access interfaces if overridden by the specific PHY driver. See the Micrel driver in drivers/net/phy/ for an example of how this can be implemented.”h]”hXThe PHY’s MMD register accesses are handled by the PAL framework by default, but can be overridden by a specific PHY driver if required. This could be the case if a PHY was released for manufacturing before the MMD PHY register definitions were standardized by the IEEE. Most modern PHYs will be able to use the generic PAL framework for accessing the PHY’s MMD registers. An example of such usage is for Energy Efficient Ethernet support, implemented in the PAL. This support uses the PAL to access MMD registers for EEE query and configuration if the PHY supports the IEEE standard access mechanisms, or can use the PHY’s specific access interfaces if overridden by the specific PHY driver. See the Micrel driver in drivers/net/phy/ for an example of how this can be implemented.”…”�”}”(hj8 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MîhjÓ h²hubeh}”(h]”Œwriting-a-phy-driver”ah ]”h"]”Œwriting a phy driver”ah$]”h&]”uh1hµhj� h²hh³hÊh´MÉubeh}”(h]”Œphy-device-drivers”ah ]”h"]”Œphy device drivers”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mºubh¶)�”}”(hhh]”(h»)�”}”(hŒ Board Fixups”h]”hŒ Board Fixups”…”�”}”(hjY h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjV h²hh³hÊh´MýubhÝ)�”}”(hXvSometimes the specific interaction between the platform and the PHY requires special handling. For instance, to change where the PHY's clock input is, or to add a delay to account for latency issues in the data path. In order to support such contingencies, the PHY Layer allows platform code to register fixups to be run when the PHY is brought up (or subsequently reset).”h]”hXxSometimes the specific interaction between the platform and the PHY requires special handling. For instance, to change where the PHY’s clock input is, or to add a delay to account for latency issues in the data path. In order to support such contingencies, the PHY Layer allows platform code to register fixups to be run when the PHY is brought up (or subsequently reset).”…”�”}”(hjg h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MÿhjV h²hubhÝ)�”}”(hX`When the PHY Layer brings up a PHY it checks to see if there are any fixups registered for it, matching based on UID (contained in the PHY device's phy_id field) and the bus identifier (contained in phydev->dev.bus_id). Both must match, however two constants, PHY_ANY_ID and PHY_ANY_UID, are provided as wildcards for the bus ID and UID, respectively.”h]”hXbWhen the PHY Layer brings up a PHY it checks to see if there are any fixups registered for it, matching based on UID (contained in the PHY device’s phy_id field) and the bus identifier (contained in phydev->dev.bus_id). Both must match, however two constants, PHY_ANY_ID and PHY_ANY_UID, are provided as wildcards for the bus ID and UID, respectively.”…”�”}”(hju h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjV h²hubhÝ)�”}”(hŒÍWhen a match is found, the PHY layer will invoke the run function associated with the fixup. This function is passed a pointer to the phy_device of interest. It should therefore only operate on that PHY.”h]”hŒÍWhen a match is found, the PHY layer will invoke the run function associated with the fixup. This function is passed a pointer to the phy_device of interest. It should therefore only operate on that PHY.”…”�”}”(hjƒ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hjV h²hubhÝ)�”}”(hŒ7The platform code can register the fixup using one of::”h]”hŒ6The platform code can register the fixup using one of:”…”�”}”(hj‘ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjV h²hubj«)�”}”(hŒÑint phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, int (*run)(struct phy_device *)); int phy_register_fixup_for_id(const char *phy_id, int (*run)(struct phy_device *));”h]”hŒÑint phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, int (*run)(struct phy_device *)); int phy_register_fixup_for_id(const char *phy_id, int (*run)(struct phy_device *));”…”�”}”hjŸ sbah}”(h]”h ]”h"]”h$]”h&]”jºj»uh1jªh³hÊh´MhjV h²hubeh}”(h]”Œ board-fixups”ah ]”h"]”Œ board fixups”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mýubh¶)�”}”(hhh]”(h»)�”}”(hŒ Standards”h]”hŒ Standards”…”�”}”(hj¸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjµ h²hh³hÊh´MubhÝ)�”}”(hŒ IEEE Standard 802.3: CSMA/CD Access Method and Physical Layer Specifications, Section Two: http://standards.ieee.org/getieee802/download/802.3-2008_section2.pdf”h]”(hŒ[IEEE Standard 802.3: CSMA/CD Access Method and Physical Layer Specifications, Section Two: ”…”�”}”(hjÆ h²hh³Nh´NubjÜ)�”}”(hŒEhttp://standards.ieee.org/getieee802/download/802.3-2008_section2.pdf”h]”hŒEhttp://standards.ieee.org/getieee802/download/802.3-2008_section2.pdf”…”�”}”(hjÎ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jÐ uh1jÛhjÆ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjµ h²hubhÝ)�”}”(hŒ^RGMII v1.3: http://web.archive.org/web/20160303212629/http://www.hp.com/rnd/pdfs/RGMIIv1_3.pdf”h]”(hŒ RGMII v1.3: ”…”�”}”(hjã h²hh³Nh´NubjÜ)�”}”(hŒRhttp://web.archive.org/web/20160303212629/http://www.hp.com/rnd/pdfs/RGMIIv1_3.pdf”h]”hŒRhttp://web.archive.org/web/20160303212629/http://www.hp.com/rnd/pdfs/RGMIIv1_3.pdf”…”�”}”(hjë h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jí uh1jÛhjã ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjµ h²hubhÝ)�”}”(hŒgRGMII v2.0: http://web.archive.org/web/20160303171328/http://www.hp.com/rnd/pdfs/RGMIIv2_0_final_hp.pdf”h]”(hŒ RGMII v2.0: ”…”�”}”(hj h²hh³Nh´NubjÜ)�”}”(hŒ[http://web.archive.org/web/20160303171328/http://www.hp.com/rnd/pdfs/RGMIIv2_0_final_hp.pdf”h]”hŒ[http://web.archive.org/web/20160303171328/http://www.hp.com/rnd/pdfs/RGMIIv2_0_final_hp.pdf”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j uh1jÛhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjµ h²hubeh}”(h]”Œ standards”ah ]”h"]”Œ standards”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mubeh}”(h]”Œphy-abstraction-layer”ah ]”h"]”Œphy abstraction layer”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jP Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j* j' jsjpjIjFj jjjþj™j–jxjuj j j2 j/ jg jd jŠ j‡ jS jP jÐ jÍ jK jH j² j¯ j" j uŒ nametypes”}”(j* ‰js‰jI‰j ‰j‰j™‰jx‰j ‰j2 ‰jg ‰jŠ ‰jS ‰jÐ ‰jK ‰j² ‰j" ‰uh}”(j' h·jphËjFjvjjLjþjŒj–j jujœj j{j/ j jd j5 j‡ jj jP j� jÍ j¬ jH jÓ j¯ jV j jµ uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”(hŒsystem_message”“”)�”}”(hhh]”hÝ)�”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…”�”}”(hj· h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhj´ ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œline”M�Œsource”hÊuh1j² hjj h²hh³hÊh´M�ubj³ )�”}”(hhh]”hÝ)�”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…”�”}”(hjÓ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhjÐ ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jÍ Œline”M•Œsource”hÊuh1j² hjj h²hh³hÊh´M•ubj³ )�”}”(hhh]”hÝ)�”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…”�”}”(hjî h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhjë ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jÍ Œline”M¯Œsource”hÊuh1j² hjj h²hh³hÊh´M¯ubeŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.