# Is PCMCIA/CardBus support really broken?



## uzbence (Oct 20, 2010)

After years I had to use PCMCIA/CardBus Ethernet card with FreeBSD and I was surprised my card is not working.
After some Googling I realized poor or no PCMCIA/Cardsbus support is a widely and well-known problem with FreeBSD since 7.0-RELEASE.
e.g. 
http://www.freebsd.org/cgi/query-pr.cgi?pr=115623

I have collected some cards and spent two days testing present PCMCIA/CardBus support on our training Thinkpad T400 and Dell Latitude D500 notebooks.

All cards work with OpenBSD-4.5/-4.6/-4.7, NetBSD-5.0.2, Linux, WindowsXP/7

NONE OF THEM WORKS with present FreeBSD versions on any notebooks. Tested with
- FreeBSD 7-STABLE i386 and amd64
- FreeBSD-8-STABLE i386 and amd64
- FreeBSD-9-CURRENT i386 and amd64

I have tried the follwing cards:
- NEC Aterm WL300NC
- Cisco Aironet 350
- Adaptec SlimSCSI 1480B
- NetGear GA511
- Xircom CreditcCard Ethernet 100/100
- SanDisk 6-in-1 PC Card Adapter
- SAnDisk CompactFlash PC Card Adapter
- Toshiba PCMCIA Flash 640MB

Most of them are my own old cards I have used regularly for years without any problem up to FreeBSD-6.0-RELEASE.
I have played around with sysctl hw.cbb I/O and memory settings but without any success.

So it seems FreeBSD has no PCMCIA/CardsBus support since 7.0-RELEASE.

I still can not really believe it.

Any experiences?
Or maybe solution?


----------



## mav@ (Oct 20, 2010)

I am frequently using PCMCIA/Cardbus cards in my laptop for last two years with 8 and 9 branches. It would be nice if you submitted more fresh and detailed info with at least fresh 8-STABLE.


----------



## uzbence (Oct 21, 2010)

*Of course*

Here it goes:
I have most of my cards with me. Test is done on my Lenovo T400.


```
FreeBSD 8.1-STABLE #18: Wed Oct 20 02:55:39 CEST 2010
    [email]feri@FeriBSD.rrc.hu[/email]:/usr/obj/usr/src/sys/GENERIC amd64
```


```
sysctl hw.cbb
hw.cbb.debug: 0
hw.cbb.start_32_io: 4096
hw.cbb.start_16_io: 256
hw.cbb.start_memory: 2281701376

lspci -lv (for the cbb)
cbb0@pci0:21:0:0:	class=0x060700 card=0x20c617aa chip=0x04761180 rev=0xba hdr=0x02
    vendor     = 'Ricoh Co Ltd'
    device     = 'Ricoh R/RL/5C476(II) (unknown)'
    class      = bridge
    subclass   = PCI-CardBus
```


1. NEC Aterm WL300NC

```
dmesg
ath0: <Atheros 5416> mem 0xbd5c0000-0xbd5cffff irq 16 at device 0.0 on cardbus0
ath0: [ITHREAD]
ath0: unable to attach hardware; HAL status 3
device_attach: ath0 attach returned 6

pciconf -lv
ath0@pci0:22:0:0:	class=0x028000 card=0x8c031033 chip=0x0023168c rev=0x01 hdr=0x00
    vendor     = 'Atheros Communications Inc.'
    device     = '802.11a/b/g/n Wireless PCI Adapter (AR5416)'
    class      = network
```

2. Toshiba 640MB PCMCIA flash (used for years upto FreeBSD6.1)

```
dmesg
CIS is too long -- truncating
pccard0: Card has no functions!
cbb0: PC Card card activation failed

pciconf -lv
card not even seen
```

3. Xircom CreditCard Ethernet 10/100 (used for years upto FreeBSD6.1)

```
dmesg
CIS is too long -- truncating
pccard0: Card has no functions!
cbb0: PC Card card activation failed

pciconf -lv
card not even seen
```
4. Adaptec SlimSCSI 1480B (used for years upto FreeBSD6.1)

```
dmesg
ahc0: <Adaptec 1480A Ultra SCSI adapter> port 0x1200-0x12ff mem 0xbd4a1000-0xbd4a1fff irq 16 at device 0.0 on cardbus0
ahc0: PCI Device 22:0:0 failed I/O mapped test.
ahc0: can't allocate register resources
device_attach: ahc0 attach returned 12

pciconf -lv
ahc0@pci0:22:0:0:	class=0x010000 card=0x75609004 chip=0x60759004 rev=0x03 hdr=0x00
    vendor     = 'Adaptec Inc'
    device     = 'CardBus Ultra SCSI Controller (AIC-7560?)'
    class      = mass storage
    subclass   = SCSI
```

