diff options
| author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2025-06-27 20:25:42 +0300 |
|---|---|---|
| committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2026-05-19 14:20:18 +0200 |
| commit | 94a11cd5ddb1d7c206f81df17a5fcb5d3ec2d13f (patch) | |
| tree | 780c3d3afada0825d914362deec77de8b6321b1e /include/linux/thunderbolt.h | |
| parent | d614113c10ae6e35e74cdfc4fea280ce1a93ca0b (diff) | |
| download | linux-94a11cd5ddb1d7c206f81df17a5fcb5d3ec2d13f.tar.gz linux-94a11cd5ddb1d7c206f81df17a5fcb5d3ec2d13f.zip | |
thunderbolt: Add tb_ring_flush()
This allows the caller to wait for the ring to be empty. We are going to
need this in the upcoming userspace tunneling support.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'include/linux/thunderbolt.h')
| -rw-r--r-- | include/linux/thunderbolt.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/thunderbolt.h b/include/linux/thunderbolt.h index 9df8a356396f..9c5cb5e4f23d 100644 --- a/include/linux/thunderbolt.h +++ b/include/linux/thunderbolt.h @@ -556,6 +556,7 @@ struct tb_nhi { * @poll_data: Data passed to @start_poll * @interval_nsec: Interval counter if interrupt throttling is to be * used with this ring (in ns) + * @wait: Used to signal that the ring may be empty now */ struct tb_ring { spinlock_t lock; @@ -580,6 +581,7 @@ struct tb_ring { void (*start_poll)(void *data); void *poll_data; unsigned int interval_nsec; + wait_queue_head_t wait; }; /* Leave ring interrupt enabled on suspend */ @@ -653,6 +655,7 @@ struct tb_ring *tb_ring_alloc_rx(struct tb_nhi *nhi, int hop, int size, u16 sof_mask, u16 eof_mask, void (*start_poll)(void *), void *poll_data); void tb_ring_start(struct tb_ring *ring); +bool tb_ring_flush(struct tb_ring *ring, unsigned int timeout_msec); void tb_ring_stop(struct tb_ring *ring); void tb_ring_free(struct tb_ring *ring); |
