3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * CDDL HEADER START
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * The contents of this file are subject to the terms of the
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * Common Development and Distribution License (the "License").
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * You may not use this file except in compliance with the License.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * or http://www.opensolaris.org/os/licensing.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * See the License for the specific language governing permissions
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * and limitations under the License.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * When distributing Covered Code, include this CDDL HEADER in each
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * If applicable, add the following below this CDDL HEADER, with the
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * fields enclosed by brackets "[]" replaced with your own identifying
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * information: Portions Copyright [yyyy] [name of copyright owner]
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * CDDL HEADER END
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * The plugin library will call MP_CMD ioctl with
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * MP_GET_TARGET_PORT_LIST_FOR_TPG subcommand.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * For each target port, the plugin will get the target port name property.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * A scsi_vhci device with pathinfo containing matching target port name
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * may potentially be associated with the given TPG.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * The plugin library will check the TPG list for qualifying scsi_vhci
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * devices and find a matching TPG id.
99054f32a1766b8a8f60509cb724359413171d1dBrendan Mmiller * An rfe was filed against MDI to
99054f32a1766b8a8f60509cb724359413171d1dBrendan Mmiller * refresh DINFOCACHE snapshot for pathinfo update.
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller * Returns MP_TRUE if the ID found in the dev info snapshot matches the ID
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller * provided by the schi_vhci driver.
3a666413480ef97101461705e1f47cbab0266301Brendan Mmillerstatic int checkTPGList(MP_UINT32 tpgID, MP_UINT64 objectSequenceNumber)
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller log(LOG_INFO, "checkTPGList()", " - enter");
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller luOID.objectSequenceNumber = objectSequenceNumber;
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller luOID.objectType = MP_OBJECT_TYPE_MULTIPATH_LU;
ba208d3f0e9d48f3c841cdd627f200a7bb04cea8Brendan Mmiller mpStatus = getAssociatedTPGOidList(luOID, &ppList);
99054f32a1766b8a8f60509cb724359413171d1dBrendan Mmiller " - getAssociatedTPGOidList() failed: %d",
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller for (tpg = 0; tpg < ppList->oidCount; tpg++) {
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller mpStatus = getTargetPortGroupProperties(ppList->oids[tpg],
99054f32a1766b8a8f60509cb724359413171d1dBrendan Mmiller " - getTargetPortGroupProperties() failed: %d",
99054f32a1766b8a8f60509cb724359413171d1dBrendan Mmiller " - found a match");
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * Returns the number of matches found. If pOidList is not NULL, then
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * populate it. A return values of -1 indicates and error, zerom menas
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * no match is found.
99054f32a1766b8a8f60509cb724359413171d1dBrendan Mmillerstatic int getOidList(di_node_t root_node, int tpgID,
if (ioctlStatus < 0) {
if (ioctlStatus != 0) {
match = 0;
if (match) {
if (status < 0) {
status);
osn = 0;
osn);
if (haveList &&
osn;
++numNodes;
return (numNodes);
mpStatus);
return (mpStatus);
return (mpStatus);
return (MP_STATUS_FAILED);
if (numNodes < 0) {
return (MP_STATUS_FAILED);
if (0 == numNodes) {
return (MP_STATUS_INSUFFICIENT_MEMORY);
return (MP_STATUS_SUCCESS);
return (MP_STATUS_INSUFFICIENT_MEMORY);
return (MP_STATUS_SUCCESS);