drivers/net/ethernet/intel/i40e/i40e_ptp.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/i40e/i40e_ptp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/i40e/i40e_ptp.c- Extension
.c- Size
- 46255 bytes
- Lines
- 1580
- 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.
- 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/ptp_classify.hlinux/posix-clock.hi40e.hi40e_devids.h
Detected Declarations
struct i40e_ptp_pins_settingsenum i40e_ptp_pinenum i40e_can_set_pinsenum i40e_ptp_gpio_pin_stateenum i40e_ptp_led_pin_statefunction i40e_ptp_extts0_workfunction i40e_is_ptp_pin_devfunction i40e_can_set_pinsfunction i40_ptp_reset_timing_eventsfunction i40e_ptp_verifyfunction i40e_ptp_readfunction i40e_ptp_writefunction i40e_ptp_convert_to_hwtstampfunction i40e_ptp_adjfinefunction i40e_ptp_set_1pps_signal_hwfunction i40e_ptp_adjtimefunction i40e_ptp_gettimexfunction i40e_ptp_settimefunction i40e_pps_configurefunction i40e_pin_statefunction i40e_ptp_enable_pinfunction ptp_pin_storefunction i40e_ptp_feature_enablefunction i40e_ptp_get_rx_eventsfunction i40e_ptp_rx_hangfunction i40e_ptp_tx_hangfunction i40e_ptp_tx_hwtstampfunction i40e_ptp_rx_hwtstampfunction i40e_ptp_set_incrementfunction i40e_ptp_hwtstamp_getfunction i40e_ptp_free_pinsfunction i40e_ptp_set_pin_hwfunction i40e_ptp_set_led_hwfunction i40e_ptp_init_leds_hwfunction i40e_ptp_set_pins_hwfunction i40e_ptp_set_pinsfunction i40e_ptp_alloc_pinsfunction i40e_ptp_set_timestamp_modefunction i40e_ptp_hwtstamp_setfunction i40e_init_pin_configfunction i40e_ptp_create_clockfunction i40e_ptp_save_hw_timefunction CLOCK_MONOTONICfunction i40e_ptp_initfunction i40e_ptp_stop
Annotated Snippet
struct i40e_ptp_pins_settings {
enum i40e_ptp_gpio_pin_state sdp3_2;
enum i40e_ptp_gpio_pin_state sdp3_3;
enum i40e_ptp_gpio_pin_state gpio_4;
enum i40e_ptp_led_pin_state led2_0;
enum i40e_ptp_led_pin_state led2_1;
enum i40e_ptp_led_pin_state led3_0;
enum i40e_ptp_led_pin_state led3_1;
};
static const struct i40e_ptp_pins_settings
i40e_ptp_pin_led_allowed_states[] = {
{off, off, off, high, high, high, high},
{off, in_A, off, high, high, high, low},
{off, out_A, off, high, low, high, high},
{off, in_B, off, high, high, high, low},
{off, out_B, off, high, low, high, high},
{in_A, off, off, high, high, high, low},
{in_A, in_B, off, high, high, high, low},
{in_A, out_B, off, high, low, high, high},
{out_A, off, off, high, low, high, high},
{out_A, in_B, off, high, low, high, high},
{in_B, off, off, high, high, high, low},
{in_B, in_A, off, high, high, high, low},
{in_B, out_A, off, high, low, high, high},
{out_B, off, off, high, low, high, high},
{out_B, in_A, off, high, low, high, high},
{off, off, in_A, high, high, low, high},
{off, out_A, in_A, high, low, low, high},
{off, in_B, in_A, high, high, low, low},
{off, out_B, in_A, high, low, low, high},
{out_A, off, in_A, high, low, low, high},
{out_A, in_B, in_A, high, low, low, high},
{in_B, off, in_A, high, high, low, low},
{in_B, out_A, in_A, high, low, low, high},
{out_B, off, in_A, high, low, low, high},
{off, off, out_A, low, high, high, high},
{off, in_A, out_A, low, high, high, low},
{off, in_B, out_A, low, high, high, low},
{off, out_B, out_A, low, low, high, high},
{in_A, off, out_A, low, high, high, low},
{in_A, in_B, out_A, low, high, high, low},
{in_A, out_B, out_A, low, low, high, high},
{in_B, off, out_A, low, high, high, low},
{in_B, in_A, out_A, low, high, high, low},
{out_B, off, out_A, low, low, high, high},
{out_B, in_A, out_A, low, low, high, high},
{off, off, in_B, high, high, low, high},
{off, in_A, in_B, high, high, low, low},
{off, out_A, in_B, high, low, low, high},
{off, out_B, in_B, high, low, low, high},
{in_A, off, in_B, high, high, low, low},
{in_A, out_B, in_B, high, low, low, high},
{out_A, off, in_B, high, low, low, high},
{out_B, off, in_B, high, low, low, high},
{out_B, in_A, in_B, high, low, low, high},
{off, off, out_B, low, high, high, high},
{off, in_A, out_B, low, high, high, low},
{off, out_A, out_B, low, low, high, high},
{off, in_B, out_B, low, high, high, low},
{in_A, off, out_B, low, high, high, low},
{in_A, in_B, out_B, low, high, high, low},
{out_A, off, out_B, low, low, high, high},
{out_A, in_B, out_B, low, low, high, high},
{in_B, off, out_B, low, high, high, low},
{in_B, in_A, out_B, low, high, high, low},
{in_B, out_A, out_B, low, low, high, high},
{end, end, end, led_end, led_end, led_end, led_end}
};
static int i40e_ptp_set_pins(struct i40e_pf *pf,
struct i40e_ptp_pins_settings *pins);
/**
* i40e_ptp_extts0_work - workqueue task function
* @work: workqueue task structure
*
* Service for PTP external clock event
**/
static void i40e_ptp_extts0_work(struct work_struct *work)
{
struct i40e_pf *pf = container_of(work, struct i40e_pf,
ptp_extts0_work);
struct i40e_hw *hw = &pf->hw;
struct ptp_clock_event event;
u32 hi, lo;
/* Event time is captured by one of the two matched registers
* PRTTSYN_EVNT_L: 32 LSB of sampled time event
* PRTTSYN_EVNT_H: 32 MSB of sampled time event
Annotation
- Immediate include surface: `linux/ptp_classify.h`, `linux/posix-clock.h`, `i40e.h`, `i40e_devids.h`.
- Detected declarations: `struct i40e_ptp_pins_settings`, `enum i40e_ptp_pin`, `enum i40e_can_set_pins`, `enum i40e_ptp_gpio_pin_state`, `enum i40e_ptp_led_pin_state`, `function i40e_ptp_extts0_work`, `function i40e_is_ptp_pin_dev`, `function i40e_can_set_pins`, `function i40_ptp_reset_timing_events`, `function i40e_ptp_verify`.
- 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.
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.