From dannyman@tellme.com  Fri Sep 22 18:22:09 2000
Return-Path: <dannyman@tellme.com>
Received: from never.tellme.com (never.tellme.com [209.157.156.27])
	by hub.freebsd.org (Postfix) with ESMTP id E846937B423
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Sep 2000 18:22:08 -0700 (PDT)
Received: by never.tellme.com (Postfix, from userid 501)
	id 784F171658; Fri, 22 Sep 2000 18:22:08 -0700 (PDT)
Message-Id: <20000923012208.784F171658@never.tellme.com>
Date: Fri, 22 Sep 2000 18:22:08 -0700 (PDT)
From: dannyman@tellme.com
Reply-To: dannyman@tellme.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: /etc/pccard_ether feature request
X-Send-Pr-Version: 3.2

>Number:         21489
>Category:       conf
>Synopsis:       /etc/pccard_ether feature request
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    imp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 22 18:30:01 PDT 2000
>Closed-Date:    Wed Nov 14 23:04:12 MST 2001
>Last-Modified:  Wed Nov 14 23:05:23 MST 2001
>Originator:     dannyman
>Release:        FreeBSD 4.1-RELEASE i386
>Organization:
Tellme Networks
>Environment:
>Description:

In trying to get my WaveLAN card to work, I found I needed to change a default
config with wicontrol prior to configuring the interface.  I wanted to do this
at bootup so I hacked /etc/pccard_ether to read a variable,
pccard_preconfig_wi0, out of rc.conf, to run the "preconfig" command prior to
attempting dhclient.  This struck me as the "right" way and I thought I'd send
my diff in so that something like this could be considered for commit in to
the source tree.

>How-To-Repeat:
>Fix:

Diffs:

*** /etc/pccard_ether.orig	Fri Sep 22 09:25:18 2000
--- /etc/pccard_ether	Fri Sep 22 09:53:12 2000
***************
*** 19,24 ****
--- 19,29 ----
  interface=$1
  shift
  
+ eval pccard_preconfig=\$pccard_preconfig_${interface}
+ if [ -n "${pccard_preconfig}" ]; then
+ 	${pccard_preconfig}
+ fi
+ 
  case ${pccard_ifconfig} in
  [Nn][Oo] | '')
          ;;
*** /etc/defaults/rc.conf.orig	Fri Sep 22 09:29:16 2000
--- /etc/defaults/rc.conf	Fri Sep 22 09:32:56 2000
***************
*** 29,34 ****
--- 29,35 ----
  pccard_ifconfig="NO"	# Specialized pccard ethernet configuration (or NO).
  pccardd_flags=""	# Additional flags for pccardd.
  pccard_conf="/etc/defaults/pccard.conf"	# pccardd(8) config file
+ #pccard_preconfig_wi0="/usr/sbin/wicontrol -i wi0 -p 1" # specialized startup for pccard ethernet
  local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d"	# startup script dirs.
  local_periodic="/usr/local/etc/periodic /usr/X11R6/etc/periodic" # periodic script dirs
  rc_conf_files="/etc/rc.conf /etc/rc.conf.local"

>Release-Note:
>Audit-Trail:

From: Brooks Davis <brooks@one-eyed-alien.net>
To: dannyman@tellme.com
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: conf/21489: /etc/pccard_ether feature request
Date: Fri, 22 Sep 2000 19:25:39 -0700

 On Fri, Sep 22, 2000 at 06:22:08PM -0700, dannyman@tellme.com wrote:
 > 
 > In trying to get my WaveLAN card to work, I found I needed to change a default
 > config with wicontrol prior to configuring the interface.  I wanted to do this
 > at bootup so I hacked /etc/pccard_ether to read a variable,
 > pccard_preconfig_wi0, out of rc.conf, to run the "preconfig" command prior to
 > attempting dhclient.  This struck me as the "right" way and I thought I'd send
 > my diff in so that something like this could be considered for commit in to
 > the source tree.
 
 This is an intresting idea, but after doing some work with a WaveLAN
 card here, I'm not sure it's enough.  The problem is that you need to
 be able to set several settings in some environments.  For example,
 in the system I'm setting up, you'll have to set the port type, the SSID,
 the first WEP key, enable encryption, etc.  I'd like to see something
 that can handle this if it's going to be commited.  For added fun, the
 Aironet cards have virtually the same issues (though they can optionaly
 remember WEP keys), but the PCI and ISA versions don't actually use PC
 Card support at all so you can't use /etc/pccard_ether to configure them.
 I'm planning to work on something next week and haven't really thought
 it out all the way yet so any suggestions would be appreciated.
 
 -- Brooks
 
 -- 
 Any statement of the form "X is the one, true Y" is FALSE.
 

