drivers/net/dsa/microchip/ksz_ptp.h
Source file repositories/reference/linux-study-clean/drivers/net/dsa/microchip/ksz_ptp.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/dsa/microchip/ksz_ptp.h- Extension
.h- Size
- 2321 bytes
- Lines
- 90
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ptp_clock_kernel.h
Detected Declarations
struct ksz_ptp_datastruct ksz_ptp_dataenum ksz_ptp_tou_modefunction ksz_ptp_clock_registerfunction ksz_ptp_clock_unregisterfunction ksz_ptp_irq_free
Annotated Snippet
struct ksz_ptp_data {
struct ptp_clock_info caps;
struct ptp_clock *clock;
struct ptp_pin_desc pin_config[KSZ_PTP_N_GPIO];
/* Serializes all operations on the PTP hardware clock */
struct mutex lock;
/* lock for accessing the clock_time */
spinlock_t clock_lock;
struct timespec64 clock_time;
enum ksz_ptp_tou_mode tou_mode;
struct timespec64 perout_target_time_first; /* start of first pulse */
struct timespec64 perout_period;
};
int ksz_ptp_clock_register(struct dsa_switch *ds);
void ksz_ptp_clock_unregister(struct dsa_switch *ds);
int ksz_get_ts_info(struct dsa_switch *ds, int port,
struct kernel_ethtool_ts_info *ts);
int ksz_hwtstamp_get(struct dsa_switch *ds, int port,
struct kernel_hwtstamp_config *config);
int ksz_hwtstamp_set(struct dsa_switch *ds, int port,
struct kernel_hwtstamp_config *config,
struct netlink_ext_ack *extack);
void ksz_port_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb);
void ksz_port_deferred_xmit(struct kthread_work *work);
bool ksz_port_rxtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb,
unsigned int type);
int ksz_ptp_irq_setup(struct dsa_switch *ds, u8 p);
void ksz_ptp_irq_free(struct dsa_switch *ds, u8 p);
#else
struct ksz_ptp_data {
/* Serializes all operations on the PTP hardware clock */
struct mutex lock;
};
static inline int ksz_ptp_clock_register(struct dsa_switch *ds)
{
return 0;
}
static inline void ksz_ptp_clock_unregister(struct dsa_switch *ds) { }
static inline int ksz_ptp_irq_setup(struct dsa_switch *ds, u8 p)
{
return 0;
}
static inline void ksz_ptp_irq_free(struct dsa_switch *ds, u8 p) {}
#define ksz_get_ts_info NULL
#define ksz_hwtstamp_get NULL
#define ksz_hwtstamp_set NULL
#define ksz_port_rxtstamp NULL
#define ksz_port_txtstamp NULL
#define ksz_port_deferred_xmit NULL
#endif /* End of CONFIG_NET_DSA_MICROCHIP_KSZ_PTP */
#endif
Annotation
- Immediate include surface: `linux/ptp_clock_kernel.h`.
- Detected declarations: `struct ksz_ptp_data`, `struct ksz_ptp_data`, `enum ksz_ptp_tou_mode`, `function ksz_ptp_clock_register`, `function ksz_ptp_clock_unregister`, `function ksz_ptp_irq_free`.
- 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.