mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-17 16:10:46 +01:00
f2b46629be
This is not quite finished yet, and therefore I have not added it to the usr.sbin/Makefile yet. I collected a bunch of Andrews small programs into one: pccardc /phk Reviewed by: phk Submitted by: Andrew McRae <andrew@mega.com.au>
184 lines
4.9 KiB
Groff
184 lines
4.9 KiB
Groff
.\" Copyright (c) 1994 Andrew McRae
|
|
.\" All rights reserved.
|
|
.\"
|
|
.Dd Novemeber 2, 1994
|
|
.Dt CARD.CONF 5
|
|
.Os FreeBSD
|
|
.Sh NAME
|
|
.Nm card.conf
|
|
.Nd
|
|
.Xr cardd 8
|
|
configuration file
|
|
.Sh DESCRIPTION
|
|
The
|
|
.Nm card.conf
|
|
file is the configuration file for the
|
|
.Xr cardd 8
|
|
PC-CARD slot management daemon.
|
|
It provides information to allow card
|
|
identification, and the matching of drivers (along
|
|
with driver resources) to the PC-CARD cards.
|
|
.Pp
|
|
There are four basic elements within the configuration file;
|
|
An optional
|
|
.Em "resource pool"
|
|
preceding the other sections,
|
|
and one or more
|
|
.Em "card identifiers" ,
|
|
and
|
|
.Em "device instances" .
|
|
The latter two may appear in any order, and may be
|
|
interspersed as desired.
|
|
.Pp
|
|
Each PC-CARD card contains configuration tuples that provide
|
|
the manufacturer and card version; these are used
|
|
to identify the card specification in the configuration
|
|
file, and from this find a driver that can be used to
|
|
interface to the particular card. There is a many-to-one mapping
|
|
between cards to drivers i.e a single driver may interface to
|
|
multiple types of cards. To aid this, card parameters may be
|
|
specified separately from the driver to initialise the card or
|
|
extract (in the case of a network card) an ethernet address.
|
|
.Pp
|
|
Once a driver is allocated to a card, it stays
|
|
allocated to that particular card.
|
|
However, multiple instances of the same type of driver can be
|
|
configured, so that if two cards are plugged in that map to a
|
|
similar type of driver, other driver instances of the same name
|
|
can be configured.
|
|
.Pp
|
|
The
|
|
.Em insert
|
|
and
|
|
.Em remove
|
|
commands allow a shell command line to be executed.
|
|
The command to be executed is the rest of the line after
|
|
the keyword. The line can be continued using a backslash.
|
|
A simple
|
|
macro substitution allows the current kernel device name
|
|
.Em ( $device )
|
|
and
|
|
network card ethernet address
|
|
.Em ( $ether )
|
|
to be inserted into the command line.
|
|
.Xr Pcmciad 8
|
|
uses the
|
|
.Xr system 3
|
|
subroutine to execute the command line.
|
|
.Pp
|
|
Numeric values may be expressed as octal, hex or decimal.
|
|
If a decimal number has
|
|
.Em k
|
|
or
|
|
.Em K
|
|
appended to it, the value is multiplied by 1024. Names may be
|
|
quoted using double quotes if spaces are required.
|
|
A hash character comments out the rest of the line.
|
|
.Ss "Resource pool"
|
|
The (optional) section specifies a pool of system resources
|
|
such as ISA bus memory address space, Input/Output ports and
|
|
interrupt request numbers. This resource pool is used
|
|
to allocate address space and interrupt numbers dynamically
|
|
according to the requirements specified in each driver
|
|
description.
|
|
.Pp
|
|
The syntax of the resources is as follows:
|
|
.Pp
|
|
.Dl io Ar start - end ...
|
|
.Dl memory Ar address size ...
|
|
.Dl irq Ar irq-number ...
|
|
.Pp
|
|
Each of the statements define I/O, memory or IRQ
|
|
blocks that can be used to allocate to drivers when
|
|
they are initialised.
|
|
.Pp
|
|
Multiple lines of any of the above statements may be
|
|
present to allow separate blocks of each resource to be
|
|
defined.
|
|
.Ss "Card Identifiers"
|
|
The syntax for card identifiers is:
|
|
.Pp
|
|
.Dl card Ar manufacturer version class
|
|
.Dl config Ar index driver interrupt [ flags ]
|
|
.Dl ether Ar offset
|
|
.Dl insert Ar command
|
|
.Dl remove Ar command
|
|
.Pp
|
|
The first line is mandatory;
|
|
the latter statements are optional and can appear in
|
|
any order. There may be multiple
|
|
.Em config
|
|
lines.
|
|
The
|
|
.Em card
|
|
parameters are the Manufacturer name and card version that
|
|
is used to match the values from the card's CIS memory. The
|
|
.Em class
|
|
identifies the card as one of the device classes listed below.
|
|
The
|
|
.Em config
|
|
parameters select the particular card's configuration index
|
|
from the range available in the card's CIS, the driver that
|
|
is to be associated with this configuration, and the interrupt
|
|
level (if any) to be assigned. An optional set of flags may
|
|
be assigned.
|
|
.Pp
|
|
The optional
|
|
.Em ether
|
|
keyword is used when network cards have their physical Ethernet address
|
|
located within the attribute memory of the card. The parameter of this
|
|
statement indicates the offset within the attribute memory of the
|
|
Ethernet address. This value can be used within insert/remove
|
|
commands using the
|
|
.Em $ether
|
|
macro.
|
|
.Pp
|
|
The
|
|
.Em insert
|
|
and
|
|
.Em remove
|
|
sections allow shell commands to be specified that are executed
|
|
when the card is inserted or removed. Multiple
|
|
.Em insert
|
|
and
|
|
.Em remove
|
|
commands are allowed, and they are executed in the order they
|
|
are listed.
|
|
.Sh EXAMPLE
|
|
A typical configuration file may appear thus:
|
|
.Bd -literal
|
|
#
|
|
# Sample configuration file.
|
|
#
|
|
# Pool parameters.
|
|
#
|
|
io 0x280 - 0x2F0 0x300 - 0x360
|
|
irq 5 6 8 9 10 15
|
|
memory 0xd4000 96k
|
|
memory 0xc4000 32k
|
|
#
|
|
# Card database.
|
|
#
|
|
card "RPTI LTD." "EP400" # NE2000 clone
|
|
ether 0x110
|
|
config 0x21 "ed0" 5
|
|
insert ifconfig $device physical $ether
|
|
insert ifconfig $device bean
|
|
remove ifconfig $device down
|
|
|
|
card "XYZZY" "FAX/1.0" tty
|
|
config 0x30 "sio1" 11
|
|
insert echo start getty
|
|
remove echo stop getty
|
|
|
|
.Ed
|
|
.Sh FILES
|
|
.Bl -tag -width /etc/card.conf -compact
|
|
.It Pa /etc/card.conf
|
|
The
|
|
.Xr cardd 8
|
|
configuration file.
|
|
.El
|
|
.Sh SEE ALSO
|
|
.Xr cardd 8
|