Alpha Test 3c589 Linux Device Driver. This is an alpha test package for the Linux 3c589 PCMCIA ethercard driver written by Donald Becker, becker@cesdis.gsfc.nasa.gov. It includes the following source files, available from cesdis.gsfc.nasa.gov: cesdis.gsfc.nasa.gov:/pub/linux/pcmcia/3c589.c cesdis.gsfc.nasa.gov:/pub/linux/pcmcia/dbether.c Quick instructions for installing this driver. Step 0. Don't bug me, unless you have a bug fix or suggestion. 1. Put cesdis.gsfc.nasa.gov:/pub/linux/pcmcia/3c589.c into drivers/net/3c589.c o Edit it to remove the hard-wired BNC port selection around line 118. 2. Apply the appended patch to add the 3c589 driver to the kernel compile. 3. Make and install your kernel. 4. Test and install the appropriate PCMCIA socket enabler for your system. 5. Put the PCMCIA enabler call before the 'ifconfig' call. 6. Change your net initialization to configure "3c589" instead of "eth0". --------------------------------------------------------------------------- Detailed instructions for installing this driver. Step 0 Realize that this is an alpha test driver. It may still contain bugs. The design of the PCMCIA socket services may not reflect the final PCMCIA support. You must know how to set up the Linux networking code and debug simple problems -- I will not set your network up or debug your system problems just because you are using an alpha driver. I don't know anything about getting the 3c589 to work with MS-DOS or MS-Window. Try contacting 3Com, or checking file://ftp.3com.com/adapters/drivers. Step 1 1. Put the 3c589.c driver source into your kernel source tree. The driver is on cesdis.gsfc.nasa.gov:/pub/linux/pcmcia/3c589.c Copy it to driver/net/3c589.c in your Linux 1.0 or 1.0.* kernel source tree. Edit it to remove the hard-wired BNC port selection around line 118. My usual network connection is 10base2. The 3c589 is shipped with the default set to 10baseT. I can't get the MS-DOS setup program to run, so I override the setting just after reading the EEPROM. This will be removed when I write a 3c589 setup and diagnostic program for Linux. Step 2 Set up the driver to be included in the kernel. This usally means making the appended changes to your Linux kernel source. (See the patch at the end of this file.) Note: This patch adds a single new device driver, and a device named "3c589". This device is similar to the generic "eth0", "eth1",... devices, and the name "3c589" is used with 'ifconfig' in place of "eth0". There are few difference from the traditional "eth0" semantics: o There is only one '3c589' device in the following patch. If you need a second (e.g. you are using a laptop as a gateway) you should add a second device named "3c589a". o The following patch sets the ethercard address to 0x300, and the IRQ to 10. Unlike other ethercard devices, a PCMCIA ethercard may be hot-installed. Probing for devices after boot-time is dangerous and unnecessary. If you need to change the address or IRQ either edit the Space.c entry or add the changes to your LILO configuration file. o Unlike 'eth0' device, which only exists if an ethercard is found, the '3c589' device is always silently "found" at boot-time. It will show up in /proc/net/dev with the note "No statistics available" until it is first 'ifconfig'ed. Step 3 Make and install a new kernel as usual. Step 4 Test and install the right PCMCIA socket enabler for your machine. This enabler code will be laptop-specific. Most laptops use either the Intel 82365 or DataBook TCIC/2N socket controller chip. If you haven't deduced which your laptop uses (perhaps by reading the banners during an MS-DOS boot) the following may help. The DataBook TCIC is usually found at I/O location 0x240, which the Intel 82365 is usally at 0x3e0. Try running the following as 'root': dd if=/dev/port bs=1 skip=576 count=16 | od -x dd if=/dev/port bs=1 skip=992 count=2 | od -x The first dumps location 0x240 (576 decimal) checking for the TCIC, while the second dumps location 0x3e0 (992 decimal) checking for the i82365. Empty location will usually be reported as 0xff or 0x7f. I developed the driver with the TCIC controller and wrote a simple enabler program for typical implementations using socket 0: cesdis.gsfc.nasa.gov:/pub/linux/pcmcia/dbether.c This trivial enabler took longer to get right than the 3c589-specific part of the driver! Programming PCMCIA bus bridges can be tricky unless you have complete system documentation. If you use another socket enabler program you'll need to set the parameters to match the Space.c entry. The following are the defaults: I/O Base 0x300 IRQ 10 Most socket enablers should read the following details from the CIS, but you may also need to know: I/O Length 16 (0x300-0x30f) COR (Configure Option) offset 0x2000 Configuration index 0x01 or 0x03 No audio, No shared memory, either level or pulse mode interrupts When the PCMCIA socket controller is properly programmed the 3c589 ID '0x6d50' will appear at I/O location 0x300. This can be checked by running the following as 'root': dd if=/dev/port bs=1 skip=768 count=2 | od -x Step 5 Call the PCMCIA enabler before the 'ifconfig' call. You might do this either at boot-time in e.g. /etc/rc.d/rc.inet1 or by hand, just before you setup the network. I use a shell script that calls the enabler program and then does most of what /etc/rc.d/rc.inet1 does. This allows me to boot the laptop while away from the network and connect it later. Step 6 Change your net initialization to 'ifconfig the "3c589" device instead of the usual "eth0". The 'ifconfig' call is often either in /etc/rc.net or /etc/rc.d/rc.inet1. N.B. You may have to call 'ifconfig' twice, or explicitly insert "up" before the IP address in the 'ifconfig' call. ifconfig 3c589 up ... Step 7 7. Send me a "happy happy joy joy" report when everything is working! Patchs to apply to the Linux kernel source. ________________Patch file follows________________ --- config.in~ Wed Mar 16 18:50:16 1994 +++ config.in Sat Mar 26 15:25:20 1994 @@ -70,7 +70,8 @@ bool '3c503 support' CONFIG_EL2 n #bool '3c505 support' CONFIG_ELPLUS n #bool '3c507 support' CONFIG_EL16 n bool '3c509/3c579 support' CONFIG_EL3 n +bool '3c589 PCMCIA support' CONFIG_3C589 y bool 'HP PCLAN support' CONFIG_HPLAN n bool 'AT1500 and NE2100 (LANCE and PCnet-ISA) support' CONFIG_LANCE n bool 'AT1700 support' CONFIG_AT1700 n --- drivers/net/Space.c~ Fri Feb 18 04:18:28 1994 +++ drivers/net/Space.c Sat Mar 26 15:06:37 1994 @@ -138,6 +138,15 @@ # define NEXT_DEV (&atp_dev) #endif +/* PCMCIA devices currently have explicit names. */ +#if defined(CONFIG_3C589) /* 3Com 3c589 PCMCIA adaptor. */ +extern int tc589_init(struct device *); +static struct device tc589_dev = { + "3c589", 0,0,0,0, 0x300, 10, 0, 0, 0, NEXT_DEV, tc589_init, /* ... */ }; +# undef NEXT_DEV +# define NEXT_DEV (&tc589_dev) +#endif + /* The first device defaults to I/O base '0', which means autoprobe. */ #ifndef ETH0_ADDR # define ETH0_ADDR 0 --- drivers/net/Makefile~ Tue Feb 22 01:38:04 1994 +++ drivers/net/Makefile Sat Mar 26 15:06:17 1994 @@ -97,6 +97,9 @@ ifdef CONFIG_EL3 NETDRV_OBJS := $(NETDRV_OBJS) net.a(3c509.o) endif +ifdef CONFIG_3C589 +NETDRV_OBJS := $(NETDRV_OBJS) net.a(3c589.o) +endif ifdef CONFIG_EEXPRESS NETDRV_OBJS := $(NETDRV_OBJS) net.a(eexpress.o) endif Top Author:Donald Becker, becker@cesdis.gsfc.nasa.gov