提交 995a9090 编写于 作者: R Richard Cochran 提交者: David S. Miller

ptp: Add a method for obtaining the device index.

This commit adds a method that MAC drivers may call in order to find out
the device number of their associated PTP Hardware Clock.
Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2173bff5
...@@ -304,6 +304,12 @@ void ptp_clock_event(struct ptp_clock *ptp, struct ptp_clock_event *event) ...@@ -304,6 +304,12 @@ void ptp_clock_event(struct ptp_clock *ptp, struct ptp_clock_event *event)
} }
EXPORT_SYMBOL(ptp_clock_event); EXPORT_SYMBOL(ptp_clock_event);
int ptp_clock_index(struct ptp_clock *ptp)
{
return ptp->index;
}
EXPORT_SYMBOL(ptp_clock_index);
/* module operations */ /* module operations */
static void __exit ptp_exit(void) static void __exit ptp_exit(void)
......
...@@ -136,4 +136,12 @@ struct ptp_clock_event { ...@@ -136,4 +136,12 @@ struct ptp_clock_event {
extern void ptp_clock_event(struct ptp_clock *ptp, extern void ptp_clock_event(struct ptp_clock *ptp,
struct ptp_clock_event *event); struct ptp_clock_event *event);
/**
* ptp_clock_index() - obtain the device index of a PTP clock
*
* @ptp: The clock obtained from ptp_clock_register().
*/
extern int ptp_clock_index(struct ptp_clock *ptp);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册