diff options
Diffstat (limited to 'usr.sbin')
30 files changed, 0 insertions, 2970 deletions
diff --git a/usr.sbin/dpt/Makefile b/usr.sbin/dpt/Makefile deleted file mode 100644 index 63b2ffb0fa93..000000000000 --- a/usr.sbin/dpt/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $Id: Makefile,v 1.2 1998/01/21 07:46:46 ShimonR Exp ShimonR $ - -SUBDIR= dpt_ctlinfo dpt_ctls dpt_dm dpt_led dpt_sig dpt_softc dpt_sysinfo - -.include <bsd.subdir.mk> diff --git a/usr.sbin/dpt/dpt_ctlinfo/Makefile b/usr.sbin/dpt/dpt_ctlinfo/Makefile deleted file mode 100644 index 690ed8e81e60..000000000000 --- a/usr.sbin/dpt/dpt_ctlinfo/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 5/31/93 -# $Id: Makefile,v 1.1 1998/01/22 23:32:27 ShimonR Exp ShimonR $ - -PROG= dpt_ctlinfo -SRCS= dpt_ctlinfo.c - -CFLAGS+=-Wall -I../../../sys -I/usr/src/sys -BINMODE=500 -BINOWN= root -MAN8= dpt_ctlinfo.8 - -.include <bsd.prog.mk> diff --git a/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.8 b/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.8 deleted file mode 100644 index f9d15301394b..000000000000 --- a/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.8 +++ /dev/null @@ -1,3 +0,0 @@ -.\" Copyright (c) 1997 Simon Shapiro. All rights reserved. -.\" -.\" There is nothing here yet, but an empty file will not patch diff --git a/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.c b/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.c deleted file mode 100644 index 63073e869dd0..000000000000 --- a/usr.sbin/dpt/dpt_ctlinfo/dpt_ctlinfo.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 1997 by Simon Shapiro - * All Rights Reserved - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* 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 $" - -#include <fcntl.h> -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <sys/queue.h> -#include <sys/ioctl.h> -#include <scsi/scsi_all.h> -#include <scsi/scsi_message.h> -#include <scsi/scsiconf.h> - -#define DPT_MEASURE_PERFORMANCE - -#include <sys/dpt.h> - - -int -main(int argc, char **argv, char **argp) -{ - eata_pt_t pass_thru; - dpt_compat_ha_t compat_softc; - - int result; - int fd; - int ndx; - - if ( (fd = open(argv[1], O_RDWR, S_IRUSR | S_IWUSR)) == -1 ) { - (void)fprintf(stderr, "%s ERROR: Failed to open \"%s\" - %s\n", - argv[0], argv[1], strerror(errno)); - exit(1); - } - - pass_thru.eataID[0] = 'E'; - pass_thru.eataID[1] = 'A'; - pass_thru.eataID[2] = 'T'; - pass_thru.eataID[3] = 'A'; - pass_thru.command = DPT_CTRLINFO; - 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)); - 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, "%d:", compat_softc.ha_vect); - (void)fprintf(stdout, "%x:", compat_softc.ha_base); - (void)fprintf(stdout, "%d:", compat_softc.ha_max_jobs); - - switch (compat_softc.ha_cache) { - case DPT_NO_CACHE: - (void)fprintf(stdout, "No Cache:"); - break; - case DPT_CACHE_WRITETHROUGH: - (void)fprintf(stdout, "WriteThrough:"); - break; - case DPT_CACHE_WRITEBACK: - (void)fprintf(stdout, "WriteBack:"); - break; - default: - (void)fprintf(stdout, "UnKnown (%d):", compat_softc.ha_cache); - } - - (void)fprintf(stdout, "%d:", compat_softc.ha_cachesize); - (void)fprintf(stdout, "%d:", compat_softc.ha_nbus); - (void)fprintf(stdout, "%d:", compat_softc.ha_ntargets); - (void)fprintf(stdout, "%d:", compat_softc.ha_nluns); - (void)fprintf(stdout, "%d:", compat_softc.ha_tshift); - (void)fprintf(stdout, "%d:", compat_softc.ha_bshift); - - (void)fprintf(stdout, "%d:", compat_softc.ha_npend); - (void)fprintf(stdout, "%d:", compat_softc.ha_active_jobs); - - (void)fprintf(stdout, "%s\n", compat_softc.ha_fw_version); - - - - return(0); -} diff --git a/usr.sbin/dpt/dpt_ctls/Makefile b/usr.sbin/dpt/dpt_ctls/Makefile deleted file mode 100644 index 7c2d150980cb..000000000000 --- a/usr.sbin/dpt/dpt_ctls/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 5/31/93 -# $Id: Makefile,v 1.1 1998/01/22 22:07:22 ShimonR Exp ShimonR $ - -PROG= dpt_ctls -SRCS= dpt_ctls.c - -CFLAGS+=-Wall -I../../../sys -I/usr/src/sys -BINMODE=500 -BINOWN= root -MAN8= dpt_ctls.8 - -.include <bsd.prog.mk> diff --git a/usr.sbin/dpt/dpt_ctls/dpt_ctls.8 b/usr.sbin/dpt/dpt_ctls/dpt_ctls.8 deleted file mode 100644 index f9d15301394b..000000000000 --- a/usr.sbin/dpt/dpt_ctls/dpt_ctls.8 +++ /dev/null @@ -1,3 +0,0 @@ -.\" Copyright (c) 1997 Simon Shapiro. All rights reserved. -.\" -.\" There is nothing here yet, but an empty file will not patch diff --git a/usr.sbin/dpt/dpt_ctls/dpt_ctls.c b/usr.sbin/dpt/dpt_ctls/dpt_ctls.c deleted file mode 100644 index d5ef550db106..000000000000 --- a/usr.sbin/dpt/dpt_ctls/dpt_ctls.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1997 by Simon Shapiro - * All Rights Reserved - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* 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 $" - -#include <fcntl.h> -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <sys/queue.h> -#include <sys/ioctl.h> -#include <scsi/scsi_all.h> -#include <scsi/scsi_message.h> -#include <scsi/scsiconf.h> - -#include <sys/dpt.h> - -int -main(int argc, char **argv, char **argp) -{ - eata_pt_t pass_thru; - int controllers_present; - - int result; - int fd; - - if ( (fd = open(argv[1], O_RDWR, S_IRUSR | S_IWUSR)) == -1 ) { - (void)fprintf(stderr, "%s ERROR: Failed to open \"%s\" - %s\n", - argv[0], argv[1], strerror(errno)); - exit(1); - } - - pass_thru.eataID[0] = 'E'; - pass_thru.eataID[1] = 'A'; - pass_thru.eataID[2] = 'T'; - pass_thru.eataID[3] = 'A'; - pass_thru.command = DPT_NUMCTRLS; - 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)); - exit(1); - } - - (void)fprintf(stdout, "%d\n", controllers_present); - return(0); -} diff --git a/usr.sbin/dpt/dpt_dm/Makefile b/usr.sbin/dpt/dpt_dm/Makefile deleted file mode 100644 index bc7b53f349da..000000000000 --- a/usr.sbin/dpt/dpt_dm/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 5/31/93 -# $Id: Makefile,v 1.4 1998/01/21 17:38:32 ShimonR Exp ShimonR $ - -PROG= dpt_dm -SRCS= dpt_dm.c - -CFLAGS+=-Wall -I../../../sys -I/usr/src/sys -BINMODE=500 -BINOWN= root -MAN8= dpt_dm.8 - -.include <bsd.prog.mk> diff --git a/usr.sbin/dpt/dpt_dm/dpt_dm.8 b/usr.sbin/dpt/dpt_dm/dpt_dm.8 deleted file mode 100644 index d04a43e36ea4..000000000000 --- a/usr.sbin/dpt/dpt_dm/dpt_dm.8 +++ /dev/null @@ -1,6 +0,0 @@ -.\" Copyright (c) 1997 Simon Shapiro. All rights reserved. -.\" -.\" There is nothing here yet, but an empty file will not patch -.\" Copyright (c) 1997 Simon Shapiro. All rights reserved. -.\" -.\" There is nothing here yet, but an empty file will not patch diff --git a/usr.sbin/dpt/dpt_dm/dpt_dm.c b/usr.sbin/dpt/dpt_dm/dpt_dm.c deleted file mode 100644 index 869007b632a9..000000000000 --- a/usr.sbin/dpt/dpt_dm/dpt_dm.c +++ /dev/null @@ -1,391 +0,0 @@ -/* - * Copyright (c) 1997 by Simon Shapiro - * All Rights Reserved - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* 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 $" - -#include <fcntl.h> -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <sys/queue.h> -#include <sys/ioctl.h> -#include <scsi/scsi_all.h> -#include <scsi/scsi_message.h> -#include <scsi/scsiconf.h> - -#define DPT_MEASURE_PERFORMANCE - -#include <sys/dpt.h> - -char * -scsi_cmd_name(u_int8_t cmd) -{ - switch (cmd) { - case 0x40: - return ("Change Definition [7.1]"); - break; - case 0x39: - return ("Compare [7,2]"); - break; - case 0x18: - return ("Copy [7.3]"); - break; - case 0x3a: - return ("Copy and Verify [7.4]"); - break; - case 0x04: - return ("Format Unit [6.1.1]"); - break; - case 0x12: - return ("Inquiry [7.5]"); - break; - case 0x36: - return ("lock/Unlock Cache [6.1.2]"); - break; - case 0x4c: - return ("Log Select [7.6]"); - break; - case 0x4d: - return ("Log Sense [7.7]"); - break; - case 0x15: - return ("Mode select (6) [7.8]"); - break; - case 0x55: - return ("Mode Select (10) [7.9]"); - break; - case 0x1a: - return ("Mode Sense (6) [7.10]"); - break; - case 0x5a: - return ("Mode Sense (10) [7.11]"); - break; - case 0xa7: - return ("Move Medium Attached [SMC]"); - break; - case 0x5e: - return ("Persistent Reserve In [7.12]"); - break; - case 0x5f: - return ("Persistent Reserve Out [7.13]"); - break; - case 0x1e: - return ("Prevent/Allow Medium Removal [7.14]"); - break; - case 0x08: - return ("Read, Receive (6) [6.1.5]"); - break; - case 0x28: - return ("Read (10) [6.1.5]"); - break; - case 0xa8: - return ("Read (12) [6.1.5]"); - break; - case 0x3c: - return ("Read Buffer [7.15]"); - break; - case 0x25: - return ("Read Capacity [6.1.6]"); - break; - case 0x37: - return ("Read Defect Data (10) [6.1.7]"); - break; - case 0xb7: - return ("Read Defect Data (12) [6.2.5]"); - break; - case 0xb4: - return ("Read Element Status Attached [SMC]"); - break; - case 0x3e: - return ("Read Long [6.1.8]"); - break; - case 0x07: - return ("Reassign Blocks [6.1.9]"); - break; - case 0x81: - return ("Rebuild [6.1.10]"); - break; - case 0x1c: - return ("Receive Diagnostics Result [7.16]"); - break; - case 0x82: - return ("Regenerate [6.1.11]"); - break; - case 0x17: - return ("Release(6) [7.17]"); - break; - case 0x57: - return ("Release(10) [7.18]"); - break; - case 0xa0: - return ("Report LUNs [7.19]"); - break; - case 0x03: - return ("Request Sense [7.20]"); - break; - case 0x16: - return ("Resereve (6) [7.21]"); - break; - case 0x56: - return ("Reserve(10) [7.22]"); - break; - case 0x2b: - return ("Reserve(10) [6.1.12]"); - break; - case 0x1d: - return ("Send Disagnostics [7.23]"); - break; - case 0x33: - return ("Set Limit (10) [6.1.13]"); - break; - case 0xb3: - return ("Set Limit (12) [6.2.8]"); - break; - case 0x1b: - return ("Start/Stop Unit [6.1.14]"); - break; - case 0x35: - return ("Synchronize Cache [6.1.15]"); - break; - case 0x00: - return ("Test Unit Ready [7.24]"); - break; - case 0x3d: - return ("Update Block (6.2.9"); - break; - case 0x2f: - return ("Verify (10) [6.1.16, 6.2.10]"); - break; - case 0xaf: - return ("Verify (12) [6.2.11]"); - break; - case 0x0a: - return ("Write, Send (6) [6.1.17, 9.2]"); - break; - case 0x2a: - return ("Write (10) [6.1.18]"); - break; - case 0xaa: - return ("Write (12) [6.2.13]"); - break; - case 0x2e: - return ("Write and Verify (10) [6.1.19, 6.2.14]"); - break; - case 0xae: - return ("Write and Verify (12) [6.1.19, 6.2.15]"); - break; - case 0x03b: - return ("Write Buffer [7.25]"); - break; - case 0x03f: - return ("Write Long [6.1.20]"); - break; - case 0x041: - return ("Write Same [6.1.21]"); - break; - case 0x052: - return ("XD Read [6.1.22]"); - break; - case 0x050: - return ("XD Write [6.1.22]"); - break; - case 0x080: - return ("XD Write Extended [6.1.22]"); - break; - case 0x051: - return ("XO Write [6.1.22]"); - break; - default: - return ("Unknown SCSI Command"); - } -} - -int -main(int argc, char **argv, char **argp) -{ - dpt_perf_t metrics; - int result; - int fd; - int ndx; - - if ( (fd = open(argv[1], O_RDWR, S_IRUSR | S_IWUSR)) == -1 ) { - (void)fprintf(stderr, "%s ERROR: Failed to open \"%s\" - %s\n", - argv[0], argv[1], strerror(errno)); - exit(1); - } - - if ( (result = ioctl(fd, DPT_IOCTL_INTERNAL_METRICS, &metrics)) != 0 ) { - (void)fprintf(stderr, "%s ERROR: Failed to send IOCTL %x - %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", - metrics.aborted_interrupts, - metrics.spurious_interrupts, - 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", - ndx, - scsi_cmd_name((u_int8_t)ndx), - metrics.command_count[ndx], - metrics.min_command_time[ndx], - metrics.max_command_time[ndx]); - } - } - - (void)fprintf(stdout, "\nREAD by size:\n"); - - /* READ/WRITE statistics, per block size */ - - for ( ndx = 0; ndx < 10; ndx++) { - if (metrics.read_by_size_count[ndx] != 0) { - char* block_size; - - switch ( ndx ) { - case SIZE_512: - block_size = "512"; - break; - case SIZE_1K: - block_size = "1K"; - break; - case SIZE_2K: - block_size = "2K"; - break; - case SIZE_4K: - block_size = "4K"; - break; - case SIZE_8K: - block_size = "8K"; - break; - case SIZE_16K: - block_size = "16K"; - break; - case SIZE_32K: - block_size = "32K"; - break; - case SIZE_64K: - block_size = "64K"; - break; - case SIZE_BIGGER: - block_size = "BIGGER"; - break; - case SIZE_OTHER: - block_size = "OTHER"; - break; - default: - block_size = "Gcc, shut up!"; - } - - (void)fprintf(stdout, "%s:%u:%u:%u\n", block_size, - metrics.read_by_size_count[ndx], - metrics.read_by_size_min_time[ndx], - metrics.read_by_size_max_time[ndx]); - } - } - - (void)fprintf(stdout, "\nWRITE by size:\n"); - - for ( ndx = 0; ndx < 10; ndx++) { - if (metrics.write_by_size_count[ndx] != 0) { - char* block_size; - - switch ( ndx ) { - case SIZE_512: - block_size = "512"; - break; - case SIZE_1K: - block_size = "1K"; - break; - case SIZE_2K: - block_size = "2K"; - break; - case SIZE_4K: - block_size = "4K"; - break; - case SIZE_8K: - block_size = "8K"; - break; - case SIZE_16K: - block_size = "16K"; - break; - case SIZE_32K: - block_size = "32K"; - break; - case SIZE_64K: - block_size = "64K"; - break; - case SIZE_BIGGER: - block_size = "BIGGER"; - break; - case SIZE_OTHER: - block_size = "OTHER"; - break; - default: - block_size = "Gcc, shut up!"; - } - - (void)fprintf(stdout, "%s:%u:%u:%u\n", block_size, - metrics.write_by_size_count[ndx], - metrics.write_by_size_min_time[ndx], - metrics.write_by_size_max_time[ndx]); - } - - } - - (void)fprintf(stdout, "\nQueues:%u:%u:%u:%u:%u:%u:%u:%u:%u\n", - metrics.max_waiting_count, - metrics.min_waiting_time, - metrics.max_waiting_time, - metrics.max_submit_count, - metrics.min_submit_time, - metrics.max_submit_time, - metrics.max_complete_count, - metrics.min_complete_time, - metrics.max_complete_time); - - (void)fprintf(stdout, "Hardware Ports:%u:%u:%u:%u\n", - metrics.command_collisions, - metrics.command_too_busy, - metrics.max_eata_tries, - metrics.min_eata_tries); - - return(0); -} diff --git a/usr.sbin/dpt/dpt_led/Makefile b/usr.sbin/dpt/dpt_led/Makefile deleted file mode 100644 index 43a2c2a7ae9a..000000000000 --- a/usr.sbin/dpt/dpt_led/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 5/31/93 -# $Id: Makefile,v 1.1 1998/01/23 02:45:53 ShimonR Exp ShimonR $ - -PROG= dpt_led -SRCS= dpt_led.c - -CFLAGS+=-Wall -I../../../sys -I/usr/src/sys -BINMODE=500 -BINOWN= root -MAN8= dpt_led.8 - -.include <bsd.prog.mk> diff --git a/usr.sbin/dpt/dpt_led/dpt_led.8 b/usr.sbin/dpt/dpt_led/dpt_led.8 deleted file mode 100644 index f9d15301394b..000000000000 --- a/usr.sbin/dpt/dpt_led/dpt_led.8 +++ /dev/null @@ -1,3 +0,0 @@ -.\" Copyright (c) 1997 Simon Shapiro. All rights reserved. -.\" -.\" There is nothing here yet, but an empty file will not patch diff --git a/usr.sbin/dpt/dpt_led/dpt_led.c b/usr.sbin/dpt/dpt_led/dpt_led.c deleted file mode 100644 index 70480e4c6884..000000000000 --- a/usr.sbin/dpt/dpt_led/dpt_led.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 1997 by Simon Shapiro - * All Rights Reserved - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* dpt_led.c: Show the blinking LED array status of a DPT HBAs */ - -#ident "$Id: dpt_led.c,v 1.1 1998/01/23 02:45:53 ShimonR Exp ShimonR $" - -#include <fcntl.h> -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <sys/queue.h> -#include <sys/ioctl.h> -#include <scsi/scsi_all.h> -#include <scsi/scsi_message.h> -#include <scsi/scsiconf.h> - -#include <sys/dpt.h> - -int -main(int argc, char **argv, char **argp) -{ - eata_pt_t pass_thru; - int led; - - int result; - int fd; - - if ( (fd = open(argv[1], O_RDWR, S_IRUSR | S_IWUSR)) == -1 ) { - (void)fprintf(stderr, "%s ERROR: Failed to open \"%s\" - %s\n", - argv[0], argv[1], strerror(errno)); - exit(1); - } - - pass_thru.eataID[0] = 'E'; - pass_thru.eataID[1] = 'A'; - pass_thru.eataID[2] = 'T'; - pass_thru.eataID[3] = 'A'; - pass_thru.command = DPT_BLINKLED; - pass_thru.command_buffer = (u_int8_t *)&led; - - 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)); - exit(1); - } - - (void)fprintf(stdout, "%s\n", i2bin((unsigned int)led, 16)); - return(0); -} - -/* - * and this one presents an integer as ones and zeros - */ -static char i2bin_bitmap[48]; /* Used for binary dump of registers */ - -char * -i2bin(unsigned int no, int length) -{ - int ndx, rind; - - for (ndx = 0, rind = 0; ndx < 32; ndx++, rind++) { - i2bin_bitmap[rind] = (((no << ndx) & 0x80000000) ? '1' : '0'); - - if (((ndx % 4) == 3)) - i2bin_bitmap[++rind] = ' '; - } - - if ((ndx % 4) == 3) - i2bin_bitmap[rind - 1] = '\0'; - else - i2bin_bitmap[rind] = '\0'; - - switch (length) { - case 8: - return (i2bin_bitmap + 30); - break; - case 16: - return (i2bin_bitmap + 20); - break; - case 24: - return (i2bin_bitmap + 10); - break; - case 32: - return (i2bin_bitmap); - default: - return ("i2bin: Invalid length Specs"); - break; - } -} - diff --git a/usr.sbin/dpt/dpt_sig/Makefile b/usr.sbin/dpt/dpt_sig/Makefile deleted file mode 100644 index 3f504864083b..000000000000 --- a/usr.sbin/dpt/dpt_sig/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 5/31/93 -# $Id: Makefile,v 1.4 1998/01/21 17:41:39 ShimonR Exp $ - -PROG= dpt_sig -SRCS= dpt_sig.c - -CFLAGS+=-Wall -I../../../sys -I/usr/src/sys -BINMODE=500 -BINOWN= root -MAN8= dpt_sig.8 - -.include <bsd.prog.mk> diff --git a/usr.sbin/dpt/dpt_sig/dpt_sig.8 b/usr.sbin/dpt/dpt_sig/dpt_sig.8 deleted file mode 100644 index f9d15301394b..000000000000 --- a/usr.sbin/dpt/dpt_sig/dpt_sig.8 +++ /dev/null @@ -1,3 +0,0 @@ -.\" Copyright (c) 1997 Simon Shapiro. All rights reserved. -.\" -.\" There is nothing here yet, but an empty file will not patch diff --git a/usr.sbin/dpt/dpt_sig/dpt_sig.c b/usr.sbin/dpt/dpt_sig/dpt_sig.c deleted file mode 100644 index 340b9249b55b..000000000000 --- a/usr.sbin/dpt/dpt_sig/dpt_sig.c +++ /dev/null @@ -1,596 +0,0 @@ -/* - * Copyright (c) 1997 by Simon Shapiro - * All Rights Reserved - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* dpt_sig.c: Dunp a DPT Signature */ - -#ident "$Id: dpt_sig.c,v 1.6 1998/01/22 22:06:30 ShimonR Exp ShimonR $" - -#include <fcntl.h> -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <sys/queue.h> -#include <sys/ioctl.h> -#include <scsi/scsi_all.h> -#include <scsi/scsi_message.h> -#include <scsi/scsiconf.h> - -#define DPT_MEASURE_PERFORMANCE - -#include <sys/dpt.h> - -/* A primitive subset of isgraph. Used by hex_dump below */ -#define IsGraph(val) ( (((val) >= ' ') && ((val) <= '~')) ) - -/* - * This function dumps bytes to the screen in hex format. - */ -void -hex_dump(u_int8_t * data, int length, char *name, int no) -{ - int line, column, ndx; - - (void)fprintf(stdout, "Kernel Hex Dump for %s-%d at %p (%d bytes)\n", - name, no, data, length); - - /* Zero out all the counters and repeat for as many bytes as we have */ - for (ndx = 0, column = 0, line = 0; ndx < length; ndx++) { - /* Print relative offset at the beginning of every line */ - if (column == 0) - (void)fprintf(stdout, "%04x ", ndx); - - /* Print the byte as two hex digits, followed by a space */ - (void)fprintf(stdout, "%02x ", data[ndx]); - - /* Split the row of 16 bytes in half */ - if (++column == 8) { - (void)fprintf(stdout, " "); - } - /* St the end of each row of 16 bytes, put a space ... */ - if (column == 16) { - (void)fprintf(stdout, " "); - - /* ... and then print the ASCII-visible on a line. */ - for (column = 0; column < 16; column++) { - int ascii_pos = ndx - 15 + column; - - /* - * Non-printable and non-ASCII are just a - * dot. ;-( - */ - if (IsGraph(data[ascii_pos])) - (void)fprintf(stdout, "%c", data[ascii_pos]); - else - (void)fprintf(stdout, "."); - } - - /* Each line ends with a new line */ - (void)fprintf(stdout, "\n"); - column = 0; - - /* - * Every 256 bytes (16 lines of 16 bytes each) have - * an empty line, separating them from the next - * ``page''. Yes, I programmed on a Z-80, where a - * page was 256 bytes :-) - */ - if (++line > 15) { - (void)fprintf(stdout, "\n"); - line = 0; - } - } - } - - /* - * We are basically done. We do want, however, to handle the ASCII - * translation of fractional lines. - */ - if ((ndx == length) && (column != 0)) { - int modulus = 16 - column, spaces = modulus * 3, skip; - - /* - * Skip to the right, as many spaces as there are bytes - * ``missing'' ... - */ - for (skip = 0; skip < spaces; skip++) - (void)fprintf(stdout, " "); - - /* ... And the gap separating the hex dump from the ASCII */ - (void)fprintf(stdout, " "); - - /* - * Do not forget the extra space that splits the hex dump - * vertically - */ - if (column < 8) - (void)fprintf(stdout, " "); - - for (column = 0; column < (16 - modulus); column++) { - int ascii_pos = ndx - (16 - modulus) + column; - - if (IsGraph(data[ascii_pos])) - (void)fprintf(stdout, "%c", data[ascii_pos]); - else - (void)fprintf(stdout, "."); - } - (void)fprintf(stdout, "\n"); - } -} - - -int -main(int argc, char **argv, char **argp) -{ - eata_pt_t pass_thru; - dpt_sig_t signature; - char *sp1; - char *sp2; - - int result; - int fd; - int ndx; - - /* If we do not do that, gcc complains about uninitialized usage (?) */ - sp1 = "Unknown"; - sp2 = "Unknown"; - - if ( (fd = open(argv[1], O_RDWR, S_IRUSR | S_IWUSR)) == -1 ) { - (void)fprintf(stderr, "%s ERROR: Failed to open \"%s\" - %s\n", - argv[0], argv[1], strerror(errno)); - exit(1); - } - - pass_thru.eataID[0] = 'E'; - pass_thru.eataID[1] = 'A'; - pass_thru.eataID[2] = 'T'; - pass_thru.eataID[3] = 'A'; - pass_thru.command = DPT_SIGNATURE; - pass_thru.command_buffer = (u_int8_t *)&signature; - - 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)); - exit(1); - } - - /* dsSignature is not null terminated! */ - for (ndx = 0; ndx < sizeof(signature.dsSignature); ndx++) - (void)fputc(signature.dsSignature[ndx], stdout); - - (void)fprintf(stdout, ":%x:", signature.SigVersion); - - switch (signature.ProcessorFamily) { - case PROC_INTEL: - sp1 = "Intel"; - switch ( signature.Processor ) { - case PROC_8086: - sp2 = "8086"; - break; - case PROC_286: - sp2 = "80286"; - break; - case PROC_386: - sp2 = "386"; - break; - case PROC_486: - sp2 = "486"; - break; - case PROC_PENTIUM: - sp2 = "Pentium"; - break; - case PROC_P6: - sp2 = "PentiumPro"; - break; - default: - sp2 = "Unknown Processor"; - break; - } - break; - case PROC_MOTOROLA: - sp1 = "Motorola"; - switch ( signature.Processor ) { - case PROC_68000: - sp2 = "68000"; - break; - case PROC_68020: - sp2 = "68020"; - break; - case PROC_68030: - sp2 = "68030"; - break; - case PROC_68040: - sp2 = "68040"; - break; - default: - sp2 = "Unknown Processor"; - break; - } - break; - case PROC_MIPS4000: - sp1 = "MIPS/SGI"; - break; - case PROC_ALPHA: - sp1 = "DEC Alpha"; - break; - default: - sp1 = "Unknown Processor Family"; - break; - } - - (void)fprintf(stdout, "%s:%s:", sp1, sp2); - - switch ( signature.Filetype ) { - case FT_EXECUTABLE: - sp1 = "Executable"; - break; - case FT_SCRIPT: - sp1 = "Script"; - break; - case FT_HBADRVR: - sp1 = "HBA Driver"; - break; - case FT_OTHERDRVR: - sp1 = "Other Driver"; - break; - case FT_IFS: - sp1 = "Installable FileSystem"; - break; - case FT_ENGINE: - sp1 = "DPT Engine"; - break; - case FT_COMPDRVR: - sp1 = "Compressed Driver"; - break; - case FT_LANGUAGE: - sp1 = "Language File"; - break; - case FT_FIRMWARE: - sp1 = "DownLoadable Firmware"; - break; - case FT_COMMMODL: - sp1 = "Communications Module"; - break; - case FT_INT13: - sp1 = "INT13 Type HBA Driver"; - break; - case FT_HELPFILE: - sp1 = "Help File"; - break; - case FT_LOGGER: - sp1 = "Event Logger"; - break; - case FT_INSTALL: - sp1 = "Installation Procedure"; - break; - case FT_LIBRARY: - sp1 = "Storage Manager Real-Mode Call"; - break; - case FT_RESOURCE: - sp1 = "Storage Manager Resource File"; - break; - case FT_MODEM_DB: - sp1 = "Storage Manager Modem Database"; - break; - default: - sp1 = "Unknown File Type"; - break; - } - - switch ( signature.FiletypeFlags ) { - case FTF_DLL: - sp2 = "Dynamically Linked Library"; - break; - case FTF_NLM: - sp2 = "NetWare Loadable Module"; - break; - case FTF_OVERLAYS: - sp2 = "Uses Overlays"; - break; - case FTF_DEBUG: - sp2 = "Debug Version"; - break; - case FTF_TSR: - sp2 = "DOS Terminate-n-Stay Resident Thing"; - break; - case FTF_SYS: - sp2 = "DOS Loadable Driver"; - break; - case FTF_PROTECTED: - sp2 = "Runs in Protected Mode"; - break; - case FTF_APP_SPEC: - sp2 = "Application Specific"; - break; - default: - sp2 = "Unknown File Type Flag"; - break; - } - - (void)fprintf(stdout, "%s:%s:", sp1, sp2); - - switch ( signature.OEM ) { - case OEM_DPT: - sp1 = "DPT"; - break; - case OEM_ATT: - sp1 = "AT&T"; - break; - case OEM_NEC: - sp1 = "NEC"; - break; - case OEM_ALPHA: - sp1 = "Alphatronix"; - break; - case OEM_AST: - sp1 = "AST"; - break; - case OEM_OLIVETTI: - sp1 = "Olivetti"; - break; - case OEM_SNI: - sp1 = "Siemens/Nixdorf"; - break; - default: - sp1 = "Unknown OEM"; - break; - } - - switch ( signature.OS ) { - case OS_DOS: - sp2 = "DOS"; - break; - case OS_WINDOWS: - sp2 = "Microsoft Windows 3.x"; - break; - case OS_WINDOWS_NT: - sp2 = "Microsoft Windows NT"; - break; - case OS_OS2M: - sp2 = "OS/2 1.2.x,MS 1.3.0,IBM 1.3.x"; - break; - case OS_OS2L: - sp2 = "Microsoft OS/2 1.301 - LADDR"; - break; - case OS_OS22x: - sp2 = "IBM OS/2 2.x"; - break; - case OS_NW286: - sp2 = "Novell NetWare 286"; - break; - case OS_NW386: - sp2 = "Novell NetWare 386"; - break; - case OS_GEN_UNIX: - sp2 = "Generic Unix"; - break; - case OS_SCO_UNIX: - sp2 = "SCO Unix"; - break; - case OS_ATT_UNIX: - sp2 = "AT&T Unix"; - break; - case OS_UNIXWARE: - sp2 = "UnixWare Unix"; - break; - case OS_INT_UNIX: - sp2 = "Interactive Unix"; - break; - case OS_SOLARIS: - sp2 = "SunSoft Solaris"; - break; - case OS_QNX: - sp2 = "QNX for Tom Moch"; - break; - case OS_NEXTSTEP: - sp2 = "NeXTSTEP"; - break; - case OS_BANYAN: - sp2 = "Banyan Vines"; - break; - case OS_OLIVETTI_UNIX: - sp2 = "Olivetti Unix"; - break; - case OS_FREEBSD: - sp2 = "FreeBSD 2.2 and later"; - break; - case OS_OTHER: - sp2 = "Other"; - break; - default: - sp2 = "Unknown O/S"; - break; - } - - (void)fprintf(stdout, "%s:%s:\n", sp1, sp2); - - if ( signature.Capabilities & CAP_RAID0 ) - (void)fprintf(stdout, "RAID-0:"); - - if ( signature.Capabilities & CAP_RAID1 ) - (void)fprintf(stdout, "RAID-1:"); - - if ( signature.Capabilities & CAP_RAID3 ) - (void)fprintf(stdout, "RAID-3:"); - - if ( signature.Capabilities & CAP_RAID5 ) - (void)fprintf(stdout, "RAID-5:"); - - if ( signature.Capabilities & CAP_SPAN ) - (void)fprintf(stdout, "SPAN:"); - - if ( signature.Capabilities & CAP_PASS ) - (void)fprintf(stdout, "PASS:"); - - if ( signature.Capabilities & CAP_OVERLAP ) - (void)fprintf(stdout, "OVERLAP:"); - - if ( signature.Capabilities & CAP_ASPI ) - (void)fprintf(stdout, "ASPI:"); - - if ( signature.Capabilities & CAP_ABOVE16MB ) - (void)fprintf(stdout, "ISA16MB:"); - - if ( signature.Capabilities & CAP_EXTEND ) - (void)fprintf(stdout, "ISA16MB:"); - - (void)fprintf(stdout, "\n"); - - if ( signature.DeviceSupp & DEV_DASD ) - (void)fprintf(stdout, "DASD:"); - - if ( signature.DeviceSupp & DEV_TAPE ) - (void)fprintf(stdout, "Tape:"); - - if ( signature.DeviceSupp & DEV_PRINTER ) - (void)fprintf(stdout, "Printer:"); - - if ( signature.DeviceSupp & DEV_PROC ) - (void)fprintf(stdout, "CPU:"); - - if ( signature.DeviceSupp & DEV_WORM ) - (void)fprintf(stdout, "WORM:"); - - if ( signature.DeviceSupp & DEV_CDROM ) - (void)fprintf(stdout, "CDROM:"); - - if ( signature.DeviceSupp & DEV_SCANNER ) - (void)fprintf(stdout, "Scanner:"); - - if ( signature.DeviceSupp & DEV_OPTICAL ) - (void)fprintf(stdout, "Optical:"); - - if ( signature.DeviceSupp & DEV_JUKEBOX ) - (void)fprintf(stdout, "Jukebox:"); - - if ( signature.DeviceSupp & DEV_COMM ) - (void)fprintf(stdout, "Comm:"); - - if ( signature.DeviceSupp & DEV_OTHER ) - (void)fprintf(stdout, "Other:"); - - if ( signature.DeviceSupp & DEV_ALL ) - (void)fprintf(stdout, "All:"); - - (void)fprintf(stdout, "\n"); - - if ( signature.AdapterSupp & ADF_2001 ) - (void)fprintf(stdout, "PM2001:"); - - if ( signature.AdapterSupp & ADF_2012A ) - (void)fprintf(stdout, "PM2012A:"); - - if ( signature.AdapterSupp & ADF_PLUS_ISA ) - (void)fprintf(stdout, "PM2011+PM2021:"); - - if ( signature.AdapterSupp & ADF_PLUS_EISA ) - (void)fprintf(stdout, "PM2012B+PM2022:"); - - if ( signature.AdapterSupp & ADF_SC3_ISA ) - (void)fprintf(stdout, "PM2021:"); - - if ( signature.AdapterSupp & ADF_SC3_EISA ) - (void)fprintf(stdout, "PM2022+PM2122:"); - - if ( signature.AdapterSupp & ADF_SC3_PCI ) - (void)fprintf(stdout, "SmartCache III PCI:"); - - if ( signature.AdapterSupp & ADF_SC4_ISA ) - (void)fprintf(stdout, "SmartCache IV ISA:"); - - if ( signature.AdapterSupp & ADF_SC4_EISA ) - (void)fprintf(stdout, "SmartCache IV EISA:"); - - if ( signature.AdapterSupp & ADF_SC4_PCI ) - (void)fprintf(stdout, "SmartCache IV PCI:"); - - if ( signature.AdapterSupp & ADF_ALL_MASTER ) - (void)fprintf(stdout, "All Bus Mastering:"); - - if ( signature.AdapterSupp & ADF_ALL_CACHE ) - (void)fprintf(stdout, "All Caching:"); - - if ( signature.AdapterSupp & ADF_ALL ) - (void)fprintf(stdout, "All HBAs:"); - - (void)fprintf(stdout, "\n"); - - if ( signature.Application & APP_DPTMGR ) - (void)fprintf(stdout, "DPTMGR:"); - - if ( signature.Application & APP_ENGINE ) - (void)fprintf(stdout, "Engine:"); - - if ( signature.Application & APP_SYTOS ) - (void)fprintf(stdout, "Systron Sytos Plus:"); - - if ( signature.Application & APP_CHEYENNE ) - (void)fprintf(stdout, "Cheyenne ARCServe + ARCSolo:"); - - if ( signature.Application & APP_MSCDEX ) - (void)fprintf(stdout, "Microsoft CD-ROM extensions:"); - - if ( signature.Application & APP_NOVABACK ) - (void)fprintf(stdout, "NovaStor Novaback:"); - - if ( signature.Application & APP_AIM ) - (void)fprintf(stdout, "Archive Information Manager:"); - - (void)fprintf(stdout, "\n"); - - if ( signature.Requirements & REQ_SMARTROM ) - (void)fprintf(stdout, "SmartROM:"); - - if ( signature.Requirements & REQ_DPTDDL ) - (void)fprintf(stdout, "DPTDDL.SYS:"); - - if ( signature.Requirements & REQ_HBA_DRIVER ) - (void)fprintf(stdout, "HBA Driver:"); - - if ( signature.Requirements & REQ_ASPI_TRAN ) - (void)fprintf(stdout, "ASPI Transport Modules:"); - - if ( signature.Requirements & REQ_ENGINE ) - (void)fprintf(stdout, "DPT Engine:"); - - if ( signature.Requirements & REQ_COMM_ENG ) - (void)fprintf(stdout, "DPT Comm Engine:"); - - (void)fprintf(stdout, "\n"); - - (void)fprintf(stdout, "%x.%x.%x:%d.%d.%d\n", - signature.Version, signature.Revision, - signature.SubRevision, - signature.Month, signature.Day, signature.Year + 1980); - - return(0); -} diff --git a/usr.sbin/dpt/dpt_softc/Makefile b/usr.sbin/dpt/dpt_softc/Makefile deleted file mode 100644 index 9977e478ee1d..000000000000 --- a/usr.sbin/dpt/dpt_softc/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 5/31/93 -# $Id: Makefile,v 1.3 1998/01/21 07:50:38 ShimonR Exp ShimonR $ - -PROG= dpt_softc -SRCS= dpt_softc.c - -CFLAGS+=-Wall -I../../../sys -I/usr/src/sys -BINMODE=500 -BINOWN= root -MAN8= dpt_softc.8 - -.include <bsd.prog.mk> diff --git a/usr.sbin/dpt/dpt_softc/dpt_softc.8 b/usr.sbin/dpt/dpt_softc/dpt_softc.8 deleted file mode 100644 index 6dfeb0f44bd4..000000000000 --- a/usr.sbin/dpt/dpt_softc/dpt_softc.8 +++ /dev/null @@ -1,4 +0,0 @@ -.\" Copyright (c) 1997 Simon Shapiro. All rights reserved. -.\" -.\" There is nothing here yet, but an empty file will not patch - diff --git a/usr.sbin/dpt/dpt_softc/dpt_softc.c b/usr.sbin/dpt/dpt_softc/dpt_softc.c deleted file mode 100644 index 6f1726f5afc4..000000000000 --- a/usr.sbin/dpt/dpt_softc/dpt_softc.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 1997 by Simon Shapiro - * All Rights Reserved - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* dpt_softc.c: Dunp a DPT control structure */ - -#ident "$Id: dpt_softc.c,v 1.7 1998/01/22 21:37:40 ShimonR Exp $" - -#include <stdlib.h> -#include <fcntl.h> -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <sys/queue.h> -#include <sys/ioctl.h> -#include <scsi/scsi_all.h> -#include <scsi/scsi_message.h> -#include <scsi/scsiconf.h> - -/* - * The following two defines alter the size and composition of dpt_softc_t. - * If useland does not match the kenel, disaster will ensue. - * Since we do not know how to pick up kernel options from here, - * and since we always use these options, we will enable them here. - * - * If you build a kernel without these options, edit here and recompile. - */ -#define DPT_MEASURE_PERFORMANCE -#define DEVFS - -#include <sys/dpt.h> - -static char i2bin_bitmap[48]; /* Used for binary dump of registers */ - -char * -i2bin(unsigned int no, int length) -{ - int ndx, rind; - - for (ndx = 0, rind = 0; ndx < 32; ndx++, rind++) { - i2bin_bitmap[rind] = (((no << ndx) & 0x80000000) ? '1' : '0'); - - if (((ndx % 4) == 3)) - i2bin_bitmap[++rind] = ' '; - } - - if ((ndx % 4) == 3) - i2bin_bitmap[rind - 1] = '\0'; - else - i2bin_bitmap[rind] = '\0'; - - switch (length) { - case 8: - return (i2bin_bitmap + 30); - break; - case 16: - return (i2bin_bitmap + 20); - break; - case 24: - return (i2bin_bitmap + 10); - break; - case 32: - return (i2bin_bitmap); - default: - return ("i2bin: Invalid length Specs"); - break; - } -} -int -main(int argc, char **argv, char **argp) -{ - dpt_user_softc_t udpt; - int result; - int fd; - - if ( (fd = open(argv[1], O_RDWR, S_IRUSR | S_IWUSR)) == -1 ) { - (void)fprintf(stderr, "%s ERROR: Failed to open \"%s\" - %s\n", - argv[0], argv[1], strerror(errno)); - exit(1); - } - - if ( (result = ioctl(fd, DPT_IOCTL_SOFTC, &udpt)) != 0 ) { - (void)fprintf(stderr, "%s ERROR: Failed to send IOCTL %x - %s\n", - argv[0], DPT_IOCTL_SOFTC, - strerror(errno)); - exit(2); - } - - (void)fprintf(stdout, "Counters:%d:%d:%d:%d:%d:%d:%d\n", - udpt.total_ccbs_count, - udpt.free_ccbs_count, - udpt.waiting_ccbs_count, - udpt.submitted_ccbs_count, - udpt.completed_ccbs_count, - udpt.commands_processed, - udpt.lost_interrupts); - - (void)fprintf(stdout, "Queue Status:%s\n", - i2bin(udpt.queue_status, sizeof(udpt.queue_status) * 8)); - - (void)fprintf(stdout, "Free lock:%s\n", - i2bin(udpt.free_lock, sizeof(udpt.free_lock) * 8)); - - (void)fprintf(stdout, "Waiting lock:%s\n", - i2bin(udpt.waiting_lock, sizeof(udpt.waiting_lock) * 8)); - - (void)fprintf(stdout, "Submitted lock:%s\n", - i2bin(udpt.submitted_lock, sizeof(udpt.submitted_lock) * 8)); - - (void)fprintf(stdout, "Completed lock:%s\n", - i2bin(udpt.completed_lock, sizeof(udpt.completed_lock) * 8)); - - (void)fprintf(stdout, "Configuration:%s:%d:%d:%d:%x:%d:%d\n", - udpt.handle_interrupts ? "Yes" : "No", - udpt.max_id, - udpt.max_lun, - udpt.channels, - udpt.io_base, - udpt.irq, - udpt.dma_channel); - - (void)fprintf(stdout, "ID:%x:%x:%s:%s:%s:%s:%x\n", - udpt.board_data.deviceType, - udpt.board_data.rm_dtq, - udpt.board_data.vendor, - udpt.board_data.modelNum, - udpt.board_data.firmware, - udpt.board_data.protocol, - udpt.EATA_revision); - - (void)fprintf(stdout,"Capabilities:%x:%d:%s:%s:%s:%s:%s\n", - udpt.bustype, - udpt.channels, - i2bin((u_int32_t)udpt.state, sizeof(udpt.state) * 8), - udpt.primary ? "Yes" : "No", - udpt.more_support ? "Yes" : "No", - udpt.immediate_support ? "Yes" : "No", - udpt.broken_INQUIRY ? "Yes" : "No"); - - (void)fprintf(stdout,"More Config:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d\n", - udpt.resetlevel[0], - udpt.resetlevel[1], - udpt.resetlevel[2], - udpt.cplen, - udpt.cppadlen, - udpt.queuesize, - udpt.sgsize, - udpt.hostid[0], - udpt.hostid[1], - udpt.hostid[2]); - - (void)fprintf(stdout,"Cache:%s:%d\n", - (udpt.cache_type == DPT_NO_CACHE) - ? "None" - : (udpt.cache_type == DPT_CACHE_WRITETHROUGH) - ? "Write-Through" : "Write-Back", - udpt.cache_size); - - return(0); -} diff --git a/usr.sbin/dpt/dpt_sysinfo/Makefile b/usr.sbin/dpt/dpt_sysinfo/Makefile deleted file mode 100644 index f5d570ab61b9..000000000000 --- a/usr.sbin/dpt/dpt_sysinfo/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 5/31/93 -# $Id: Makefile,v 1.1 1998/01/22 23:32:27 ShimonR Exp ShimonR $ - -PROG= dpt_sysinfo -SRCS= dpt_sysinfo.c - -CFLAGS+=-Wall -I../../../sys -I/usr/src/sys -BINMODE=500 -BINOWN= root -MAN8= dpt_sysinfo.8 - -.include <bsd.prog.mk> diff --git a/usr.sbin/dpt/dpt_sysinfo/dpt_sysinfo.8 b/usr.sbin/dpt/dpt_sysinfo/dpt_sysinfo.8 deleted file mode 100644 index f9d15301394b..000000000000 --- a/usr.sbin/dpt/dpt_sysinfo/dpt_sysinfo.8 +++ /dev/null @@ -1,3 +0,0 @@ -.\" Copyright (c) 1997 Simon Shapiro. All rights reserved. -.\" -.\" There is nothing here yet, but an empty file will not patch diff --git a/usr.sbin/dpt/dpt_sysinfo/dpt_sysinfo.c b/usr.sbin/dpt/dpt_sysinfo/dpt_sysinfo.c deleted file mode 100644 index 13cfef7880db..000000000000 --- a/usr.sbin/dpt/dpt_sysinfo/dpt_sysinfo.c +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (c) 1997 by Simon Shapiro - * All Rights Reserved - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* 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 $" - -#include <fcntl.h> -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <sys/time.h> -#include <sys/stat.h> -#include <sys/queue.h> -#include <sys/ioctl.h> -#include <scsi/scsi_all.h> -#include <scsi/scsi_message.h> -#include <scsi/scsiconf.h> - -#define DPT_MEASURE_PERFORMANCE - -#include <sys/dpt.h> - - -int -main(int argc, char **argv, char **argp) -{ - eata_pt_t pass_thru; - dpt_sysinfo_t sysinfo; - - int result; - int fd; - int ndx; - - if ( (fd = open(argv[1], O_RDWR, S_IRUSR | S_IWUSR)) == -1 ) { - (void)fprintf(stderr, "%s ERROR: Failed to open \"%s\" - %s\n", - argv[0], argv[1], strerror(errno)); - exit(1); - } - - pass_thru.eataID[0] = 'E'; - pass_thru.eataID[1] = 'A'; - pass_thru.eataID[2] = 'T'; - pass_thru.eataID[3] = 'A'; - pass_thru.command = DPT_SYSINFO; - pass_thru.command_buffer = (u_int8_t *)&sysinfo; - - 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)); - exit(1); - } - - (void)fprintf(stdout, "%x:%x:%d:", - sysinfo.drive0CMOS, sysinfo.drive1CMOS, sysinfo.numDrives); - - switch (sysinfo.processorFamily) { - case PROC_INTEL: - (void)fprintf(stdout, "Intel:"); - switch (sysinfo.processorType) { - case PROC_8086: - (void)fprintf(stdout, "8086:"); - break; - case PROC_286: - (void)fprintf(stdout, "80286:"); - break; - case PROC_386: - (void)fprintf(stdout, "i386:"); - break; - case PROC_486: - (void)fprintf(stdout, "80486:"); - break; - case PROC_PENTIUM: - (void)fprintf(stdout, "Pentium:"); - break; - case PROC_P6: - (void)fprintf(stdout, "Pentium-Pro:"); - break; - default: - (void)fprintf(stdout, "Unknown (%d):", sysinfo.processorType); - } - break; - case PROC_MOTOROLA: - (void)fprintf(stdout, "Motorola:"); - switch (sysinfo.processorType) { - case PROC_68000: - (void)fprintf(stdout, "M68000"); - break; - case PROC_68020: - (void)fprintf(stdout, "M68020"); - break; - case PROC_68030: - (void)fprintf(stdout, "M68030"); - break; - case PROC_68040: - (void)fprintf(stdout, "M68040"); - break; - default: - (void)fprintf(stdout, "Unknown (%d):", sysinfo.processorType); - } - break; - case PROC_MIPS4000: - (void)fprintf(stdout, "MIPS:Any:"); - break; - case PROC_ALPHA: - (void)fprintf(stdout, "Alpha:Any:"); - break; - default: - (void)fprintf(stdout, "Unknown (%d):Any:", sysinfo.processorFamily); - } - - (void)fprintf(stdout, "%d.%d.%d:", - sysinfo.smartROMMajorVersion, - sysinfo.smartROMMinorVersion, - sysinfo.smartROMRevision); - - (void)fprintf(stdout, "%c%c%c%c%c%c%c%c%c%c%c:", - (sysinfo.flags & SI_CMOS_Valid) ? '+' : '-', - (sysinfo.flags & SI_NumDrivesValid) ? '+' : '-', - (sysinfo.flags & SI_ProcessorValid) ? '+' : '-', - (sysinfo.flags & SI_MemorySizeValid) ? '+' : '-', - (sysinfo.flags & SI_DriveParamsValid) ? '+' : '-', - (sysinfo.flags & SI_SmartROMverValid) ? '+' : '-', - (sysinfo.flags & SI_OSversionValid) ? '+' : '-', - (sysinfo.flags & SI_OSspecificValid) ? '+' : '-', - (sysinfo.flags & SI_BusTypeValid) ? '+' : '-', - (sysinfo.flags & SI_ALL_VALID) ? '+' : '-', - (sysinfo.flags & SI_NO_SmartROM) ? '+' : '-'); - - (void)fprintf(stdout, "%d:", sysinfo.conventionalMemSize); - (void)fprintf(stdout, "%d:", sysinfo.extendedMemSize); - - switch (sysinfo.osType) { - case OS_DOS: - (void)fprintf(stdout, "DOS:"); - break; - case OS_WINDOWS: - (void)fprintf(stdout, "Win3.1:"); - break; - case OS_WINDOWS_NT: - (void)fprintf(stdout, "NT:"); - break; - case OS_OS2M: - (void)fprintf(stdout, "OS/2-std:"); - break; - case OS_OS2L: - (void)fprintf(stdout, "OS/2-LADDR:"); - break; - case OS_OS22x: - (void)fprintf(stdout, "OS/2-2.x:"); - break; - case OS_NW286: - (void)fprintf(stdout, "NetWare-286:"); - break; - case OS_NW386: - (void)fprintf(stdout, "NetWare-386:"); - break; - case OS_GEN_UNIX: - (void)fprintf(stdout, "Unix:"); - break; - case OS_SCO_UNIX: - (void)fprintf(stdout, "SCO Unix:"); - break; - case OS_ATT_UNIX: - (void)fprintf(stdout, "AT&T Unix:"); - break; - case OS_UNIXWARE: - (void)fprintf(stdout, "UnixWare:"); - break; - case OS_INT_UNIX: - (void)fprintf(stdout, "IAC Unix:"); - break; - case OS_SOLARIS: - (void)fprintf(stdout, "Solaris:"); - break; - case OS_QNX: - (void)fprintf(stdout, "Qnx:"); - break; - case OS_NEXTSTEP: - (void)fprintf(stdout, "NextStep:"); - break; - case OS_BANYAN: - (void)fprintf(stdout, "Banyan:"); - break; - case OS_OLIVETTI_UNIX: - (void)fprintf(stdout, "Olivetti Unix:"); - break; - case OS_FREEBSD: - (void)fprintf(stdout, "FreeBSD:"); - break; - case OS_OTHER: - (void)fprintf(stdout, "Other (%d):", sysinfo.osType); - break; - default: - (void)fprintf(stdout, "Unknown (%d):", sysinfo.osType); - } - - (void)fprintf(stdout, "%d.%d.%d.%d:", sysinfo.osMajorVersion, - sysinfo.osMinorVersion, sysinfo.osRevision, - sysinfo.osSubRevision); - - switch (sysinfo.busType) { - case HBA_BUS_ISA: - (void)fprintf(stdout, "ISA:"); - break; - case HBA_BUS_EISA: - (void)fprintf(stdout, "EISA:"); - break; - case HBA_BUS_PCI: - (void)fprintf(stdout, "PCI:"); - break; - default: - (void)fprintf(stdout, "Unknown (%d):", sysinfo.busType); - } - - for (ndx = 0; ndx < 16; ndx++) { - if (sysinfo.drives[ndx].cylinders == 0) - continue; - (void)fprintf(stdout, "d%dc%dh%ds%d:", ndx, - sysinfo.drives[ndx].cylinders, - sysinfo.drives[ndx].heads, - sysinfo.drives[ndx].sectors); - } - - (void)fprintf(stdout, "\n"); - - return(0); -} diff --git a/usr.sbin/pccard/pccardc/rdattr.c b/usr.sbin/pccard/pccardc/rdattr.c deleted file mode 100644 index 8d28ed788a9d..000000000000 --- a/usr.sbin/pccard/pccardc/rdattr.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1995 Andrew McRae. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/ioctl.h> -#include <pccard/cardinfo.h> - -int -rdattr_main(argc, argv) - int argc; - char *argv[]; -{ - int i, reg, length; - char name[64]; - u_char *buf; - int fd; - off_t offs; - - if (argc != 4) { - fprintf(stderr, "usage: %s rdattr slot offs length\n", argv[0]); - exit(1); - } - sprintf(name, CARD_DEVICE, atoi(argv[1])); - fd = open(name, O_RDONLY); - if (fd < 0) { - perror(name); - exit(1); - } - reg = MDF_ATTR; - if (ioctl(fd, PIOCRWFLAG, ®)) { - perror("ioctl (PIOCRWFLAG)"); - exit(1); - } - if (sscanf(argv[2], "%x", ®) != 1 || - sscanf(argv[3], "%x", &length) != 1) { - fprintf(stderr, "arg error\n"); - exit(1); - } - offs = reg; - if ((buf = malloc(length)) == 0) { - perror(name); - exit(1); - } - lseek(fd, offs, SEEK_SET); - if (read(fd, buf, length) != length) { - perror(name); - exit(1); - } - for (i = 0; i < length; i++) { - if (i % 16 == 0) { - printf("%04x: ", (int) offs + i); - } - printf("%02x ", buf[i]); - if (i % 16 == 15) { - printf("\n"); - } - } - if (i % 16 != 0) { - printf("\n"); - } - return 0; -} diff --git a/usr.sbin/pccard/pccardd/pccardd.c b/usr.sbin/pccard/pccardd/pccardd.c deleted file mode 100644 index 3525fac9822a..000000000000 --- a/usr.sbin/pccard/pccardd/pccardd.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 1995 Andrew McRae. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static const char rcsid[] = - "$Id: pccardd.c,v 1.1 1998/02/27 08:19:25 hosokawa Exp $"; -#endif /* not lint */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <fcntl.h> -#include <unistd.h> -#define EXTERN -#include "cardd.h" - -char *config_file = "/etc/pccard.conf"; - -/* - * mainline code for cardd - */ -int -main(int argc, char *argv[]) -{ - struct slot *slots, *sp; - int count, dodebug = 0; - int doverbose = 0; - - while ((count = getopt(argc, argv, ":dvf:")) != -1) { - switch (count) { - case 'd': - setbuf(stdout, 0); - setbuf(stderr, 0); - dodebug = 1; - break; - case 'v': - doverbose = 1; - break; - case 'f': - config_file = optarg; - break; - case ':': - die("no config file argument"); - break; - case '?': - die("illegal option"); - break; - } - } -#ifdef DEBUG - dodebug = 1; -#endif - io_avail = bit_alloc(IOPORTS); /* Only supports ISA ports */ - - /* Mem allocation done in MEMUNIT units. */ - mem_avail = bit_alloc(MEMBLKS); - readfile(config_file); - if (doverbose) - dump_config_file(); - log_setup(); - if (!dodebug) - if (daemon(0, 0)) - die("fork failed"); - slots = readslots(); - if (slots == 0) - die("no PC-CARD slots"); - logmsg("pccardd started", NULL); - for (;;) { - fd_set mask; - FD_ZERO(&mask); - for (sp = slots; sp; sp = sp->next) - FD_SET(sp->fd, &mask); - count = select(32, 0, 0, &mask, 0); - if (count == -1) { - logerr("select"); - continue; - } - if (count) - for (sp = slots; sp; sp = sp->next) - if (FD_ISSET(sp->fd, &mask)) - slot_change(sp); - } -} diff --git a/usr.sbin/pppd/cbcp.c b/usr.sbin/pppd/cbcp.c deleted file mode 100644 index db939baa6317..000000000000 --- a/usr.sbin/pppd/cbcp.c +++ /dev/null @@ -1,430 +0,0 @@ -/* - * cbcp - Call Back Configuration Protocol. - * - * Copyright (c) 1995 Pedro Roque Marques - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Pedro Roque Marques. The name of the author may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef lint -static char rcsid[] = "$Id$"; -#endif - -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/time.h> -#include <syslog.h> - -#include "pppd.h" -#include "cbcp.h" -#include "fsm.h" -#include "lcp.h" -#include "ipcp.h" - -/* - * Protocol entry points. - */ -static void cbcp_init __P((int unit)); -static void cbcp_open __P((int unit)); -static void cbcp_lowerup __P((int unit)); -static void cbcp_input __P((int unit, u_char *pkt, int len)); -static void cbcp_protrej __P((int unit)); -static int cbcp_printpkt __P((u_char *pkt, int len, - void (*printer) __P((void *, char *, ...)), - void *arg)); - -struct protent cbcp_protent = { - PPP_CBCP, - cbcp_init, - cbcp_input, - cbcp_protrej, - cbcp_lowerup, - NULL, - cbcp_open, - NULL, - cbcp_printpkt, - NULL, - 0, - "CBCP", - NULL, - NULL, - NULL -}; - -cbcp_state cbcp[NUM_PPP]; - -/* internal prototypes */ - -static void cbcp_recvreq __P((cbcp_state *us, char *pckt, int len)); -static void cbcp_resp __P((cbcp_state *us)); -static void cbcp_up __P((cbcp_state *us)); -static void cbcp_recvack __P((cbcp_state *us, char *pckt, int len)); -static void cbcp_send __P((cbcp_state *us, u_char code, u_char *buf, int len)); - -/* init state */ -static void -cbcp_init(iface) - int iface; -{ - cbcp_state *us; - - us = &cbcp[iface]; - memset(us, 0, sizeof(cbcp_state)); - us->us_unit = iface; - us->us_type |= (1 << CB_CONF_NO); -} - -/* lower layer is up */ -static void -cbcp_lowerup(iface) - int iface; -{ - cbcp_state *us = &cbcp[iface]; - - syslog(LOG_DEBUG, "cbcp_lowerup"); - syslog(LOG_DEBUG, "want: %d", us->us_type); - - if (us->us_type == CB_CONF_USER) - syslog(LOG_DEBUG, "phone no: %s", us->us_number); -} - -static void -cbcp_open(unit) - int unit; -{ - syslog(LOG_DEBUG, "cbcp_open"); -} - -/* process an incomming packet */ -static void -cbcp_input(unit, inpacket, pktlen) - int unit; - u_char *inpacket; - int pktlen; -{ - u_char *inp; - u_char code, id; - u_short len; - - cbcp_state *us = &cbcp[unit]; - - inp = inpacket; - - if (pktlen < CBCP_MINLEN) { - syslog(LOG_ERR, "CBCP packet is too small"); - return; - } - - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - -#if 0 - if (len > pktlen) { - syslog(LOG_ERR, "CBCP packet: invalid length"); - return; - } -#endif - - len -= CBCP_MINLEN; - - switch(code) { - case CBCP_REQ: - us->us_id = id; - cbcp_recvreq(us, inp, len); - break; - - case CBCP_RESP: - syslog(LOG_DEBUG, "CBCP_RESP received"); - break; - - case CBCP_ACK: - if (id != us->us_id) - syslog(LOG_DEBUG, "id doesn't match: expected %d recv %d", - us->us_id, id); - - cbcp_recvack(us, inp, len); - break; - - default: - break; - } -} - -/* protocol was rejected by foe */ -void cbcp_protrej(int iface) -{ -} - -char *cbcp_codenames[] = { - "Request", "Response", "Ack" -}; - -char *cbcp_optionnames[] = { - "NoCallback", - "UserDefined", - "AdminDefined", - "List" -}; - -/* pretty print a packet */ -static int -cbcp_printpkt(p, plen, printer, arg) - u_char *p; - int plen; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - int code, opt, id, len, olen, delay; - u_char *pstart; - - if (plen < HEADERLEN) - return 0; - pstart = p; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < HEADERLEN || len > plen) - return 0; - - if (code >= 1 && code <= sizeof(cbcp_codenames) / sizeof(char *)) - printer(arg, " %s", cbcp_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - - printer(arg, " id=0x%x", id); - len -= HEADERLEN; - - switch (code) { - case CBCP_REQ: - case CBCP_RESP: - case CBCP_ACK: - while(len >= 2) { - GETCHAR(opt, p); - GETCHAR(olen, p); - - if (olen < 2 || olen > len) { - break; - } - - printer(arg, " <"); - len -= olen; - - if (opt >= 1 && opt <= sizeof(cbcp_optionnames) / sizeof(char *)) - printer(arg, " %s", cbcp_optionnames[opt-1]); - else - printer(arg, " option=0x%x", opt); - - if (olen > 2) { - GETCHAR(delay, p); - printer(arg, " delay = %d", delay); - } - - if (olen > 3) { - int addrt; - char str[256]; - - GETCHAR(addrt, p); - memcpy(str, p, olen - 4); - str[olen - 4] = 0; - printer(arg, " number = %s", str); - } - printer(arg, ">"); - break; - } - - default: - break; - } - - for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - - return p - pstart; -} - -/* received CBCP request */ -static void -cbcp_recvreq(us, pckt, pcktlen) - cbcp_state *us; - char *pckt; - int pcktlen; -{ - u_char type, opt_len, delay, addr_type; - char address[256]; - int len = pcktlen; - - address[0] = 0; - - while (len) { - syslog(LOG_DEBUG, "length: %d", len); - - GETCHAR(type, pckt); - GETCHAR(opt_len, pckt); - - if (opt_len > 2) - GETCHAR(delay, pckt); - - us->us_allowed |= (1 << type); - - switch(type) { - case CB_CONF_NO: - syslog(LOG_DEBUG, "no callback allowed"); - break; - - case CB_CONF_USER: - syslog(LOG_DEBUG, "user callback allowed"); - if (opt_len > 4) { - GETCHAR(addr_type, pckt); - memcpy(address, pckt, opt_len - 4); - address[opt_len - 4] = 0; - if (address[0]) - syslog(LOG_DEBUG, "address: %s", address); - } - break; - - case CB_CONF_ADMIN: - syslog(LOG_DEBUG, "user admin defined allowed"); - break; - - case CB_CONF_LIST: - break; - } - len -= opt_len; - } - - cbcp_resp(us); -} - -static void -cbcp_resp(us) - cbcp_state *us; -{ - u_char cb_type; - u_char buf[256]; - u_char *bufp = buf; - int len = 0; - - cb_type = us->us_allowed & us->us_type; - syslog(LOG_DEBUG, "cbcp_resp cb_type=%d", cb_type); - -#if 0 - if (!cb_type) - lcp_down(us->us_unit); -#endif - - if (cb_type & ( 1 << CB_CONF_USER ) ) { - syslog(LOG_DEBUG, "cbcp_resp CONF_USER"); - PUTCHAR(CB_CONF_USER, bufp); - len = 3 + 1 + strlen(us->us_number) + 1; - PUTCHAR(len , bufp); - PUTCHAR(5, bufp); /* delay */ - PUTCHAR(1, bufp); - BCOPY(us->us_number, bufp, strlen(us->us_number) + 1); - cbcp_send(us, CBCP_RESP, buf, len); - return; - } - - if (cb_type & ( 1 << CB_CONF_ADMIN ) ) { - syslog(LOG_DEBUG, "cbcp_resp CONF_ADMIN"); - PUTCHAR(CB_CONF_ADMIN, bufp); - len = 3 + 1; - PUTCHAR(len , bufp); - PUTCHAR(5, bufp); /* delay */ - PUTCHAR(0, bufp); - cbcp_send(us, CBCP_RESP, buf, len); - return; - } - - if (cb_type & ( 1 << CB_CONF_NO ) ) { - syslog(LOG_DEBUG, "cbcp_resp CONF_NO"); - PUTCHAR(CB_CONF_NO, bufp); - len = 3; - PUTCHAR(len , bufp); - PUTCHAR(0, bufp); - cbcp_send(us, CBCP_RESP, buf, len); - (*ipcp_protent.open)(us->us_unit); - return; - } -} - -static void -cbcp_send(us, code, buf, len) - cbcp_state *us; - u_char code; - u_char *buf; - int len; -{ - u_char *outp; - int outlen; - - outp = outpacket_buf; - - outlen = 4 + len; - - MAKEHEADER(outp, PPP_CBCP); - - PUTCHAR(code, outp); - PUTCHAR(us->us_id, outp); - PUTSHORT(outlen, outp); - - if (len) - BCOPY(buf, outp, len); - - output(us->us_unit, outpacket_buf, outlen + PPP_HDRLEN); -} - -static void -cbcp_recvack(us, pckt, len) - cbcp_state *us; - char *pckt; - int len; -{ - u_char type, delay, addr_type; - int opt_len; - char address[256]; - - if (len) { - GETCHAR(type, pckt); - GETCHAR(opt_len, pckt); - - if (opt_len > 2) - GETCHAR(delay, pckt); - - if (opt_len > 4) { - GETCHAR(addr_type, pckt); - memcpy(address, pckt, opt_len - 4); - address[opt_len - 4] = 0; - if (address[0]) - syslog(LOG_DEBUG, "peer will call: %s", address); - } - } - - cbcp_up(us); -} - -extern int persist; - -/* ok peer will do callback */ -static void -cbcp_up(us) - cbcp_state *us; -{ - persist = 0; - lcp_close(0, "Call me back, please"); -} diff --git a/usr.sbin/pppd/cbcp.h b/usr.sbin/pppd/cbcp.h deleted file mode 100644 index c2ab3f68991f..000000000000 --- a/usr.sbin/pppd/cbcp.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef CBCP_H -#define CBCP_H - -typedef struct cbcp_state { - int us_unit; /* Interface unit number */ - u_char us_id; /* Current id */ - u_char us_allowed; - int us_type; - char *us_number; /* Telefone Number */ -} cbcp_state; - -extern cbcp_state cbcp[]; - -extern struct protent cbcp_protent; - -#define CBCP_MINLEN 4 - -#define CBCP_REQ 1 -#define CBCP_RESP 2 -#define CBCP_ACK 3 - -#define CB_CONF_NO 1 -#define CB_CONF_USER 2 -#define CB_CONF_ADMIN 3 -#define CB_CONF_LIST 4 -#endif diff --git a/usr.sbin/pppd/chap_ms.h b/usr.sbin/pppd/chap_ms.h deleted file mode 100644 index 2fa7c93dc304..000000000000 --- a/usr.sbin/pppd/chap_ms.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * chap.h - Challenge Handshake Authentication Protocol definitions. - * - * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited. - * http://www.strataware.com/ - * - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Eric Rosenquist. The name of the author may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id: chap_ms.h,v 1.3 1997/08/19 17:52:35 peter Exp $ - */ - -#ifndef __CHAPMS_INCLUDE__ - -#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ -#define MAX_NT_PASSWORD 256 /* Maximum number of (Unicode) chars in an NT password */ - -void ChapMS __P((chap_state *, char *, int, char *, int)); - -#define __CHAPMS_INCLUDE__ -#endif /* __CHAPMS_INCLUDE__ */ diff --git a/usr.sbin/pppd/demand.c b/usr.sbin/pppd/demand.c deleted file mode 100644 index af1a8bbc46c0..000000000000 --- a/usr.sbin/pppd/demand.c +++ /dev/null @@ -1,348 +0,0 @@ -/* - * demand.c - Support routines for demand-dialling. - * - * Copyright (c) 1993 The Australian National University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the Australian National University. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef lint -static char rcsid[] = "$Id: demand.c,v 1.3 1997/08/19 17:52:36 peter Exp $"; -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <fcntl.h> -#include <syslog.h> -#include <netdb.h> -#include <sys/param.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <sys/time.h> -#include <sys/resource.h> -#include <sys/stat.h> -#include <sys/socket.h> -#ifdef PPP_FILTER -#include <net/if.h> -#include <net/bpf.h> -#include <pcap.h> -#endif - -#include "pppd.h" -#include "fsm.h" -#include "ipcp.h" -#include "lcp.h" - -char *frame; -int framelen; -int framemax; -int escape_flag; -int flush_flag; -int fcs; - -struct packet { - int length; - struct packet *next; - unsigned char data[1]; -}; - -struct packet *pend_q; -struct packet *pend_qtail; - -static int active_packet __P((unsigned char *, int)); - -/* - * demand_conf - configure the interface for doing dial-on-demand. - */ -void -demand_conf() -{ - int i; - struct protent *protp; - -/* framemax = lcp_allowoptions[0].mru; - if (framemax < PPP_MRU) */ - framemax = PPP_MRU; - framemax += PPP_HDRLEN + PPP_FCSLEN; - frame = malloc(framemax); - if (frame == NULL) - novm("demand frame"); - framelen = 0; - pend_q = NULL; - escape_flag = 0; - flush_flag = 0; - fcs = PPP_INITFCS; - - ppp_send_config(0, PPP_MRU, (u_int32_t) 0, 0, 0); - ppp_recv_config(0, PPP_MRU, (u_int32_t) 0, 0, 0); - -#ifdef PPP_FILTER - set_filters(&pass_filter, &active_filter); -#endif - - /* - * Call the demand_conf procedure for each protocol that's got one. - */ - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) - if (!((*protp->demand_conf)(0))) - die(1); -} - - -/* - * demand_block - set each network protocol to block further packets. - */ -void -demand_block() -{ - int i; - struct protent *protp; - - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) - sifnpmode(0, protp->protocol & ~0x8000, NPMODE_QUEUE); - get_loop_output(); -} - -/* - * demand_discard - set each network protocol to discard packets - * with an error. - */ -void -demand_discard() -{ - struct packet *pkt, *nextpkt; - int i; - struct protent *protp; - - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) - sifnpmode(0, protp->protocol & ~0x8000, NPMODE_ERROR); - get_loop_output(); - - /* discard all saved packets */ - for (pkt = pend_q; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - free(pkt); - } - pend_q = NULL; - framelen = 0; - flush_flag = 0; - escape_flag = 0; - fcs = PPP_INITFCS; -} - -/* - * demand_unblock - set each enabled network protocol to pass packets. - */ -void -demand_unblock() -{ - int i; - struct protent *protp; - - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) - sifnpmode(0, protp->protocol & ~0x8000, NPMODE_PASS); -} - -/* - * FCS lookup table as calculated by genfcstab. - */ -static u_short fcstab[256] = { - 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, - 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, - 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, - 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, - 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, - 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, - 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, - 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, - 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, - 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, - 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, - 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, - 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, - 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, - 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, - 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, - 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, - 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, - 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, - 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, - 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, - 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, - 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, - 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, - 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, - 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, - 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, - 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, - 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, - 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, - 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, - 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 -}; - -/* - * loop_chars - process characters received from the loopback. - * Calls loop_frame when a complete frame has been accumulated. - * Return value is 1 if we need to bring up the link, 0 otherwise. - */ -int -loop_chars(p, n) - unsigned char *p; - int n; -{ - int c, rv; - - rv = 0; - for (; n > 0; --n) { - c = *p++; - if (c == PPP_FLAG) { - if (!escape_flag && !flush_flag - && framelen > 2 && fcs == PPP_GOODFCS) { - framelen -= 2; - if (loop_frame(frame, framelen)) - rv = 1; - } - framelen = 0; - flush_flag = 0; - escape_flag = 0; - fcs = PPP_INITFCS; - continue; - } - if (flush_flag) - continue; - if (escape_flag) { - c ^= PPP_TRANS; - escape_flag = 0; - } else if (c == PPP_ESCAPE) { - escape_flag = 1; - continue; - } - if (framelen >= framemax) { - flush_flag = 1; - continue; - } - frame[framelen++] = c; - fcs = PPP_FCS(fcs, c); - } - return rv; -} - -/* - * loop_frame - given a frame obtained from the loopback, - * decide whether to bring up the link or not, and, if we want - * to transmit this frame later, put it on the pending queue. - * Return value is 1 if we need to bring up the link, 0 otherwise. - * We assume that the kernel driver has already applied the - * pass_filter, so we won't get packets it rejected. - * We apply the active_filter to see if we want this packet to - * bring up the link. - */ -int -loop_frame(frame, len) - unsigned char *frame; - int len; -{ - struct packet *pkt; - - /* log_packet(frame, len, "from loop: ", LOG_DEBUG); */ - if (len < PPP_HDRLEN) - return 0; - if ((PPP_PROTOCOL(frame) & 0x8000) != 0) - return 0; /* shouldn't get any of these anyway */ - if (!active_packet(frame, len)) - return 0; - - pkt = (struct packet *) malloc(sizeof(struct packet) + len); - if (pkt != NULL) { - pkt->length = len; - pkt->next = NULL; - memcpy(pkt->data, frame, len); - if (pend_q == NULL) - pend_q = pkt; - else - pend_qtail->next = pkt; - pend_qtail = pkt; - } - return 1; -} - -/* - * demand_rexmit - Resend all those frames which we got via the - * loopback, now that the real serial link is up. - */ -void -demand_rexmit(proto) - int proto; -{ - struct packet *pkt, *prev, *nextpkt; - - prev = NULL; - pkt = pend_q; - pend_q = NULL; - for (; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - if (PPP_PROTOCOL(pkt->data) == proto) { - output(0, pkt->data, pkt->length); - free(pkt); - } else { - if (prev == NULL) - pend_q = pkt; - else - prev->next = pkt; - prev = pkt; - } - } - pend_qtail = prev; - if (prev != NULL) - prev->next = NULL; -} - -/* - * Scan a packet to decide whether it is an "active" packet, - * that is, whether it is worth bringing up the link for. - */ -static int -active_packet(p, len) - unsigned char *p; - int len; -{ - int proto, i; - struct protent *protp; - - if (len < PPP_HDRLEN) - return 0; - proto = PPP_PROTOCOL(p); -#ifdef PPP_FILTER - if (active_filter.bf_len != 0 - && bpf_filter(active_filter.bf_insns, frame, len, len) == 0) - return 0; -#endif - for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { - if (!protp->enabled_flag) - return 0; - if (protp->active_pkt == NULL) - return 1; - return (*protp->active_pkt)(p, len); - } - } - return 0; /* not a supported protocol !!?? */ -} diff --git a/usr.sbin/pppd/ipxcp.h b/usr.sbin/pppd/ipxcp.h deleted file mode 100644 index 139a7260b300..000000000000 --- a/usr.sbin/pppd/ipxcp.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * ipxcp.h - IPX Control Protocol definitions. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -/* - * Options. - */ -#define IPX_NETWORK_NUMBER 1 /* IPX Network Number */ -#define IPX_NODE_NUMBER 2 -#define IPX_COMPRESSION_PROTOCOL 3 -#define IPX_ROUTER_PROTOCOL 4 -#define IPX_ROUTER_NAME 5 -#define IPX_COMPLETE 6 - -/* Values for the router protocol */ -#define IPX_NONE 0 -#define RIP_SAP 2 -#define NLSP 4 - -typedef struct ipxcp_options { - int neg_node : 1; /* Negotiate IPX node number? */ - int req_node : 1; /* Ask peer to send IPX node number? */ - - int neg_nn : 1; /* Negotiate IPX network number? */ - int req_nn : 1; /* Ask peer to send IPX network number */ - - int neg_name : 1; /* Negotiate IPX router name */ - int neg_complete : 1; /* Negotiate completion */ - int neg_router : 1; /* Negotiate IPX router number */ - - int accept_local : 1; /* accept peer's value for ournode */ - int accept_remote : 1; /* accept peer's value for hisnode */ - int accept_network : 1; /* accept network number */ - - int tried_nlsp : 1; /* I have suggested NLSP already */ - int tried_rip : 1; /* I have suggested RIP/SAP already */ - - u_int32_t his_network; /* base network number */ - u_int32_t our_network; /* our value for network number */ - u_int32_t network; /* the final network number */ - - u_char his_node[6]; /* peer's node number */ - u_char our_node[6]; /* our node number */ - u_char name [48]; /* name of the router */ - int router; /* routing protocol */ -} ipxcp_options; - -extern fsm ipxcp_fsm[]; -extern ipxcp_options ipxcp_wantoptions[]; -extern ipxcp_options ipxcp_gotoptions[]; -extern ipxcp_options ipxcp_allowoptions[]; -extern ipxcp_options ipxcp_hisoptions[]; - -extern struct protent ipxcp_protent; diff --git a/usr.sbin/vidcontrol/decode.h b/usr.sbin/vidcontrol/decode.h deleted file mode 100644 index b939af4f369e..000000000000 --- a/usr.sbin/vidcontrol/decode.h +++ /dev/null @@ -1 +0,0 @@ -int decode(FILE *fd, char *buffer); |