From: Maciek Machnikowski <maciek@machnikowski.net>
To: kuba@kernel.org
Cc: maciek@machnikowski.net, richardcochran@gmail.com,
netdev@vger.kernel.org, milena.olech@intel.com
Subject: [PATCH net-next 1/2] ptp: Expose ptp_clock_info to external drivers
Date: Thu, 19 Feb 2026 15:05:29 +0100 [thread overview]
Message-ID: <20260219140530.2148-2-maciek@machnikowski.net> (raw)
In-Reply-To: <20260219140530.2148-1-maciek@machnikowski.net>
Allow exposing the ptp_clock_info of the ptp_mock to the external drivers.
This is a prerequisite for implementing ptp support on netdevsim mock.
Co-developed-by: Milena Olech <milena.olech@intel.com>
Signed-off-by: Milena Olech <milena.olech@intel.com>
Signed-off-by: Maciek Machnikowski <maciek@machnikowski.net>
---
drivers/ptp/ptp_mock.c | 6 ++++++
include/linux/ptp_mock.h | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/drivers/ptp/ptp_mock.c b/drivers/ptp/ptp_mock.c
index bbd14ce24..0d0936298 100644
--- a/drivers/ptp/ptp_mock.c
+++ b/drivers/ptp/ptp_mock.c
@@ -171,5 +171,11 @@ void mock_phc_destroy(struct mock_phc *phc)
}
EXPORT_SYMBOL_GPL(mock_phc_destroy);
+struct ptp_clock_info *mock_phc_get_ptp_info(struct mock_phc *phc)
+{
+ return &phc->info;
+}
+EXPORT_SYMBOL_GPL(mock_phc_get_ptp_info);
+
MODULE_DESCRIPTION("Mock-up PTP Hardware Clock driver");
MODULE_LICENSE("GPL");
diff --git a/include/linux/ptp_mock.h b/include/linux/ptp_mock.h
index 72eb40103..e33188dec 100644
--- a/include/linux/ptp_mock.h
+++ b/include/linux/ptp_mock.h
@@ -16,6 +16,7 @@ struct mock_phc;
struct mock_phc *mock_phc_create(struct device *dev);
void mock_phc_destroy(struct mock_phc *phc);
int mock_phc_index(struct mock_phc *phc);
+struct ptp_clock_info *mock_phc_get_ptp_info(struct mock_phc *phc);
#else
@@ -33,6 +34,10 @@ static inline int mock_phc_index(struct mock_phc *phc)
return -1;
}
+static inline struct ptp_clock_info *mock_phc_get_ptp_info(struct mock_phc *phc)
+{
+ return NULL;
+}
#endif
#endif /* _PTP_MOCK_H_ */
--
2.53.0
next prev parent reply other threads:[~2026-02-19 14:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-19 14:05 [PATCH net-next 0/2] Implement PTP support in netdevsim Maciek Machnikowski
2026-02-19 14:05 ` Maciek Machnikowski [this message]
2026-02-19 14:05 ` [PATCH net-next 2/2] netdevsim: Implement basic ptp support Maciek Machnikowski
2026-02-19 16:16 ` Andrew Lunn
2026-02-19 20:42 ` Jakub Kicinski
2026-02-20 21:07 ` Maciek Machnikowski
2026-02-20 20:08 ` Willem de Bruijn
2026-02-20 21:06 ` Maciek Machnikowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260219140530.2148-2-maciek@machnikowski.net \
--to=maciek@machnikowski.net \
--cc=kuba@kernel.org \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox