| 1 | /* SPDX-License-Identifier: MIT */ |
| 2 | /* |
| 3 | * Copyright © 2023 Intel Corporation |
| 4 | */ |
| 5 | |
| 6 | #ifndef _XE_GUC_RELAY_TYPES_H_ |
| 7 | #define _XE_GUC_RELAY_TYPES_H_ |
| 8 | |
| 9 | #include <linux/mempool.h> |
| 10 | #include <linux/ratelimit_types.h> |
| 11 | #include <linux/spinlock.h> |
| 12 | #include <linux/workqueue.h> |
| 13 | |
| 14 | /** |
| 15 | * struct xe_guc_relay - Data used by the VF-PF Relay Communication over GuC. |
| 16 | */ |
| 17 | struct xe_guc_relay { |
| 18 | /**@lock: protects all internal data. */ |
| 19 | spinlock_t lock; |
| 20 | |
| 21 | /** @worker: dispatches incoming action messages. */ |
| 22 | struct work_struct worker; |
| 23 | |
| 24 | /** @pending_relays: list of sent requests that await a response. */ |
| 25 | struct list_head pending_relays; |
| 26 | |
| 27 | /** @incoming_actions: list of incoming relay action messages to process. */ |
| 28 | struct list_head incoming_actions; |
| 29 | |
| 30 | /** @pool: pool of the relay message buffers. */ |
| 31 | mempool_t pool; |
| 32 | |
| 33 | /** @last_rid: last Relay-ID used while sending a message. */ |
| 34 | u32 last_rid; |
| 35 | |
| 36 | /** @diag_ratelimit: ratelimit state used to throttle diagnostics messages. */ |
| 37 | struct ratelimit_state diag_ratelimit; |
| 38 | }; |
| 39 | |
| 40 | #endif |
| 41 | |