Skip to content
  • Nithin Sujir's avatar
    tg3: Update link_up flag for phylib devices · 84421b99
    Nithin Sujir authored
    Commit f4a46d1f
    
     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: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
    Signed-off-by: default avatarNithin Nayak Sujir <nsujir@broadcom.com>
    Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    84421b99