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