On 11/06/2014 12:18 AM, Matthew Gabeler-Lee wrote:
>
>> 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.
>
> By shut it off, I mean running "ip link set dev eth0 down" to disable the
> interface -- /usr/share/laptop-mode-tools/modules/ethernet line 131.
>

That part is executed only if you instruct LMT to completely disable the
ethernet, when you switch to battery.  The setting for it is:
DISABLE_ETHERNET_ON_BATTERY=1

>>> 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..
>
> I think my hardware may have some limitations around the speed
> changing that
> yours does not have.

No. That's why I said. I believe I have the same hardware.
0f:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)

But honestly, I haven't used the ethernet since the last time I
installed on the laptop.

>
>> 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.
>
> This seems bass ackwards?  Wouldn't you want the on battery state to
> be the
> low speed to save power?  That's not really relevant to my problem
> though.
>

Yeah!! I need to investigate the cause. But like you know, many a times
it is the device drivers' bugs that end up reporting the wrong status.

> Running "ethtools -s eth0 speed 10" (or any other value for the speed)
> fails
> to set the speed limit on my system.  In order to set the speed limit
> on my
> system, you must also specify the duplex setting -- "ethtool -s eth0
> speed 10 duplex full" works properly, as does "... duplex half".
>

I don't see that working. Did you check the report back with ethtool ?
It still says the old speed and settings.

>> # when no carrier is detected on the interface (e.g., no active cable is
>> # plugged in).
>
> This is the other / more important aspect that is not working properly
> for
> me.
>
> Because of the call to ethtool to set the speed, it always sees
> NO-CARRIER
> when it checks this.  This temporary NO-CARRIER state happens even if the
> ethtool call gives the error described above, or if it succeeds, and
> even if
> the speed set is the same as the current speed.
>
> Switching the order of the "Handle throttling" and "Shut down interface"
> sections in the ethernet module script would be sufficient to fix the
> issue,
> at least as far as it can be fixed within the limitations of my hardware.

I am really confused here. But I'd be willing to take a patch if you
prepare.

>
> I don't think there's any way to fix the link loss every time the
> speed is
> set from l-m-t without breaking other systems.  I think that would
> need to
> be fixed in the driver, if possible ...  it may be a limitation of the
> hardware.
>


-- 
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to