Print this page
10089 phy_check() is bitwise, should be streetwise

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/mii/mii.c
          +++ new/usr/src/uts/common/io/mii/mii.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26   26  /*
       27 + * Copyright (c) 2018, Joyent, Inc.
       28 + */
       29 +
       30 +/*
  27   31   * mii - MII/PHY support for MAC drivers
  28   32   *
  29   33   * Utility module to provide a consistent interface to a MAC driver accross
  30   34   * different implementations of PHY devices
  31   35   */
  32   36  
  33   37  #include <sys/types.h>
  34   38  #include <sys/debug.h>
  35   39  #include <sys/errno.h>
  36   40  #include <sys/param.h>
↓ open down ↓ 1475 lines elided ↑ open up ↑
1512 1516          } else {
1513 1517                  ph->phy_lp_aneg = !!(anexp & MII_AN_EXP_LPCANAN);
1514 1518  
1515 1519                  /*
1516 1520                   * Note: If the peer doesn't support autonegotiation, then
1517 1521                   * according to clause 28.5.4.5, the link partner ability
1518 1522                   * register will still have the right bits set.  However,
1519 1523                   * gigabit modes cannot use legacy parallel detection.
1520 1524                   */
1521 1525  
1522      -                if ((ph->phy_type == XCVR_1000T) &
     1526 +                if ((ph->phy_type == XCVR_1000T) &&
1523 1527                      (anexp & MII_AN_EXP_LPCANAN)) {
1524 1528  
1525 1529                          /* check for gige */
1526 1530                          msstat = phy_read(ph, MII_MSSTATUS);
1527 1531  
1528 1532                          ph->phy_lp_1000_hdx =
1529 1533                              !!(msstat & MII_MSSTATUS_LP1000T);
1530 1534  
1531 1535                          ph->phy_lp_1000_fdx =
1532 1536                              !!(msstat & MII_MSSTATUS_LP1000T_FD);
↓ open down ↓ 657 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX