drivers/net/ethernet/amd/xgbe/xgbe-i2c.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/amd/xgbe/xgbe-i2c.c- Extension
.c- Size
- 9548 bytes
- Lines
- 406
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/interrupt.hlinux/kmod.hlinux/delay.hlinux/completion.hlinux/mutex.hxgbe.hxgbe-common.h
Detected Declarations
function Copyrightfunction xgbe_i2c_set_enablefunction xgbe_i2c_disablefunction xgbe_i2c_enablefunction xgbe_i2c_clear_all_interruptsfunction xgbe_i2c_disable_interruptsfunction xgbe_i2c_enable_interruptsfunction xgbe_i2c_writefunction xgbe_i2c_readfunction xgbe_i2c_clear_isr_interruptsfunction xgbe_i2c_isr_bh_workfunction xgbe_i2c_isrfunction xgbe_i2c_set_modefunction xgbe_i2c_get_featuresfunction xgbe_i2c_set_targetfunction xgbe_i2c_combined_isrfunction xgbe_i2c_xferfunction xgbe_i2c_stopfunction xgbe_i2c_startfunction xgbe_i2c_initfunction xgbe_init_function_ptrs_i2c
Annotated Snippet
if (ret) {
netdev_err(pdata->netdev, "i2c irq request failed\n");
return ret;
}
}
pdata->i2c.started = 1;
return 0;
}
static int xgbe_i2c_init(struct xgbe_prv_data *pdata)
{
int ret;
xgbe_i2c_disable_interrupts(pdata);
ret = xgbe_i2c_disable(pdata);
if (ret) {
dev_err(pdata->dev, "failed to disable i2c master\n");
return ret;
}
xgbe_i2c_get_features(pdata);
xgbe_i2c_set_mode(pdata);
xgbe_i2c_clear_all_interrupts(pdata);
return 0;
}
void xgbe_init_function_ptrs_i2c(struct xgbe_i2c_if *i2c_if)
{
i2c_if->i2c_init = xgbe_i2c_init;
i2c_if->i2c_start = xgbe_i2c_start;
i2c_if->i2c_stop = xgbe_i2c_stop;
i2c_if->i2c_xfer = xgbe_i2c_xfer;
i2c_if->i2c_isr = xgbe_i2c_combined_isr;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/interrupt.h`, `linux/kmod.h`, `linux/delay.h`, `linux/completion.h`, `linux/mutex.h`, `xgbe.h`, `xgbe-common.h`.
- Detected declarations: `function Copyright`, `function xgbe_i2c_set_enable`, `function xgbe_i2c_disable`, `function xgbe_i2c_enable`, `function xgbe_i2c_clear_all_interrupts`, `function xgbe_i2c_disable_interrupts`, `function xgbe_i2c_enable_interrupts`, `function xgbe_i2c_write`, `function xgbe_i2c_read`, `function xgbe_i2c_clear_isr_interrupts`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.