drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c- Extension
.c- Size
- 9889 bytes
- Lines
- 345
- 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/acpi.hlinux/bitfield.hlinux/delay.hlinux/device.hlinux/err.hlinux/io.hlinux/iopoll.hlinux/ioport.hlinux/irqreturn.hlinux/jiffies.hlinux/module.hlinux/mod_devicetable.hlinux/phy.hlinux/platform_device.hlinux/property.hmlxbf_gige.hmlxbf_gige_regs.hmlxbf_gige_mdio_bf2.hmlxbf_gige_mdio_bf3.h
Detected Declarations
function calculate_i1clkfunction mdio_period_mapfunction mlxbf_gige_mdio_create_cmdfunction mlxbf_gige_mdio_readfunction mlxbf_gige_mdio_writefunction mlxbf_gige_mdio_cfgfunction mlxbf_gige_mdio_probefunction mlxbf_gige_mdio_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
/* MDIO support for Mellanox Gigabit Ethernet driver
*
* Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES
*/
#include <linux/acpi.h>
#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/ioport.h>
#include <linux/irqreturn.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include "mlxbf_gige.h"
#include "mlxbf_gige_regs.h"
#include "mlxbf_gige_mdio_bf2.h"
#include "mlxbf_gige_mdio_bf3.h"
static struct mlxbf_gige_mdio_gw mlxbf_gige_mdio_gw_t[] = {
[MLXBF_GIGE_VERSION_BF2] = {
.gw_address = MLXBF2_GIGE_MDIO_GW_OFFSET,
.read_data_address = MLXBF2_GIGE_MDIO_GW_OFFSET,
.busy = {
.mask = MLXBF2_GIGE_MDIO_GW_BUSY_MASK,
.shift = MLXBF2_GIGE_MDIO_GW_BUSY_SHIFT,
},
.read_data = {
.mask = MLXBF2_GIGE_MDIO_GW_AD_MASK,
.shift = MLXBF2_GIGE_MDIO_GW_AD_SHIFT,
},
.write_data = {
.mask = MLXBF2_GIGE_MDIO_GW_AD_MASK,
.shift = MLXBF2_GIGE_MDIO_GW_AD_SHIFT,
},
.devad = {
.mask = MLXBF2_GIGE_MDIO_GW_DEVAD_MASK,
.shift = MLXBF2_GIGE_MDIO_GW_DEVAD_SHIFT,
},
.partad = {
.mask = MLXBF2_GIGE_MDIO_GW_PARTAD_MASK,
.shift = MLXBF2_GIGE_MDIO_GW_PARTAD_SHIFT,
},
.opcode = {
.mask = MLXBF2_GIGE_MDIO_GW_OPCODE_MASK,
.shift = MLXBF2_GIGE_MDIO_GW_OPCODE_SHIFT,
},
.st1 = {
.mask = MLXBF2_GIGE_MDIO_GW_ST1_MASK,
.shift = MLXBF2_GIGE_MDIO_GW_ST1_SHIFT,
},
},
[MLXBF_GIGE_VERSION_BF3] = {
.gw_address = MLXBF3_GIGE_MDIO_GW_OFFSET,
.read_data_address = MLXBF3_GIGE_MDIO_DATA_READ,
.busy = {
.mask = MLXBF3_GIGE_MDIO_GW_BUSY_MASK,
.shift = MLXBF3_GIGE_MDIO_GW_BUSY_SHIFT,
},
.read_data = {
.mask = MLXBF3_GIGE_MDIO_GW_DATA_READ_MASK,
.shift = MLXBF3_GIGE_MDIO_GW_DATA_READ_SHIFT,
},
.write_data = {
.mask = MLXBF3_GIGE_MDIO_GW_DATA_MASK,
.shift = MLXBF3_GIGE_MDIO_GW_DATA_SHIFT,
},
.devad = {
.mask = MLXBF3_GIGE_MDIO_GW_DEVAD_MASK,
.shift = MLXBF3_GIGE_MDIO_GW_DEVAD_SHIFT,
},
.partad = {
.mask = MLXBF3_GIGE_MDIO_GW_PARTAD_MASK,
.shift = MLXBF3_GIGE_MDIO_GW_PARTAD_SHIFT,
},
.opcode = {
.mask = MLXBF3_GIGE_MDIO_GW_OPCODE_MASK,
.shift = MLXBF3_GIGE_MDIO_GW_OPCODE_SHIFT,
},
.st1 = {
.mask = MLXBF3_GIGE_MDIO_GW_ST1_MASK,
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/bitfield.h`, `linux/delay.h`, `linux/device.h`, `linux/err.h`, `linux/io.h`, `linux/iopoll.h`, `linux/ioport.h`.
- Detected declarations: `function calculate_i1clk`, `function mdio_period_map`, `function mlxbf_gige_mdio_create_cmd`, `function mlxbf_gige_mdio_read`, `function mlxbf_gige_mdio_write`, `function mlxbf_gige_mdio_cfg`, `function mlxbf_gige_mdio_probe`, `function mlxbf_gige_mdio_remove`.
- 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.