diff options
author | eivind <eivind@FreeBSD.org> | 1998-08-05 00:54:38 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1998-08-05 00:54:38 +0000 |
commit | f03826546dda8a7ceb4654dd24f3c23547bf5a30 (patch) | |
tree | 0665db6870e7ad529c2e975ebe1ced2688d8c652 /usr.sbin/dpt | |
parent | 926810dcee72cabf9aeb2364563cd63a890a127b (diff) | |
download | FreeBSD-src-f03826546dda8a7ceb4654dd24f3c23547bf5a30.zip FreeBSD-src-f03826546dda8a7ceb4654dd24f3c23547bf5a30.tar.gz |
Update DPT driver from 1.4.3 to 1.4.5
Submitted by: Simon Shapiro <shimon@simon-shapiro.org>
Diffstat (limited to 'usr.sbin/dpt')
-rw-r--r-- | usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.c | 14 | ||||
-rw-r--r-- | usr.sbin/dpt/dpt_ctls/dpt_ctls.c | 9 | ||||
-rw-r--r-- | usr.sbin/dpt/dpt_dm/dpt_dm.c | 50 |
3 files changed, 51 insertions, 22 deletions
diff --git a/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.c b/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.c index 63073e8..9a3e39b 100644 --- a/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.c +++ b/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.c @@ -30,7 +30,7 @@ /* dpt_ctlinfo.c: Dunp a DPT HBA Information Block */ -#ident "$Id: dpt_ctlinfo.c,v 1.1 1998/01/22 23:32:27 ShimonR Exp ShimonR $" +#ident "$Id: dpt_ctlinfo.c,v 1.1 1998/01/26 06:20:37 julian Exp $" #include <fcntl.h> #include <stdio.h> @@ -73,17 +73,19 @@ main(int argc, char **argv, char **argp) pass_thru.command_buffer = (u_int8_t *)&compat_softc; if ( (result = ioctl(fd, DPT_IOCTL_SEND, &pass_thru)) != 0 ) { - (void)fprintf(stderr, "%s ERROR: Failed to send IOCTL %x - %s\n", - argv[0], DPT_IOCTL_SEND, - strerror(errno)); + (void)fprintf(stderr, "%s ERROR: Failed to send IOCTL " + "%lx - %s\n", + argv[0], DPT_IOCTL_SEND, + strerror(errno)); exit(1); } (void)fprintf(stdout, "%x:", compat_softc.ha_state); for (ndx = 0; ndx < MAX_CHANNELS; ndx++) - (void)fprintf(stdout, (ndx == (MAX_CHANNELS - 1)) ? "%d:" : "%d,", - compat_softc.ha_id[ndx]); + (void)fprintf(stdout, (ndx == (MAX_CHANNELS - 1)) ? "%d:" : + "%d,", + compat_softc.ha_id[ndx]); (void)fprintf(stdout, "%d:", compat_softc.ha_vect); (void)fprintf(stdout, "%x:", compat_softc.ha_base); diff --git a/usr.sbin/dpt/dpt_ctls/dpt_ctls.c b/usr.sbin/dpt/dpt_ctls/dpt_ctls.c index d5ef550..3c66da5 100644 --- a/usr.sbin/dpt/dpt_ctls/dpt_ctls.c +++ b/usr.sbin/dpt/dpt_ctls/dpt_ctls.c @@ -30,7 +30,7 @@ /* dpt_ctls.c: Dunp a the number of configured DPT HBAs */ -#ident "$Id: dpt_ctls.c,v 1.1 1998/01/22 22:07:22 ShimonR Exp ShimonR $" +#ident "$Id: dpt_ctls.c,v 1.1 1998/01/26 06:20:39 julian Exp $" #include <fcntl.h> #include <stdio.h> @@ -69,9 +69,10 @@ main(int argc, char **argv, char **argp) pass_thru.command_buffer = (u_int8_t *)&controllers_present; if ( (result = ioctl(fd, DPT_IOCTL_SEND, &pass_thru)) != 0 ) { - (void)fprintf(stderr, "%s ERROR: Failed to send IOCTL %x - %s\n", - argv[0], DPT_IOCTL_SEND, - strerror(errno)); + (void)fprintf(stderr, "%s ERROR: Failed to send IOCTL " + "%lx - %s\n", + argv[0], DPT_IOCTL_SEND, + strerror(errno)); exit(1); } diff --git a/usr.sbin/dpt/dpt_dm/dpt_dm.c b/usr.sbin/dpt/dpt_dm/dpt_dm.c index 869007b..a2d1b12 100644 --- a/usr.sbin/dpt/dpt_dm/dpt_dm.c +++ b/usr.sbin/dpt/dpt_dm/dpt_dm.c @@ -30,12 +30,13 @@ /* dpt_dm.c: Dump a DPT metrics structure */ -#ident "$Id: dpt_dm.c,v 1.8 1998/01/21 17:38:32 ShimonR Exp ShimonR $" +#ident "$Id: dpt_dm.c,v 1.1 1998/08/03 16:43:36 root Exp root $" #include <fcntl.h> #include <stdio.h> #include <string.h> #include <errno.h> +#include <stdarg.h> #include <sys/time.h> #include <sys/stat.h> #include <sys/queue.h> @@ -231,6 +232,19 @@ scsi_cmd_name(u_int8_t cmd) } } +static const char * +tmpsprintf(int buffer, const char *format, ...) +{ + static char buffers[16][16]; + va_list ap; + + va_start(ap, format); + vsnprintf(buffers[buffer], 16, format, ap); + va_end(ap); + return buffers[buffer]; +} + + int main(int argc, char **argv, char **argp) { @@ -246,27 +260,31 @@ main(int argc, char **argv, char **argp) } if ( (result = ioctl(fd, DPT_IOCTL_INTERNAL_METRICS, &metrics)) != 0 ) { - (void)fprintf(stderr, "%s ERROR: Failed to send IOCTL %x - %s\n", + (void)fprintf(stderr, "%s ERROR: Failed to send IOCTL %lx - %s\n", argv[0], DPT_IOCTL_INTERNAL_METRICS, strerror(errno)); exit(2); } /* Interrupt related measurements */ - (void)fprintf(stdout, "Interrupts:%d:%d:%d:%d\n\nCommands:\n", + (void)fprintf(stdout, "Interrupts:%u:%u:%s:%u\n\nCommands:\n", metrics.aborted_interrupts, metrics.spurious_interrupts, - metrics.min_intr_time, + metrics.min_intr_time == BIG_ENOUGH ? + "N/A" : + tmpsprintf(0, "%u", metrics.min_intr_time), metrics.max_intr_time); /* SCSI Commands, can be no more than 256 of them */ for (ndx = 0; ndx < 256; ndx++) { if (metrics.command_count[ndx] != 0) { - (void)fprintf(stdout, "%d:%s:%d:%d:%d\n", + (void)fprintf(stdout, "%u:%s:%u:%s:%d\n", ndx, scsi_cmd_name((u_int8_t)ndx), metrics.command_count[ndx], - metrics.min_command_time[ndx], + metrics.min_command_time[ndx] == BIG_ENOUGH ? + "N/A" : + tmpsprintf(0, "%u", metrics.min_command_time[ndx]), metrics.max_command_time[ndx]); } } @@ -370,22 +388,30 @@ main(int argc, char **argv, char **argp) } - (void)fprintf(stdout, "\nQueues:%u:%u:%u:%u:%u:%u:%u:%u:%u\n", + (void)fprintf(stdout, "\nQueues:%u:%s:%u:%u:%s:%u:%u:%s:%u\n", metrics.max_waiting_count, - metrics.min_waiting_time, + metrics.min_waiting_time == BIG_ENOUGH ? + "N/A" : + tmpsprintf(0, "%u", metrics.min_waiting_time), metrics.max_waiting_time, metrics.max_submit_count, - metrics.min_submit_time, + metrics.min_submit_time == BIG_ENOUGH ? + "N/A" : + tmpsprintf(1, "%u", metrics.min_submit_time), metrics.max_submit_time, metrics.max_complete_count, - metrics.min_complete_time, + metrics.min_complete_time == BIG_ENOUGH ? + "N/A" : + tmpsprintf(2, "%u", metrics.min_complete_time), metrics.max_complete_time); - (void)fprintf(stdout, "Hardware Ports:%u:%u:%u:%u\n", + (void)fprintf(stdout, "Hardware Ports:%u:%u:%u:%s\n", metrics.command_collisions, metrics.command_too_busy, metrics.max_eata_tries, - metrics.min_eata_tries); + metrics.min_eata_tries == BIG_ENOUGH ? + "N/A" : + tmpsprintf(0, "%u", metrics.min_eata_tries)); return(0); } |