Re: [PATCH] ptp: Demultiplexed timestamp channels
From: Richard Cochran <richardcochran@gmail.com>
Date: 2023-08-29 14:08:10
On Tue, Aug 29, 2023 at 01:47:52PM +0200, Xabier Marquiegui wrote:
Add the posibility to demultiplex the timestamp channels for external timestamp event channels. In some applications it can be necessary to have different consumers for different timestamp channels. For example, synchronize to an external pps source with linuxptp ts2phc while timestmping external events with another application. This change proposes the dynamic creation of one char-device per timestamp channel only if the user requests the demuxing of timestamp channels. It allows for on-the-fly demuxing of specific channels.
No need to make complex configuration to enable this. Just make one queue per open character device, and one for sysfs.
The operation can be controlled via sysfs. See file Documentation/ABI/testing/sysfs-ptp for more details.
No need for new sysfs hooks.
--- Documentation/ABI/testing/sysfs-ptp | 16 +++ MAINTAINERS | 5 + drivers/ptp/Makefile | 2 +- drivers/ptp/ptp_chardev.c | 2 - drivers/ptp/ptp_clock.c | 22 ++- drivers/ptp/ptp_demuxtschan.c | 211 ++++++++++++++++++++++++++++
No need to add a second char dev implementation. Just change the existing one to have a per-file queue. General comment: Lots of coding style violations here. See CodingStyle and use scripts/checkpatch.pl Thanks, Richard