Re: [PATCH net-next v3 3/3] ptp: support event queue reader channel masks
From: Richard Cochran <richardcochran@gmail.com>
Date: 2023-09-30 22:37:43
From: Richard Cochran <richardcochran@gmail.com>
Date: 2023-09-30 22:37:43
On Thu, Sep 28, 2023 at 03:35:44PM +0200, Xabier Marquiegui wrote:
diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h index 05cc35fc94ac..6bbf11dc4a05 100644 --- a/include/uapi/linux/ptp_clock.h +++ b/include/uapi/linux/ptp_clock.h@@ -105,6 +105,15 @@ struct ptp_extts_request { unsigned int rsv[2]; /* Reserved for future use. */ }; +struct ptp_tsfilter { + union { + unsigned int reader_rpid; /* PID of device user */ + unsigned int ndevusers; /* Device user count */ + }; + int reader_oid; /* Object ID of the timestamp event queue */ + unsigned int mask; /* Channel mask. LSB = channel 0 */ +};
This is WAY too complicated. Just let the user pass a bit mask (say 32 x uint64_t = 2048 channels) of what they want to receive. OR: - ioctl to clear mask - ioctl to set one channel in mask After opening the character device, the default is that the user will receive events from all channels. This is an established API, and you cannot change it. If the user is only interested in specific channels, then they can set the mask after calling open(). Thanks, Richard