diff options
Diffstat (limited to 'board/Arcturus/ucp1020/cmd_arc.c')
-rw-r--r-- | board/Arcturus/ucp1020/cmd_arc.c | 433 |
1 files changed, 303 insertions, 130 deletions
diff --git a/board/Arcturus/ucp1020/cmd_arc.c b/board/Arcturus/ucp1020/cmd_arc.c index 1c42fee3d6..7a510c61fb 100644 --- a/board/Arcturus/ucp1020/cmd_arc.c +++ b/board/Arcturus/ucp1020/cmd_arc.c | |||
@@ -2,8 +2,8 @@ | |||
2 | /* | 2 | /* |
3 | * Command for accessing Arcturus factory environment. | 3 | * Command for accessing Arcturus factory environment. |
4 | * | 4 | * |
5 | * Copyright 2013-2015 Arcturus Networks Inc. | 5 | * Copyright 2013-2019 Arcturus Networks Inc. |
6 | * http://www.arcturusnetworks.com/products/ucp1020/ | 6 | * https://www.arcturusnetworks.com/products/ |
7 | * by Oleksandr G Zhadan et al. | 7 | * by Oleksandr G Zhadan et al. |
8 | * | 8 | * |
9 | */ | 9 | */ |
@@ -12,32 +12,13 @@ | |||
12 | #include <div64.h> | 12 | #include <div64.h> |
13 | #include <malloc.h> | 13 | #include <malloc.h> |
14 | #include <spi_flash.h> | 14 | #include <spi_flash.h> |
15 | 15 | #include <mmc.h> | |
16 | #include <version.h> | ||
17 | #include <environment.h> | ||
16 | #include <asm/io.h> | 18 | #include <asm/io.h> |
17 | 19 | ||
18 | #ifndef CONFIG_SF_DEFAULT_SPEED | 20 | static ulong fwenv_addr[MAX_FWENV_ADDR]; |
19 | # define CONFIG_SF_DEFAULT_SPEED 1000000 | 21 | const char mystrerr[] = "ERROR: Failed to save factory info"; |
20 | #endif | ||
21 | #ifndef CONFIG_SF_DEFAULT_MODE | ||
22 | # define CONFIG_SF_DEFAULT_MODE SPI_MODE0 | ||
23 | #endif | ||
24 | #ifndef CONFIG_SF_DEFAULT_CS | ||
25 | # define CONFIG_SF_DEFAULT_CS 0 | ||
26 | #endif | ||
27 | #ifndef CONFIG_SF_DEFAULT_BUS | ||
28 | # define CONFIG_SF_DEFAULT_BUS 0 | ||
29 | #endif | ||
30 | |||
31 | #define MAX_SERIAL_SIZE 15 | ||
32 | #define MAX_HWADDR_SIZE 17 | ||
33 | |||
34 | #define FIRM_ADDR1 (0x200 - sizeof(smac)) | ||
35 | #define FIRM_ADDR2 (0x400 - sizeof(smac)) | ||
36 | #define FIRM_ADDR3 (CONFIG_ENV_SECT_SIZE + 0x200 - sizeof(smac)) | ||
37 | #define FIRM_ADDR4 (CONFIG_ENV_SECT_SIZE + 0x400 - sizeof(smac)) | ||
38 | |||
39 | static struct spi_flash *flash; | ||
40 | char smac[4][18]; | ||
41 | 22 | ||
42 | static int ishwaddr(char *hwaddr) | 23 | static int ishwaddr(char *hwaddr) |
43 | { | 24 | { |
@@ -51,156 +32,349 @@ static int ishwaddr(char *hwaddr) | |||
51 | return -1; | 32 | return -1; |
52 | } | 33 | } |
53 | 34 | ||
54 | static int set_arc_product(int argc, char *const argv[]) | 35 | #if (FWENV_TYPE == FWENV_MMC) |
36 | |||
37 | static char smac[29][18] __attribute__ ((aligned(0x200))); /* 1 MMC block is 512 bytes */ | ||
38 | |||
39 | int set_mmc_arc_product(int argc, char *const argv[]) | ||
55 | { | 40 | { |
56 | int err = 0; | 41 | struct mmc *mmc; |
57 | char *mystrerr = "ERROR: Failed to save factory info in spi location"; | 42 | u32 blk, cnt, n; |
43 | int i, err = 1; | ||
44 | void *addr; | ||
45 | const u8 mmc_dev_num = CONFIG_SYS_MMC_ENV_DEV; | ||
46 | |||
47 | mmc = find_mmc_device(mmc_dev_num); | ||
48 | if (!mmc) { | ||
49 | printf("No SD/MMC/eMMC card found\n"); | ||
50 | return 0; | ||
51 | } | ||
52 | if (mmc_init(mmc)) { | ||
53 | printf("%s(%d) init failed\n", IS_SD(mmc) ? "SD" : "MMC", | ||
54 | mmc_dev_num); | ||
55 | return 0; | ||
56 | } | ||
57 | if (mmc_getwp(mmc) == 1) { | ||
58 | printf("Error: card is write protected!\n"); | ||
59 | return CMD_RET_FAILURE; | ||
60 | } | ||
58 | 61 | ||
59 | if (argc != 5) | 62 | /* Save factory defaults */ |
60 | return -1; | 63 | addr = (void *)smac; |
64 | cnt = 1; /* One 512 bytes block */ | ||
65 | |||
66 | for (i = 0; i < MAX_FWENV_ADDR; i++) | ||
67 | if (fwenv_addr[i] != -1) { | ||
68 | blk = fwenv_addr[i] / 512; | ||
69 | n = blk_dwrite(mmc_get_blk_desc(mmc), blk, cnt, addr); | ||
70 | if (n != cnt) | ||
71 | printf("%s: %s [%d]\n", __func__, mystrerr, i); | ||
72 | else | ||
73 | err = 0; | ||
74 | } | ||
75 | if (err) | ||
76 | return -2; | ||
61 | 77 | ||
62 | /* Check serial number */ | 78 | return err; |
63 | if (strlen(argv[1]) != MAX_SERIAL_SIZE) | 79 | } |
64 | return -1; | ||
65 | 80 | ||
66 | /* Check HWaddrs */ | 81 | static int read_mmc_arc_info(void) |
67 | if (ishwaddr(argv[2]) || ishwaddr(argv[3]) || ishwaddr(argv[4])) | 82 | { |
68 | return -1; | 83 | struct mmc *mmc; |
84 | u32 blk, cnt, n; | ||
85 | int i; | ||
86 | void *addr; | ||
87 | const u8 mmc_dev_num = CONFIG_SYS_MMC_ENV_DEV; | ||
88 | |||
89 | mmc = find_mmc_device(mmc_dev_num); | ||
90 | if (!mmc) { | ||
91 | printf("No SD/MMC/eMMC card found\n"); | ||
92 | return 0; | ||
93 | } | ||
94 | if (mmc_init(mmc)) { | ||
95 | printf("%s(%d) init failed\n", IS_SD(mmc) ? "SD" : "MMC", | ||
96 | mmc_dev_num); | ||
97 | return 0; | ||
98 | } | ||
69 | 99 | ||
70 | strcpy(smac[3], argv[1]); | 100 | addr = (void *)smac; |
71 | strcpy(smac[2], argv[2]); | 101 | cnt = 1; /* One 512 bytes block */ |
72 | strcpy(smac[1], argv[3]); | ||
73 | strcpy(smac[0], argv[4]); | ||
74 | 102 | ||
75 | flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS, | 103 | for (i = 0; i < MAX_FWENV_ADDR; i++) |
76 | CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE); | 104 | if (fwenv_addr[i] != -1) { |
105 | blk = fwenv_addr[i] / 512; | ||
106 | n = blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr); | ||
107 | flush_cache((ulong) addr, 512); | ||
108 | if (n == cnt) | ||
109 | return (i + 1); | ||
110 | } | ||
111 | return 0; | ||
112 | } | ||
113 | #endif | ||
77 | 114 | ||
78 | /* | 115 | #if (FWENV_TYPE == FWENV_SPI_FLASH) |
79 | * Save factory defaults | ||
80 | */ | ||
81 | 116 | ||
82 | if (spi_flash_write(flash, FIRM_ADDR1, sizeof(smac), smac)) { | 117 | static struct spi_flash *flash; |
83 | printf("%s: %s [1]\n", __func__, mystrerr); | 118 | static char smac[4][18]; |
84 | err++; | ||
85 | } | ||
86 | if (spi_flash_write(flash, FIRM_ADDR2, sizeof(smac), smac)) { | ||
87 | printf("%s: %s [2]\n", __func__, mystrerr); | ||
88 | err++; | ||
89 | } | ||
90 | 119 | ||
91 | if (spi_flash_write(flash, FIRM_ADDR3, sizeof(smac), smac)) { | 120 | int set_spi_arc_product(int argc, char *const argv[]) |
92 | printf("%s: %s [3]\n", __func__, mystrerr); | 121 | { |
93 | err++; | 122 | int i, err = 1; |
94 | } | ||
95 | 123 | ||
96 | if (spi_flash_write(flash, FIRM_ADDR4, sizeof(smac), smac)) { | 124 | flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS, |
97 | printf("%s: %s [4]\n", __func__, mystrerr); | 125 | CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE); |
98 | err++; | 126 | if (!flash) { |
127 | printf("Failed to initialize SPI flash at %u:%u\n", | ||
128 | CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS); | ||
129 | return -1; | ||
99 | } | 130 | } |
100 | 131 | ||
101 | if (err == 4) { | 132 | /* Save factory defaults */ |
102 | printf("%s: %s [ALL]\n", __func__, mystrerr); | 133 | for (i = 0; i < MAX_FWENV_ADDR; i++) |
134 | if (fwenv_addr[i] != -1) | ||
135 | if (spi_flash_write | ||
136 | (flash, fwenv_addr[i], sizeof(smac), smac)) | ||
137 | printf("%s: %s [%d]\n", __func__, mystrerr, i); | ||
138 | else | ||
139 | err = 0; | ||
140 | if (err) | ||
103 | return -2; | 141 | return -2; |
104 | } | ||
105 | 142 | ||
106 | return 0; | 143 | return err; |
107 | } | 144 | } |
108 | 145 | ||
109 | int get_arc_info(void) | 146 | static int read_spi_arc_info(void) |
110 | { | 147 | { |
111 | int location = 1; | 148 | int i; |
112 | char *myerr = "ERROR: Failed to read all 4 factory info spi locations"; | ||
113 | 149 | ||
114 | flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS, | 150 | flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS, |
115 | CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE); | 151 | CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE); |
152 | if (!flash) { | ||
153 | printf("Failed to initialize SPI flash at %u:%u\n", | ||
154 | CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS); | ||
155 | return 0; | ||
156 | } | ||
157 | for (i = 0; i < MAX_FWENV_ADDR; i++) | ||
158 | if (fwenv_addr[i] != -1) | ||
159 | if (!spi_flash_read | ||
160 | (flash, fwenv_addr[i], sizeof(smac), smac)) | ||
161 | return (i + 1); | ||
162 | return 0; | ||
163 | } | ||
164 | #endif | ||
165 | |||
166 | #if (FWENV_TYPE == FWENV_NOR_FLASH) | ||
116 | 167 | ||
117 | if (spi_flash_read(flash, FIRM_ADDR1, sizeof(smac), smac)) { | 168 | static char smac[4][18]; |
118 | location++; | 169 | |
119 | if (spi_flash_read(flash, FIRM_ADDR2, sizeof(smac), smac)) { | 170 | int set_nor_arc_product(int argc, char *const argv[]) |
120 | location++; | 171 | { |
121 | if (spi_flash_read(flash, FIRM_ADDR3, sizeof(smac), | 172 | int i, err = 1; |
122 | smac)) { | 173 | |
123 | location++; | 174 | /* Save factory defaults */ |
124 | if (spi_flash_read(flash, FIRM_ADDR4, | 175 | for (i = 0; i < MAX_FWENV_ADDR; i++) |
125 | sizeof(smac), smac)) { | 176 | if (fwenv_addr[i] != -1) { |
126 | printf("%s: %s\n", __func__, myerr); | 177 | ulong fwenv_end = fwenv_addr[i] + 4; |
127 | return -2; | 178 | |
128 | } | 179 | flash_sect_roundb(&fwenv_end); |
129 | } | 180 | flash_sect_protect(0, fwenv_addr[i], fwenv_end); |
181 | if (flash_write | ||
182 | ((char *)smac, fwenv_addr[i], sizeof(smac))) | ||
183 | printf("%s: %s [%d]\n", __func__, mystrerr, i); | ||
184 | else | ||
185 | err = 0; | ||
186 | flash_sect_protect(1, fwenv_addr[i], fwenv_end); | ||
130 | } | 187 | } |
131 | } | 188 | if (err) |
132 | if (smac[3][0] != 0) { | 189 | return -2; |
133 | if (location > 1) | 190 | |
134 | printf("Using region %d\n", location); | 191 | return err; |
135 | printf("SERIAL: "); | 192 | } |
136 | if (smac[3][0] == 0xFF) { | 193 | |
137 | printf("\t<not found>\n"); | 194 | static int read_nor_arc_info(void) |
138 | } else { | 195 | { |
139 | printf("\t%s\n", smac[3]); | 196 | int i; |
140 | env_set("SERIAL", smac[3]); | 197 | |
198 | for (i = 0; i < MAX_FWENV_ADDR; i++) | ||
199 | if (fwenv_addr[i] != -1) { | ||
200 | memcpy(smac, (void *)fwenv_addr[i], sizeof(smac)); | ||
201 | return (i + 1); | ||
141 | } | 202 | } |
203 | |||
204 | return 0; | ||
205 | } | ||
206 | #endif | ||
207 | |||
208 | int set_arc_product(int argc, char *const argv[]) | ||
209 | { | ||
210 | if (argc != 5) | ||
211 | return -1; | ||
212 | |||
213 | /* Check serial number */ | ||
214 | if (strlen(argv[1]) != MAX_SERIAL_SIZE) | ||
215 | return -1; | ||
216 | |||
217 | /* Check HWaddrs */ | ||
218 | if (ishwaddr(argv[2]) || ishwaddr(argv[3]) || ishwaddr(argv[4])) | ||
219 | return -1; | ||
220 | |||
221 | strcpy(smac[0], argv[1]); | ||
222 | strcpy(smac[1], argv[2]); | ||
223 | strcpy(smac[2], argv[3]); | ||
224 | strcpy(smac[3], argv[4]); | ||
225 | |||
226 | #if (FWENV_TYPE == FWENV_NOR_FLASH) | ||
227 | return set_nor_arc_product(argc, argv); | ||
228 | #endif | ||
229 | #if (FWENV_TYPE == FWENV_SPI_FLASH) | ||
230 | return set_spi_arc_product(argc, argv); | ||
231 | #endif | ||
232 | #if (FWENV_TYPE == FWENV_MMC) | ||
233 | return set_mmc_arc_product(argc, argv); | ||
234 | #endif | ||
235 | return -2; | ||
236 | } | ||
237 | |||
238 | static int read_arc_info(void) | ||
239 | { | ||
240 | #if (FWENV_TYPE == FWENV_NOR_FLASH) | ||
241 | return read_nor_arc_info(); | ||
242 | #endif | ||
243 | #if (FWENV_TYPE == FWENV_SPI_FLASH) | ||
244 | return read_spi_arc_info(); | ||
245 | #endif | ||
246 | #if (FWENV_TYPE == FWENV_MMC) | ||
247 | return read_mmc_arc_info(); | ||
248 | #endif | ||
249 | return 0; | ||
250 | } | ||
251 | |||
252 | static int do_get_arc_info(void) | ||
253 | { | ||
254 | int l = read_arc_info(); | ||
255 | char *oldserial = env_get("SERIAL"); | ||
256 | char *oldversion = env_get("VERSION"); | ||
257 | |||
258 | if (oldversion != NULL) | ||
259 | if (strcmp(oldversion, U_BOOT_VERSION) != 0) | ||
260 | oldversion = NULL; | ||
261 | |||
262 | if (l == 0) { | ||
263 | printf("%s: failed to read factory info\n", __func__); | ||
264 | return -2; | ||
142 | } | 265 | } |
143 | 266 | ||
144 | if (strcmp(smac[2], "00:00:00:00:00:00") == 0) | 267 | printf("\rSERIAL: "); |
145 | return 0; | 268 | if (smac[0][0] == EMPY_CHAR) { |
269 | printf("<not found>\n"); | ||
270 | } else { | ||
271 | printf("%s\n", smac[0]); | ||
272 | env_set("SERIAL", smac[0]); | ||
273 | } | ||
274 | |||
275 | if (strcmp(smac[1], "00:00:00:00:00:00") == 0) { | ||
276 | env_set("ethaddr", NULL); | ||
277 | env_set("eth1addr", NULL); | ||
278 | env_set("eth2addr", NULL); | ||
279 | goto done; | ||
280 | } | ||
146 | 281 | ||
147 | printf("HWADDR0:"); | 282 | printf("HWADDR0: "); |
148 | if (smac[2][0] == 0xFF) { | 283 | if (smac[1][0] == EMPY_CHAR) { |
149 | printf("\t<not found>\n"); | 284 | printf("<not found>\n"); |
150 | } else { | 285 | } else { |
151 | char *ret = env_get("ethaddr"); | 286 | char *ret = env_get("ethaddr"); |
152 | 287 | ||
153 | if (strcmp(ret, __stringify(CONFIG_ETHADDR)) == 0) { | 288 | if (ret == NULL) { |
154 | env_set("ethaddr", smac[2]); | 289 | env_set("ethaddr", smac[1]); |
155 | printf("\t%s (factory)\n", smac[2]); | 290 | printf("%s\n", smac[1]); |
291 | } else if (strcmp(ret, __stringify(CONFIG_ETHADDR)) == 0) { | ||
292 | env_set("ethaddr", smac[1]); | ||
293 | printf("%s (factory)\n", smac[1]); | ||
156 | } else { | 294 | } else { |
157 | printf("\t%s\n", ret); | 295 | printf("%s\n", ret); |
158 | } | 296 | } |
159 | } | 297 | } |
160 | 298 | ||
161 | if (strcmp(smac[1], "00:00:00:00:00:00") == 0) { | 299 | if (strcmp(smac[2], "00:00:00:00:00:00") == 0) { |
162 | env_set("eth1addr", smac[2]); | 300 | env_set("eth1addr", NULL); |
163 | env_set("eth2addr", smac[2]); | 301 | env_set("eth2addr", NULL); |
164 | return 0; | 302 | goto done; |
165 | } | 303 | } |
166 | 304 | ||
167 | printf("HWADDR1:"); | 305 | printf("HWADDR1: "); |
168 | if (smac[1][0] == 0xFF) { | 306 | if (smac[2][0] == EMPY_CHAR) { |
169 | printf("\t<not found>\n"); | 307 | printf("<not found>\n"); |
170 | } else { | 308 | } else { |
171 | char *ret = env_get("eth1addr"); | 309 | char *ret = env_get("eth1addr"); |
172 | 310 | ||
173 | if (strcmp(ret, __stringify(CONFIG_ETH1ADDR)) == 0) { | 311 | if (ret == NULL) { |
174 | env_set("eth1addr", smac[1]); | 312 | env_set("ethaddr", smac[2]); |
175 | printf("\t%s (factory)\n", smac[1]); | 313 | printf("%s\n", smac[2]); |
314 | } else if (strcmp(ret, __stringify(CONFIG_ETH1ADDR)) == 0) { | ||
315 | env_set("eth1addr", smac[2]); | ||
316 | printf("%s (factory)\n", smac[2]); | ||
176 | } else { | 317 | } else { |
177 | printf("\t%s\n", ret); | 318 | printf("%s\n", ret); |
178 | } | 319 | } |
179 | } | 320 | } |
180 | 321 | ||
181 | if (strcmp(smac[0], "00:00:00:00:00:00") == 0) { | 322 | if (strcmp(smac[3], "00:00:00:00:00:00") == 0) { |
182 | env_set("eth2addr", smac[1]); | 323 | env_set("eth2addr", NULL); |
183 | return 0; | 324 | goto done; |
184 | } | 325 | } |
185 | 326 | ||
186 | printf("HWADDR2:"); | 327 | printf("HWADDR2: "); |
187 | if (smac[0][0] == 0xFF) { | 328 | if (smac[3][0] == EMPY_CHAR) { |
188 | printf("\t<not found>\n"); | 329 | printf("<not found>\n"); |
189 | } else { | 330 | } else { |
190 | char *ret = env_get("eth2addr"); | 331 | char *ret = env_get("eth2addr"); |
191 | 332 | ||
192 | if (strcmp(ret, __stringify(CONFIG_ETH2ADDR)) == 0) { | 333 | if (ret == NULL) { |
193 | env_set("eth2addr", smac[0]); | 334 | env_set("ethaddr", smac[3]); |
194 | printf("\t%s (factory)\n", smac[0]); | 335 | printf("%s\n", smac[3]); |
336 | } else if (strcmp(ret, __stringify(CONFIG_ETH2ADDR)) == 0) { | ||
337 | env_set("eth2addr", smac[3]); | ||
338 | printf("%s (factory)\n", smac[3]); | ||
195 | } else { | 339 | } else { |
196 | printf("\t%s\n", ret); | 340 | printf("%s\n", ret); |
197 | } | 341 | } |
198 | } | 342 | } |
343 | done: | ||
344 | if (oldserial == NULL || oldversion == NULL) { | ||
345 | if (oldversion == NULL) | ||
346 | env_set("VERSION", U_BOOT_VERSION); | ||
347 | env_save(); | ||
348 | } | ||
199 | 349 | ||
200 | return 0; | 350 | return 0; |
201 | } | 351 | } |
202 | 352 | ||
203 | static int do_arc_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) | 353 | static int init_fwenv(void) |
354 | { | ||
355 | int i, ret = -1; | ||
356 | |||
357 | fwenv_addr[0] = FWENV_ADDR1; | ||
358 | fwenv_addr[1] = FWENV_ADDR2; | ||
359 | fwenv_addr[2] = FWENV_ADDR3; | ||
360 | fwenv_addr[3] = FWENV_ADDR4; | ||
361 | |||
362 | for (i = 0; i < MAX_FWENV_ADDR; i++) | ||
363 | if (fwenv_addr[i] != -1) | ||
364 | ret = 0; | ||
365 | if (ret) | ||
366 | printf("%s: No firmfare info storage address is defined\n", | ||
367 | __func__); | ||
368 | return ret; | ||
369 | } | ||
370 | |||
371 | void get_arc_info(void) | ||
372 | { | ||
373 | if (!init_fwenv()) | ||
374 | do_get_arc_info(); | ||
375 | } | ||
376 | |||
377 | static int do_arc_cmd(cmd_tbl_t * cmdtp, int flag, int argc, char *const argv[]) | ||
204 | { | 378 | { |
205 | const char *cmd; | 379 | const char *cmd; |
206 | int ret = -1; | 380 | int ret = -1; |
@@ -209,15 +383,14 @@ static int do_arc_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) | |||
209 | --argc; | 383 | --argc; |
210 | ++argv; | 384 | ++argv; |
211 | 385 | ||
212 | if (strcmp(cmd, "product") == 0) { | 386 | if (init_fwenv()) |
387 | return ret; | ||
388 | |||
389 | if (strcmp(cmd, "product") == 0) | ||
213 | ret = set_arc_product(argc, argv); | 390 | ret = set_arc_product(argc, argv); |
214 | goto done; | 391 | else if (strcmp(cmd, "info") == 0) |
215 | } | 392 | ret = do_get_arc_info(); |
216 | if (strcmp(cmd, "info") == 0) { | 393 | |
217 | ret = get_arc_info(); | ||
218 | goto done; | ||
219 | } | ||
220 | done: | ||
221 | if (ret == -1) | 394 | if (ret == -1) |
222 | return CMD_RET_USAGE; | 395 | return CMD_RET_USAGE; |
223 | 396 | ||