*BSD News Article 4934


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!spool.mu.edu!sol.ctr.columbia.edu!destroyer!ubc-cs!alberta!cpsc.ucalgary.ca!ajfcal!novatel!hpeyerl
From: hpeyerl@novatel.cuc.ab.ca (Herb Peyerl)
Subject: patch for ifconfig to allow easier config of AUI/BNC.
Message-ID: <1992Sep10.154423.10000@novatel.cuc.ab.ca>
Organization: none
Date: Thu, 10 Sep 1992 15:44:23 GMT
Lines: 113

[ I posted this message a week ago and we were having some problems
  with our news software.  Since I hadn't received any responses
  or seen any followups, I began to get suspicious.  I checked
  around on a few other sites and did not see my message arrive
  there; so, I'm posting it again.  Apologies if this is a re-
  run but I felt it was going to be important enough to a large
  enough audience that a repost was warranted. I'd appreciate some
  feedback regarding this matter.  Even if it's just to say "It 
  worked for me." I'll be on vacation from the 11th to the 21st
  and will attend to my mail upon my well rested return. Thanks. ]

I've had some mail and seen a number of posts here asking about
the configuration of the AUI/BNC connectors on the 3Com 3c503
card.  When I released the initial version of the ec driver
back in 0.0 days, there was a kludge for configuring this option
requiring you to go into your ioconf.c and edit the isa_device
structure setting bit 8 of the unit number to 1 indicating AUI.
This was hideous but I could think of no other way to do it.

When 0.1 was released; Bill Jolitz had modified the ec driver
in some ways (to his credit).  One of these ways was to remove
my hideous kludge and add a check for IFF_LLC0 being set in the
"ifnet" struct.  If set, the driver uses AUI, else BNC.

I've been trying to decide how best to allow this to be changed
from an admin level.  I figured I could write a utility to just
do the appropriate ioctl() but decided we didn't really need 
YAU (yet another utility).  Other's have mentioned that creating
a /dev/ec0 entry with the appropriate major/minor numbers would
suffice but, not understanding how that could work, I didn't
pursue it.  The final solution (which I finally decided upon) was
to patch ifconfig.  It was a simple patch and works extremely
well (in my basement using a 3c503 with a DESTA transceiver
plugged into a transceiver cable which is plugged into the AUI
port of the 3c503.)

Here's basically what you need to do:

Copy this message to somewhere (/tmp)

# cd /usr/src/sbin/ifconfig
# patch < /tmp/message
# make
# cd obj
# mv /sbin/ifconfig /sbin/ifconfig.dist
# mv ifconfig /sbin/ifconfig
# mv /usr/share/man/cat8/ifconfig.0 /usr/share/man/cat8/ifconfig.0.dist
# mv ifconfig.0 /usr/share/man/cat8/ifconfig.0
# ifconfig ec0 down
# ifconfig ec0 aui
# ifconfig ec0 up

Or in your  /etc/netstart change:

ifconfig ec0 inet $hostname

to:

ifconfig ec0 inet $hostname aui

(Note: "ifconfig ec0 bnc" is also supported but is the default upon
 startup so is not needed. It is useful if you want to change from
 aui to bnc on the fly.  Make sure you mark the interface down, then
 set aui/bnc and then mark the interface up.)

Some will wonder about the appropriateness of patching ifconfig just
to make it easier to configure one card.  I wondered this same thing.
I figured if Bill can patch the driver to use one of the interface
flags for this purpose, then he must have intended for some way to
do this from user-level. It doesn't appear that any other cards use
IFF_LLC0 for any other purpose so "ifconfig we0 aui" won't have any
affect on anything.

Hope this helps everyone... Does anyone have any comments as to the
appropriateness of this fix? (I'll wait for responses before I submit
a BUGNFIX.FORM to Lynne. Unless Lynne sees this, feels it's appropriate
and submits it herself.)

###### Cut Here #######

*** ifconfig.c	Fri Feb  7 16:27:09 1992
--- ifconfig.c	Sun Sep  6 11:23:50 1992
***************
*** 107,112 ****
--- 107,114 ----
  	{ "-arp",	IFF_NOARP,	setifflags },
  	{ "debug",	IFF_DEBUG,	setifflags },
  	{ "-debug",	-IFF_DEBUG,	setifflags },
+ 	{ "aui",	IFF_LLC0,	setifflags },
+ 	{ "bnc",	-IFF_LLC0,	setifflags },
  	{ "alias",	IFF_UP,		notealias },
  	{ "-alias",	-IFF_UP,	notealias },
  	{ "delete",	-IFF_UP,	notealias },
*** ifconfig.8	Tue Apr 16 17:28:08 1991
--- ifconfig.8	Sun Sep  6 11:43:49 1992
***************
*** 130,135 ****
--- 130,139 ----
  addresses and 10Mb/s Ethernet addresses.
  .It Fl arp
  Disable the use of the Address Resolution Protocol.
+ .It Cm aui
+ Enable the AUI port on a 3c503 adaptor.
+ .It Cm bnc
+ Enable the BNC port on a 3c503 adaptor. (default)
  .It Cm broadcast
  (Inet only)
  Specify the address to use to represent broadcasts to the
-- 
"I was early to finish | hpeyerl@novatel.cuc.ab.ca <Reply-To>   | I brew |
I was late to start, I | peyerlh@cuug.ab.ca                     | there- | 
might be an adult, but | #define JANITOR "Network Administrator"| fore I | 
I'm a minor at heart." |    JANITOR, NovAtel Communications Ltd.|   AM.  |