On 11/05/2014 11:02 AM, Matthew Gabeler-Lee wrote: > I've found that laptop-mode-tools shuts off the ethernet interface any time > I go on battery, even if it is in use. After some digging, I found the > cause. > > On at least my system (r8169 driver), any time ethtool is called to set the > advertised link speed, it causes a momentary loss of carrier. This causes > l-m-t to incorrectly think the link was not in use, and shut it off.
What do you mean by "shut it off" ?
I believe the ethernet is disabled, while on battery, only if the
corresponding setting is enabled in the config file.
> The
> temporary loss of carrier is an annoying behavior, but not l-m-t's fault.
> It does seem like something that may happen with many NICs, however, not
> just mine, so it seems like l-m-t ought to take the possibility into
> account.
In LMT, there is no special handling when a link goes down. We don't
trap/act on that.
>
> On a related note, the invocation of ethtool doesn't work at all on at least
> that chipset. Apparently it is necessary to include the duplex setting as
> well. Not including the duplex setting causes ethtool to emit "Cannot
> advertise speed X" ... but still causes the momentary carrier loss. I
> don't know if this requirement/limitation is specific to the r8169 driver.
> Including the duplex setting allows it to actually restrict the link speed.
I'm not sure what you mean here. Works for me..
The only catch you'll notice is that while on AC, my wired ethernet is
10Mb/s where as on BATT, it is 1000Mb/s. I guess it is for the fact that
I am not using my ethernet at all and have marked accordingly in my
config file. i.e....
*********************
# In practise, most of the times a user is on battery, she is using the
wireless device
# Under such cases, you might want to disable your ethernet interface
completely, when
# on battery.
#
# Set below setting to 1, to disable ethernet interface when on battery and
# when no carrier is detected on the interface (e.g., no active cable is
# plugged in).
DISABLE_ETHERNET_ON_BATTERY=1
*********************
While on AC.
14:05:42 rrs@learner:~$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Speed: 10Mb/s
Duplex: Half
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: no
While on Battery
14:05:46 rrs@learner:~$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: pumbg
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: no
--
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."
signature.asc
Description: OpenPGP digital signature

