drivers/ptp/ptp_netc.c
Source file repositories/reference/linux-study-clean/drivers/ptp/ptp_netc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/ptp/ptp_netc.c- Extension
.c- Size
- 27358 bytes
- Lines
- 1044
- Domain
- Driver Families
- Bucket
- drivers/ptp
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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.
- 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
linux/bitfield.hlinux/clk.hlinux/fsl/netc_global.hlinux/module.hlinux/of.hlinux/of_platform.hlinux/pci.hlinux/ptp_clock_kernel.h
Detected Declarations
struct netc_ppstruct netc_timerenum netc_pp_typefunction netc_timer_cnt_writefunction netc_timer_offset_readfunction netc_timer_offset_writefunction netc_timer_cur_time_readfunction netc_timer_alarm_writefunction netc_timer_get_integral_periodfunction netc_timer_calculate_fiper_pwfunction netc_timer_set_pps_alarmfunction netc_timer_set_perout_alarmfunction netc_timer_get_alarm_idfunction netc_timer_get_gclk_periodfunction netc_timer_enable_periodic_pulsefunction netc_timer_disable_periodic_pulsefunction netc_timer_select_pps_channelfunction netc_timer_enable_ppsfunction net_timer_enable_peroutfunction netc_timer_handle_etts_eventfunction netc_timer_enable_exttsfunction netc_timer_disable_fiperfunction netc_timer_enable_fiperfunction netc_timer_enablefunction netc_timer_perout_loopbackfunction netc_timer_adjust_periodfunction netc_timer_adjfinefunction netc_timer_adjtimefunction netc_timer_gettimex64function netc_timer_settime64function netc_timer_initfunction netc_timer_pci_probefunction netc_timer_pci_removefunction netc_timer_get_reference_clk_sourcefunction netc_timer_parse_dtfunction netc_timer_isrfunction netc_timer_init_msix_irqfunction netc_timer_free_msix_irqfunction netc_timer_get_global_ip_revfunction netc_timer_probefunction netc_timer_remove
Annotated Snippet
static struct pci_driver netc_timer_driver = {
.name = KBUILD_MODNAME,
.id_table = netc_timer_id_table,
.probe = netc_timer_probe,
.remove = netc_timer_remove,
};
module_pci_driver(netc_timer_driver);
MODULE_DESCRIPTION("NXP NETC Timer PTP Driver");
MODULE_LICENSE("Dual BSD/GPL");
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/fsl/netc_global.h`, `linux/module.h`, `linux/of.h`, `linux/of_platform.h`, `linux/pci.h`, `linux/ptp_clock_kernel.h`.
- Detected declarations: `struct netc_pp`, `struct netc_timer`, `enum netc_pp_type`, `function netc_timer_cnt_write`, `function netc_timer_offset_read`, `function netc_timer_offset_write`, `function netc_timer_cur_time_read`, `function netc_timer_alarm_write`, `function netc_timer_get_integral_period`, `function netc_timer_calculate_fiper_pw`.
- Atlas domain: Driver Families / drivers/ptp.
- Implementation status: pattern 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.