






.H3 "Recognizing PC Card devices"
When you insert a PC Card device into a the system, it can take a while for it to
be recognized.  The current code is very conservative and simply waits a while
between each step of the integration.  On the system console you'll see things
like:
.Dx
Mar 10 11:03:35 sydney /kernel: pccard: card inserted, slot 0
Mar 10 11:03:35 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) removed.
Mar 10 11:03:40 sydney pccardd[58]: Card "AmbiCom Inc"("AMB8002T") [Ethernet TP Only] 
[RevB] matched "AmbiCom Inc" ("AMB8002T") [(null)] [(null)] 
Mar 10 11:03:45 sydney /kernel: ed1 at port 0x300-0x31f irq 11 slot 0 on pccard0
Mar 10 11:03:45 sydney /kernel: ed1: address 00:10:7a:98:22:ba, type NE2000 (16 bit) 
Mar 10 11:03:45 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) inserted.
.De
This example shows a 10 Mb/s Ethernet card being inserted.  Some of these
messages come from the kernel, so they also appear in the output of \fIdmesg\fP.
After the final message, \fIifconfig\fP\| shows an entry for the interface
\fIed1\fP.  Why \fIed1\fP\| and not \fIed0\fP\|?  The \f(CWGENERIC\fP kernel
already has an interface \fIed0\fP which it reserves for ISA even if it fails
the probe.  This strangeness will go away in release 5.
.P
When you remove the card, you don't see nearly as much:
.Dx
Mar 10 16:01:37 sydney /kernel: ed1: detached
Mar 10 16:01:37 sydney /kernel: pccard: card removed, slot 0
Mar 10 16:01:37 sydney dhclient: receive_packet failed on ed1: Device not configured
.De
The third message comes from \fIdhclient\fP, which we'll see in \*[chnetsetup].
\fIdhclient\fP\| currently has the problem that it will loop forever if you
remove the card.  You should first stop it:
.Dx
# \f(CBkillall dhclient\fP
.De
If you don't, you'll get messages like this:
.Dx
Mar 10 15:31:37 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:45 sydney last message repeated 87544 times
.De
That's right, it produces thousands of these messages a second, using up quite a
bit of processor time doing so.


.Dx
Mar 10 13:09:26 sydney /kernel: ed1: detached
Mar 10 13:09:27 sydney /kernel: pccard: card disabled, slot 0
Mar 10 13:09:27 sydney /kernel: resumed from suspended mode (slept 01:20:29)
Mar 10 13:09:27 sydney /kernel: ata0: resetting devices .. done
Mar 10 13:09:27 sydney /kernel: ata1: resetting devices .. done
Mar 10 13:09:27 sydney /kernel: pcm0: ac97 codec failed to reset extended mode (0, got 80)
Mar 10 13:09:27 sydney /kernel: pccard: card inserted, slot 0
Mar 10 13:09:27 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) removed.
Mar 10 13:09:32 sydney pccardd[58]: Card "AmbiCom Inc"("AMB8002T") [Ethernet TP Only] [RevB] matched "AmbiCom Inc" ("AMB
8002T") [(null)] [(null)] 
Mar 10 13:09:37 sydney /kernel: ed1 at port 0x300-0x31f irq 11 slot 0 on pccard0
Mar 10 13:09:37 sydney /kernel: ed1: address 00:10:7a:98:22:ba, type NE2000 (16 bit) 
Mar 10 13:09:37 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) inserted.
Mar 10 12:41:01 sydney dhclient: New IP Address(ed1): 192.109.197.110
Mar 10 12:41:01 sydney dhclient: New Subnet Mask (ed1): 255.255.255.0
Mar 10 12:41:01 sydney dhclient: New Broadcast Address(ed1): 192.109.197.255
Mar 10 12:41:01 sydney dhclient: New Routers: 192.109.197.82
Mar 10 12:42:15 sydney su: grog to root on /dev/ttyp4
Mar 10 15:23:41 sydney /kernel: pccard: card inserted, slot 1
Mar 10 15:23:47 sydney pccardd[58]: Card "IBM Corporation"("IBM High Rate Wireless LAN PC Card") [Version 01.01] [] matc
hed "IBM Corporation" ("IBM High Rate Wireless LAN PC Card") [(null)] [(null)] 
Mar 10 15:23:52 sydney /kernel: wi0: <WaveLAN/IEEE 802.11> at port 0x240-0x27f irq 11 slot 1 on pccard1
Mar 10 15:23:53 sydney /kernel: wi0: Ethernet address: 00:02:2d:1d:22:0d
Mar 10 15:23:52 sydney pccardd[58]: wi0: IBM Corporation (IBM High Rate Wireless LAN PC Card) inserted.
Mar 10 14:54:08 sydney dhclient: Can't bind to dhcp address: Address already in use
Mar 10 14:54:08 sydney dhclient: exiting.
Mar 10 16:01:37 sydney /kernel: ed1: detached
Mar 10 16:01:37 sydney /kernel: pccard: card removed, slot 0
Mar 10 15:31:37 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 16:01:37 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) removed.
Mar 10 15:31:37 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:45 sydney last message repeated 87544 times
Mar 10 16:01:45 sydney /kernel: pccard: card inserted, slot 0
Mar 10 15:31:45 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:51 sydney last message repeated 55163 times
Mar 10 16:01:51 sydney pccardd[58]: Card "CF"("048MB") [] [(null)] matched "CF" ("048MB") [(null)] [(null)] 
Mar 10 15:31:51 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:55 sydney last message repeated 40414 times
Mar 10 15:31:55 sydney dhclient: Can't bind to dhcp address: Address already in use
Mar 10 15:31:55 sydney dhclient: exiting.
Mar 10 15:31:55 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:56 sydney last message repeated 9247 times
Mar 10 16:01:56 sydney /kernel: ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
Mar 10 16:01:56 sydney /kernel: ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
Mar 10 15:31:56 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:56 sydney last message repeated 12 times
Mar 10 16:01:56 sydney pccardd[58]: ata4: CF (048MB) inserted.
Mar 10 15:31:56 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:32:04 sydney last message repeated 89545 times
Mar 10 15:32:30 sydney dhclient: New IP Address(wi0): 192.109.197.194
Mar 10 15:32:30 sydney dhclient: New Subnet Mask (wi0): 255.255.255.224
Mar 10 15:32:30 sydney dhclient: New Broadcast Address(wi0): 192.109.197.223
Mar 10 15:32:30 sydney dhclient: New Routers: 192.109.197.222
Mar 10 16:07:12 sydney /kernel: ata4: detached
Mar 10 16:07:12 sydney /kernel: pccard: card removed, slot 0
Mar 10 16:07:12 sydney pccardd[58]: ata4: CF (048MB) removed.
Mar 10 16:10:01 sydney /kernel: pid 304 (emacs), uid 0: exited on signal 11 (core dumped)
Mar 10 16:55:22 sydney /kernel: wi0: promiscuous mode enabled
Mar 10 16:55:31 sydney /kernel: wi0: promiscuous mode disabled
Mar 13 18:08:36 sydney su: BAD SU grog to root on /dev/ttyp3
Mar 13 18:08:46 sydney su: grog to root on /dev/ttyp3
Mar 16 11:10:40 sydney /kernel: pccard: card inserted, slot 0
Mar 16 11:10:45 sydney pccardd[58]: Card "CF"("048MB") [] [(null)] matched "CF" ("048MB") [(null)] [(null)] 
Mar 16 11:10:50 sydney /kernel: ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
Mar 16 11:10:51 sydney /kernel: ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
Mar 16 11:10:50 sydney pccardd[58]: ata4: CF (048MB) inserted.
Mar 16 11:21:43 sydney su: BAD SU grog to root on /dev/ttyp5
Mar 16 11:21:48 sydney su: grog to root on /dev/ttyp5
Mar 16 12:58:59 sydney /kernel: ata4: detached
Mar 16 12:58:59 sydney /kernel: pccard: card removed, slot 0
Mar 16 12:58:59 sydney pccardd[58]: ata4: CF (048MB) removed.
Mar 16 13:11:36 sydney /kernel: pccard: card inserted, slot 0
Mar 16 13:11:42 sydney pccardd[58]: Card "CF"("048MB") [] [(null)] matched "CF" ("048MB") [(null)] [(null)] 
Mar 16 13:11:47 sydney /kernel: ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
Mar 16 13:11:47 sydney /kernel: ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
Mar 16 13:11:47 sydney pccardd[58]: ata4: CF (048MB) inserted.
Mar 16 14:39:18 sydney /kernel: ata4: detached
Mar 16 14:39:18 sydney /kernel: pccard: card removed, slot 0
Mar 16 14:39:18 sydney pccardd[58]: ata4: CF (048MB) removed.
Mar 17 13:27:30 sydney /kernel: pccard: card inserted, slot 0
Mar 17 13:27:36 sydney pccardd[58]: Card "CF"("048MB") [] [(null)] matched "CF" ("048MB") [(null)] [(null)] 
Mar 17 13:27:41 sydney /kernel: ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
Mar 17 13:27:41 sydney /kernel: ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
Mar 17 13:27:41 sydney pccardd[58]: ata4: CF (048MB) inserted.
Mar 17 13:29:41 sydney /kernel: ata4: detached
Mar 17 13:29:42 sydney /kernel: pccard: card removed, slot 0
Mar 17 13:29:41 sydney pccardd[58]: ata4: CF (048MB) removed.

