Print this page
5255 uts shouldn't open-code ISP2

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/comstar/port/fct/discovery.c
          +++ new/usr/src/uts/common/io/comstar/port/fct/discovery.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  
       25 +#include <sys/sysmacros.h>
  25   26  #include <sys/conf.h>
  26   27  #include <sys/file.h>
  27   28  #include <sys/ddi.h>
  28   29  #include <sys/sunddi.h>
  29   30  #include <sys/modctl.h>
  30   31  #include <sys/scsi/scsi.h>
  31   32  #include <sys/scsi/impl/scsi_reset_notify.h>
  32   33  #include <sys/disp.h>
  33   34  #include <sys/byteorder.h>
  34   35  #include <sys/varargs.h>
↓ open down ↓ 177 lines elided ↑ open up ↑
 212  213  fct_li_to_txt(fct_link_info_t *li, char *topology, char *speed)
 213  214  {
 214  215          uint8_t s = li->port_speed;
 215  216  
 216  217          if (li->port_topology > PORT_TOPOLOGY_PUBLIC_LOOP) {
 217  218                  (void) sprintf(topology, "Invalid %02x", li->port_topology);
 218  219          } else {
 219  220                  (void) strcpy(topology, topologies[li->port_topology]);
 220  221          }
 221  222  
 222      -        if ((s == 0) || ((s & 0xf00) != 0) || ((s & (s - 1)) != 0)) {
      223 +        if ((s == 0) || ((s & 0xf00) != 0) || !ISP2(s)) {
 223  224                  speed[0] = '?';
 224  225          } else if (s == PORT_SPEED_10G) {
 225  226                  speed[0] = '1';
 226  227                  speed[1] = '0';
 227  228                  speed[2] = 'G';
 228  229                  speed[3] = 0;
 229  230          } else {
 230  231                  speed[0] = '0' + li->port_speed;
 231  232                  speed[1] = 'G';
 232  233                  speed[2] = 0;
↓ open down ↓ 2614 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX