xref: /freebsd/sys/dev/qat/qat_api/include/icp_sal_versions.h (revision 5f4c09dd85bff675e0ca63c55ea3c517e0fddfcc)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
3 /**
4  ***************************************************************************
5  * @file icp_sal_versions.h
6  *
7  * @defgroup SalVersions
8  *
9  * @ingroup SalVersions
10  *
11  * API and structures definition for obtaining software and hardware versions
12  *
13  ***************************************************************************/
14 
15 #ifndef _ICP_SAL_VERSIONS_H_
16 #define _ICP_SAL_VERSIONS_H_
17 
18 #define ICP_SAL_VERSIONS_FW_VERSION_SIZE 16
19 /**< Max length of firmware version string */
20 #define ICP_SAL_VERSIONS_SW_VERSION_SIZE 16
21 /**< Max length of software version string */
22 #define ICP_SAL_VERSIONS_MMP_VERSION_SIZE 16
23 /**< Max length of MMP binary version string */
24 #define ICP_SAL_VERSIONS_HW_VERSION_SIZE 4
25 /**< Max length of hardware version string */
26 
27 /* Part name and number of the accelerator device  */
28 #define SAL_INFO2_DRIVER_SW_VERSION_MAJ_NUMBER 3
29 #define SAL_INFO2_DRIVER_SW_VERSION_MIN_NUMBER 14
30 #define SAL_INFO2_DRIVER_SW_VERSION_PATCH_NUMBER 0
31 
32 /**
33 *******************************************************************************
34  * @ingroup SalVersions
35  *      Structure holding versions information
36  *
37  * @description
38  *      This structure stores information about versions of software
39  *      and hardware being run on a particular device.
40  *****************************************************************************/
41 typedef struct icp_sal_dev_version_info_s {
42 	Cpa32U devId;
43 	/**< Number of acceleration device for which this structure holds
44 	 * version
45 	 * information */
46 	Cpa8U firmwareVersion[ICP_SAL_VERSIONS_FW_VERSION_SIZE];
47 	/**< String identifying the version of the firmware associated with
48 	 * the device. */
49 	Cpa8U mmpVersion[ICP_SAL_VERSIONS_MMP_VERSION_SIZE];
50 	/**< String identifying the version of the MMP binary associated with
51 	 * the device. */
52 	Cpa8U softwareVersion[ICP_SAL_VERSIONS_SW_VERSION_SIZE];
53 	/**< String identifying the version of the software associated with
54 	 * the device. */
55 	Cpa8U hardwareVersion[ICP_SAL_VERSIONS_HW_VERSION_SIZE];
56 	/**< String identifying the version of the hardware (stepping and
57 	 * revision ID) associated with the device. */
58 } icp_sal_dev_version_info_t;
59 
60 /**
61 *******************************************************************************
62  * @ingroup SalVersions
63  *      Obtains the version information for a given device
64  * @description
65  *      This function obtains hardware and software version information
66  *      associated with a given device.
67  *
68  * @param[in]   accelId     ID of the acceleration device for which version
69  *                          information is to be obtained.
70  * @param[out]  pVerInfo    Pointer to a structure that will hold version
71  *                          information
72  *
73  * @context
74  *      This function might sleep. It cannot be executed in a context that
75  *      does not permit sleeping.
76  * @assumptions
77  *      The system has been started
78  * @sideEffects
79  *      None
80  * @blocking
81  *      No
82  * @reentrant
83  *      No
84  * @threadSafe
85  *      Yes
86  *
87  * @return CPA_STATUS_SUCCESS       Operation finished successfully
88  * @return CPA_STATUS_INVALID_PARAM Invalid parameter passed to the function
89  * @return CPA_STATUS_RESOURCE      System resources problem
90  * @return CPA_STATUS_FAIL          Operation failed
91  *
92  *****************************************************************************/
93 CpaStatus icp_sal_getDevVersionInfo(Cpa32U accelId,
94 				    icp_sal_dev_version_info_t *pVerInfo);
95 
96 #endif
97