fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
0c034175550709323575bc82b80a835256239e86Jiri Svoboda * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *(warg->linkpp) = strdup(di_devlink_path(devlink));
0c034175550709323575bc82b80a835256239e86Jiri Svoboda*getDeviceFileName(MP_UINT64 objectSequenceNumber)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "getDeviceFileName()", " - enter");
0c034175550709323575bc82b80a835256239e86Jiri Svoboda " - objectSequenceNumber: %llx",
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu " - $ERROR, di_init() failed");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cur_node = di_drv_first_node("scsi_vhci", root_node);
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu " - $ERROR, di_drv_first_node() failed");
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu " - found node.");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - $ERROR, di_devlink_init() failed.");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) snprintf(fullName, 511, "%s:%s", pathName, minorName);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memset(&warg, 0, sizeof (walk_devlink_t));
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu " - $ERROR, devLink is NULL.");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "MP_GetMPLogicalUnitProperties()", " - enter");
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu "oid.objectSequenceNumber = %llx",
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu "invalid driver file handle");
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu " - error exit");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memset(&mp_ioctl, 0, sizeof (mp_iocdata_t));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memset(&luInfo, 0, sizeof (mp_logical_unit_prop_t));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mp_ioctl.mp_ibuf = (caddr_t)&oid.objectSequenceNumber;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mp_ioctl.mp_ilen = sizeof (oid.objectSequenceNumber);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mp_ioctl.mp_olen = sizeof (mp_logical_unit_prop_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ioctlStatus = ioctl(g_scsi_vhci_fd, MP_CMD, &mp_ioctl);
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu "IOCTL call failed. IOCTL error is: %d",
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu "IOCTL call failed. IOCTL error is: %s",
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu "IOCTL call failed. mp_ioctl.mp_errno: %x",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mpStatus = getStatus4ErrorCode(mp_ioctl.mp_errno);
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu " - error exit");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memset(pProps, 0, sizeof (MP_MULTIPATH_LOGICAL_UNIT_PROPERTIES));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pProps->autoFailbackEnabled = luInfo.autoFailbackEnabled;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pProps->autoProbingEnabled = luInfo.autoProbingEnabled;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pProps->currentFailbackPollingRate = luInfo.currentFailBackPollingRate;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pProps->currentLoadBalanceType = luInfo.currentLoadBalanceType;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pProps->currentProbingPollingRate = luInfo.currentProbingPollingRate;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte deviceFileName = getDeviceFileName(oid.objectSequenceNumber);
6162934bde6d217b658d7a46f26727932be8f711Ramesh Chitrothu "deviceFileName: %s",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pProps->failbackPollingRateMax = luInfo.failbackPollingRateMax;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strncpy(pProps->name, luInfo.name, sizeof (pProps->name) - 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte overridePathOID.objectSequenceNumber = luInfo.overridePathID;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte overridePathOID.objectType = MP_OBJECT_TYPE_PATH_LU;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memcpy(&pProps->overridePath, &overridePathOID, sizeof (MP_OID));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pProps->probingPollingRateMax = luInfo.probingPollingRateMax;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "MP_GetMPLogicalUnitProperties()", " - exit");