Implement pccardc power command. This allows one to power off

individual slots at one's whim.  Useful for turning the slots into
card carrying cases, etc.  Patch was originally from mihira-san in
message to freebsd-mobile.  He ported the code originally from PAO.

Submitted by: MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>
This commit is contained in:
Warner Losh 1999-12-02 05:52:58 +00:00
parent 4ecd5f6e8c
commit 78944e7259
3 changed files with 20 additions and 1 deletions

View File

@ -4,7 +4,7 @@
# $FreeBSD$
#
PROG= pccardc
SRCS= beep.c dumpcis.c enabler.c pccardc.c pccardmem.c printcis.c \
SRCS= beep.c dumpcis.c enabler.c pccardc.c pccardmem.c power.c printcis.c \
rdattr.c rdmap.c rdreg.c readcis.c wrattr.c wrreg.c
MAN8= pccardc.8

View File

@ -54,6 +54,8 @@ Device driver enabler
Print command summary
.It Pa pccardmem
Allocate memory for pccard driver
.It Pa power
Power on/off slots
.It Pa rdattr
Read attribute memory
.It Pa rdmap
@ -162,6 +164,21 @@ This subcommand corresponds to
in
.Xr rc.conf 5 .
.It
.Nm power Ar slot 0|1
.Pp
It turns ON/OFF a power supply of a card in the slot specified in
.Ar slot .
.Pp
.Bl -tag -width Ds
.It Ar 0
turn OFF a power supply. If a card becomes unstable when it is removed at
activate state,
this can force it to turn into inactive state first and remove it safely.
.It Ar 1
turn ON a power supply and into active state similar to a card insertion.
.El
.Pp
It
.Nm rdattr Ar slot offs length
.Pp
Prints a hex dump

View File

@ -41,6 +41,7 @@ DECL(dumpcis_main);
DECL(enabler_main);
DECL(help_main);
DECL(pccardmem_main);
DECL(power_main);
DECL(rdattr_main);
DECL(rdmap_main);
DECL(rdreg_main);
@ -57,6 +58,7 @@ struct {
{ "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" },