Print this page
4777 ibdm shouldn't abuse ddi_get_time(9f)
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Albert Lee <albert.lee@nexenta.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>


   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 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */



  25 
  26 #ifndef _SYS_IB_MGT_IBDM_IBDM_IBNEX_H
  27 #define _SYS_IB_MGT_IBDM_IBDM_IBNEX_H
  28 
  29 /*
  30  * This file contains the definitions of private interfaces
  31  * and data structures used between IB nexus and IBDM.
  32  */
  33 
  34 #include <sys/ib/ibtl/ibti_common.h>
  35 #include <sys/ib/mgt/ibmf/ibmf.h>
  36 #include <sys/ib/mgt/ib_dm_attr.h>
  37 
  38 #ifdef __cplusplus
  39 extern "C" {
  40 #endif
  41 
  42 /* DM return status codes from private interfaces */
  43 typedef enum ibdm_status_e {
  44         IBDM_SUCCESS = 0,


 198         uint16_t                pa_port_num;
 199         uint32_t                pa_vendorid;
 200         uint32_t                pa_productid;
 201         uint32_t                pa_dev_version;
 202         ibt_port_state_t        pa_state;
 203         ibmf_saa_handle_t       pa_sa_hdl;
 204         ibmf_impl_caps_t        pa_ibmf_caps;
 205         ibt_hca_hdl_t           pa_hca_hdl;
 206 } ibdm_port_attr_t;
 207 _NOTE(SCHEME_PROTECTS_DATA("Serialized access by cv", ibdm_port_attr_s))
 208 
 209 /*
 210  * HCA list structure.
 211  */
 212 typedef struct ibdm_hca_list_s {
 213         ibdm_port_attr_t        *hl_port_attr;          /* port attributes */
 214         struct ibdm_hca_list_s  *hl_next;               /* ptr to next list */
 215         ib_guid_t               hl_hca_guid;            /* HCA GUID */
 216         uint32_t                hl_nports;              /* #ports of this HCA */
 217         uint32_t                hl_nports_active;       /* #ports active */
 218         time_t                  hl_attach_time;         /* attach time */
 219         ibt_hca_hdl_t           hl_hca_hdl;             /* HCA handle */
 220         ibdm_port_attr_t        *hl_hca_port_attr;      /* Dummy Port Attr */
 221                                                         /* for HCA node */
 222 } ibdm_hca_list_t;
 223 _NOTE(SCHEME_PROTECTS_DATA("Serialized access by cv", ibdm_hca_list_s))
 224 
 225 /*
 226  * The DM callback definitions
 227  *
 228  * ibdm_callback_t
 229  *      Pointer to DM callback function
 230  *      IBDM notifies IB nexus of ibdm_event_t using this callback.
 231  * Arguments
 232  *      arg     : The value of "arg" depends on the "event"
 233  *              IBDM_EVENT_CREATE_HCA_NODE      (pointer to HCA GUID)
 234  *              IBDM_EVENT_REMOVE_HCA_NODE      (pointer to HCA GUID)
 235  *              IBDM_EVENT_IOC_PROP_UPDATE      (ibdm_ioc_info_t *)
 236  *
 237  *      event   : ibdm_event_t values
 238  *




   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 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 /*
  26  * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  27  */
  28 
  29 #ifndef _SYS_IB_MGT_IBDM_IBDM_IBNEX_H
  30 #define _SYS_IB_MGT_IBDM_IBDM_IBNEX_H
  31 
  32 /*
  33  * This file contains the definitions of private interfaces
  34  * and data structures used between IB nexus and IBDM.
  35  */
  36 
  37 #include <sys/ib/ibtl/ibti_common.h>
  38 #include <sys/ib/mgt/ibmf/ibmf.h>
  39 #include <sys/ib/mgt/ib_dm_attr.h>
  40 
  41 #ifdef __cplusplus
  42 extern "C" {
  43 #endif
  44 
  45 /* DM return status codes from private interfaces */
  46 typedef enum ibdm_status_e {
  47         IBDM_SUCCESS = 0,


 201         uint16_t                pa_port_num;
 202         uint32_t                pa_vendorid;
 203         uint32_t                pa_productid;
 204         uint32_t                pa_dev_version;
 205         ibt_port_state_t        pa_state;
 206         ibmf_saa_handle_t       pa_sa_hdl;
 207         ibmf_impl_caps_t        pa_ibmf_caps;
 208         ibt_hca_hdl_t           pa_hca_hdl;
 209 } ibdm_port_attr_t;
 210 _NOTE(SCHEME_PROTECTS_DATA("Serialized access by cv", ibdm_port_attr_s))
 211 
 212 /*
 213  * HCA list structure.
 214  */
 215 typedef struct ibdm_hca_list_s {
 216         ibdm_port_attr_t        *hl_port_attr;          /* port attributes */
 217         struct ibdm_hca_list_s  *hl_next;               /* ptr to next list */
 218         ib_guid_t               hl_hca_guid;            /* HCA GUID */
 219         uint32_t                hl_nports;              /* #ports of this HCA */
 220         uint32_t                hl_nports_active;       /* #ports active */
 221         hrtime_t                hl_attach_time;         /* attach time */
 222         ibt_hca_hdl_t           hl_hca_hdl;             /* HCA handle */
 223         ibdm_port_attr_t        *hl_hca_port_attr;      /* Dummy Port Attr */
 224                                                         /* for HCA node */
 225 } ibdm_hca_list_t;
 226 _NOTE(SCHEME_PROTECTS_DATA("Serialized access by cv", ibdm_hca_list_s))
 227 
 228 /*
 229  * The DM callback definitions
 230  *
 231  * ibdm_callback_t
 232  *      Pointer to DM callback function
 233  *      IBDM notifies IB nexus of ibdm_event_t using this callback.
 234  * Arguments
 235  *      arg     : The value of "arg" depends on the "event"
 236  *              IBDM_EVENT_CREATE_HCA_NODE      (pointer to HCA GUID)
 237  *              IBDM_EVENT_REMOVE_HCA_NODE      (pointer to HCA GUID)
 238  *              IBDM_EVENT_IOC_PROP_UPDATE      (ibdm_ioc_info_t *)
 239  *
 240  *      event   : ibdm_event_t values
 241  *