Bug 93681 - ipw radio turned on needlessly
Summary: ipw radio turned on needlessly
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Florent Thoumie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-21 23:40 UTC by adrian
Modified: 2006-05-08 10:38 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description adrian 2006-02-21 23:40:03 UTC
	At boot time the radio is turned on regardless of whether the
	network is being configured.  This is unecessary as the radio
	is automatically turned on when the network is configured
	using either ifconfig or dhclient.

	This just burns battery life without accomplishing anything when
	you do not need the ipw(4) interface configured.

Fix: 

--- /etc/rc.d/ipw	2006/02/21 13:54:23	1.1
+++ /etc/rc.d/ipw	2006/02/21 13:54:36
@@ -51,7 +51,6 @@
 		eval _file=\$_ipw_file_${i}
 		echo -n " [${i}:${_mode:=bss}]"
 		${command} -i ${i} -f /boot/firmware/${_file}
-		ifconfig ${i} up
 	done
 	echo "."
 }
How-To-Repeat: 
	Put the follwing in /etc/rc.conf.local to cause the ipw(4) firmware
	to be loaded at boot-time:

	ipw_enable="YES"

        This is necessary, before the interface can be configured by 
	any system utilities.

	Next add the following to /etc/rc.conf.local, so that the interfaces
	may be configured via DHCP, but not automatically at boot-time:

	ifconfig_DEFAULT="DHCP NOAUTO"

	Now reboot the system.

	When the system boots up, the /etc/rc.d/ipw start sequence executes
	"ifconfig ${i} up" which turns on the radio.  This is unecessary.

	If the diff below is applied, the system will boot as before, but
	not turn on the NIC radio.

	If you configure the interface using either ifconfig directly, or 
	by running "/etc/rc.d/dhclient ipw0 start", the NIC radio will be 
	turned on automatically.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-02-22 00:19:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->flz

Over to maintainer
Comment 2 Florent Thoumie freebsd_committer freebsd_triage 2006-02-22 00:33:03 UTC
State Changed
From-To: open->suspended
Comment 3 Florent Thoumie freebsd_committer freebsd_triage 2006-02-22 00:33:34 UTC
State Changed
From-To: suspended->analyzed

Marking the interface as UP doesn't turn on the radio on my Dell 
Latitude D800.  Sem had problems without the line you want to remove. 
I'll try to test this ASAP.
Comment 4 adrian 2006-02-22 22:49:45 UTC
        Well, on an IBM X31 it certainly does.  See below:

: adrian@atf;
: adrian@atf; ipwcontrol ipw0 -r
Radio is OFF
: adrian@atf; sudo ifconfig ipw0 up
: adrian@atf; ipwcontrol ipw0 -r
Radio is ON
: adrian@atf; sudo ifconfig ipw0 down
: adrian@atf; ipwcontrol ipw0 -r
Radio is OFF
: adrian@atf; sudo ifconfig ipw0 up
: adrian@atf; ipwcontrol ipw0 -r
Radio is ON
: adrian@atf;

	Adrian
-- 
[ adrian@ubergeeks.com ]
Comment 5 adrian 2006-03-09 14:22:33 UTC
 	This may be an issue with IBM Thinkpads, if Dell's don't exhibit 
this behavior.

 	I had to move my X31 disk to a T42 because the X31 died.  The T42 
has the iwi(4) wireless NIC instead of the ipw(4).  The rc.d script 
exhibits the exact same behavior.  It brings up the the interface when 
"ifconfig iwi0 up" is run.

 	The new wrinkle is that dhclient get started if this happens at 
boot-time and configures the NIC despite my having put

 	ifconfig_DEFAULT="DHCP NOAUTO"

in the /etc/rc.conf.local file.  This may be a separate issue though.  I 
just know that taking out the "ifconfig ${i} up" line in /etc/rc.d/iwi 
takes care of this.  Running "/etc/rc.d/dhclient start iwi0" still brings 
up the interface and uses dhcp just fine.

 	Here's what's changed since my original report:

Updated the OS to:

FreeBSD atf.cs.virginia.edu 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #5: Sat Feb 25 14:38:40 EST 2006     adrian@atf.cs.virginia.edu:/usr/obj/usr/src/sys/ThinkPad_X31  i386

Now using this NIC firmware package:

iwi-firmware-2.4_2

If this is deemed a real problem, both ports should be fixed.

 	Adrian
-- 
[ adrian@ubergeeks.com ]
Comment 6 Florent Thoumie freebsd_committer freebsd_triage 2006-05-08 10:38:17 UTC
State Changed
From-To: analyzed->closed

Committed. Thanks!