include/linux/mii_timestamper.h

Source file repositories/reference/linux-study-clean/include/linux/mii_timestamper.h

File Facts

System
Linux kernel
Corpus path
include/linux/mii_timestamper.h
Extension
.h
Size
3954 bytes
Lines
129
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct mii_timestamper {
	bool (*rxtstamp)(struct mii_timestamper *mii_ts,
			 struct sk_buff *skb, int type);

	void (*txtstamp)(struct mii_timestamper *mii_ts,
			 struct sk_buff *skb, int type);

	int  (*hwtstamp_set)(struct mii_timestamper *mii_ts,
			     struct kernel_hwtstamp_config *kernel_config,
			     struct netlink_ext_ack *extack);

	int  (*hwtstamp_get)(struct mii_timestamper *mii_ts,
			     struct kernel_hwtstamp_config *kernel_config);

	void (*link_state)(struct mii_timestamper *mii_ts,
			   struct phy_device *phydev);

	int  (*ts_info)(struct mii_timestamper *mii_ts,
			struct kernel_ethtool_ts_info *ts_info);

	struct device *device;
};

/**
 * struct mii_timestamping_ctrl - MII time stamping controller interface.
 *
 * @probe_channel:	Callback into the controller driver announcing the
 *			presence of the 'port' channel.  The 'device' field
 *			had been passed to register_mii_tstamp_controller().
 *			The driver must return either a pointer to a valid
 *			MII timestamper instance or PTR_ERR.
 *
 * @release_channel:	Releases an instance obtained via .probe_channel.
 */
struct mii_timestamping_ctrl {
	struct mii_timestamper *(*probe_channel)(struct device *device,
						 unsigned int port);
	void (*release_channel)(struct device *device,
				struct mii_timestamper *mii_ts);
};

#ifdef CONFIG_NETWORK_PHY_TIMESTAMPING

int register_mii_tstamp_controller(struct device *device,
				   struct mii_timestamping_ctrl *ctrl);

void unregister_mii_tstamp_controller(struct device *device);

struct mii_timestamper *register_mii_timestamper(struct device_node *node,
						 unsigned int port);

void unregister_mii_timestamper(struct mii_timestamper *mii_ts);

#else

static inline
int register_mii_tstamp_controller(struct device *device,
				   struct mii_timestamping_ctrl *ctrl)
{
	return -EOPNOTSUPP;
}

static inline void unregister_mii_tstamp_controller(struct device *device)
{
}

static inline
struct mii_timestamper *register_mii_timestamper(struct device_node *node,
						 unsigned int port)
{
	return NULL;
}

static inline void unregister_mii_timestamper(struct mii_timestamper *mii_ts)
{
}

#endif

#endif

Annotation

Implementation Notes