• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Licensed under the Apache License, Version 2.0 (the "License");
15  * you may not use this file except in compliance with the License.
16  * You may obtain a copy of the License at
17  *
18  *     http://www.apache.org/licenses/LICENSE-2.0
19  *
20  * Unless required by applicable law or agreed to in writing, software
21  * distributed under the License is distributed on an "AS IS" BASIS,
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23  * See the License for the specific language governing permissions and
24  * limitations under the License.
25  * Description: define hmac version
26  * Create: 2021-9-28
27  */
28 
29 #ifndef __HMAC_VERSION_H__
30 #define __HMAC_VERSION_H__
31 
32 #include "osal_types.h"
33 
34 /*
35  * WSxx [  a  ].[  c  ].T[  c  ].[  d  ]
36  * WSxx [1-255].[1-255].T[1-255].[1-255]
37  */
38 typedef union {
39     osal_u32 ver;
40     struct {
41         osal_u32 d : 8; /* [ 7,  0] */
42         osal_u32 c : 8; /* [15,  8] */
43         osal_u32 b : 8; /* [23, 16] */
44         osal_u32 a : 8; /* [31, 24] */
45     } bits;
46 } version_u;
47 
48 typedef union {
49     osal_u32 ver;
50     struct {
51         osal_u32 c : 8; /* [7..0] */
52         osal_u32 r : 8; /* [15..8] */
53         osal_u32 v : 16; /* [31..16] */
54     } bits;
55 } rom_version_u;
56 
57 typedef struct {
58     version_u host;
59     version_u device;
60     rom_version_u device_rom;
61 } version_t;
62 
63 osal_u32 hmac_get_version(osal_void);
64 osal_u32 hmac_get_device_version(osal_void);
65 osal_u32 hmac_get_device_rom_version(osal_void);
66 
67 #endif
68 
69