/*
* 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
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sun_sas.h>
/*
* Pass scsi request buffer into uscsi command and sent it out via ioctl
*/
static HBA_STATUS
{
return (status);
}
/*
* Send a SCSI report luns command to a remote WWN
*/
{
int chkDomainPort = 0;
int hbaPortFound = 0;
double duration;
/* Validate the arguments */
if (responseBuffer == NULL) {
return (HBA_STATUS_ERROR_ARG);
}
if (senseBuffer == NULL) {
return (HBA_STATUS_ERROR_ARG);
}
if (responseSize == NULL) {
return (HBA_STATUS_ERROR_ARG);
}
return (HBA_STATUS_ERROR_ARG);
}
if (scsiStatus == NULL) {
return (HBA_STATUS_ERROR_ARG);
}
return (HBA_STATUS_ERROR_INVALID_HANDLE);
}
/* Check for stale data */
if (status != HBA_STATUS_OK) {
return (status);
}
chkDomainPort = 1;
/* Determine which port to use */
hba_port_ptr != NULL;
if (hbaPortFound == 0) {
/*
* Since all the ports under the same HBA have
* the same LocalSASAddress, we should break
* the loop once we find it dosn't match.
*/
break;
} else {
hbaPortFound = 1;
}
}
if (chkDomainPort != 0) {
domainPortFound = 1;
}
if (!(domainPortFound)) {
continue;
}
}
hba_disco_port != NULL;
/*
* If discoveredPort is not given targetPort, skip
*/
/* Does not match */
continue;
}
/*
* target port
*/
"%016llx on handle %08lx is not a Target",
return (HBA_STATUS_ERROR_NOT_A_TARGET);
}
of %.4f seconds", duration);
return (status);
}
}
if (chkDomainPort) {
"Port %016llx on handle %08lx",
return (HBA_STATUS_ERROR_ILLEGAL_WWN);
}
}
if (hbaPortFound == 0) {
"Unable to locate requested Port WWN %016llx on "
} else if (chkDomainPort && !domainPortFound) {
" domainPortWWN %016llx on handle %08lx",
} else {
"Port WWN %016llx on handle %08lx",
}
return (HBA_STATUS_ERROR_ILLEGAL_WWN);
}