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 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
37 MP_GetPluginPropertiesPlugin(MP_PLUGIN_PROPERTIES
*pProps
)
39 mp_iocdata_t mp_ioctl
;
40 mp_driver_prop_t driverInfo
;
43 MP_STATUS mpStatus
= MP_STATUS_SUCCESS
;
45 log(LOG_INFO
, "MP_GetPluginPropertiesPlugin()", " - enter");
47 if (g_scsi_vhci_fd
< 0) {
48 log(LOG_INFO
, "MP_GetPluginPropertiesPlugin()",
49 "invalid driver file handle");
50 return (MP_STATUS_FAILED
);
53 (void) memset(pProps
, 0, sizeof (MP_PLUGIN_PROPERTIES
));
54 (void) memset(&mp_ioctl
, 0, sizeof (mp_iocdata_t
));
55 (void) memset(&driverInfo
, 0, sizeof (mp_driver_prop_t
));
57 mp_ioctl
.mp_cmd
= MP_GET_DRIVER_PROP
;
58 mp_ioctl
.mp_obuf
= (caddr_t
)&driverInfo
;
59 mp_ioctl
.mp_olen
= sizeof (mp_driver_prop_t
);
60 mp_ioctl
.mp_xfer
= MP_XFER_READ
;
62 ioctlStatus
= ioctl(g_scsi_vhci_fd
, MP_CMD
, &mp_ioctl
);
64 log(LOG_INFO
, "MP_GetPluginPropertiesPlugin()",
65 " IOCTL call returned: %d", ioctlStatus
);
67 if (ioctlStatus
< 0) {
71 if (ioctlStatus
!= 0) {
72 log(LOG_INFO
, "MP_GetPluginPropertiesPlugin()",
73 "IOCTL call failed. IOCTL error is: %d",
75 log(LOG_INFO
, "MP_GetPluginPropertiesPlugin()",
76 "IOCTL call failed. IOCTL error is: %s",
77 strerror(ioctlStatus
));
78 log(LOG_INFO
, "MP_GetPluginPropertiesPlugin()",
79 "IOCTL call failed. mp_ioctl.mp_errno: %x",
82 if (ENOTSUP
== ioctlStatus
) {
83 mpStatus
= MP_STATUS_UNSUPPORTED
;
84 } else if (0 == mp_ioctl
.mp_errno
) {
85 mpStatus
= MP_STATUS_FAILED
;
87 mpStatus
= getStatus4ErrorCode(mp_ioctl
.mp_errno
);
90 log(LOG_INFO
, "MP_GetPluginPropertiesPlugin()",
96 (void) wcsncpy(pProps
->vendor
, L
"Sun Microsystems", 255);
98 pProps
->autoFailbackSupport
= driverInfo
.autoFailbackSupport
;
99 pProps
->autoProbingSupport
= driverInfo
.autoProbingSupport
;
102 (void) mbstowcs(pProps
->buildTime
, BUILD_TIME
, 256);
105 pProps
->canOverridePaths
= driverInfo
.canOverridePaths
;
106 pProps
->canSetTPGAccess
= driverInfo
.canSetTPGAccess
;
107 pProps
->currentFailbackPollingRate
=
108 driverInfo
.currentFailbackPollingRate
;
109 pProps
->currentProbingPollingRate
=
110 driverInfo
.currentProbingPollingRate
;
111 pProps
->defaultloadBalanceType
=
112 driverInfo
.defaultLoadBalanceType
;
114 (void) strncpy(pProps
->deviceFileNamespace
,
115 driverInfo
.deviceFileNamespace
, 255);
117 (void) strncpy(pProps
->driverName
, "scsi_vhci", 255);
119 (void) wcsncpy(pProps
->driverVendor
, L
"Sun Microsystems", 255);
121 (void) mbstowcs(pProps
->driverVersion
, driverInfo
.driverVersion
, 256);
123 pProps
->exposesPathDeviceFiles
= driverInfo
.exposesPathDeviceFiles
;
124 pProps
->failbackPollingRateMax
= driverInfo
.failbackPollingRateMax
;
126 (void) strncpy(pProps
->fileName
, "libmpscsi_vhci.so", 255);
128 (void) wcsncpy(pProps
->implementationVersion
, L
"1.0.0.0", 255);
130 pProps
->maximumWeight
= driverInfo
.maximumWeight
;
131 pProps
->onlySupportsSpecifiedProducts
=
132 driverInfo
.onlySupportsSpecifiedProducts
;
134 pProps
->pluginAutoFailbackEnabled
= driverInfo
.autoFailbackEnabled
;
135 pProps
->pluginAutoProbingEnabled
= driverInfo
.autoProbingEnabled
;
137 pProps
->probingPollingRateMax
= driverInfo
.probingPollingRateMax
;
139 pProps
->supportedLoadBalanceTypes
=
140 driverInfo
.supportedLoadBalanceTypes
;
141 pProps
->supportedMpVersion
= MP_LIBVERSION
;
144 log(LOG_INFO
, "MP_GetPluginPropertiesPlugin()", " - exit");
146 return (MP_STATUS_SUCCESS
);