From: hpeyerl@novatel.cuc.ab.ca (Herb Peyerl)
Subject: patch for ifconfig to allow easier config of AUI/BNC.
Organization: none
Date: Sun, 6 Sep 1992 17:56:47 GMT

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

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.  |
Newsgroups: comp.unix.bsd