📄 pcmcia.5
字号:
.\" Copyright (C) 1998 David A. Hinds -- dahinds@users.sourceforge.net.\" pcmcia.5 1.29 2002/07/13 18:11:04.\".TH PCMCIA 5 "2002/07/13 18:11:04" "pcmcia-cs".SH NAME/etc/pcmcia/config \- PCMCIA card configuration database.SH DESCRIPTIONThe PCMCIA card configuration file is read by \fIcardmgr\fR(8)at startup time. It defines what resources are available for use byCard Services, describes how to load and initialize device drivers,and describes specific PCMCIA cards..SH Resource descriptionsThere are three kinds of resource entries: \fBinclude\fR,\fBexclude\fR, and \fBreserve\fR. Including a resource enables CardServices to allocate that resource for client drivers. Part of aresource that is under Card Services control can be excluded if aspecific device in the system uses that resource. And, a resource canbe reserved, so that it will only be assigned to a client if thatclient specifically asks for that resource, or no other suitableresources are available..PPThere are three resource types: \fBport\fR, \fBmemory\fR, and\fBirq\fR. By default, Card Services assumes that it can use anyinterrupt that is not bound by another device driver. However, itmakes no assumptions about IO port and address ranges, because someLinux drivers do not register their resource usage. So, port andmemory ranges must be explicitly made available for use by PCMCIAdevices..PPSo, here is a portion of a config file:.sp.RS.nfinclude port 0x300-0x3ff, memory 0xd0000-0xdffffreserve irq 3exclude irq 4, port 0x3f8-0x3ff.RE.fi.spThis says that Card Services can allocate ports in the range 0x300 to0x3ff, and memory in the range 0xd0000 to 0xdffff. It should not useirq 4 or ports 0x3f8-0x3ff (even if they seem to be available). Andirq 3 should only be allocated if a client specifically asks for it..PPCard Services will never allocate resources already allocated byanother kernel device driver. The.BR include / exclude / reservemechanism just provides a way of controlling what resources it willtry to use, to accomodate devices that are not registered with theLinux resource manager..SH Device driver descriptionsAll Card Services client drivers are identified by a 32-character tag.\fBDevice\fR entries in the config file describe client drivers. The onlyrequired field is the device tag. Additional fields can specifykernel modules that need to be loaded to make the device available,and a script to be executed to enable and disable instances ofa device. When an instance of a driver is assigned to a socket, itgives cardmgr a device name by which this device will be known by thesystem (for example, \fIeth0\fR for a net device, or \fIcua1\fR for amodem). This name will be passed to the configuration script. Forexample:.sp.RS.nfdevice "pcnet_cs" class "network" module "net/8390" opts "ei_debug=4", "pcnet_cs".RE.fi.spThis says that the \fBpcnet_cs\fR device requires two loadable modules.The first one is located in the \fInet\fR module subdirectory and willbe loaded with a specific parameter setting. The second module shouldbe in the \fIpcmcia\fR module subdirectory. The device is in thenetwork class, so the \fInetwork\fR script in the configurationdirectory will be used to start or stop the device..PPIt is also possible to specify default options for a particular kernelmodule, outside of a device driver declaration. This is convenientfor keeping local configuration options in a file separate from themain card configuration file. For example:.sp.RS.nfmodule "pcnet_cs" opts "mem_speed=600".RE.fi.sp.SH Card descriptionsCard declarations map PCMCIA cards to their client drivers. A carddeclaration consists of a descriptive name, a method for identifyingthe card when it is inserted, and driver bindings. There are sixidentification methods: the \fBversion\fR method matches a card usingits VERSION_1 id strings, the \fBmanfid\fR method matches a card usingits MANFID tuple codes, the \fBpci\fR method matches a CardBus cardusing its PCI device ID's, the \fBtuple\fR method matches a card usingany string embedded in any arbitrary CIS tuple, the \fBfunction\fRmethod matches a card using its function ID, and the \fBanonymous\fRmethod matches any card that does not have a CIS. This last methodis only intended to be used for old-style Type I memory cards. The\fBmanfid\fR and \fBversion\fR methods can be combined to provide morediscrimination; the other methods cannot be combined. For example:.sp.RS.nfcard "Linksys Ethernet Card" tuple 0x40, 0x0009, "E-CARD PC Ethernet Card" bind "pcnet_cs".RE.fi.spThis card is identified by a string at offset 0x0009 in tuple 0x40,and will be bound to the \fBpcnet_cs\fR driver (which must be alreadydeclared in a \fBdriver\fR declaration)..sp.RS.nfcard "Connectware LANdingGear Adapter" manfid 0x0057, 0x1004 bind "pcnet_cs".RE.fi.spThis card is identified by its MANFID tuple contents. The \fBpci\fRmethod has the same form, with \fBpci\fR replacing \fBmanfid\fR..sp.RS.nfcard "D-Link DE-650 Ethernet Card" version "D-Link", "DE-650" bind "pcnet_cs".RE.fi.spThis card will be identified using its VERSION_1 tuple, and will alsobe bound to the \fBpcnet_cs\fR driver..sp.RS.nfcard "Serial port device" function serial_port bind "serial_cs".RE.fi.spThis binds the \fBserial_cs\fR driver to any card with a CIS functionID of 0x02, which corresponds to a serial port card. The function IDcan either be a number, or one of the following predefined functions:\fBmemory_card\fR, \fBserial_port\fR, \fBparallel_port\fR,\fBfixed_disk\fR, \fBvideo_adapter\fR, \fBnetwork_adapter\fR, and\fBaims_card\fR..PPFinally, the configuration file can specify that Card Services shoulduse a replacement for the configuration information found on a card.This can be useful if a card's configuration information isparticularly incomplete or inaccurate. The new information is readfrom a file as in this example:.sp.RS.nfcard "Evil broken card" manfid 0x1234, 0x5678 cis "fixup.cis" bind "serial_cs".RE.fi.sp.SH Memory region definitions Memory region definitions are used to associate a particular type ofmemory device with a Memory Technology Driver, or "MTD". An MTD isused to service memory accesses in a device-independent fashion. Whena card is identified, Card Services will attempt to load MTD's for allits memory regions..PPA memory region definition begins with the \fBregion\fR keyword and adescriptive string. This is followed by an identification method:either \fBdefault\fR to identify an MTD to be used for any otherwiseunclassified region, or \fBjedec\fR to identify a region based on itsJEDEC identification codes. Thus, for example,.sp.RS.nfregion "Intel Series 2 Flash" jedec 0x89 0xa2 mtd "iflash2_mtd".RE.fi.spspecifies that the \fBiflash2_mtd\fR driver will be loaded based on aJEDEC match..SH Including definitions from other filesThe \fBsource\fR command can be used to include configurationinformation from other files. The default config file specifies:.sp.RS.nfsource ./*.confsource ./config.opts.RE.fi.spThe arguments for the \fBsource\fR command are evaluated using normalfilename wildcard expansion rules. Where available, the \fBsource\fRcommand is implemented using the \fBwordexp\fR library function, whichalso implements environment variable expansion, arithmatic expansion,and command substitution..SH BUGSThe \fBreserve\fR keyword has not actually been implemented in auseful way for this version of Card Services..SH AUTHORDavid Hinds \- dahinds@users.sourceforge.net.SH "SEE ALSO"cardmgr(8).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -