]> git.baikalelectronics.ru Git - kernel.git/commit
tg3: Update link_up flag for phylib devices
authorNithin Sujir <nsujir@broadcom.com>
Fri, 8 Mar 2013 08:01:24 +0000 (08:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Mar 2013 18:14:58 +0000 (13:14 -0500)
commitb193fd86faa29f4227f659eca5412382cf531f8d
treee0a6b178ea560ea57da344c3bdae8cf93179f0cc
parent8a4eb236cc399cff0f5073cb36b8897daccaa76a
tg3: Update link_up flag for phylib devices

Commit 5de8fdd65b0f611657c0eec1d5882cb4f0d1fd15 introduced a bug where
the ifconfig stats would remain 0 for phylib devices. This is due to
tp->link_up flag never becoming true causing tg3_periodic_fetch_stats()
to return.

The link_up flag was being updated in tg3_test_and_report_link_chg()
after setting up the phy. This function however, is not called for
phylib devices since the driver does not do the phy setup.

This patch moves the link_up flag update into the common
tg3_link_report() function that gets called for phylib devices as well
for non phylib devices when the link state changes.

To avoid updating link_up twice, we replace tg3_carrier_...() calls that
are followed by tg3_link_report(), with netif_carrier_...(). We can then
remove the unused tg3_carrier_on() function.

CC: <stable@vger.kernel.org>
Reported-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c