ccdconfig.c (4b49587c3dd54aed8eb103d838a89ca79484a9b6) | ccdconfig.c (2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2003 Poul-Henning Kamp 5 * Copyright (c) 1996 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation --- 249 unchanged lines hidden (view full) --- 258 gctl_ro_param(grq, "nprovider", sizeof(argc), &argc); 259 for (i = 0; i < argc; i++) { 260 sprintf(buf1, "provider%d", i); 261 cp = argv[i]; 262 if (!strncmp(cp, _PATH_DEV, strlen(_PATH_DEV))) 263 cp += strlen(_PATH_DEV); 264 gctl_ro_param(grq, buf1, -1, cp); 265 } | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2003 Poul-Henning Kamp 5 * Copyright (c) 1996 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation --- 249 unchanged lines hidden (view full) --- 258 gctl_ro_param(grq, "nprovider", sizeof(argc), &argc); 259 for (i = 0; i < argc; i++) { 260 sprintf(buf1, "provider%d", i); 261 cp = argv[i]; 262 if (!strncmp(cp, _PATH_DEV, strlen(_PATH_DEV))) 263 cp += strlen(_PATH_DEV); 264 gctl_ro_param(grq, buf1, -1, cp); 265 } |
266 gctl_rw_param(grq, "output", sizeof(buf1), buf1); | 266 buf1[0] = '\0'; 267 gctl_add_param(grq, "output", sizeof(buf1), buf1, 268 GCTL_PARAM_WR | GCTL_PARAM_ASCII); |
267 errstr = gctl_issue(grq); 268 if (errstr == NULL) { 269 if (verbose) { 270 printf("%s", buf1); 271 } 272 gctl_free(grq); 273 return (0); 274 } --- 91 unchanged lines hidden (view full) --- 366 struct gctl_req *grq; 367 int ncp; 368 char *cp; 369 char const *errstr; 370 371 grq = gctl_get_handle(); 372 ncp = 65536; 373 cp = malloc(ncp); | 269 errstr = gctl_issue(grq); 270 if (errstr == NULL) { 271 if (verbose) { 272 printf("%s", buf1); 273 } 274 gctl_free(grq); 275 return (0); 276 } --- 91 unchanged lines hidden (view full) --- 368 struct gctl_req *grq; 369 int ncp; 370 char *cp; 371 char const *errstr; 372 373 grq = gctl_get_handle(); 374 ncp = 65536; 375 cp = malloc(ncp); |
376 cp[0] = '\0'; |
|
374 gctl_ro_param(grq, "verb", -1, "list"); 375 gctl_ro_param(grq, "class", -1, "CCD"); 376 gctl_ro_param(grq, "unit", sizeof(unit), &unit); | 377 gctl_ro_param(grq, "verb", -1, "list"); 378 gctl_ro_param(grq, "class", -1, "CCD"); 379 gctl_ro_param(grq, "unit", sizeof(unit), &unit); |
377 gctl_rw_param(grq, "output", ncp, cp); | 380 gctl_add_param(grq, "output", ncp, cp, 381 GCTL_PARAM_WR | GCTL_PARAM_ASCII); |
378 errstr = gctl_issue(grq); 379 if (errstr != NULL) 380 errx(1, "%s\nor possibly kernel and ccdconfig out of sync", 381 errstr); 382 if (strlen(cp) == 0) 383 errx(1, "ccd%d not configured", unit); 384 if (verbose && !v) { 385 printf("# ccd\t\tileave\tflags\tcomponent devices\n"); --- 67 unchanged lines hidden --- | 382 errstr = gctl_issue(grq); 383 if (errstr != NULL) 384 errx(1, "%s\nor possibly kernel and ccdconfig out of sync", 385 errstr); 386 if (strlen(cp) == 0) 387 errx(1, "ccd%d not configured", unit); 388 if (verbose && !v) { 389 printf("# ccd\t\tileave\tflags\tcomponent devices\n"); --- 67 unchanged lines hidden --- |