Bug#511653: laptop-mode-tools: When the wireless interface is down, wireless-iwl-power fails

2009-01-25 Thread Bart Samwel
Hi Costas,

cost...@students.cs.unipi.gr wrote:
 Quoting Bart Samwel b...@samwel.tk:
 
 Thanks for reporting and contributing. Apparently we cannot tell the
 driver to use a certain power level when the hardware is disabled...
 This is a shame, because the power level will be incorrect when the
 device is re-enabled -- laptop mode tools doesn't re-apply settings when
 interfaces are enabled or disabled.

 I wonder, does this problem happen only when the hardware kill switch is
 used? Or does this already go wrong if you just do an ifdown on your
 device (as indicated by /sys/class/net/$DEVICE/operstate)? I wonder if
 there are other things that can't be used if the device's radio is
 killed. Might be worth a submitting a bug report to the iwl guys...

 Cheers,
 Bart

 
 Hello again Bart,
 
 When I submitted the bug, the wireless was killed by the hardware rf switch on
 boot.
 If it is killed by the switch,
 cat /sys/class/net/wlan0/device/enable gives 0
 cat /sys/class/net/wlan0/operstate gives down
 
 Now, if i turn the rf switch to on and keep the interface down:
 cat /sys/class/net/wlan0/device/enable gives 0
 cat /sys/class/net/wlan0/operstate gives down
 
 During ifconfig ups/ifconfig downs /sys/../operstate remains down,
 /sys/../enable changes according to up/down.
 As it seems, for operstate to work i have to be connected to an ap.
 ifconfig wlan0 up just doesn't change it.
 
 In my /etc/network/interfaces i have no section for wlan0.
 
 The /sys/class/net/wlan0/device/enable maybe better for laptop-mode, because
 many people don't have an rf switch or are not connected to ap at boot.

I've reported this problem upstream because I really don't think this
should be my problem to solve:

http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1893

If they don't respond positively I'll have to reconsider, but for now
I'll wait to see what they say!

Cheers,
Bart



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#511653: laptop-mode-tools: When the wireless interface is down, wireless-iwl-power fails

2009-01-13 Thread Bart Samwel
Hi Constantinos,

Constantinos Drogos wrote:
 Hello.
 In my system, wireless-iwl-power module fails at startup of 
 laptop-mode-tools, if the wireless 
 interface are not up.
 The error seems to be that the scriptcannot write power level to
 /sys/class/net/$DEVICE/device/power_level if $DEVICE is down.
 The error showed is: 
 /usr/share/laptop-mode-tools/modules/wireless-iwl-power: line 48: echo: 
 write error: 
 Resource temporarily unavailable
 
 The driver used is the iwl3945.
 
 The error seems to be corrected if everytime it searches for an interface, it 
 checks if it is 
 up via /sys/class/net/$DEVICE/device/enable (1 for up, 0 for down)
 
 This change seems to work at least in my computer:

Thanks for reporting and contributing. Apparently we cannot tell the
driver to use a certain power level when the hardware is disabled...
This is a shame, because the power level will be incorrect when the
device is re-enabled -- laptop mode tools doesn't re-apply settings when
interfaces are enabled or disabled.

I wonder, does this problem happen only when the hardware kill switch is
used? Or does this already go wrong if you just do an ifdown on your
device (as indicated by /sys/class/net/$DEVICE/operstate)? I wonder if
there are other things that can't be used if the device's radio is
killed. Might be worth a submitting a bug report to the iwl guys...

Cheers,
Bart



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#511653: laptop-mode-tools: When the wireless interface is down, wireless-iwl-power fails

2009-01-13 Thread costasd
Quoting Bart Samwel b...@samwel.tk:


 Thanks for reporting and contributing. Apparently we cannot tell the
 driver to use a certain power level when the hardware is disabled...
 This is a shame, because the power level will be incorrect when the
 device is re-enabled -- laptop mode tools doesn't re-apply settings when
 interfaces are enabled or disabled.

 I wonder, does this problem happen only when the hardware kill switch is
 used? Or does this already go wrong if you just do an ifdown on your
 device (as indicated by /sys/class/net/$DEVICE/operstate)? I wonder if
 there are other things that can't be used if the device's radio is
 killed. Might be worth a submitting a bug report to the iwl guys...

 Cheers,
 Bart


Hello again Bart,

When I submitted the bug, the wireless was killed by the hardware rf switch on
boot.
If it is killed by the switch,
cat /sys/class/net/wlan0/device/enable gives 0
cat /sys/class/net/wlan0/operstate gives down

Now, if i turn the rf switch to on and keep the interface down:
cat /sys/class/net/wlan0/device/enable gives 0
cat /sys/class/net/wlan0/operstate gives down

During ifconfig ups/ifconfig downs /sys/../operstate remains down,
/sys/../enable changes according to up/down.
As it seems, for operstate to work i have to be connected to an ap.
ifconfig wlan0 up just doesn't change it.

In my /etc/network/interfaces i have no section for wlan0.

The /sys/class/net/wlan0/device/enable maybe better for laptop-mode, because
many people don't have an rf switch or are not connected to ap at boot.







--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#511653: laptop-mode-tools: When the wireless interface is down, wireless-iwl-power fails

2009-01-12 Thread Constantinos Drogos
Package: laptop-mode-tools
Version: 1.45-1
Severity: normal


Hello.
In my system, wireless-iwl-power module fails at startup of laptop-mode-tools, 
if the wireless 
interface are not up. The error seems to be that the scriptcannot write power 
level to 
/sys/class/net/$DEVICE/device/power_level if $DEVICE is down.
The error showed is: /usr/share/laptop-mode-tools/modules/wireless-iwl-power: 
line 48: echo: write error: 
Resource temporarily unavailable

The driver used is the iwl3945.

The error seems to be corrected if everytime it searches for an interface, it 
checks if it is 
up via /sys/class/net/$DEVICE/device/enable (1 for up, 0 for down)

This change seems to work at least in my computer:

--- wireless-iwl-power  2009-01-13 03:52:00.0 +0200
+++ wireless-iwl-power-new  2009-01-13 04:34:10.0 +0200
@@ -16,6 +16,7 @@
 findWifiIfsByDriver () {
local DEVICE;
local LINK_TARGET;
+local ENABLED;

for DEVICE in /sys/class/net/*; do
if [ -d $DEVICE/wireless -a -h $DEVICE/device/driver ]; then
@@ -23,8 +24,8 @@
# the driver.
LINK_TARGET=`readlink $DEVICE/device/driver`
LINK_TARGET=${LINK_TARGET##*/}
-
-   if [ $LINK_TARGET = $1 ] ; then
+ENABLED=`cat $DEVICE/device/enable`
+   if [ $LINK_TARGET = $1 ]  [ $ENABLED -eq 1 ] ; 
then
# add the interface name to the list
WIFI_IFNAMES=$WIFI_IFNAMES ${DEVICE##*/}



-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable'), (500, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-2-erebus (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages laptop-mode-tools depends on:
ii  lsb-base  3.2-20 Linux Standard Base 3.2 init scrip
ii  util-linux2.13.1.1-1 Miscellaneous system utilities

Versions of packages laptop-mode-tools recommends:
ii  acpid 1.0.8-1Utilities for using ACPI power man
ii  hal   0.5.11-8   Hardware Abstraction Layer
ii  hdparm8.9-3  tune hard disk parameters for high
ii  sdparm1.02-1 Output and modify SCSI device para

laptop-mode-tools suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org