38 #if defined(__linux__) || defined(__APPLE__)
40 #include <sys/types.h>
50 static void display_help(
void)
52 printf(
"-------- init_rsrc_logan v%s --------\n"
53 "Initialize NetInt Logan transcoder resource pool\n"
54 "-r Init transcoder card resource regardless firmware release \n"
55 " version to libxcoder_logan version compatibility.\n"
56 " Default: only init cards with compatible firmware version.\n"
57 "-c Only init if all cards are fully compatible.\n"
58 " Default: init as many fully and partially cards as possible.\n"
59 "-t Set timeout time in seconds for device polling, will exit with failure \n"
61 " Default: no timeout.\n"
62 "-l Set loglevel of libxcoder_logan API.\n"
63 " [none, fatal, error, info, debug, trace]\n"
65 "-v Show libxcoder_logan version.\n"
76 int main(
int argc,
char *argv[])
79 int init_no_compat_check = 0;
80 int init_only_if_full_compat = 0;
81 int should_match_rev = 1;
83 int timeout_seconds = 0;
86 while ((opt =
getopt(argc, argv,
"hvrct:l:")) != -1)
95 init_no_compat_check = 1;
98 init_only_if_full_compat = 1;
102 printf(
"Timeout will be set %d\n", timeout_seconds);
105 if (!strcmp(
optarg,
"none")) {
107 }
else if (!strcmp(
optarg,
"fatal")) {
109 }
else if (!strcmp(
optarg,
"error")) {
111 }
else if (!strcmp(
optarg,
"info")) {
113 }
else if (!strcmp(
optarg,
"debug")) {
115 }
else if (!strcmp(
optarg,
"trace")) {
118 fprintf(stderr,
"unknown log level selected: %s",
optarg);
126 fprintf(stderr,
"Wrong option\n");
131 if (init_no_compat_check && init_only_if_full_compat)
133 fprintf(stderr,
"Error: -r option cannot be used with -c option\n\n");
137 if (init_no_compat_check)
139 should_match_rev = 0;
141 else if (init_only_if_full_compat)
143 should_match_rev = 2;
146 #if defined(__linux__) || defined(__APPLE__)
155 printf(
"NETINT Logan Resources Intitialized Successfully\n");
int main(int argc, char *argv[])
Common NETINT definitions used by all modules.
@ NI_LOGAN_RETCODE_SUCCESS
#define NI_LOGAN_RETCODE_INIT_ALREADY
#define NI_LOGAN_XCODER_REVISION
int getopt(int argc, char *argv[], const char *optstring)
void ni_log_set_level(ni_log_level_t level)
Set ni_log_level.
int ni_logan_rsrc_init(int should_match_rev, int timeout_seconds)
Initialize and create all resources required to work with NETINT NVMe transcoder devices....
Exported definitions related to resource management of NI T-408 devices.
Private definitions related to resource management of NI T-408 devices.
Exported utility routines definition.