ed1: detached
pccard: card disabled, slot 0
resumed from suspended mode (slept 01:20:29)
ata0: resetting devices .. done
ata1: resetting devices .. done
pcm0: ac97 codec failed to reset extended mode (0, got 80)
pccard: card inserted, slot 0
ed1 at port 0x300-0x31f irq 11 slot 0 on pccard0
ed1: address 00:10:7a:98:22:ba, type NE2000 (16 bit) 
pccard: card inserted, slot 1
wi0: <WaveLAN/IEEE 802.11> at port 0x240-0x27f irq 11 slot 1 on pccard1
wi0: Ethernet address: 00:02:2d:1d:22:0d
ed1: detached
pccard: card removed, slot 0
pccard: card inserted, slot 0
ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
ata4: detached
pccard: card removed, slot 0
pid 304 (emacs), uid 0: exited on signal 11 (core dumped)
wi0: promiscuous mode enabled
wi0: promiscuous mode disabled
pccard: card inserted, slot 0
ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
ata4: detached
pccard: card removed, slot 0
pccard: card inserted, slot 0
ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
ata4: detached
pccard: card removed, slot 0
pccard: card inserted, slot 0
ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
ata4: detached
pccard: card removed, slot 0
.De
.H2 "PC Card and CardBus devices"
.Pn PCCard-details
As discussed above, probes at boot time are not sufficient to discover PC Card
and CardBus devices, since they can be inserted or removed while the system is
running.  Instead, the \fIpccardd\fP\| daemon monitors the PC Card hardware and
performs the appropriate actions when cards are inserted or removed.
.Aside
In release 5 of FreeBSD, there is no \fIpccardd\fP.  Instead, the kernel
performs these functions directly.  At the time of writing, the functionality
has not been finalized.
.End-aside
When \fIpccardd\fP\| detects a card insertion, it reads identification data from
the \fICard Information Structure\fP\| or \fICIS\fP.  The CIS contains
information needed to configure the card.  The most important fields are the
\fIVersion 1 info\fP.  You can display this information with the utility
\fIpccardc\fP\| (note that the name ends in \fIc\fP, not in \fId\fP\| for the
\fIpccardd\fP\| daemon).  For example, you might find the following information:
.Dx
# \f(CBpccardc dumpcis\fP
Configuration data for card in slot 1
\&\fI(other information omitted)\fP\|
Tuple #4, code = 0x15 (Version 1 info), length = 80
    000:  05 00 4c 75 63 65 6e 74 20 54 65 63 68 6e 6f 6c
    010:  6f 67 69 65 73 00 57 61 76 65 4c 41 4e 2f 49 45
    020:  45 45 00 56 65 72 73 69 6f 6e 20 30 31 2e 30 31
    030:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    040:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff
        Version = 5.0, Manuf = [Lucent Technologies], card vers = [WaveLAN/IEEE]
        Addit. info = [Version 01.01],[]
