1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright(c) 2022, Intel Corporation. All rights reserved.
4  */
5 
6 #ifndef __INTEL_PXP_FW_INTERFACE_CMN_H__
7 #define __INTEL_PXP_FW_INTERFACE_CMN_H__
8 
9 #include <linux/types.h>
10 
11 #define PXP_APIVER(x, y) (((x) & 0xFFFF) << 16 | ((y) & 0xFFFF))
12 
13 /*
14  * there are a lot of status codes for PXP, but we only define the cross-API
15  * common ones that we actually can handle in the kernel driver. Other failure
16  * codes should be printed to error msg for debug.
17  */
18 enum pxp_status {
19 	PXP_STATUS_SUCCESS = 0x0,
20 	PXP_STATUS_ERROR_API_VERSION = 0x1002,
21 	PXP_STATUS_OP_NOT_PERMITTED = 0x4013
22 };
23 
24 /* Common PXP FW message header */
25 struct pxp_cmd_header {
26 	u32 api_version;
27 	u32 command_id;
28 	union {
29 		u32 status; /* out */
30 		u32 stream_id; /* in */
31 	};
32 	/* Length of the message (excluding the header) */
33 	u32 buffer_len;
34 } __packed;
35 
36 #endif /* __INTEL_PXP_FW_INTERFACE_CMN_H__ */
37