From: Danny Howard <dannyman@tellme.com>
To: Brooks Davis <brooks@one-eyed-alien.net>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: conf/21489: /etc/pccard_ether feature request
Date: Fri, 22 Sep 2000 19:29:52 -0700

 On Fri, Sep 22, 2000 at 07:25:39PM -0700, Brooks Davis wrote:
 > 
 > This is an intresting idea, but after doing some work with a WaveLAN
 > card here, I'm not sure it's enough.  The problem is that you need to
 > be able to set several settings in some environments.  For example,
 > in the system I'm setting up, you'll have to set the port type, the SSID,
 [...]
 
 I'd think you could write a script to plug in for pre-config.
 
 The trick is how the system would determine appropriate settings for a card
 before it can even determine the network it is on.  My hunch is that the wi
 driver should be able to try a few different settings, but this is a lot more
 work than the simple kludge suggested here, which will get a lot of folks like
 me working right away. :)
 
 -danny
 

From: Brooks Davis <brooks@one-eyed-alien.net>
To: Danny Howard <dannyman@tellme.com>
Cc: Brooks Davis <brooks@one-eyed-alien.net>,
	FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: conf/21489: /etc/pccard_ether feature request
Date: Fri, 22 Sep 2000 19:40:42 -0700

 On Fri, Sep 22, 2000 at 07:29:52PM -0700, Danny Howard wrote:
 > I'd think you could write a script to plug in for pre-config.
 > 
 > The trick is how the system would determine appropriate settings for a card
 > before it can even determine the network it is on.  My hunch is that the wi
 > driver should be able to try a few different settings, but this is a lot more
 > work than the simple kludge suggested here, which will get a lot of folks like
 > me working right away. :)
 
 Writing a script like thatmay be the solution I choose in the end.
 I'm scheduled to spend next week on these issues for a project at work
 so I should have a more flexiable solution by next Friday.  I'm sure
 you can wait that long. ;-)
 
 -- Brooks
 
 -- 
 Any statement of the form "X is the one, true Y" is FALSE.
 

From: dannyman@tellme.com
To: FreeBSD-gnats-submit@FreeBSD.ORG
Cc:  
Subject: conf/21489: /etc/pccard_ether feature request
Date: Fri, 22 Sep 2000 18:22:08 -0700 (PDT)

 >Number:         21489
 >Category:       conf
 >Synopsis:       /etc/pccard_ether feature request
 >Confidential:   no
 >Severity:       non-critical
 >Priority:       low
 >Responsible:    freebsd-bugs
 >State:          open
 >Quarter:        
 >Keywords:       
 >Date-Required:
 >Class:          change-request
 >Submitter-Id:   current-users
 >Arrival-Date:   Fri Sep 22 18:30:01 PDT 2000
 >Closed-Date:
 >Last-Modified:
 >Originator:     dannyman
 >Release:        FreeBSD 4.1-RELEASE i386
 >Organization:
 Tellme Networks
 >Environment:
 >Description:
 
 In trying to get my WaveLAN card to work, I found I needed to change a default
 config with wicontrol prior to configuring the interface.  I wanted to do this
 at bootup so I hacked /etc/pccard_ether to read a variable,
 pccard_preconfig_wi0, out of rc.conf, to run the "preconfig" command prior to
 attempting dhclient.  This struck me as the "right" way and I thought I'd send
 my diff in so that something like this could be considered for commit in to
 the source tree.
 
 >How-To-Repeat:
 >Fix:
 
 Diffs:
 
 *** /etc/pccard_ether.orig	Fri Sep 22 09:25:18 2000
 --- /etc/pccard_ether	Fri Sep 22 09:53:12 2000
 ***************
 *** 19,24 ****
 --- 19,29 ----
   interface=$1
   shift
   
 + eval pccard_preconfig=\$pccard_preconfig_${interface}
 + if [ -n "${pccard_preconfig}" ]; then
 + 	${pccard_preconfig}
 + fi
 + 
   case ${pccard_ifconfig} in
   [Nn][Oo] | '')
           ;;
 *** /etc/defaults/rc.conf.orig	Fri Sep 22 09:29:16 2000
 --- /etc/defaults/rc.conf	Fri Sep 22 09:32:56 2000
 ***************
 *** 29,34 ****
 --- 29,35 ----
   pccard_ifconfig="NO"	# Specialized pccard ethernet configuration (or NO).
   pccardd_flags=""	# Additional flags for pccardd.
   pccard_conf="/etc/defaults/pccard.conf"	# pccardd(8) config file
 + #pccard_preconfig_wi0="/usr/sbin/wicontrol -i wi0 -p 1" # specialized startup for pccard ethernet
   local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d"	# startup script dirs.
   local_periodic="/usr/local/etc/periodic /usr/X11R6/etc/periodic" # periodic script dirs
   rc_conf_files="/etc/rc.conf /etc/rc.conf.local"
 
 >Release-Note:
 >Audit-Trail:
 >Unformatted:
  
 
 
 To Unsubscribe: send mail to majordomo@FreeBSD.org
 with "unsubscribe freebsd-bugs" in the body of the message
 
 

From: Brooks Davis <brooks@one-eyed-alien.net>
To: Danny Howard <dannyman@tellme.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: conf/21489: /etc/pccard_ether feature request
Date: Tue, 26 Sep 2000 19:04:00 -0700

 On Fri, Sep 22, 2000 at 07:29:52PM -0700, Danny Howard wrote:
 > I'd think you could write a script to plug in for pre-config.
 
 After some additional thought this is basically the approach I'm taking.
 I've attached a diff which adds support like your's except that it adds
 it to both /etc/pccard_ether and /etc/rc.network.  It also provides a
 method by which this code can reset the ifconfig arguments in the
 preifconfig code.  The reason is that if you know which network you
 attached to you may know more about how to configure your IP address
 then you did before.  Of the three ways I though about integrating this,
 your's turned out to be the cleanest IMO.
 
 If any committer wants to add this code, I'd suggest
 investigating the possibility of removing rc.network's support for
 /etc/start_if.<interface> files in favor of preifconfig as you can always
 add back support with preifconfig like this:
 
 preifconfig_fxp0=". /etc/start_if.fxp0"
 
 and I doubt start_if.* is widely used.
 
 > The trick is how the system would determine appropriate settings for a card
 > before it can even determine the network it is on.  My hunch is that the wi
 > driver should be able to try a few different settings, but this is a lot more
 > work than the simple kludge suggested here, which will get a lot of folks like
 > me working right away. :)
 
 Following a suggestion from someone at BSDi who had a personal script
 that does this, I've created a script which does just that though his
 attempted to acquire an IP via DHCP to check for a connection and mine
 instead just checks to see if you are talking to someone with appropriate
 parsing of the wicontrol and (soon) ancontrol output and lets the existing
 ifconfig code handle actually configuring an interface.
 
 Since I've spent a fair bit of time on this, I've got to run it past our
 software release board before I can submit it for inclusion, but I'm
 hoping that won't take more then a couple weeks.  In the mean time, I
 fully support integrating the attached patch or something with
 equivalent functionality as it paves the way for a full solution (which
 should make your network configuration work right out of the box.)
 
 -- Brooks
 
 -- 
 Any statement of the form "X is the one, true Y" is FALSE.
 
 --- /usr/src/etc/pccard_ether	Wed Sep 13 23:21:48 2000
 +++ pccard_ether	Tue Sep 26 17:39:09 2000
 @@ -19,6 +19,16 @@
  interface=$1
  shift
  
 +preifconfig_ifconfig=""
 +preifconfig_interface=${interface}
 +eval preifconfig=\$preifconfig_${interface}
 +if [ -n "${preifconfig}" ]; then
 +	$preifconfig
 +fi
 +if [ -n "${preifconfig_ifconfig}" ]; then
 +	pccard_ifconfig=${ifconfig}
 +fi
 +
  case ${pccard_ifconfig} in
  [Nn][Oo] | '')
          ;;
 --- /usr/src/etc/rc.network	Wed Sep  6 22:56:31 2000
 +++ rc.network	Tue Sep 26 17:40:13 2000
 @@ -91,9 +91,20 @@
  			eval showstat_$ifn=1
  		fi
  
 +		preifconfig_ifconfig=""
 +		preifconfig_interface=${ifn}
 +		eval preifconfig=\$preifconfig_${interface}
 +		if [ -n "${preifconfig}" ]; then
 +			$preifconfig
 +		fi
 +
  		# Do the primary ifconfig if specified
  		#
 -		eval ifconfig_args=\$ifconfig_${ifn}
 +		if [ -n "${preifconfig_ifconfig}" ]; then
 +			ifconfig_args=${ifconfig}
 +		else
 +			eval ifconfig_args=\$ifconfig_${ifn}
 +		fi
  
  		case ${ifconfig_args} in
  		'')
 
Responsible-Changed-From-To: freebsd-bugs->imp 
Responsible-Changed-By: unfurl 
Responsible-Changed-When: Wed May 30 22:37:20 PDT 2001 
Responsible-Changed-Why:  
imp asked for it 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21489 
State-Changed-From-To: open->closed 
State-Changed-By: imp 
State-Changed-When: Wed Nov 14 23:04:12 MST 2001 
State-Changed-Why:  
on freebsd, then can be done with the /etc/start_if.${interface} 
hook. 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21489 
>Unformatted:
 
