drivers/net/ethernet/intel/ice/ice_ptp.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/ice_ptp.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ice/ice_ptp.h- Extension
.h- Size
- 14442 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.
- 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/ptp_clock_kernel.hlinux/kthread.hice_ptp_hw.h
Detected Declarations
struct ice_tx_tstampstruct ice_ptp_txstruct ice_ptp_portstruct ice_ptp_pin_descstruct ice_ptpstruct ice_pfenum ice_tx_tstamp_workenum ice_ptp_tx_interruptenum ice_ptp_stateenum ice_ptp_pinenum ice_ptp_pin_nvmfunction ice_ptp_hwtstamp_getfunction ice_ptp_hwtstamp_setfunction ice_ptp_restore_timestamp_modefunction ice_ptp_req_tx_single_tstampfunction ice_ptp_tx_tstamps_pendingfunction ice_ptp_read_src_clk_regfunction ice_ptp_get_rx_hwtsfunction ice_ptp_rebuild
Annotated Snippet
struct ice_tx_tstamp {
struct sk_buff *skb;
unsigned long start;
u64 cached_tstamp;
};
/**
* enum ice_tx_tstamp_work - Status of Tx timestamp work function
* @ICE_TX_TSTAMP_WORK_DONE: Tx timestamp processing is complete
* @ICE_TX_TSTAMP_WORK_PENDING: More Tx timestamps are pending
*/
enum ice_tx_tstamp_work {
ICE_TX_TSTAMP_WORK_DONE = 0,
ICE_TX_TSTAMP_WORK_PENDING,
};
/**
* struct ice_ptp_tx - Tracking structure for all Tx timestamp requests on a port
* @lock: lock to prevent concurrent access to fields of this struct
* @tstamps: array of len to store outstanding requests
* @in_use: bitmap of len to indicate which slots are in use
* @stale: bitmap of len to indicate slots which have stale timestamps
* @block: which memory block (quad or port) the timestamps are captured in
* @offset: offset into timestamp block to get the real index
* @len: length of the tstamps and in_use fields.
* @init: if true, the tracker is initialized;
* @calibrating: if true, the PHY is calibrating the Tx offset. During this
* window, timestamps are temporarily disabled.
* @has_ready_bitmap: if true, the hardware has a valid Tx timestamp ready
* bitmap register. If false, fall back to verifying new
* timestamp values against previously cached copy.
* @last_ll_ts_idx_read: index of the last LL TS read by the FW
*/
struct ice_ptp_tx {
spinlock_t lock; /* lock protecting in_use bitmap */
struct ice_tx_tstamp *tstamps;
unsigned long *in_use;
unsigned long *stale;
u8 block;
u8 offset;
u8 len;
u8 init : 1;
u8 calibrating : 1;
u8 has_ready_bitmap : 1;
s8 last_ll_ts_idx_read;
};
/* Quad and port information for initializing timestamp blocks */
#define INDEX_PER_QUAD 64
#define INDEX_PER_PORT_E82X 16
#define INDEX_PER_PORT 64
/**
* struct ice_ptp_port - data used to initialize an external port for PTP
*
* This structure contains data indicating whether a single external port is
* ready for PTP functionality. It is used to track the port initialization
* and determine when the port's PHY offset is valid.
*
* @list_node: list member structure
* @tx: Tx timestamp tracking for this port
* @ov_work: delayed work task for tracking when PHY offset is valid
* @ps_lock: mutex used to protect the overall PTP PHY start procedure
* @link_up: indicates whether the link is up
* @tx_fifo_busy_cnt: number of times the Tx FIFO was busy
* @port_num: the port number this structure represents
* @tx_clk: currently active Tx reference clock source
* @tx_clk_req: requested Tx reference clock source (new target)
*/
struct ice_ptp_port {
struct list_head list_node;
struct ice_ptp_tx tx;
struct kthread_delayed_work ov_work;
struct mutex ps_lock; /* protects overall PTP PHY start procedure */
bool link_up;
u8 tx_fifo_busy_cnt;
u8 port_num;
enum ice_e825c_ref_clk tx_clk;
enum ice_e825c_ref_clk tx_clk_req;
};
enum ice_ptp_tx_interrupt {
ICE_PTP_TX_INTERRUPT_NONE = 0,
ICE_PTP_TX_INTERRUPT_SELF,
ICE_PTP_TX_INTERRUPT_ALL,
};
#define GLTSYN_TGT_H_IDX_MAX 4
enum ice_ptp_state {
Annotation
- Immediate include surface: `linux/ptp_clock_kernel.h`, `linux/kthread.h`, `ice_ptp_hw.h`.
- Detected declarations: `struct ice_tx_tstamp`, `struct ice_ptp_tx`, `struct ice_ptp_port`, `struct ice_ptp_pin_desc`, `struct ice_ptp`, `struct ice_pf`, `enum ice_tx_tstamp_work`, `enum ice_ptp_tx_interrupt`, `enum ice_ptp_state`, `enum ice_ptp_pin`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- 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.