summaryrefslogtreecommitdiff
path: root/drivers/ptp/ptp_private.h
diff options
context:
space:
mode:
authorXabier Marquiegui <reibax@gmail.com>2023-10-12 00:39:56 +0200
committerDavid S. Miller <davem@davemloft.net>2023-10-15 20:07:52 +0100
commitc5a445b1e9347b14752b01f1a304bd7a2f260acc (patch)
tree52baa7d81f8a107faf818fdb2ee06ed9550ca747 /drivers/ptp/ptp_private.h
parent8f5de6fb245326704f37d91780b9a10253a8a100 (diff)
ptp: support event queue reader channel masks
On systems with multiple timestamp event channels, some readers might want to receive only a subset of those channels. Add the necessary modifications to support timestamp event channel filtering, including two IOCTL operations: - Clear all channels - Enable one channel The mask modification operations will be applied exclusively on the event queue assigned to the file descriptor used on the IOCTL operation, so the typical procedure to have a reader receiving only a subset of the enabled channels would be: - Open device file - ioctl: clear all channels - ioctl: enable one channel - start reading Calling the enable one channel ioctl more than once will result in multiple enabled channels. Signed-off-by: Xabier Marquiegui <reibax@gmail.com> Suggested-by: Richard Cochran <richardcochran@gmail.com> Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ptp/ptp_private.h')
-rw-r--r--drivers/ptp/ptp_private.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index 9d5f3d95058e..ad4ce1b25c86 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -16,10 +16,12 @@
#include <linux/ptp_clock_kernel.h>
#include <linux/time.h>
#include <linux/list.h>
+#include <linux/bitmap.h>
#define PTP_MAX_TIMESTAMPS 128
#define PTP_BUF_TIMESTAMPS 30
#define PTP_DEFAULT_MAX_VCLOCKS 20
+#define PTP_MAX_CHANNELS 2048
struct timestamp_event_queue {
struct ptp_extts_event buf[PTP_MAX_TIMESTAMPS];
@@ -27,6 +29,7 @@ struct timestamp_event_queue {
int tail;
spinlock_t lock;
struct list_head qlist;
+ unsigned long *mask;
};
struct ptp_clock {