Author: np
Date: Sat Mar 24 01:07:58 2018
New Revision: 331472
URL: https://svnweb.freebsd.org/changeset/base/331472

Log:
  cxgbe(4): Always initialize requested_speed to a valid value.
  
  This fixes an avoidable EINVAL when the user tries to disable AN after
  the port is initialized but l1cfg doesn't have a valid speed to use.
  
  MFC after:    1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c        Sat Mar 24 00:26:42 2018        
(r331471)
+++ head/sys/dev/cxgbe/t4_main.c        Sat Mar 24 01:07:58 2018        
(r331472)
@@ -3981,12 +3981,11 @@ init_l1cfg(struct port_info *pi)
 
        ASSERT_SYNCHRONIZED_OP(sc);
 
+       lc->requested_speed = port_top_speed(pi);       /* in Gbps */
        if (t4_autoneg != 0 && lc->supported & FW_PORT_CAP_ANEG) {
                lc->requested_aneg = AUTONEG_ENABLE;
-               lc->requested_speed = 0;
        } else {
                lc->requested_aneg = AUTONEG_DISABLE;
-               lc->requested_speed = port_top_speed(pi);       /* in Gbps */
        }
 
        lc->requested_fc = t4_pause_settings & (PAUSE_TX | PAUSE_RX);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to