Subject: adding PCM100 to pcmcia
To: None <tech-kern@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-kern
Date: 02/26/2003 14:39:07
As I mentioned in
http://mail-index.netbsd.org/tech-kern/2002/12/12/0001.html
I am adding to support for Linksys EtherFast 10/100 Integrated PC Card
(Model No: PCM100).

I have successfully used the card under FreeBSD 4.7-STABLE and Linux.
Linux says:
 eth0: NE2000 (DL10022 rev 05): io 0x300, irq 3, hw_addr 00:04:5A:08:78:E1

So I edited pcmciadevs based on FreeBSD's pccarddevs and OpenBSD's
pcmciadevs.

diff -b -u -r1.167.4.6 pcmciadevs
--- pcmciadevs	2002/11/19 21:29:47	1.167.4.6
+++ pcmciadevs	2003/02/26 20:46:33
@@ -433,6 +433,7 @@
 product IODATA PCLAT		{ "I-O&spDATA", "PCLA", "ETHERNET", NULL } IO-DATA PCLA/T
 product LANTECH FASTNETTX	{ "ASIX", "AX88190", NULL, NULL } Lantech Fastnet/TX
 product LINKSYS ECARD_2		{ "LINKSYS", "E-CARD", NULL, NULL } Linksys E-Card
+product LINKSYS PCM100		{ "Linksys", "EtherFast&sp10/100&spIntegrated&spPC&spCard&sp(PCM100)", "Ver&sp1.0", NULL }
 product MEGAHERTZ XJ2288 	{ "MEGAHERTZ", "MODEM&spXJ2288", NULL, NULL } Megahertz XJ2288 Modem
 product MELCO LPC2_TX		{ "MELCO", "LPC2-TX", NULL, NULL } Melco LPC2-TX
 product NAKAGAWAMETAL LNT10TN	{ "PCMCIA", "LNT-10TN", NULL, NULL } NAKAGAWA METAL LNT-10TN NE2000 Compatible Card

My new product is the only product without a product name after the
closing } brace. That's the way it is in the FreeBSD pccarddevs too. All
of them in OpenBSD's file don't have any of these product names.

And ran: "make -f Makefile.pcmciadevs"

And then edited if_ne_pcmcia.c partially based on OpenBSD's if_ne_pcmcia.c
code.

(OpenBSD's ne2000dev struct doesn't include the PCMCIA_STR_* "name".)

diff -b -u -r1.90.4.2 if_ne_pcmcia.c
--- if_ne_pcmcia.c	2002/09/18 19:37:21	1.90.4.2
+++ if_ne_pcmcia.c	2003/02/26 21:01:04
@@ -228,6 +228,11 @@
       PCMCIA_CIS_LINKSYS_ECARD_1,
       0, -1, { 0x00, 0x80, 0xc8 } },

+    { PCMCIA_STR_LINKSYS_PCM100,
+      PCMCIA_VENDOR_LINKSYS, PCMCIA_PRODUCT_LINKSYS_PCM100,
+      PCMCIA_CIS_LINKSYS_PCM100,
+      0, -1, { 0x00, 0x04, 0x5a } },
+
     { PCMCIA_STR_PLANEX_FNW3600T,
       PCMCIA_VENDOR_LINKSYS, PCMCIA_PRODUCT_LINKSYS_COMBO_ECARD,
       PCMCIA_CIS_PLANEX_FNW3600T,


Now my dmesg reports:

 ne2 at pcmcia1 function 0 port 0x400-0x40f port 0x410-0x41f
 ne2:  Ethernet
 ne2: Ethernet address 01:d4:ff:03:00:20

Notice that the name is just a single space " ". I assume that is because
PCMCIA_STR_LINKSYS_PCM100 is nothing.

And I don't know why hardware address is different from what Linux
detects. (It works fine under Linux.)

It behaves just like when it configures without the new code (as Linksys
Combo EthernetCard Ethernet). It can ping fine, but tcp traffic doesn't
work.

Any ideas?

Anyone notice any errors above?

Any suggestions on how this should be done?

I am now building again with the added PCMCIA_STR_LINKSYS_PCM100 part and
with PCMCIAVERBOSE option enabled. (And then I make new boot1.fs and
boot2.fs with this.)

Thank you,

   Jeremy C. Reed

p.s. I need to get NetBSD easily on to this laptop. I guess I could patch
sysinst again to allow "sl" as valid interface. But then I will still need
the ethernet to work for when I travel.