xref: /linux/drivers/gpu/drm/xe/xe_guc_relay.h (revision 7255fcc80d4b525cc10cfaaf7f485830d4ed2000)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _XE_GUC_RELAY_H_
7 #define _XE_GUC_RELAY_H_
8 
9 #include <linux/types.h>
10 #include <linux/errno.h>
11 
12 struct xe_guc_relay;
13 
14 int xe_guc_relay_init(struct xe_guc_relay *relay);
15 
16 int xe_guc_relay_send_to_pf(struct xe_guc_relay *relay,
17 			    const u32 *msg, u32 len, u32 *buf, u32 buf_size);
18 
19 int xe_guc_relay_process_guc2vf(struct xe_guc_relay *relay, const u32 *msg, u32 len);
20 
21 #ifdef CONFIG_PCI_IOV
22 int xe_guc_relay_send_to_vf(struct xe_guc_relay *relay, u32 target,
23 			    const u32 *msg, u32 len, u32 *buf, u32 buf_size);
24 int xe_guc_relay_process_guc2pf(struct xe_guc_relay *relay, const u32 *msg, u32 len);
25 #else
26 static inline int xe_guc_relay_send_to_vf(struct xe_guc_relay *relay, u32 target,
27 					  const u32 *msg, u32 len, u32 *buf, u32 buf_size)
28 {
29 	return -ENODEV;
30 }
31 static inline int xe_guc_relay_process_guc2pf(struct xe_guc_relay *relay, const u32 *msg, u32 len)
32 {
33 	return -ENODEV;
34 }
35 #endif
36 
37 #endif
38