drivers/net/ethernet/intel/ixgbe/devlink/devlink.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbe/devlink/devlink.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbe/devlink/devlink.c- Extension
.c- Size
- 15815 bytes
- Lines
- 559
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ixgbe.hdevlink.hixgbe_fw_update.h
Detected Declarations
struct ixgbe_info_ctxenum ixgbe_devlink_version_typefunction ixgbe_info_get_dsnfunction ixgbe_info_orom_verfunction ixgbe_info_eetrackfunction ixgbe_info_fw_apifunction ixgbe_info_fw_buildfunction ixgbe_info_fw_srevfunction ixgbe_info_orom_srevfunction ixgbe_info_nvm_verfunction ixgbe_info_netlist_verfunction ixgbe_info_netlist_buildfunction ixgbe_set_ctx_dev_capsfunction ixgbe_devlink_info_get_e610function ixgbe_devlink_pending_info_get_e610function ixgbe_devlink_info_getfunction ixgbe_devlink_reload_empr_startfunction ixgbe_devlink_reload_empr_finishfunction ERR_PTRfunction ixgbe_devlink_set_switch_idfunction ixgbe_devlink_register_port
Annotated Snippet
struct ixgbe_info_ctx {
char buf[128];
struct ixgbe_orom_info pending_orom;
struct ixgbe_nvm_info pending_nvm;
struct ixgbe_netlist_info pending_netlist;
struct ixgbe_hw_dev_caps dev_caps;
};
enum ixgbe_devlink_version_type {
IXGBE_DL_VERSION_RUNNING,
IXGBE_DL_VERSION_STORED
};
static void ixgbe_info_get_dsn(struct ixgbe_adapter *adapter,
struct ixgbe_info_ctx *ctx)
{
u8 dsn[8];
/* Copy the DSN into an array in Big Endian format */
put_unaligned_be64(pci_get_dsn(adapter->pdev), dsn);
snprintf(ctx->buf, sizeof(ctx->buf), "%8phD", dsn);
}
static void ixgbe_info_orom_ver(struct ixgbe_adapter *adapter,
struct ixgbe_info_ctx *ctx,
enum ixgbe_devlink_version_type type)
{
struct ixgbe_hw *hw = &adapter->hw;
struct ixgbe_nvm_version nvm_ver;
ctx->buf[0] = '\0';
if (hw->mac.type == ixgbe_mac_e610) {
struct ixgbe_orom_info *orom = &adapter->hw.flash.orom;
if (type == IXGBE_DL_VERSION_STORED &&
ctx->dev_caps.common_cap.nvm_update_pending_orom)
orom = &ctx->pending_orom;
snprintf(ctx->buf, sizeof(ctx->buf), "%u.%u.%u",
orom->major, orom->build, orom->patch);
return;
}
ixgbe_get_oem_prod_version(hw, &nvm_ver);
if (nvm_ver.oem_valid) {
snprintf(ctx->buf, sizeof(ctx->buf), "%x.%x.%x",
nvm_ver.oem_major, nvm_ver.oem_minor,
nvm_ver.oem_release);
return;
}
ixgbe_get_orom_version(hw, &nvm_ver);
if (nvm_ver.or_valid)
snprintf(ctx->buf, sizeof(ctx->buf), "%d.%d.%d",
nvm_ver.or_major, nvm_ver.or_build, nvm_ver.or_patch);
}
static void ixgbe_info_eetrack(struct ixgbe_adapter *adapter,
struct ixgbe_info_ctx *ctx,
enum ixgbe_devlink_version_type type)
{
struct ixgbe_hw *hw = &adapter->hw;
struct ixgbe_nvm_version nvm_ver;
if (hw->mac.type == ixgbe_mac_e610) {
u32 eetrack = hw->flash.nvm.eetrack;
if (type == IXGBE_DL_VERSION_STORED &&
ctx->dev_caps.common_cap.nvm_update_pending_nvm)
eetrack = ctx->pending_nvm.eetrack;
snprintf(ctx->buf, sizeof(ctx->buf), "0x%08x", eetrack);
return;
}
ixgbe_get_oem_prod_version(hw, &nvm_ver);
/* No ETRACK version for OEM */
if (nvm_ver.oem_valid) {
ctx->buf[0] = '\0';
return;
}
ixgbe_get_etk_id(hw, &nvm_ver);
snprintf(ctx->buf, sizeof(ctx->buf), "0x%08x", nvm_ver.etk_id);
}
Annotation
- Immediate include surface: `ixgbe.h`, `devlink.h`, `ixgbe_fw_update.h`.
- Detected declarations: `struct ixgbe_info_ctx`, `enum ixgbe_devlink_version_type`, `function ixgbe_info_get_dsn`, `function ixgbe_info_orom_ver`, `function ixgbe_info_eetrack`, `function ixgbe_info_fw_api`, `function ixgbe_info_fw_build`, `function ixgbe_info_fw_srev`, `function ixgbe_info_orom_srev`, `function ixgbe_info_nvm_ver`.
- 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.