blob: ff6b3b4ae162c7ccda288782876da26db534811d [file] [log] [blame]
developer02e65912023-08-17 16:33:10 +08001/* adapter_driver97_init.c
2 *
3 * Adapter top level module, Security-IP-97 driver's entry point.
4 */
5
6/*****************************************************************************
7* Copyright (c) 2011-2020 by Rambus, Inc. and/or its subsidiaries.
8*
9* This program is free software: you can redistribute it and/or modify
10* it under the terms of the GNU General Public License as published by
11* the Free Software Foundation, either version 2 of the License, or
12* any later version.
13*
14* This program is distributed in the hope that it will be useful,
15* but WITHOUT ANY WARRANTY; without even the implied warranty of
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17* GNU General Public License for more details.
18*
19* You should have received a copy of the GNU General Public License
20* along with this program. If not, see <http://www.gnu.org/licenses/>.
21*****************************************************************************/
22
23/*----------------------------------------------------------------------------
24 * This module implements (provides) the following interface(s):
25 */
26
27#include "api_driver97_init.h" // Driver Init API
28
29
30/*----------------------------------------------------------------------------
31 * This module uses (requires) the following interface(s):
32 */
33
34// Default Adapter configuration
35#include "cs_adapter.h" // ADAPTER_DRIVER_NAME
36
37// Adapter Initialization API
38#include "adapter_init.h" // Adapter_*
39#include "adapter_global_init.h"
40
41// Logging API
42#include "log.h" // LOG_INFO
43
44
45/*----------------------------------------------------------------------------
46 * Driver97_Init
47 */
48int
49Driver97_Init(void)
50{
51 LOG_INFO("\n\t Driver97_Init \n");
52
53 LOG_INFO("%s driver: initializing\n", ADAPTER_DRIVER_NAME);
54
55 Adapter_Report_Build_Params();
56
57 if (!Adapter_Init())
58 {
59 return -1;
60 }
61
62 if (!Adapter_Global_Init())
63 {
64 Adapter_UnInit();
65 return -1;
66 }
67
68 LOG_INFO("\n\t Driver97_Init done \n");
69
70 return 0; // success
71}
72
73
74/*----------------------------------------------------------------------------
75 * Driver97_Exit
76 */
77void
78Driver97_Exit(void)
79{
80 LOG_INFO("\n\t Driver97_Exit \n");
81
82 LOG_INFO("%s driver: exit\n", ADAPTER_DRIVER_NAME);
83
84 Adapter_Global_UnInit();
85 Adapter_UnInit();
86
87 LOG_INFO("\n\t Driver97_Exit done \n");
88}
89
90#include "adapter_driver97_init_ext.h"
91
92/* end of file adapter_driver97_init.c */