\&\fI(other information omitted)\fP\|
2 slots found
.De
This comes from a Lucent Wireless networking card.  \fIpccardd\fP\| uses the
fields \f(CWManuf.\fP and \f(CWAddit. info\fP to look up the card in the file
.File /etc/default/pccard.conf .
In this case it would find something like this:
.Dx
# Lucent WaveLAN/IEEE
card "Lucent Technologies" "WaveLAN/IEEE"
	config	0x1 "wi" ?
	insert	/etc/pccard_ether $device start
	remove	/etc/pccard_ether $device stop
.De
This information tells \fIpccardd\fP\| how to configure the card.  Specifically,
.Ls B
.LI
\fIpccardd\fP\| uses the \f(CWcard\fP line to match with the information in the
Version 1 info on the CIS.
.LI
The \f(CWconfig\fP line specifies which configuration from the CIS to use (index
1, specified in hexadecimal in this example), which driver (\f(CWwi\fP) to use,
and optionally which interrupt (IRQ) to use.  This example, as in most cases,
specifies the interrupt as \f(CW?\fP, indicating that \fIpccardd\fP\| can choose
its own IRQ.
.LI
The line \f(CWinsert\fP states what should be done when the card is inserted.
It's possible to have \f(CWinsert\fP lines, which are then executed in sequence.
.LI
The name \f(CW$device\fP is the name the device will get.  We know from the
\f(CWconfig\fP line that it's the \fIwi\fP\| driver, but we don't know the unit
number.  \fIpccardd\fP\| does, and it replaces \f(CW$device\fP with the
interface name, probably \f(CWwi0\fP.
.LI
The line \f(CWremove\fP states what should be done when the card is removed.
It's possible to have \f(CWremove\fP lines, which are then executed in sequence.
.Le
When you insert this card into a machine, the following messages appear on the
console:
.Dx
Apr 27 16:57:20 andante /kernel: pccard: card inserted, slot 1
Apr 27 16:57:26 andante pccardd[59]: Card "Lucent Technologies"("WaveLAN/I
EEE") [Version 01.01] [] matched "Lucent Technologies" ("WaveLAN/IEEE") [(
null)] [(null)] 
Apr 27 16:57:31 andante /kernel: wi0: <WaveLAN/IEEE 802.11> at port 0x240-
0x27f irq 11 slot 1 on pccard1
Apr 27 16:57:31 andante /kernel: wi0: Ethernet address: 00:02:2d:04:09:3a
Apr 27 16:57:31 andante pccardd[59]: wi0: Lucent Technologies (WaveLAN/IE
EE) inserted.
.De
Note the time it takes.  This is a real example: it takes 11 seconds from
insertion until the card is recognized.  It is planned to reduce this time in
future releases of FreeBSD.
.P
Why 
.File /etc/defaults/pccard.conf \|?
The file is quite large, over 2000 lines, but even so it doesn't contain
descriptions for every card available.  If you find you have a card that isn't
described there, or if you want to treat it differently, you can put a
description in
.File /etc/pccard.conf .
Entries in
this file override any corresponding entry in 
.File /etc/defaults/pccard.conf .
For example, you might have an IBM wireless ethernet card.  These cards are in
fact practically identical to the Lucent card described above, but the version 1
information is different.  In such a case, you can put the following information
into 
.File /etc/pccard.conf \\|:
.Dx
# Lucent WaveLAN/IEEE
card "IBM Corporation" "IBM High Rate Wireless LAN PC Card"
	config	0x1 "wi" ?
	insert	/etc/pccard_ether $device start
	remove	/etc/pccard_ether $device stop
.De
Note that \fIpccardd\fP\| only makes the card accessible.  Although this is a
network card, you won't be connected to the network after insertion.  This is
much the same situation as with a normal Ethernet card:  \*[chnetsetup],
discusses how to configure the card to participate in a network.
.H3 "Configuring PC Card and CardBus cards
PC Card cards differ in one important way from other buses: they're designed for
the cards to be \fIhot plugged\fP, to be inserted and removed from a running
system.  This means that the conventional boot probes are not sufficient to
detect them.  Instead, a special process monitors the PC Card hardware and
performs the appropriate actions when a card is inserted or removed.  We'll look
at how that works in \*[chstarting], on page
.Sref \*[PC Card-probe] .
.H3 "Support for PC Card"
The \f(CWGENERIC\fP FreeBSD kernel contains support for PC Card, so you don't
need to build a new kernel.  The following entries in the configuration file
control PC Card:
.Dx
# PC CARD (PC Card) support
device		card
device		pcic0	at isa? irq 0 port 0x3e0 iomem 0xd0000
device		pcic1	at isa? irq 0 port 0x3e2 iomem 0xd4000 disable
.De
The \fIpcic\fP\| device is the PC Card controller, not the cards, which have
separate entries.  These are usually the same code as the corresponding ISA
device, but wireless cards are an exception: they are only available as PC Card
cards.  Here's an example of the configuration of the popular Lucent
\fIOrinoco\fP\| cards, previously called WaveLAN:
.Dx
# WaveLAN/IEEE 802.11 wireless NICs. Note: the WaveLAN/IEEE really
# exists only as a PC Card device, so there is no ISA attachment needed
# and resources will always be dynamically assigned by the pccard code.
device		wi
.De
We'll look at wireless cards below.
.H3 "Recognizing PC Card cards"
It's not enough to have kernel support for PC Card: in version 4 of FreeBSD you
also need to run \fIpccardd\fP, a userland daemon which controls insertion and
removal of the cards.  By default, \fIpccardd\fP\| does not get started when you
start your machine.  Start it at boot time by adding the following entry to
\fI/etc/rc.conf\fP\|:
.Dx
pccard_enable=YES
.De
You can also start it explicitly by simply running \fIpccardd\fP.
\fIpccardd\fP\| will no longer be needed in version 5 of FreeBSD.
.H3 "Recognizing PC Card devices"
When you insert a PC Card device into a the system, it can take a while for it to
be recognized.  The current code is very conservative and simply waits a while
between each step of the integration.  On the system console you'll see things
like:
.Dx
Mar 10 11:03:35 sydney /kernel: pccard: card inserted, slot 0
Mar 10 11:03:35 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) removed.
Mar 10 11:03:40 sydney pccardd[58]: Card "AmbiCom Inc"("AMB8002T") [Ethernet TP Only] 
[RevB] matched "AmbiCom Inc" ("AMB8002T") [(null)] [(null)] 
Mar 10 11:03:45 sydney /kernel: ed1 at port 0x300-0x31f irq 11 slot 0 on pccard0
Mar 10 11:03:45 sydney /kernel: ed1: address 00:10:7a:98:22:ba, type NE2000 (16 bit) 
Mar 10 11:03:45 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) inserted.
.De
This example shows a 10 Mb/s Ethernet card being inserted.  Some of these
messages come from the kernel, so they also appear in the output of \fIdmesg\fP.
After the final message, \fIifconfig\fP\| shows an entry for the interface
\fIed1\fP.  Why \fIed1\fP\| and not \fIed0\fP\|?  The \f(CWGENERIC\fP kernel
already has an interface \fIed0\fP which it reserves for ISA even if it fails
the probe.  This strangeness will go away in release 5.
.P
When you remove the card, you don't see nearly as much:
.Dx
Mar 10 16:01:37 sydney /kernel: ed1: detached
Mar 10 16:01:37 sydney /kernel: pccard: card removed, slot 0
Mar 10 16:01:37 sydney dhclient: receive_packet failed on ed1: Device not configured
.De
The third message comes from \fIdhclient\fP, which we'll see in \*[chnetsetup].
\fIdhclient\fP\| currently has the problem that it will loop forever if you
remove the card.  You should first stop it:
.Dx
# \f(CBkillall dhclient\fP
.De
If you don't, you'll get messages like this:
.Dx
Mar 10 15:31:37 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:45 sydney last message repeated 87544 times
.De
That's right, it produces thousands of these messages a second, using up quite a
bit of processor time doing so.



Mar 10 13:09:26 sydney /kernel: ed1: detached
Mar 10 13:09:27 sydney /kernel: pccard: card disabled, slot 0
Mar 10 13:09:27 sydney /kernel: resumed from suspended mode (slept 01:20:29)
Mar 10 13:09:27 sydney /kernel: ata0: resetting devices .. done
Mar 10 13:09:27 sydney /kernel: ata1: resetting devices .. done
Mar 10 13:09:27 sydney /kernel: pcm0: ac97 codec failed to reset extended mode (0, got 80)
Mar 10 13:09:27 sydney /kernel: pccard: card inserted, slot 0
Mar 10 13:09:27 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) removed.
Mar 10 13:09:32 sydney pccardd[58]: Card "AmbiCom Inc"("AMB8002T") [Ethernet TP Only] [RevB] matched "AmbiCom Inc" ("AMB
8002T") [(null)] [(null)] 
Mar 10 13:09:37 sydney /kernel: ed1 at port 0x300-0x31f irq 11 slot 0 on pccard0
Mar 10 13:09:37 sydney /kernel: ed1: address 00:10:7a:98:22:ba, type NE2000 (16 bit) 
Mar 10 13:09:37 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) inserted.
Mar 10 12:41:01 sydney dhclient: New IP Address(ed1): 192.109.197.110
Mar 10 12:41:01 sydney dhclient: New Subnet Mask (ed1): 255.255.255.0
Mar 10 12:41:01 sydney dhclient: New Broadcast Address(ed1): 192.109.197.255
Mar 10 12:41:01 sydney dhclient: New Routers: 192.109.197.82
Mar 10 12:42:15 sydney su: grog to root on /dev/ttyp4
Mar 10 15:23:41 sydney /kernel: pccard: card inserted, slot 1
Mar 10 15:23:47 sydney pccardd[58]: Card "IBM Corporation"("IBM High Rate Wireless LAN PC Card") [Version 01.01] [] matc
hed "IBM Corporation" ("IBM High Rate Wireless LAN PC Card") [(null)] [(null)] 
Mar 10 15:23:52 sydney /kernel: wi0: <WaveLAN/IEEE 802.11> at port 0x240-0x27f irq 11 slot 1 on pccard1
Mar 10 15:23:53 sydney /kernel: wi0: Ethernet address: 00:02:2d:1d:22:0d
Mar 10 15:23:52 sydney pccardd[58]: wi0: IBM Corporation (IBM High Rate Wireless LAN PC Card) inserted.
Mar 10 14:54:08 sydney dhclient: Can't bind to dhcp address: Address already in use
Mar 10 14:54:08 sydney dhclient: exiting.
Mar 10 16:01:37 sydney /kernel: ed1: detached
Mar 10 16:01:37 sydney /kernel: pccard: card removed, slot 0
Mar 10 15:31:37 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 16:01:37 sydney pccardd[58]: ed1: AmbiCom Inc (AMB8002T) removed.
Mar 10 15:31:37 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:45 sydney last message repeated 87544 times
Mar 10 16:01:45 sydney /kernel: pccard: card inserted, slot 0
Mar 10 15:31:45 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:51 sydney last message repeated 55163 times
Mar 10 16:01:51 sydney pccardd[58]: Card "CF"("048MB") [] [(null)] matched "CF" ("048MB") [(null)] [(null)] 
Mar 10 15:31:51 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:55 sydney last message repeated 40414 times
Mar 10 15:31:55 sydney dhclient: Can't bind to dhcp address: Address already in use
Mar 10 15:31:55 sydney dhclient: exiting.
Mar 10 15:31:55 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:56 sydney last message repeated 9247 times
Mar 10 16:01:56 sydney /kernel: ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
Mar 10 16:01:56 sydney /kernel: ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
Mar 10 15:31:56 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:31:56 sydney last message repeated 12 times
Mar 10 16:01:56 sydney pccardd[58]: ata4: CF (048MB) inserted.
Mar 10 15:31:56 sydney dhclient: receive_packet failed on ed1: Device not configured
Mar 10 15:32:04 sydney last message repeated 89545 times
Mar 10 15:32:30 sydney dhclient: New IP Address(wi0): 192.109.197.194
Mar 10 15:32:30 sydney dhclient: New Subnet Mask (wi0): 255.255.255.224
Mar 10 15:32:30 sydney dhclient: New Broadcast Address(wi0): 192.109.197.223
Mar 10 15:32:30 sydney dhclient: New Routers: 192.109.197.222
Mar 10 16:07:12 sydney /kernel: ata4: detached
Mar 10 16:07:12 sydney /kernel: pccard: card removed, slot 0
Mar 10 16:07:12 sydney pccardd[58]: ata4: CF (048MB) removed.
Mar 10 16:10:01 sydney /kernel: pid 304 (emacs), uid 0: exited on signal 11 (core dumped)
Mar 10 16:55:22 sydney /kernel: wi0: promiscuous mode enabled
Mar 10 16:55:31 sydney /kernel: wi0: promiscuous mode disabled
Mar 13 18:08:36 sydney su: BAD SU grog to root on /dev/ttyp3
Mar 13 18:08:46 sydney su: grog to root on /dev/ttyp3
Mar 16 11:10:40 sydney /kernel: pccard: card inserted, slot 0
Mar 16 11:10:45 sydney pccardd[58]: Card "CF"("048MB") [] [(null)] matched "CF" ("048MB") [(null)] [(null)] 
Mar 16 11:10:50 sydney /kernel: ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
Mar 16 11:10:51 sydney /kernel: ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
Mar 16 11:10:50 sydney pccardd[58]: ata4: CF (048MB) inserted.
Mar 16 11:21:43 sydney su: BAD SU grog to root on /dev/ttyp5
Mar 16 11:21:48 sydney su: grog to root on /dev/ttyp5
Mar 16 12:58:59 sydney /kernel: ata4: detached
Mar 16 12:58:59 sydney /kernel: pccard: card removed, slot 0
Mar 16 12:58:59 sydney pccardd[58]: ata4: CF (048MB) removed.
Mar 16 13:11:36 sydney /kernel: pccard: card inserted, slot 0
Mar 16 13:11:42 sydney pccardd[58]: Card "CF"("048MB") [] [(null)] matched "CF" ("048MB") [(null)] [(null)] 
Mar 16 13:11:47 sydney /kernel: ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
Mar 16 13:11:47 sydney /kernel: ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
Mar 16 13:11:47 sydney pccardd[58]: ata4: CF (048MB) inserted.
Mar 16 14:39:18 sydney /kernel: ata4: detached
Mar 16 14:39:18 sydney /kernel: pccard: card removed, slot 0
Mar 16 14:39:18 sydney pccardd[58]: ata4: CF (048MB) removed.
Mar 17 13:27:30 sydney /kernel: pccard: card inserted, slot 0
Mar 17 13:27:36 sydney pccardd[58]: Card "CF"("048MB") [] [(null)] matched "CF" ("048MB") [(null)] [(null)] 
Mar 17 13:27:41 sydney /kernel: ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
Mar 17 13:27:41 sydney /kernel: ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
Mar 17 13:27:41 sydney pccardd[58]: ata4: CF (048MB) inserted.
Mar 17 13:29:41 sydney /kernel: ata4: detached
Mar 17 13:29:42 sydney /kernel: pccard: card removed, slot 0
Mar 17 13:29:41 sydney pccardd[58]: ata4: CF (048MB) removed.

ed1: detached
pccard: card disabled, slot 0
resumed from suspended mode (slept 01:20:29)
ata0: resetting devices .. done
ata1: resetting devices .. done
pcm0: ac97 codec failed to reset extended mode (0, got 80)
pccard: card inserted, slot 0
ed1 at port 0x300-0x31f irq 11 slot 0 on pccard0
ed1: address 00:10:7a:98:22:ba, type NE2000 (16 bit) 
pccard: card inserted, slot 1
wi0: <WaveLAN/IEEE 802.11> at port 0x240-0x27f irq 11 slot 1 on pccard1
wi0: Ethernet address: 00:02:2d:1d:22:0d
ed1: detached
pccard: card removed, slot 0
pccard: card inserted, slot 0
ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
ata4: detached
pccard: card removed, slot 0
pid 304 (emacs), uid 0: exited on signal 11 (core dumped)
wi0: promiscuous mode enabled
wi0: promiscuous mode disabled
pccard: card inserted, slot 0
ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
ata4: detached
pccard: card removed, slot 0
pccard: card inserted, slot 0
ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
ata4: detached
pccard: card removed, slot 0
pccard: card inserted, slot 0
ata4 at port 0x280-0x28f irq 11 slot 0 on pccard0
ad8: 46MB <> [185/16/32] at ata4-master BIOSPIO
ata4: detached
pccard: card removed, slot 0
.De
.H2 "Configuring PC Card and CardBus devices"
As discussed above, probes at boot time are not sufficient to discover PC Card
and CardBus devices, since they can be inserted or removed while the system is
running.  Instead, the \fIpccardd\fP\| daemon monitors the PC Card hardware and
performs the appropriate actions when cards are inserted or removed.
.Aside
In release 5 of FreeBSD, there is no \fIpccardd\fP.  Instead, the kernel
performs these functions directly.  At the time of writing, the functionality
has not been finalized.
.End-aside
When \fIpccardd\fP\| detects a card insertion, it reads identification data from
the \fICard Information Structure\fP\| or \fICIS\fP.  The CIS contains
information needed to configure the card.  The most important fields are the
\fIVersion 1 info\fP.  You can display this information with the utility
\fIpccardc\fP\| (note that the name ends in \fIc\fP, not in \fId\fP\| for the
\fIpccardd\fP\| daemon).  For example, you might find the following information:
.Dx
# \f(CBpccardc dumpcis\fP
Configuration data for card in slot 1
\&\fI(other information omitted)\fP\|
Tuple #4, code = 0x15 (Version 1 info), length = 80
    000:  05 00 4c 75 63 65 6e 74 20 54 65 63 68 6e 6f 6c
    010:  6f 67 69 65 73 00 57 61 76 65 4c 41 4e 2f 49 45
    020:  45 45 00 56 65 72 73 69 6f 6e 20 30 31 2e 30 31
    030:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    040:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff
        Version = 5.0, Manuf = [Lucent Technologies], card vers = [WaveLAN/IEEE]
        Addit. info = [Version 01.01],[]
\&\fI(other information omitted)\fP\|
2 slots found
.De
This comes from a Lucent Wireless networking card.  \fIpccardd\fP\| uses the
fields \f(CWManuf.\fP and \f(CWAddit. info\fP to look up the card in the file
.File /etc/default/pccard.conf .
In this case it would find something like this:
.Dx
# Lucent WaveLAN/IEEE
card "Lucent Technologies" "WaveLAN/IEEE"
	config	0x1 "wi" ?
	insert	/etc/pccard_ether $device start
	remove	/etc/pccard_ether $device stop
.De
This information tells \fIpccardd\fP\| how to configure the card.  Specifically,
.Ls B
.LI
\fIpccardd\fP\| uses the \f(CWcard\fP line to match with the information in the
Version 1 info on the CIS.
.LI
The \f(CWconfig\fP line specifies which configuration from the CIS to use (index
1, specified in hexadecimal in this example), which driver (\f(CWwi\fP) to use,
and optionally which interrupt (IRQ) to use.  This example, as in most cases,
specifies the interrupt as \f(CW?\fP, indicating that \fIpccardd\fP\| can choose
its own IRQ.
.LI
The line \f(CWinsert\fP states what should be done when the card is inserted.
It's possible to have \f(CWinsert\fP lines, which are then executed in sequence.
.LI
The name \f(CW$device\fP is the name the device will get.  We know from the
\f(CWconfig\fP line that it's the \fIwi\fP\| driver, but we don't know the unit
number.  \fIpccardd\fP\| does, and it replaces \f(CW$device\fP with the
interface name, probably \f(CWwi0\fP.
.LI
The line \f(CWremove\fP states what should be done when the card is removed.
It's possible to have \f(CWremove\fP lines, which are then executed in sequence.
.Le
When you insert this card into a machine, the following messages appear on the
console:
.Dx
Apr 27 16:57:20 andante /kernel: pccard: card inserted, slot 1
Apr 27 16:57:26 andante pccardd[59]: Card "Lucent Technologies"("WaveLAN/I
EEE") [Version 01.01] [] matched "Lucent Technologies" ("WaveLAN/IEEE") [(
null)] [(null)] 
Apr 27 16:57:31 andante /kernel: wi0: <WaveLAN/IEEE 802.11> at port 0x240-
0x27f irq 11 slot 1 on pccard1
Apr 27 16:57:31 andante /kernel: wi0: Ethernet address: 00:02:2d:04:09:3a
Apr 27 16:57:31 andante pccardd[59]: wi0: Lucent Technologies (WaveLAN/IE
EE) inserted.
.De
Note the time it takes.  This is a real example: it takes 11 seconds from
insertion until the card is recognized.  It is planned to reduce this time in
future releases of FreeBSD.
.P
Why 
.File /etc/defaults/pccard.conf \|?
The file is quite large, over 2000 lines, but even so it doesn't contain
descriptions for every card available.  If you find you have a card that isn't
described there, or if you want to treat it differently, you can put a
description in
.File /etc/pccard.conf .
Entries in
this file override any corresponding entry in 
.File /etc/defaults/pccard.conf .
For example, you might have an IBM wireless ethernet card.  These cards are in
fact practically identical to the Lucent card described above, but the version 1
information is different.  In such a case, you can put the following information
into 
.File /etc/pccard.conf \\|:
.Dx
# Lucent WaveLAN/IEEE
card "IBM Corporation" "IBM High Rate Wireless LAN PC Card"
	config	0x1 "wi" ?
	insert	/etc/pccard_ether $device start
	remove	/etc/pccard_ether $device stop
.De
Note that \fIpccardd\fP\| only makes the card accessible.  Although this is a
network card, you won't be connected to the network after insertion.  This is
much the same situation as with a normal Ethernet card:  \*[chnetsetup],
discusses how to configure the card to participate in a network.