5.NetGear Gigabit PC Card GA511  (used for years upto FreeBSD6.1)

```
dmesg
re0: <RealTek 8169/8169S/8169SB(L)/8110S/8110SB(L) Gigabit Ethernet> port 0x1200-0x12ff mem 0xbd4a1000-0xbd4a11ff irq 16 at device 0.0 on cardbus0
re0: reset never completed!
re0: Chip rev. 0x00000000
re0: MAC rev. 0x00000000
re0: PHY read failed
re0: MII without any phy!
device_attach: re0 attach returned 6

pciconf -lv
re0@pci0:22:0:0:	class=0x020000 card=0x52001385 chip=0x816910ec rev=0x10 hdr=0x00
    vendor     = 'Realtek Semiconductor'
    device     = 'Single Gigabit LOM Ethernet Controller (RTL8110)'
    class      = network
    subclass   = ethernet
```

*6. Reference: unsupported hardware: SUNIX RS-232 CardBus*

```
[B]dmesg
CIS is too long -- truncating
pccard0: Card has no functions!
cbb0: PC Card card activation failed

pciconf -lv
card not seen[/B]
```

It seems to me that 32 bit cards are not supported 16 bit cards are not even recognized. All cards except the NEC were used without any problem and regularly up to FreeBSD 6.1. At our training/demo lab I have tried to set the cbb I/O and mem based on the info gotten from the other operating systems but without any success.

But based on my previous experience on last two days playing I will only be able to produce the same that can be found all around the web.
e.g. the URL in my previous post or the following from m0n0wall site: http://forum.m0n0.ch/index.php?topic=3937.0

In the last post - by the developer - poor PCMCIA/CardBus support is handled as a triviality.

If you have some specific request regarding commands, debugging, or testing anything specific please write and I will do.

Almost old FreeBSD user.


----------



## uzbence (Oct 21, 2010)

*correction*

Sorry!

The URL is bad in my previous post.
The correct URL:

http://forum.pfsense.org/index.php?topic=23539.0

After work I was lost in my fresh bookmarks.


----------



## uzbence (Oct 22, 2010)

*one more card*

I asked for a Cisco Aironet 350 that worked like hell since I remember. 
I have used it daily before WiFi card was "by default part" of a notebook.
And now:

```
CIS is too long -- truncating
pccard0: Card has no functions!
cbb0: PC Card card activation failed
```

16 bit PCMCIA CARD -> not even recognized.


----------



## uzbence (Oct 23, 2010)

*partial solution*

After reading through the Google hits it seemed it can be I/O problem.
All cards (except the reference) worked well on MSW, Debian, OpenBSD and NetBSD.
I "copied" the settings from MSW -> no success.
OpenBSD -> success

So the solution - we call in Hungary someting like "blind hen solution":

```
sysctl hw.cbb.start_memory=0xf4800000
```
16 bit card:

```
cbb0: card inserted: event=0x00000000, state=30000410
cbb_pcic_socket_enable:
cbb0: cbb_power: 5V
cbb_pcic_socket_enable:
an0: <Cisco Systems 350 Series Wireless LAN Adapter> at port 0x100-0x13f irq 16 function 0 config 5 on pccard0
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: record length mismatch -- expected 192, got 200 for Rid ff00
an0: got RSSI <-> dBM map
an0: supported rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
an0: WARNING: using obsoleted if_watchdog interface
an0: Ethernet address: 00:0d:bc:3a:e7:95
an0: [GIANT-LOCKED]
an0: [ITHREAD]
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: record length mismatch -- expected 194, got 196 for Rid ff10
```
32 bit card:

```
cbb0: card inserted: event=0x00000000, state=30000820
cbb0: cbb_power: 3V
ath0: <Atheros 5416> mem 0xf4810000-0xf481ffff irq 16 at device 0.0 on cardbus0
ath0: [ITHREAD]
ath0: AR5416 mac 13.10 RF5133 phy 8.1
```

16 bit card is recognized but after trying to create wlan device:

```
an0: wlan_clone_create: reject, not an 802.11 device
```

32 bit card works perfectly.
I try the other cards.

Sorry for replying for myself again and again. This is the last.
I know this is a peripherial problem for most users, but I use FreeBSD for networking training and now on notebooks.


----------



## richardpl (Oct 24, 2010)

for an(4) you need ancontrol(8)


----------



## uzbence (Oct 24, 2010)

*Thank You Very Much!*

Thank You very much!

Now all cards working AND the Cisco350 as well.


----------

