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.
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.
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]
22 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
37 MP_UINT32 g_pluginOwnerID
= 0;
38 int g_scsi_vhci_fd
= -1;
40 PROPERTY_CALLBACK_NODE g_Property_Callback_List
[MP_OBJECT_TYPE_MAX
+ 1];
41 VISIBILITY_CALLBACK_NODE g_Visibility_Callback_List
[MP_OBJECT_TYPE_MAX
+ 1];
43 sysevent_handle_t
*g_SysEventHandle
= NULL
;
45 pthread_mutex_t g_visa_mutex
= PTHREAD_MUTEX_INITIALIZER
;
46 pthread_mutex_t g_prop_mutex
= PTHREAD_MUTEX_INITIALIZER
;
49 * Called by the common layer to request the plugin to initialize
54 Initialize(MP_UINT32 pluginOwnerID
)
56 log(LOG_INFO
, "Initialize()", " - enter");
59 (void) memset(&g_Property_Callback_List
, 0,
60 sizeof (PROPERTY_CALLBACK_NODE
) * (MP_OBJECT_TYPE_MAX
+ 1));
62 (void) memset(&g_Visibility_Callback_List
, 0,
63 sizeof (VISIBILITY_CALLBACK_NODE
) * (MP_OBJECT_TYPE_MAX
+ 1));
65 /* Attempt to open the driver that this plugin will make request of. */
66 g_scsi_vhci_fd
= open("/devices/scsi_vhci:devctl",
69 if (g_scsi_vhci_fd
< 0) {
70 log(LOG_INFO
, "Initialize()",
71 " - failed to open driver. error is : %s",
73 log(LOG_INFO
, "Initialize()", " - error exit");
74 return (MP_STATUS_FAILED
);
77 g_pluginOwnerID
= pluginOwnerID
;
79 log(LOG_INFO
, "Initialize()", " - exit");
81 return (MP_STATUS_SUCCESS
);