summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2008-11-17 22:19:19 +0000
committerimp <imp@FreeBSD.org>2008-11-17 22:19:19 +0000
commit5cf9a95bf50d3be79138d7c74bd0a0cd923764a8 (patch)
tree9dcf2e89d4f74664a397b8b45afc0acac6898733
parent4a8dc1a10cb0835fea210b4d9b6e986aac3d2523 (diff)
downloadFreeBSD-src-5cf9a95bf50d3be79138d7c74bd0a0cd923764a8.zip
FreeBSD-src-5cf9a95bf50d3be79138d7c74bd0a0cd923764a8.tar.gz
Move dumpcis to its own directory, start to decouple from the
pccardc/pccardd history.
-rw-r--r--usr.sbin/Makefile2
-rw-r--r--usr.sbin/dumpcis/Makefile (renamed from usr.sbin/pccard/dumpcis/Makefile)4
-rw-r--r--usr.sbin/dumpcis/dumpcis.8 (renamed from usr.sbin/pccard/dumpcis/dumpcis.8)0
-rw-r--r--usr.sbin/dumpcis/dumpcis.c (renamed from usr.sbin/pccard/pccardc/dumpcis.c)0
-rw-r--r--usr.sbin/dumpcis/dumpcisfile.c (renamed from usr.sbin/pccard/pccardc/dumpcisfile.c)0
-rw-r--r--usr.sbin/dumpcis/main.c (renamed from usr.sbin/pccard/dumpcis/main.c)0
-rw-r--r--usr.sbin/dumpcis/printcis.c (renamed from usr.sbin/pccard/pccardc/printcis.c)0
-rw-r--r--usr.sbin/dumpcis/readcis.c (renamed from usr.sbin/pccard/pccardd/readcis.c)0
-rw-r--r--usr.sbin/dumpcis/readcis.h (renamed from usr.sbin/pccard/pccardd/readcis.h)0
-rw-r--r--usr.sbin/pccard/Makefile6
-rw-r--r--usr.sbin/pccard/Makefile.inc3
-rw-r--r--usr.sbin/pccard/pccardc/Makefile14
-rw-r--r--usr.sbin/pccard/pccardc/beep.c77
-rw-r--r--usr.sbin/pccard/pccardc/enabler.c153
-rw-r--r--usr.sbin/pccard/pccardc/pccardc.8283
-rw-r--r--usr.sbin/pccard/pccardc/pccardc.c100
-rw-r--r--usr.sbin/pccard/pccardc/pccardmem.c72
-rw-r--r--usr.sbin/pccard/pccardc/power.c82
-rw-r--r--usr.sbin/pccard/pccardc/rdattr.c84
-rw-r--r--usr.sbin/pccard/pccardc/rdmap.c109
-rw-r--r--usr.sbin/pccard/pccardc/rdreg.c82
-rw-r--r--usr.sbin/pccard/pccardc/wrattr.c80
-rw-r--r--usr.sbin/pccard/pccardc/wrreg.c73
23 files changed, 1 insertions, 1223 deletions
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index 993eb8a..83a16f1 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -45,6 +45,7 @@ SUBDIR= ${_ac} \
diskinfo \
${_dnssec-keygen} \
${_dnssec-signzone} \
+ dumpcis \
${_editmap} \
${_edquota} \
${_eeprom} \
@@ -115,7 +116,6 @@ SUBDIR= ${_ac} \
${_ntp} \
${_nvram} \
${_ofwdump} \
- pccard \
pciconf \
periodic \
${_pkg_install} \
diff --git a/usr.sbin/pccard/dumpcis/Makefile b/usr.sbin/dumpcis/Makefile
index 795c05c..b68e2e4 100644
--- a/usr.sbin/pccard/dumpcis/Makefile
+++ b/usr.sbin/dumpcis/Makefile
@@ -2,12 +2,8 @@
#
# $FreeBSD$
-.PATH: ${.CURDIR}/../pccardd ${.CURDIR}/../pccardc
-
PROG= dumpcis
MAN= dumpcis.8
SRCS= main.c dumpcis.c dumpcisfile.c readcis.c printcis.c
-CFLAGS+= -I${.CURDIR}/../pccardd -I${.CURDIR}/../pccardc
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/pccard/dumpcis/dumpcis.8 b/usr.sbin/dumpcis/dumpcis.8
index 518eadd..518eadd 100644
--- a/usr.sbin/pccard/dumpcis/dumpcis.8
+++ b/usr.sbin/dumpcis/dumpcis.8
diff --git a/usr.sbin/pccard/pccardc/dumpcis.c b/usr.sbin/dumpcis/dumpcis.c
index d085e37..d085e37 100644
--- a/usr.sbin/pccard/pccardc/dumpcis.c
+++ b/usr.sbin/dumpcis/dumpcis.c
diff --git a/usr.sbin/pccard/pccardc/dumpcisfile.c b/usr.sbin/dumpcis/dumpcisfile.c
index 6a415ba..6a415ba 100644
--- a/usr.sbin/pccard/pccardc/dumpcisfile.c
+++ b/usr.sbin/dumpcis/dumpcisfile.c
diff --git a/usr.sbin/pccard/dumpcis/main.c b/usr.sbin/dumpcis/main.c
index 317195c..317195c 100644
--- a/usr.sbin/pccard/dumpcis/main.c
+++ b/usr.sbin/dumpcis/main.c
diff --git a/usr.sbin/pccard/pccardc/printcis.c b/usr.sbin/dumpcis/printcis.c
index f8a53b3..f8a53b3 100644
--- a/usr.sbin/pccard/pccardc/printcis.c
+++ b/usr.sbin/dumpcis/printcis.c
diff --git a/usr.sbin/pccard/pccardd/readcis.c b/usr.sbin/dumpcis/readcis.c
index 73b72ef..73b72ef 100644
--- a/usr.sbin/pccard/pccardd/readcis.c
+++ b/usr.sbin/dumpcis/readcis.c
diff --git a/usr.sbin/pccard/pccardd/readcis.h b/usr.sbin/dumpcis/readcis.h
index 8ebd745..8ebd745 100644
--- a/usr.sbin/pccard/pccardd/readcis.h
+++ b/usr.sbin/dumpcis/readcis.h
diff --git a/usr.sbin/pccard/Makefile b/usr.sbin/pccard/Makefile
deleted file mode 100644
index 18bd019..0000000
--- a/usr.sbin/pccard/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# Makefile for pccardc/pccardd.
-# $FreeBSD$
-
-SUBDIR= dumpcis
-
-.include <bsd.subdir.mk>
diff --git a/usr.sbin/pccard/Makefile.inc b/usr.sbin/pccard/Makefile.inc
deleted file mode 100644
index 265f86d..0000000
--- a/usr.sbin/pccard/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-# $FreeBSD$
-
-.include "../Makefile.inc"
diff --git a/usr.sbin/pccard/pccardc/Makefile b/usr.sbin/pccard/pccardc/Makefile
deleted file mode 100644
index d0649a2..0000000
--- a/usr.sbin/pccard/pccardc/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# pccardc Makefile
-#
-# $FreeBSD$
-
-.PATH: ${.CURDIR}/../pccardd
-
-PROG= pccardc
-MAN= pccardc.8
-SRCS= beep.c dumpcis.c dumpcisfile.c enabler.c pccardc.c pccardmem.c power.c \
- printcis.c rdattr.c rdmap.c rdreg.c readcis.c wrattr.c wrreg.c
-
-CFLAGS+= -I${.CURDIR}/../pccardd
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/pccard/pccardc/beep.c b/usr.sbin/pccard/pccardc/beep.c
deleted file mode 100644
index be62c56..0000000
--- a/usr.sbin/pccard/pccardc/beep.c
+++ /dev/null
@@ -1,77 +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.
- */
-
-/*
- * Code cleanup, bug-fix and extension
- * by Tatsumi Hosokawa <hosokawa@mt.cs.keio.ac.jp>
- */
-
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <ctype.h>
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-#include <pccard/cardinfo.h>
-
-int
-beep_main(argc, argv)
- int argc;
- char *argv[];
-{
- int fd, newstat, valid = 1;
- char name[64], *p;
-
- if (argc != 2)
- valid = 0;
- if (valid) {
- for (p = argv[1]; *p; p++) {
- if (!isdigit(*p)) {
- valid = 0;
- break;
- }
- }
- }
- if (!valid)
- errx(1, "usage: %s beep newstat", argv[0]);
-
- sscanf(argv[1], "%d", &newstat);
- sprintf(name, CARD_DEVICE, 0);
- fd = open(name, O_RDWR);
- if (fd < 0)
- err(1, "%s", name);
- if (ioctl(fd, PIOCSBEEP, &newstat) < 0)
- err(1, "ioctl (PIOCSBEEP)");
- return 0;
-}
diff --git a/usr.sbin/pccard/pccardc/enabler.c b/usr.sbin/pccard/pccardc/enabler.c
deleted file mode 100644
index 2793e33..0000000
--- a/usr.sbin/pccard/pccardc/enabler.c
+++ /dev/null
@@ -1,153 +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[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-
-#include <pccard/cardinfo.h>
-#include <pccard/cis.h>
-
-static void usage(char *);
-
-int
-enabler_main(argc, argv)
- int argc;
- char *argv[];
-{
- struct dev_desc drv;
- struct mem_desc mem;
- struct io_desc io;
- int fd, slot, i, card_addr;
- char name[32];
- char *p;
-
- bzero(&drv, sizeof(drv));
- if (argc < 3)
- usage("arg count");
- slot = atoi(argv[1]);
- if (slot < 0 || slot >= MAXSLOT)
- usage("illegal slot number");
- p = argv[2];
- while (*p && (*p < '0' || *p > '9'))
- p++;
- if (*p == 0)
- usage("no unit on device name");
- drv.unit = atoi(p);
- *p = 0;
- strcpy(drv.name, argv[2]);
- argv += 3;
- argc -= 3;
- while (argc > 1) {
- if (strcmp(argv[0], "-m") == 0) {
- if (argc < 4)
- usage("memory argument error");
- if (sscanf(argv[1], "%x", &card_addr) != 1)
- usage("bad card address");
- if (sscanf(argv[2], "%lx", &drv.mem) != 1)
- usage("bad memory address");
- if (sscanf(argv[3], "%d", &i) != 1)
- usage("bad memory size");
- drv.memsize = i * 1024;
- argc -= 2;
- argv += 2;
- } else if (strcmp(argv[0], "-f") == 0) {
- if (sscanf(argv[1], "%x", &drv.flags) != 1)
- usage("bad driver flags");
- } else if (strcmp(argv[0], "-a") == 0) {
- if (sscanf(argv[1], "%x", &drv.iobase) != 1)
- usage("bad I/O address");
- } else if (strcmp(argv[0], "-i") == 0) {
- if (sscanf(argv[1], "%d", &i) != 1 || i < 1 || i > 15)
- usage("illegal IRQ");
- drv.irqmask = 1 << i;
- }
- argc -= 2;
- argv += 2;
- }
- if (argc)
- usage("no parameter for argument");
- printf("drv %s%d, mem 0x%lx, size %d, io 0x%x, irq 0x%x, flags 0x%x\n",
- drv.name, drv.unit, drv.mem, drv.memsize, drv.iobase,
- drv.irqmask, drv.flags);
- sprintf(name, CARD_DEVICE, slot);
- fd = open(name, O_RDWR);
- if (fd < 0)
- err(1, "%s", name);
-
- /* Map the memory and I/O contexts. */
- if (drv.mem) {
- mem.window = 0;
- mem.flags = MDF_ACTIVE | MDF_16BITS;
- mem.start = (caddr_t)drv.mem;
- mem.size = drv.memsize;
- mem.card = card_addr;
- if (ioctl(fd, PIOCSMEM, &mem))
- err(1, "set memory context");
- }
- if (drv.iobase) {
- io.window = 0;
- io.flags = IODF_ACTIVE | IODF_CS16;
- io.start = drv.iobase;
- io.size = 32; /* Blah... */
- if (ioctl(fd, PIOCSIO, &io))
- err(1, "set I/O context");
- }
- if (ioctl(fd, PIOCSDRV, &drv))
- warn("set driver");
- close(fd);
- return 0;
-}
-
-/*
- * usage - print usage and exit
- */
-void
-usage(msg)
- char *msg;
-{
- fprintf(stderr, "enabler: %s\n", msg);
- fprintf(stderr,
-"usage: pccardc enabler slot driver [-m addr size] [-a iobase] [-i irq]\n");
- fprintf(stderr,
-" -m card addr size : card address (hex), host address (hex) & size (Kb)\n");
- fprintf(stderr,
-" -a iobase : I/O port address (hex)\n");
- fprintf(stderr,
-" -i irq : interrupt request number (1-15)\n");
- fprintf(stderr,
-" Example: enabler 0 ed0 -m 2000 d4000 16 -a 300 -i 3\n");
- exit(1);
-}
diff --git a/usr.sbin/pccard/pccardc/pccardc.8 b/usr.sbin/pccard/pccardc/pccardc.8
deleted file mode 100644
index e1e0925..0000000
--- a/usr.sbin/pccard/pccardc/pccardc.8
+++ /dev/null
@@ -1,283 +0,0 @@
-.\"
-.\" Copyright (c) 1998 Toshihiko ARAI <toshi@jp.FreeBSD.org>
-.\" 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.
-.\"
-.\" Translated to English by Hiroki Sato <hrs@geocities.co.jp>
-.\"
-.\" $FreeBSD$
-.\"
-.Dd November 14, 1998
-.Dt PCCARDC 8
-.Os
-.Sh NAME
-.Nm pccardc
-.Nd PC-CARD (PCMCIA) management and monitoring tool
-.Sh SYNOPSIS
-.Nm
-.Ar subcommand
-.Op Ar arg ...
-.Sh DESCRIPTION
-The
-.Nm
-utility controls PC-CARD slots and configures and displays information
-about PCMCIA cards.
-It understands the following subcommands:
-.Pp
-.Bl -tag -width dumpcisfile -compact
-.It Ic beep
-Set beep type
-.It Ic dumpcis
-Print card CIS(s)
-.It Ic dumpcisfile
-Print card CIS(s) from files
-.It Ic enabler
-Device driver enabler
-.It Ic help
-Print command summary
-.It Ic pccardmem
-Allocate memory for pccard driver
-.It Ic power
-Power on/off slots and leaves them disabled
-.It Ic rdattr
-Read attribute memory
-.It Ic rdmap
-Read pcic mappings
-.It Ic rdreg
-Read pcic register
-.It Ic wrattr
-Write byte to attribute memory
-.It Ic wrreg
-Write pcic register
-.El
-.Bl -enum
-.It
-.Ic beep Ar beep_mode
-.Pp
-Specifies the sound made upon card insertion or removal.
-This subcommand corresponds to
-.Va pccard_beep
-in
-.Xr rc.conf 5 .
-Allowed values for
-.Ar beep_mode
-are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Li 0
-silent mode
-.It Li 1
-simple beep mode
-.It Li 2
-melody mode
-.El
-.It
-.Ic dumpcis
-.Op Ar slot
-.Pp
-Displays
-.Em CIS
-(Card Information Structure) tuple in EEPROM of a PC-CARD card.
-.Ar Slot
-specifies which slot to read.
-When no option is supplied, it displays
-the CIS of all of the available cards.
-.It
-.Ic dumpcisfile
-.Ar
-.Pp
-Displays CIS(s) in the same format as
-.Ic dumpcis ,
-but does so using
-one or more files
-as the input CIS data instead of physical PC-CARD cards.
-.It
-.Ic enabler Ar slot driver
-.Op Fl m Ar card addr size
-.Op Fl a Ar iobase
-.Op Fl i Ar irq
-.Pp
-This is a "point enabler" which can be used to set
-parameters manually to enable a card when
-.Xr pccardd 8
-cannot allocate drivers to a PC-CARD card properly.
-Specify a PC-CARD slot in
-.Ar slot
-and a device name (such as "ed0" or "sio2") in
-.Ar driver ,
-along with some or all of the following options:
-.Bl -tag -width Ds
-.It Fl m Ar card addr size
-maps the shared-memory window of the card to host address.
-.Ar card
-is the starting address of shared-memory (hex) in the card's address space,
-.Ar addr
-is the address (hex) to map the memory to in the computer's address space, and
-.Ar size
-is the size of memory window (kb).
-.It Fl a Ar iobase
-.Ar iobase
-specifies the port number to be mapped to the I/O window (hex)
-.It Fl i Ar irq
-.Ar irq
-specifies the IRQ (decimal from 1 to 15) the card will use for interrupts.
-.El
-.Pp
-For example,
-.Bd -literal
- enabler 0 ed0 -m 2000 d4000 16 -a 300 -i 3
-.Ed
-.Pp
-assigns the card in slot zero to the first NE2000 ethernet card driver at
-port 0x300 and IRQ 3,
-mapping the 16KB memory region at 0x2000 in the card to 0xd4000.
-.Pp
-This allows use of some unrecognized cards with broken CIS tuples,
-and is also useful for testing a card that has not yet reported.
-However, beware that it frequently cannot recognize new cards properly.
-.It
-.Ic help
-.Pp
-Prints help for
-.Nm .
-.It
-.Ic pccardmem Ar addr
-.Pp
-Specifies the host address range PC-CARD controller(PCIC)
-will use to map cards to.
-Because the PCIC needs a contiguous 16KB memory, and most machines
-have other ROMs or devices at other places in the ISA I/O memory
-address range, generally you can only use the following four addresses:
-.Pp
-.Bl -tag -width 0xd0000 -compact
-.It Ar 0xd0000
-0xd0000-0xd3fff (default)
-.It Ar 0xd4000
-0xd4000-0xd7fff
-.It Ar 0xd8000
-0xd8000-0xdbfff
-.It Ar 0xdc000
-0xdc000-0xdffff
-.El
-.Pp
-You can use "DEFAULT" instead of 0xd0000.
-This subcommand corresponds to
-.Va pccard_mem
-in
-.Xr rc.conf 5 .
-.It
-.Ic power Ar slot power_mode
-.Pp
-Changes the state of the power supply of the card in the specified
-.Ar slot :
-.Pp
-.Bl -tag -width Ds
-.It Li 0
-Turn off a power supply.
-If a card becomes unstable when it is removed at
-activate state,
-this can force it into inactive state first and remove it safely.
-The slot will remain disabled until you eject the card with the system
-running or reenable the card with another
-.Ic pccardc power
-power command.
-The slot will even remain disabled when you suspend and resume the
-computer.
-.It Li 1
-Turn on a power supply and set it into active state
-(the system treats the card as if it was just inserted).
-.El
-.Pp
-.It
-.Ic rdattr Ar slot offs length
-.Pp
-Prints a hex dump
-.Ar length
-bytes long of the EEPROM of the card in slot
-.Ar slot
-starting at
-.Ar offs .
-All parameters are in hex.
-.It
-.Ic rdmap
-.Op Ar slot
-.Pp
-Displays where the four memory windows and two I/O windows of a PC-CARD slot
-are mapped to on the host.
-If
-.Ar slot
-is not supplied, it displays the information for all of slots in the system.
-.It
-.Ic rdreg
-.Op Ar slot
-.Pp
-Displays the 64 registers of the card in
-.Ar slot
-(all slots by default).
-.It
-.Ic wrattr Ar slot offs value
-.Pp
-Writes a single byte to the card's EEPROM at
-an offset address from the top specified in
-.Ar offs
-(hex),
-with a value specified in
-.Ar value
-(hex).
-This is preserved after the card is removed.
-.It
-.Ic wrreg Ar slot reg value
-.Pp
-Writes a register of a PC-CARD.
-Specify a PC-CARD slot number in
-.Ar slot ,
-a register number in
-.Ar reg
-(hex) and
-a value in
-.Ar value
-(hex).
-.El
-.Sh FILES
-.Bl -tag -width /etc/rc.conf -compact
-.It Pa /etc/rc.conf
-configuration file
-.El
-.Sh SEE ALSO
-.Xr rc.conf 5 ,
-.Xr pccardd 8
-.Sh AUTHORS
-.An -nosplit
-The original version was written by
-.An Andrew McRae Aq andrew@mega.com.au .
-.An Tatsumi Hosokawa Aq hosokawa@mt.cs.keio.ac.jp
-fixed bugs and added some features.
-This man page was written by
-.An Toshihiko ARAI Aq toshi@jp.FreeBSD.org .
-.Sh BUGS
-Be careful when using
-.Ic enabler
-and
-.Ic wrattr .
-Misuse can make the system unstable or damage the card.
diff --git a/usr.sbin/pccard/pccardc/pccardc.c b/usr.sbin/pccard/pccardc/pccardc.c
deleted file mode 100644
index c1f6ece..0000000
--- a/usr.sbin/pccard/pccardc/pccardc.c
+++ /dev/null
@@ -1,100 +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[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <err.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef int (*main_t)(int, char **);
-
-#define DECL(foo) int foo(int, char**)
-DECL(beep_main);
-DECL(dumpcis_main);
-DECL(dumpcisfile_main);
-DECL(enabler_main);
-DECL(help_main);
-DECL(pccardmem_main);
-DECL(power_main);
-DECL(rdattr_main);
-DECL(rdmap_main);
-DECL(rdreg_main);
-DECL(wrattr_main);
-DECL(wrreg_main);
-
-struct {
- char *name;
- main_t func;
- char *help;
-} subcommands[] = {
- { "beep", beep_main, "Beep type" },
- { "dumpcis", dumpcis_main, "Prints CIS for all cards" },
- { "dumpcisfile", dumpcisfile_main, "Prints CIS from a file" },
- { "enabler", enabler_main, "Device driver enabler" },
- { "help", help_main, "Prints command summary" },
- { "pccardmem", pccardmem_main, "Allocate memory for pccard driver" },
- { "power", power_main, "Power on/off slots" },
- { "rdattr", rdattr_main, "Read attribute memory" },
- { "rdmap", rdmap_main, "Read pcic mappings" },
- { "rdreg", rdreg_main, "Read pcic register" },
- { "wrattr", wrattr_main, "Write byte to attribute memory" },
- { "wrreg", wrreg_main, "Write pcic register" },
- { 0, 0 }
-};
-
-int
-main(int argc, char **argv)
-{
- int i;
-
- for (i = 0; argc > 1 && subcommands[i].name; i++) {
- if (!strcmp(argv[1], subcommands[i].name)) {
- argv[1] = argv[0];
- return (*subcommands[i].func) (argc - 1, argv + 1);
- }
- }
- if (argc > 1)
- warnx("unknown subcommand");
- return help_main(argc, argv);
-}
-
-int
-help_main(int argc, char **argv)
-{
- int i;
-
- fprintf(stderr, "usage: pccardc <subcommand> <arg> ...\n");
- fprintf(stderr, "subcommands:\n");
- for (i = 0; subcommands[i].name; i++)
- fprintf(stderr, "\t%s\n\t\t%s\n",
- subcommands[i].name, subcommands[i].help);
- return 1;
-}
diff --git a/usr.sbin/pccard/pccardc/pccardmem.c b/usr.sbin/pccard/pccardc/pccardmem.c
deleted file mode 100644
index 0b1d176..0000000
--- a/usr.sbin/pccard/pccardc/pccardmem.c
+++ /dev/null
@@ -1,72 +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[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-#include <pccard/cardinfo.h>
-
-static void
-usage()
-{
- fprintf(stderr, "usage: pccardc pccardmem [memory-address]\n");
- exit(1);
-}
-
-int
-pccardmem_main(argc, argv)
- int argc;
- char *argv[];
-{
- char name[64];
- int addr = 0;
- int fd;
-
- if (argc > 2)
- usage();
- sprintf(name, CARD_DEVICE, 0);
- fd = open(name, O_RDONLY);
- if (fd < 0)
- err(1, "%s", name);
- if (argc == 2) {
- if (sscanf(argv[1], "%x", &addr) != 1)
- errx(1, "arg error");
- }
- if (ioctl(fd, PIOCRWMEM, &addr))
- err(1, "ioctl (PIOCRWMEM)");
- else
- printf("PCCARD Memory address set to 0x%x\n", addr);
- return 0;
-}
diff --git a/usr.sbin/pccard/pccardc/power.c b/usr.sbin/pccard/pccardc/power.c
deleted file mode 100644
index 59d43a5..0000000
--- a/usr.sbin/pccard/pccardc/power.c
+++ /dev/null
@@ -1,82 +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.
- */
-
-/* $FreeBSD$ */
-
-/*
- * Code cleanup, bug-fix and extension
- * by Tatsumi Hosokawa <hosokawa@mt.cs.keio.ac.jp>
- */
-
-#ifndef lint
-static const char rcsid[] =
- "PAO: power.c,v 1.3 1999/02/11 05:00:54 kuriyama Exp";
-#endif /* not lint */
-
-#include <ctype.h>
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-#include <pccard/cardinfo.h>
-
-int
-power_main(argc, argv)
- int argc;
- char *argv[];
-{
- int fd, i, newstat, valid = 1;
- char name[64], *p;
-
- if (argc != 3)
- valid = 0;
- for (i = 1; i <= 2; i++) {
- if (valid) {
- for (p = argv[i]; *p; p++) {
- if (!isdigit(*p)) {
- valid = 0;
- break;
- }
- }
- }
- }
- if (!valid)
- errx(1, "usage: %s power slot newstat", argv[0]);
-
- sscanf(argv[2], "%d", &newstat);
- sprintf(name, CARD_DEVICE, atoi(argv[1]));
- fd = open(name, O_RDWR);
- if (fd < 0)
- err(1, "%s", name);
- newstat = newstat ? 1 : 0;
- if (ioctl(fd, PIOCSVIR, &newstat) < 0)
- err(1, "ioctl (PIOCSVIR)");
- return 0;
-}
diff --git a/usr.sbin/pccard/pccardc/rdattr.c b/usr.sbin/pccard/pccardc/rdattr.c
deleted file mode 100644
index 1f90c77..0000000
--- a/usr.sbin/pccard/pccardc/rdattr.c
+++ /dev/null
@@ -1,84 +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 <err.h>
-#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)
- errx(1, "Usage: %s rdattr slot offs length", argv[0]);
-
- sprintf(name, CARD_DEVICE, atoi(argv[1]));
- fd = open(name, O_RDONLY);
- if (fd < 0)
- err(1, "%s", name);
-
- reg = MDF_ATTR;
- if (ioctl(fd, PIOCRWFLAG, &reg))
- err(1, "ioctl (PIOCRWFLAG)");
-
- if (sscanf(argv[2], "%x", &reg) != 1 ||
- sscanf(argv[3], "%x", &length) != 1)
- errx(1, "arg error");
-
- offs = reg;
- if ((buf = malloc(length)) == 0)
- errx(1, "malloc failed");
-
- lseek(fd, offs, SEEK_SET);
- if (read(fd, buf, length) != length)
- err(1, "%s", name);
-
- 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/pccardc/rdmap.c b/usr.sbin/pccard/pccardc/rdmap.c
deleted file mode 100644
index 3ac81f9..0000000
--- a/usr.sbin/pccard/pccardc/rdmap.c
+++ /dev/null
@@ -1,109 +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[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-
-#include <pccard/cardinfo.h>
-#include <pccard/cis.h>
-
-static void
-dump_io(fd, nio)
- int fd, nio;
-{
- struct io_desc io;
- int i;
-
- for (i = 0; i < nio; i++) {
- io.window = i;
- if (ioctl(fd, PIOCGIO, &io))
- err(1, "ioctl (PIOCGIO)");
- printf("I/O %d: flags 0x%03x port 0x%3x size %d bytes\n",
- io.window, io.flags, io.start, io.size);
- }
-}
-
-static void
-dump_mem(fd, nmem)
- int fd, nmem;
-{
- struct mem_desc mem;
- int i;
-
- for (i = 0; i < nmem; i++) {
- mem.window = i;
- if (ioctl(fd, PIOCGMEM, &mem))
- err(1, "ioctl (PIOCGMEM)");
- printf("Mem %d: flags 0x%03x host %p card %04lx size %d bytes\n",
- mem.window, mem.flags, mem.start, mem.card, mem.size);
- }
-}
-
-static void
-scan(slot)
- int slot;
-{
- int fd;
- char name[64];
- struct slotstate st;
-
- sprintf(name, CARD_DEVICE, slot);
- fd = open(name, O_RDONLY);
- if (fd < 0)
- return;
- if (ioctl(fd, PIOCGSTATE, &st))
- err(1, "ioctl (PIOCGSTATE)");
-/*
- if (st.state == filled)
- */
- {
- dump_mem(fd, st.maxmem);
- dump_io(fd, st.maxio);
- }
- close(fd);
-}
-
-int
-rdmap_main(argc, argv)
- int argc;
- char *argv[];
-{
- int node;
-
- for (node = 0; node < 8; node++)
- scan(node);
- exit(0);
-}
diff --git a/usr.sbin/pccard/pccardc/rdreg.c b/usr.sbin/pccard/pccardc/rdreg.c
deleted file mode 100644
index a317148..0000000
--- a/usr.sbin/pccard/pccardc/rdreg.c
+++ /dev/null
@@ -1,82 +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[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-#include <pccard/cardinfo.h>
-
-void
-dumpslot(sl)
- int sl;
-{
- char name[64];
- int fd;
- struct pcic_reg r;
-
- sprintf(name, CARD_DEVICE, sl);
- fd = open(name, O_RDONLY);
- if (fd < 0) {
- warn("%s", name);
- return;
- }
- printf("Registers for slot %d\n", sl);
- for (r.reg = 0; r.reg < 0x40; r.reg++) {
- if (ioctl(fd, PIOCGREG, &r)) {
- err(1, "ioctl (PIOCGREG)");
- break;
- }
- if ((r.reg % 16) == 0)
- printf("%02x:", r.reg);
- printf(" %02x", r.value);
- if ((r.reg % 16) == 15)
- printf("\n");
- }
- close(fd);
-}
-
-int
-rdreg_main(argc, argv)
- int argc;
- char *argv[];
-{
- if (argc != 2) {
- dumpslot(0);
- dumpslot(1);
- } else
- dumpslot(atoi(argv[1]));
- return 0;
-}
diff --git a/usr.sbin/pccard/pccardc/wrattr.c b/usr.sbin/pccard/pccardc/wrattr.c
deleted file mode 100644
index cc3df8e..0000000
--- a/usr.sbin/pccard/pccardc/wrattr.c
+++ /dev/null
@@ -1,80 +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[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-#include <pccard/cardinfo.h>
-
-static void
-usage()
-{
- fprintf(stderr, "usage: pccardc wrattr slot offs value\n");
- exit(1);
-}
-
-int
-wrattr_main(argc, argv)
- int argc;
- char *argv[];
-{
- int reg, value;
- char name[64], c;
- int fd;
- off_t offs;
-
- if (argc != 4)
- usage();
- sprintf(name, CARD_DEVICE, atoi(argv[1]));
- fd = open(name, O_RDWR);
- if (fd < 0)
- err(1, "%s", name);
-
- reg = MDF_ATTR;
- if (ioctl(fd, PIOCRWFLAG, &reg))
- err(1, "ioctl (PIOCRWFLAG)");
-
- if (sscanf(argv[2], "%x", &reg) != 1 ||
- sscanf(argv[3], "%x", &value) != 1)
- errx(1, "arg error");
-
- offs = reg;
- c = value;
- lseek(fd, offs, SEEK_SET);
- if (write(fd, &c, 1) != 1)
- err(1, "%s", name);
- return 0;
-}
diff --git a/usr.sbin/pccard/pccardc/wrreg.c b/usr.sbin/pccard/pccardc/wrreg.c
deleted file mode 100644
index 5fda2a7..0000000
--- a/usr.sbin/pccard/pccardc/wrreg.c
+++ /dev/null
@@ -1,73 +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[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-#include <pccard/cardinfo.h>
-
-static void
-usage()
-{
- fprintf(stderr, "usage: pccardc wrreg slot reg value\n");
- exit(1);
-}
-
-int
-wrreg_main(argc, argv)
- int argc;
- char *argv[];
-{
- int reg, value;
- char name[64];
- int fd;
- struct pcic_reg r;
-
- if (argc != 4)
- usage();
- sprintf(name, CARD_DEVICE, atoi(argv[1]));
- fd = open(name, O_RDWR);
- if (fd < 0)
- err(1, "%s", name);
- if (sscanf(argv[2], "%x", &reg) != 1 ||
- sscanf(argv[3], "%x", &value) != 1)
- errx(1, "arg error");
- r.reg = reg;
- r.value = value;
- if (ioctl(fd, PIOCSREG, &r))
- err(1, "ioctl (PIOCSREG)");
- return 0;
-}
OpenPOWER on IntegriCloud