*BSD News Article 54411


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!zombie.ncsc.mil!news.mathworks.com!newsfeed.internetmci.com!news.msfc.nasa.gov!sol.ctr.columbia.edu!startide.ctr.columbia.edu!wpaul
From: wpaul@ctr.columbia.edu (Bill Paul)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: HELP! dual 3c503 cards
Date: 3 Nov 1995 15:57:46 GMT
Organization: Columbia University Center for Telecommunications Research
Lines: 165
Distribution: usa
Message-ID: <47de5q$ga7@sol.ctr.columbia.edu>
References: <47b9ki$389@news.cerf.net>
NNTP-Posting-Host: startide.ctr.columbia.edu
X-Newsreader: TIN [version 1.2 PL2]

Daring to challenge the will of the almighty Leviam00se, Henry Castro 
(microcdm@nic.cerf.net) had the courage to say: : Hello,

: I'm trying to set up a box with 2 cards in it. I've hacked the kernel for
: device issues, they're set at ed0 and ed1. I can get one to go but not
: both, anybody have a clue? All help appreciated.

: thanks,

: henry
: hcastro@microcadam.com

You're being wonderfully non-specific here. _HOW_ did you hack the
kernel? _WHAT_ is the nature of the problem with the second card?
What _VERSION_ of FreeBSD are you using?

We need details, dammit! We're not mind readers. Say what error messages
you encountered or what sort of failure you noticed; _THEN_ maybe somebody
can tell you what your problem is.

People, take note: 'it doesn't work' is not a problem report. It's a
joke, and it's one I'm getting really tired of hearing.

That said, there's no reason you can't get two 3c503 cards working together
in a FreeBSD system. I built an IP router this way:

FreeBSD 2.0.5-RELEASE #0: Thu Jun 29 14:28:14 EDT 1995
    wpaul@ieor-gw2:/usr/src/sys/compile/IEOR_GW
CPU: i486DX (486-class CPU)
real memory  = 8290304 (2024 pages)
avail memory = 7426048 (1813 pages)
Probing for devices on the ISA bus:
sc0 at 0x60-0x6f irq 1 on motherboard
sc0: VGA mono <16 virtual consoles, flags=0x0>
ed0 at 0x250-0x25f irq 3 maddr 0xc8000 msize 8192 on isa
ed0: address 02:60:8c:db:63:c3, type 3c503 (16 bit) 
bpf: ed0 attached
ed1 at 0x350-0x35f irq 4 maddr 0xcc000 msize 8192 on isa
ed1: address 02:60:8c:db:64:b6, type 3c503 (16 bit) 
bpf: ed1 attached
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
fdc0: NEC 72065B
fd0: 1.44MB 3.5in
wdc0 at 0x1f0-0x1f7 irq 14 on isa
wdc0: unit 0 (wd0): <WDC AC1170>
wd0: 162MB (333300 sectors), 1010 cyls, 6 heads, 55 S/T, 512 B/S
npx0 on motherboard
npx0: INT 16 interface
bpf: lo0 attached

The machine is a Dell 486 desktop (ISA -- no, really). I turned off the 
serial ports in the CMOS configuration since I didn't need them for this 
system, and I wanted to free up their IRQ lines. Note that the 3c503 can 
only be configured to one of four possible IRQs: 2,3,4 and 5. This means 
you can't have more than four of them in the system at once. Also, the 
older 8-bit models tend to have somewhat sub-par performance; they work 
well enough for most things, but they can give you grief with NFS unless 
you reduce your NFS blocksizes from 8K to 4K. The cards I used are newer 
16-bit models; they can handle NFS no problem (though I'm not using NFS 
with this machine).

Here's the kernel config file I'm using:

#
# IEOR_GW -- Generic machine with WD (IDE) family disks and two
#            ethernet adapters. (This machine is a router.)
#
#

machine         "i386"
cpu             "I486_CPU"
ident           IEOR_GW
maxusers        10

options         INET                    #InterNETworking
options         FFS                     #Berkeley Fast Filesystem
options         PROCFS                  #Process filesystem
options         "COMPAT_43"             #Compatible with BSD 4.3
options         UCONSOLE                #Allow users to grab the console
options         GATEWAY                 #We forward packets
options         ARP_PROXYALL            #Hoo boy!

config          vmunix  root on wd0 

controller      isa0

# Only one floppy drive in this machine
controller      fdc0    at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
disk            fd0     at fdc0 drive 0

# Only one disk in this machine
controller      wdc0    at isa? port "IO_WD1" bio irq 14 vector wdintr
disk            wd0     at wdc0 drive 0

# Console driver
device          sc0     at isa? port "IO_KBD" tty irq 1 vector scintr

# FPU (math co-processor)
device          npx0    at isa? port "IO_NPX" irq 13 vector npxintr

# Two ethernet devices
device ed0 at isa? port 0x250 net irq  3 iomem 0xc8000 vector edintr
device ed1 at isa? port 0x350 net irq  4 iomem 0xcc000 vector edintr

pseudo-device   loop
pseudo-device   ether
pseudo-device   log
pseudo-device   pty     32
pseudo-device   bpfilter 4      # Berkeley Packet Filter (for tcpdump)
pseudo-device   gzip            # Exec gzipped a.out's



Note that I have turned on global proxy arp with ARP_PROXYALL. This is
because both interfaces have IP addresses in the same subnet. This is a
hack, but it's a working hack, so I'm not complaining.

You'll also note that I used IRQs 3 and 4 for the ethernet cards. As I
said, I disabled the serial ports so that these would be free. You can
use any combination of 2,3,4 and 5 that suits you. You need to jumper
the cards for seperate I/O addresses (0x250 and 0x350 in my case) and
seperate shared memory base addresses (0xc800 and 0xcc00, again in my 
case).

You do NOT jumper select the IRQ with the 3c503 adapter. You just tell
the driver what IRQ you want to use and the driver will program the card
to use it (as long as it's free). Only the I/O address and shared memory
base address need to be set with jumpers.

As a last detail, the interface that connects to the campus network (ed1)
is hooked up via its AUI port. By default, the 'ed' driver configures the
3c503 to use is on-board transceiver, which means it comes up expecting
to use the BNC/TP connector instead. There are two ways to make it
switch to the AUI port:

1) Use the 'link2' option when ifconfig-ing the device:

   # ifconfig ed1 inet xxx.xxx.xxx.xxx link2 netmask 0xffffff00

2) Change the default behavior of the driver by specifying a 'flags' argument
   in the kernel config file (please excuse the long line):

   device ed1 at isa? port 0x350 net irq  4 flags 0x0001 iomem 0xcc000 vector edintr

   If you examine /sys/i386/isa/if_edreg.h, you'll see what flags are
   supported by the driver and what they do. Generally, this method is
   only needed if you're going to be configuring a kernel for a diskless
   machine that needs to have its ethernet interface working immediately.

I used method 1; I tend to see one 'ed1: device timeout' error when the
system starts up, but after that it works fine. If you set the option
flags such that the driver initializes the AUI port by default, you
don't get the timeout.

-Bill

--
=============================================================================
-Bill Paul            (212) 854-6020 | System Manager
Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
License error: The license for this .sig file has expired. You must obtain
a new license key before any more witty phrases will appear in this space.
=============================================================================