Subject: Re: (WAS Help on cloning) Billionton OEM compact flash Ethernet
To: NetBSD netbsd-help mailing list <netbsd-help@netbsd.org>
From: Michael Francini <francini@mindspring.com>
List: netbsd-help
Date: 04/02/2003 20:27:37
First off, Thanks to both Christos and Julian for responding so quickly
to my question.  Additionally, I'd like to say that I appreciate that
both your answers were consistent, making this patch semm simple.

After I got the first response, I browsed further through the
if_ne_pcmcia.c sources and found the structures for Billionton's PCMCIA
10mb adapter. Since it uses the same chipset as the CF adapter I
followed your suggestions, copying and modify the structures in
"if_ne_pcmcia.c" and "pcmciadevs", then remade the headers and
recompiled the kernel.    VIOLA, IT WORKS!!  I've already sup'd the
entire package source distribution to my z50 and it seems rock solid. 
Thanks for the help.

Let me know if you want me to post the mods to the group.

Regards,

Mike F.

Christos Zoulas wrote:

>>I bought off ebay a compact flash Ethernet adapter that I've since
>>learned is made by Billionton Taiwan.  It's their model CFLT-10N. 
(FYI,
>>this praticular nic has a picture of a person flying a hanglider on
>>it).  It uses the TAMARAK TC3299CE chipset which is register
compatible
>>with the National Semiconductor NE8390 chipset.  I was able to verify
>>this by configuring my PCMCIA config options file on my linux box to
use
>>the 8390 module on this NIC and VIOLA, IT WORKED!!  The problem is:
the
>>manufacturer and product CIS codes aren't in the card so when I plug
the
>>nic into my IBM Z50 CE laptop running NetBSD, it doesn't work, showing
>>the dreaded 0xfff... id for both product and manufacturer codes. What
I
>>am able to obtain from my linux box cardctl info is the following:
>>
>>PRODID_1="CF"
>>PRODID_2="10Base-Ethernet"
>>PRODID_3="1.0"
>>PRODID_4=""
>>MANFID=0000,0000
>>FUNCID=6
>>
> 
> Try this patch and [make -f Makefile.pcmciadevs there]
> 
> christos
> 
> Index: if_ne_pcmcia.c
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/pcmcia/if_ne_pcmcia.c,v
> retrieving revision 1.100
> diff -u -u -r1.100 if_ne_pcmcia.c
> --- if_ne_pcmcia.c	2003/01/16 15:21:20	1.100
> +++ if_ne_pcmcia.c	2003/04/01 22:40:33
> @@ -475,6 +475,11 @@
>        PCMCIA_CIS_DYNALINK_L10C,
>        0, -1, { 0x00, 0x00, 0x00 } },
>  
> +    { PCMCIA_STR_TAMARAK_TC3299CE,
> +      PCMCIA_VENDOR_TAMARAK, PCMCIA_PRODUCT_TAMARAK_TC3299CE,
> +      PCMCIA_CIS_TAMARAK_TC3299CE,
> +      0, -1, { 0x00, 0x00, 0x00 } },
> +
>  #if 0
>      /* the rest of these are stolen from the linux pcnet pcmcia
device
>         driver.  Since I don't know the manfid or cis info strings for
> Index: pcmciadevs
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/pcmcia/pcmciadevs,v
> retrieving revision 1.179
> diff -u -u -r1.179 pcmciadevs
> --- pcmciadevs	2003/01/16 15:18:44	1.179
> +++ pcmciadevs	2003/04/01 22:40:33
> @@ -401,6 +401,7 @@
>  vendor RPTI			-1 	RPTI
>  vendor SVEC			-1	SVEC/Hawking Technology
>  vendor SYNERGY21		-1	Synergy 21
> +vendor TAMARAK			-1	Tamarak
>  vendor TEAC			-1	TEAC
>  vendor YEDATA			-1 	Y-E DATA
>  
> @@ -472,6 +473,7 @@
>   */
>  product SVEC PN650TX		-1 SVEC PN650TX 10/100 Dual Speed Fast Ethernet
PC Card
>  product SYNERGY21 S21810	{ "PCMCIA", "Ethernet", "A", "004743118001"
} Synergy 21 S21810+ NE2000 Compatible Card
> +product TAMARAK TC3299CE	{ "CF", "10Base-Ethernet", "1.0", NULL }
Tamarak CFLT-10N Ethernet
>  product TEAC IDECARDII		{ NULL, "NinjaATA-", NULL, NULL } TEAC IDE
Card/II
>  product XIRCOM CFE_10		{ "Xircom", "CompactCard&spEthernet",
"CFE-10", "1.00" } Xircom CompactCard CFE-10
>  product YEDATA EXTERNAL_FDD	{ "Y-E&spDATA", "External&spFDD", NULL,
NULL } Y-E DATA External FDD

>From Julian, 

In summary, you need to add the correct information to pcmciadevs and
if_ne_pcmcia.c and rebuild your kernel.  See the kernel documentation
at:

  http://www.netbsd.org/Documentation/kernel/

for how to do that.

Looking at pcmciadevs, there is already an entry:

  product BILLIONTON LNT10TN    { "PCMCIA", "LNT-10TN", NULL, NULL }
Billionton Systems Inc. LNT-10TN NE2000 Compatible Card

with a corresponding match in if_ne_pcmcia.c:

    { PCMCIA_STR_BILLIONTON_LNT10TN,
      PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
      PCMCIA_CIS_BILLIONTON_LNT10TN,
      0, -1, { 0x00, 0x00, 0x00 } },

So, if you can find out the information for this card - by adding:

  options       PCMCIAVERBOSE

to your kernel configuration, you should be able to clone those entries
with
the correct strings added.  I would guess something like:

  product BILLIONTON CFLT_10N   { "CF", "10Base-Ethernet", NULL, NULL }
Billionton Systems Inc. CFLT-10N 1.0 NE2000 Compatible Card

for pcmciadevs, and then:

    { PCMCIA_STR_BILLIONTON_CFLT_10N
      PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
      PCMCIA_CIS_BILLIONTON_CFLT_10N
      0, -1, { 0x00, 0x00, 0x00 } },

for if_ne_pcmcia.c.

One final thing, you need to rebuild pcmciadevs.h and pcmciadevs_data.h
before you start a kernel build, by running:

  make -f Makefile.pcmciadevs

Hope this helps.

J