Lines 424-439
Link Here
|
424 |
|
424 |
|
425 |
/* ARGSUSED */ |
425 |
/* ARGSUSED */ |
426 |
static int |
426 |
static int |
427 |
do_params(const char *cname, int argc, char **argv) |
427 |
do_params(const char *cname, int argc, char **argv __unused) |
428 |
{ |
428 |
{ |
429 |
struct changer_params data; |
429 |
struct changer_params data; |
430 |
int picker; |
430 |
int picker; |
431 |
|
431 |
|
432 |
/* No arguments to this command. */ |
432 |
/* No arguments to this command. */ |
433 |
|
433 |
if (argc > 1) { |
434 |
++argv; --argc; |
|
|
435 |
|
436 |
if (argc) { |
437 |
warnx("%s: no arguments expected", cname); |
434 |
warnx("%s: no arguments expected", cname); |
438 |
goto usage; |
435 |
goto usage; |
439 |
} |
436 |
} |
Lines 467-481
Link Here
|
467 |
|
464 |
|
468 |
/* ARGSUSED */ |
465 |
/* ARGSUSED */ |
469 |
static int |
466 |
static int |
470 |
do_getpicker(const char *cname, int argc, char **argv) |
467 |
do_getpicker(const char *cname, int argc, char **argv __unused) |
471 |
{ |
468 |
{ |
472 |
int picker; |
469 |
int picker; |
473 |
|
470 |
|
474 |
/* No arguments to this command. */ |
471 |
/* No arguments to this command. */ |
475 |
|
472 |
if (argc > 1) { |
476 |
++argv; --argc; |
|
|
477 |
|
478 |
if (argc) { |
479 |
warnx("%s: no arguments expected", cname); |
473 |
warnx("%s: no arguments expected", cname); |
480 |
goto usage; |
474 |
goto usage; |
481 |
} |
475 |
} |
Lines 966-972
Link Here
|
966 |
} else { |
960 |
} else { |
967 |
element = parse_element_unit(*argv); |
961 |
element = parse_element_unit(*argv); |
968 |
} |
962 |
} |
969 |
++argv; --argc; |
|
|
970 |
|
963 |
|
971 |
/* Get the status */ |
964 |
/* Get the status */ |
972 |
ces = get_element_status((unsigned int)type, (unsigned int)element, |
965 |
ces = get_element_status((unsigned int)type, (unsigned int)element, |
Lines 1072-1081
Link Here
|
1072 |
|
1065 |
|
1073 |
/* Read in the changer slots */ |
1066 |
/* Read in the changer slots */ |
1074 |
if (cp.cp_nslots > 0) { |
1067 |
if (cp.cp_nslots > 0) { |
|
|
1068 |
(void) memset(&cesr, 0, sizeof(cesr)); |
1075 |
cesr.cesr_element_type = CHET_ST; |
1069 |
cesr.cesr_element_type = CHET_ST; |
1076 |
cesr.cesr_element_base = 0; |
|
|
1077 |
cesr.cesr_element_count = cp.cp_nslots; |
1070 |
cesr.cesr_element_count = cp.cp_nslots; |
1078 |
cesr.cesr_flags |= CESR_VOLTAGS; |
1071 |
cesr.cesr_flags = CESR_VOLTAGS; |
1079 |
cesr.cesr_element_status = ces; |
1072 |
cesr.cesr_element_status = ces; |
1080 |
|
1073 |
|
1081 |
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { |
1074 |
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { |
Lines 1087-1098
Link Here
|
1087 |
|
1080 |
|
1088 |
/* Read in the drive information */ |
1081 |
/* Read in the drive information */ |
1089 |
if (cp.cp_ndrives > 0 ) { |
1082 |
if (cp.cp_ndrives > 0 ) { |
1090 |
|
|
|
1091 |
(void) memset(&cesr, 0, sizeof(cesr)); |
1083 |
(void) memset(&cesr, 0, sizeof(cesr)); |
1092 |
cesr.cesr_element_type = CHET_DT; |
1084 |
cesr.cesr_element_type = CHET_DT; |
1093 |
cesr.cesr_element_base = 0; |
|
|
1094 |
cesr.cesr_element_count = cp.cp_ndrives; |
1085 |
cesr.cesr_element_count = cp.cp_ndrives; |
1095 |
cesr.cesr_flags |= CESR_VOLTAGS; |
1086 |
cesr.cesr_flags = CESR_VOLTAGS; |
1096 |
cesr.cesr_element_status = ces; |
1087 |
cesr.cesr_element_status = ces; |
1097 |
|
1088 |
|
1098 |
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { |
1089 |
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { |
Lines 1106-1114
Link Here
|
1106 |
if (cp.cp_nportals > 0 ) { |
1097 |
if (cp.cp_nportals > 0 ) { |
1107 |
(void) memset(&cesr, 0, sizeof(cesr)); |
1098 |
(void) memset(&cesr, 0, sizeof(cesr)); |
1108 |
cesr.cesr_element_type = CHET_IE; |
1099 |
cesr.cesr_element_type = CHET_IE; |
1109 |
cesr.cesr_element_base = 0; |
|
|
1110 |
cesr.cesr_element_count = cp.cp_nportals; |
1100 |
cesr.cesr_element_count = cp.cp_nportals; |
1111 |
cesr.cesr_flags |= CESR_VOLTAGS; |
1101 |
cesr.cesr_flags = CESR_VOLTAGS; |
1112 |
cesr.cesr_element_status = ces; |
1102 |
cesr.cesr_element_status = ces; |
1113 |
|
1103 |
|
1114 |
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { |
1104 |
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { |
Lines 1122-1130
Link Here
|
1122 |
if (cp.cp_npickers > 0) { |
1112 |
if (cp.cp_npickers > 0) { |
1123 |
(void) memset(&cesr, 0, sizeof(cesr)); |
1113 |
(void) memset(&cesr, 0, sizeof(cesr)); |
1124 |
cesr.cesr_element_type = CHET_MT; |
1114 |
cesr.cesr_element_type = CHET_MT; |
1125 |
cesr.cesr_element_base = 0; |
|
|
1126 |
cesr.cesr_element_count = cp.cp_npickers; |
1115 |
cesr.cesr_element_count = cp.cp_npickers; |
1127 |
cesr.cesr_flags |= CESR_VOLTAGS; |
1116 |
cesr.cesr_flags = CESR_VOLTAGS; |
1128 |
cesr.cesr_element_status = ces; |
1117 |
cesr.cesr_element_status = ces; |
1129 |
|
1118 |
|
1130 |
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { |
1119 |
if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { |