| Summary: | /etc/pccard_ether feature request | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | dannyman <dannyman> | ||||
| Component: | conf | Assignee: | Warner Losh <imp> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.1-RELEASE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
dannyman
2000-09-23 02:22:08 UTC
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. Fix: Diffs: 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. 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
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.
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 imp asked for it State Changed
From-To: open->closed
on freebsd, then can be done with the /etc/start_if.${interface}
hook.
|