• Francois Romieu's avatar
    r8169: link speed selection timer rework. · 4876cc1e
    Francois Romieu authored
    The implementation was a bit krusty.
    
    The 10s rtl8169_phy_timer timer has been (was ?) required with older
    8169 for adequate phy operation when full gigabit is advertised in
    autonegotiated mode. The timer does nothing if the link is up.
    Otherwise it keeps resetting the phy until things improve.
    
    - the device private data field phy_1000_ctrl_reg was used to
      schedule the timer. Avoid it and save a few bytes.
    
    - rtl8169_set_settings
      pending timer is disabled before changing the link settings as
      rtl8169_phy_timer is not always needed (see the removed test in
      rtl8169_phy_timer).
    
    - rtl8169_set_speed
      the requested link parameters may not match the chipset : bail out
      early on failure.
    
    - rtl8169_open
      Calling rtl8169_request_timer is redundant with
      -> rtl8169_open
         -> rtl8169_init_phy
            -> rtl8169_set_speed
               -> mod_timer
      The latter always enables the phy timer whereas the former did not
      for RTL_GIGA_MAC_VER_01. It should not make things worse but only
      time will tell if reality agrees.
    
    - rtl8169_request_timer : unused yet. Removed.
    
    - rtl8169_delete_timer : useless. Bloat. Removed.
    
    Side effect : the timer may kick in if the TBI is enabled. I do not
    know if the TBI has ever been used in real life.
    Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
    Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
    4876cc1e
r8169.c 129 KB