/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <sun_sas.h>
/*
* Retrieves the mapping between targets and OS SCSI information
*/
{
int i, index;
int hbaPortFound = 0;
int domainPortFound = 0;
return (HBA_STATUS_ERROR_ARG);
}
/* on error, need to set NumberOfEntries to 0 */
mapping->NumberOfEntries = 0;
return (HBA_STATUS_ERROR_INVALID_HANDLE);
}
/*
* We should indicate an error if no domainPortWWN passed in.
*/
mapping->NumberOfEntries = 0;
return (HBA_STATUS_ERROR_ARG);
}
/*
* walk through the list of ports for this hba and count up the number
* of discovered ports on each hba port
*/
i = 0;
if (hbaPortFound == 0) {
/*
* HBA ports under the same HBA may have
* different LocalSASAddress. We should loop
* through the HBA port list to find the
* matching HBA port.
*/
continue;
} else {
hbaPortFound = 1;
}
}
/*
* Check whether the domainPortWWN matches.
*/
!= HBA_STATUS_OK) {
continue;
}
domainPortFound = 1;
hba_disco_port != NULL;
mapping_ptr != NULL;
/*
* Add the information as much as mapping
* can hold.
*/
continue;
}
sizeof (SMHBA_SCSIID));
PortLun, sizeof (SMHBA_PORTLUN));
sizeof (SMHBA_LUID));
i++;
}
}
}
}
/*
* check to make sure user has passed in an acceptable PortWWN for
* the given handle
*/
if (hbaPortFound == 0) {
"HBA Port WWN %016llx on handle %08lx",
return (HBA_STATUS_ERROR_ILLEGAL_WWN);
}
if (domainPortFound == 0) {
"port %016llx for port %016llx on handle "
return (HBA_STATUS_ERROR_ILLEGAL_WWN);
}
"total entries: %d: mapping->NumberofEntries: %d.",
return (HBA_STATUS_ERROR_MORE_DATA);
}
/* convert devpath to dev link */
return (HBA_STATUS_OK);
}