Print this page
XXXX don't fail device detach when it's physically removed
   1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */

  21 /*
  22  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.



  23  * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
  24  * Copyright 2016 Joyent, Inc.
  25  * Copyright (c) 2016 by Delphix. All rights reserved.

  26  */
  27 
  28 #ifndef _SYS_DDI_IMPLDEFS_H
  29 #define _SYS_DDI_IMPLDEFS_H
  30 
  31 #include <sys/types.h>
  32 #include <sys/param.h>
  33 #include <sys/t_lock.h>
  34 #include <sys/ddipropdefs.h>
  35 #include <sys/devops.h>
  36 #include <sys/autoconf.h>
  37 #include <sys/mutex.h>
  38 #include <vm/page.h>
  39 #include <sys/dacf_impl.h>
  40 #include <sys/ndifm.h>
  41 #include <sys/epm.h>
  42 #include <sys/ddidmareq.h>
  43 #include <sys/ddi_intr.h>
  44 #include <sys/ddi_hp.h>
  45 #include <sys/ddi_hp_impl.h>


 193          */
 194         struct pm_info *devi_pm_info;           /* 0 => dev not power managed */
 195         uint_t          devi_pm_flags;          /* pm flags */
 196         int             devi_pm_num_components; /* number of components */
 197         size_t          devi_pm_comp_size;      /* size of devi_components */
 198         struct pm_component *devi_pm_components; /* array of pm components */
 199         struct dev_info *devi_pm_ppm;           /* ppm attached to this one */
 200         void            *devi_pm_ppm_private;   /* for use by ppm driver */
 201         int             devi_pm_dev_thresh;     /* "device" threshold */
 202         uint_t          devi_pm_kidsupcnt;      /* # of kids powered up */
 203         struct pm_scan  *devi_pm_scan;          /* pm scan info */
 204         uint_t          devi_pm_noinvolpm;      /* # of descendents no-invol */
 205         uint_t          devi_pm_volpmd;         /* # of voluntarily pm'ed */
 206         kmutex_t        devi_pm_lock;           /* pm lock for state */
 207         kmutex_t        devi_pm_busy_lock;      /* for component busy count */
 208 
 209         uint_t          devi_state;             /* device/bus state flags */
 210                                                 /* see below for definitions */
 211         kcondvar_t      devi_cv;                /* cv */
 212         int             devi_ref;               /* reference count */

 213 
 214         dacf_rsrvlist_t *devi_dacf_tasks;       /* dacf reservation queue */
 215 
 216         ddi_node_class_t devi_node_class;       /* Node class */
 217         int             devi_node_attributes;   /* Node attributes: See below */
 218 
 219         char            *devi_device_class;
 220 
 221         /*
 222          * New mpxio kernel hooks entries
 223          */
 224         int             devi_mdi_component;     /* mpxio component type */
 225         void            *devi_mdi_client;       /* mpxio client information */
 226         void            *devi_mdi_xhci;         /* vhci/phci info */
 227 
 228         ddi_prop_list_t *devi_global_prop_list; /* driver global properties */
 229         major_t         devi_major;             /* driver major number */
 230         ddi_node_state_t devi_node_state;       /* state of node */
 231         uint_t          devi_flags;             /* configuration flags */
 232         int             devi_circular;          /* for recursive operations */


   1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 /*
  27  * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
  28  * Copyright 2016 Joyent, Inc.
  29  * Copyright (c) 2016 by Delphix. All rights reserved.
  30  * Copyright 2018 Nexenta Systems, Inc.
  31  */
  32 
  33 #ifndef _SYS_DDI_IMPLDEFS_H
  34 #define _SYS_DDI_IMPLDEFS_H
  35 
  36 #include <sys/types.h>
  37 #include <sys/param.h>
  38 #include <sys/t_lock.h>
  39 #include <sys/ddipropdefs.h>
  40 #include <sys/devops.h>
  41 #include <sys/autoconf.h>
  42 #include <sys/mutex.h>
  43 #include <vm/page.h>
  44 #include <sys/dacf_impl.h>
  45 #include <sys/ndifm.h>
  46 #include <sys/epm.h>
  47 #include <sys/ddidmareq.h>
  48 #include <sys/ddi_intr.h>
  49 #include <sys/ddi_hp.h>
  50 #include <sys/ddi_hp_impl.h>


 198          */
 199         struct pm_info *devi_pm_info;           /* 0 => dev not power managed */
 200         uint_t          devi_pm_flags;          /* pm flags */
 201         int             devi_pm_num_components; /* number of components */
 202         size_t          devi_pm_comp_size;      /* size of devi_components */
 203         struct pm_component *devi_pm_components; /* array of pm components */
 204         struct dev_info *devi_pm_ppm;           /* ppm attached to this one */
 205         void            *devi_pm_ppm_private;   /* for use by ppm driver */
 206         int             devi_pm_dev_thresh;     /* "device" threshold */
 207         uint_t          devi_pm_kidsupcnt;      /* # of kids powered up */
 208         struct pm_scan  *devi_pm_scan;          /* pm scan info */
 209         uint_t          devi_pm_noinvolpm;      /* # of descendents no-invol */
 210         uint_t          devi_pm_volpmd;         /* # of voluntarily pm'ed */
 211         kmutex_t        devi_pm_lock;           /* pm lock for state */
 212         kmutex_t        devi_pm_busy_lock;      /* for component busy count */
 213 
 214         uint_t          devi_state;             /* device/bus state flags */
 215                                                 /* see below for definitions */
 216         kcondvar_t      devi_cv;                /* cv */
 217         int             devi_ref;               /* reference count */
 218         int             devi_gone;              /* devi gone, force clean */
 219 
 220         dacf_rsrvlist_t *devi_dacf_tasks;       /* dacf reservation queue */
 221 
 222         ddi_node_class_t devi_node_class;       /* Node class */
 223         int             devi_node_attributes;   /* Node attributes: See below */
 224 
 225         char            *devi_device_class;
 226 
 227         /*
 228          * New mpxio kernel hooks entries
 229          */
 230         int             devi_mdi_component;     /* mpxio component type */
 231         void            *devi_mdi_client;       /* mpxio client information */
 232         void            *devi_mdi_xhci;         /* vhci/phci info */
 233 
 234         ddi_prop_list_t *devi_global_prop_list; /* driver global properties */
 235         major_t         devi_major;             /* driver major number */
 236         ddi_node_state_t devi_node_state;       /* state of node */
 237         uint_t          devi_flags;             /* configuration flags */
 238         int             devi_circular;          /* for recursive operations */