Print this page
NEX-3705 Need to update libses with LID/USN code from sesctld
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/scsi/libscsi/common/scsi_engine.c
          +++ new/usr/src/lib/scsi/libscsi/common/scsi_engine.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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  /*
  23   23   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  24   25   */
  25   26  
  26   27  #include <sys/types.h>
  27   28  #include <sys/isa_defs.h>
  28   29  #include <sys/systeminfo.h>
  29   30  #include <sys/scsi/generic/commands.h>
  30   31  #include <sys/scsi/impl/commands.h>
  31   32  #include <sys/scsi/impl/uscsi.h>
  32   33  
  33   34  #include <stdio.h>
↓ open down ↓ 157 lines elided ↑ open up ↑
 191  192          tp->lst_engine = ep;
 192  193          tp->lst_priv = private;
 193  194  
 194  195          ++hp->lsh_targets;
 195  196  
 196  197          if (libscsi_get_inquiry(hp, tp) != 0) {
 197  198                  libscsi_close(hp, tp);
 198  199                  return (NULL);
 199  200          }
 200  201  
      202 +        if (libscsi_get_inquiry_dev_id(hp, tp) != 0)
      203 +                tp->lst_lid = NULL;
      204 +        if (libscsi_get_inquiry_usn(hp, tp) != 0)
      205 +                tp->lst_usn = NULL;
      206 +
 201  207          return (tp);
 202  208  }
 203  209  
 204  210  libscsi_hdl_t *
 205  211  libscsi_get_handle(libscsi_target_t *tp)
 206  212  {
 207  213          return (tp->lst_hdl);
 208  214  }
 209  215  
 210  216  void
 211  217  libscsi_close(libscsi_hdl_t *hp, libscsi_target_t *tp)
 212  218  {
 213  219          tp->lst_engine->lse_ops->lseo_close(hp, tp->lst_priv);
 214  220          libscsi_free(hp, tp->lst_vendor);
 215  221          libscsi_free(hp, tp->lst_product);
 216  222          libscsi_free(hp, tp->lst_revision);
      223 +        if (tp->lst_lid != NULL)
      224 +                libscsi_free(hp, tp->lst_lid);
      225 +        if (tp->lst_usn != NULL)
      226 +                libscsi_free(hp, tp->lst_usn);
 217  227          libscsi_free(hp, tp);
 218  228          --hp->lsh_targets;
 219  229  }
 220  230  
 221  231  sam4_status_t
 222  232  libscsi_action_get_status(const libscsi_action_t *ap)
 223  233  {
 224  234          const libscsi_action_impl_t *aip = (const libscsi_action_impl_t *)ap;
 225  235  
 226  236          return (aip->lsai_status);
↓ open down ↓ 392 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX