drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c- Extension
.c- Size
- 77547 bytes
- Lines
- 2859
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hlinux/delay.hlinux/iopoll.hlinux/sched.hixgbe.hixgbe_phy.h
Detected Declarations
function ixgbe_out_i2c_byte_ackfunction ixgbe_in_i2c_byte_ackfunction ixgbe_ones_comp_byte_addfunction ixgbe_read_i2c_combined_generic_intfunction ixgbe_write_i2c_combined_generic_intfunction ixgbe_probe_phyfunction ixgbe_identify_phy_genericfunction ixgbe_check_reset_blockedfunction ixgbe_get_phy_idfunction ixgbe_get_phy_type_from_idfunction ixgbe_reset_phy_genericfunction ixgbe_read_phy_reg_mdifunction ixgbe_read_phy_reg_genericfunction ixgbe_write_phy_reg_mdifunction ixgbe_write_phy_reg_genericfunction ixgbe_msca_cmdfunction ixgbe_mii_bus_read_generic_c22function ixgbe_mii_bus_read_generic_c45function ixgbe_mii_bus_write_generic_c22function ixgbe_mii_bus_write_generic_c45function ixgbe_mii_bus_read_c22function ixgbe_mii_bus_read_c45function ixgbe_mii_bus_write_c22function ixgbe_mii_bus_write_c45function ixgbe_x550em_a_mii_bus_read_c22function ixgbe_x550em_a_mii_bus_read_c45function ixgbe_x550em_a_mii_bus_write_c22function ixgbe_x550em_a_mii_bus_write_c45function PCI_DEVFNfunction ixgbe_x550em_a_has_miifunction ixgbe_mii_bus_initfunction ixgbe_setup_phy_link_genericfunction ixgbe_setup_phy_link_speed_genericfunction ixgbe_get_copper_speeds_supportedfunction ixgbe_get_copper_link_capabilities_genericfunction ixgbe_check_phy_link_tnxfunction ixgbe_setup_phy_link_tnxfunction ixgbe_reset_phy_nlfunction ixgbe_identify_module_genericfunction ixgbe_identify_sfp_module_genericfunction ixgbe_identify_qsfp_module_genericfunction ixgbe_get_sfp_init_sequence_offsetsfunction ixgbe_read_i2c_eeprom_genericfunction ixgbe_read_i2c_sff8472_genericfunction ixgbe_write_i2c_eeprom_genericfunction ixgbe_is_sfp_probefunction ixgbe_read_i2c_byte_generic_intfunction ixgbe_read_i2c_byte_generic
Annotated Snippet
if (ixgbe_probe_phy(hw, phy_addr)) {
status = 0;
break;
}
}
/* Certain media types do not have a phy so an address will not
* be found and the code will take this path. Caller has to
* decide if it is an error or not.
*/
if (status)
hw->phy.mdio.prtad = MDIO_PRTAD_NONE;
return status;
}
/**
* ixgbe_check_reset_blocked - check status of MNG FW veto bit
* @hw: pointer to the hardware structure
*
* This function checks the MMNGC.MNG_VETO bit to see if there are
* any constraints on link from manageability. For MAC's that don't
* have this bit just return false since the link can not be blocked
* via this method.
**/
bool ixgbe_check_reset_blocked(struct ixgbe_hw *hw)
{
u32 mmngc;
/* If we don't have this bit, it can't be blocking */
if (hw->mac.type == ixgbe_mac_82598EB)
return false;
mmngc = IXGBE_READ_REG(hw, IXGBE_MMNGC);
if (mmngc & IXGBE_MMNGC_MNG_VETO) {
hw_dbg(hw, "MNG_VETO bit detected.\n");
return true;
}
return false;
}
/**
* ixgbe_get_phy_id - Get the phy type
* @hw: pointer to hardware structure
*
**/
static int ixgbe_get_phy_id(struct ixgbe_hw *hw)
{
u16 phy_id_high = 0;
u16 phy_id_low = 0;
int status;
status = hw->phy.ops.read_reg(hw, MDIO_DEVID1, MDIO_MMD_PMAPMD,
&phy_id_high);
if (!status) {
hw->phy.id = (u32)(phy_id_high << 16);
status = hw->phy.ops.read_reg(hw, MDIO_DEVID2, MDIO_MMD_PMAPMD,
&phy_id_low);
hw->phy.id |= (u32)(phy_id_low & IXGBE_PHY_REVISION_MASK);
hw->phy.revision = (u32)(phy_id_low & ~IXGBE_PHY_REVISION_MASK);
}
return status;
}
/**
* ixgbe_get_phy_type_from_id - Get the phy type
* @phy_id: hardware phy id
*
**/
static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
{
enum ixgbe_phy_type phy_type;
switch (phy_id) {
case TN1010_PHY_ID:
phy_type = ixgbe_phy_tn;
break;
case X550_PHY_ID2:
case X550_PHY_ID3:
case X540_PHY_ID:
phy_type = ixgbe_phy_aq;
break;
case QT2022_PHY_ID:
phy_type = ixgbe_phy_qt;
break;
case ATH_PHY_ID:
phy_type = ixgbe_phy_nl;
break;
Annotation
- Immediate include surface: `linux/pci.h`, `linux/delay.h`, `linux/iopoll.h`, `linux/sched.h`, `ixgbe.h`, `ixgbe_phy.h`.
- Detected declarations: `function ixgbe_out_i2c_byte_ack`, `function ixgbe_in_i2c_byte_ack`, `function ixgbe_ones_comp_byte_add`, `function ixgbe_read_i2c_combined_generic_int`, `function ixgbe_write_i2c_combined_generic_int`, `function ixgbe_probe_phy`, `function ixgbe_identify_phy_generic`, `function ixgbe_check_reset_blocked`, `function ixgbe_get_phy_id`, `function ixgbe_get_phy_type_from_id`.
- Atlas domain: Driver Families / drivers/net.
- 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.