]> git.baikalelectronics.ru Git - kernel.git/commit
r8169: Don't update statistics counters when interface is down
authorIvan Vecera <ivecera@redhat.com>
Sat, 7 Feb 2009 05:49:57 +0000 (21:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Feb 2009 05:49:57 +0000 (21:49 -0800)
commit1a46c7d0633da62e89cfb834c9af11ee20db51e7
treeefed57e98981e928f91c239075e4ed4bea5385ec
parent8e49f7bdeafff302e7304ab9b430939494832457
r8169: Don't update statistics counters when interface is down

Some Realtek chips (RTL8169sb/8110sb in my case) are unable to retrieve
ethtool statistics when the interface is down. The process stays in
endless loop in rtl8169_get_ethtool_stats. This is because these chips
need to have receiver enabled (CmdRxEnb bit in ChipCmd register) that is
cleared when the interface is going down. It's better to update statistics
only when the interface is up and otherwise return copy of statistics
grabbed when the interface was up (in rtl8169_close).

It is interesting that PCI-E NICs (like 8168b/8111b...) are not affected.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/r8169.c