/*
* 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 <unistd.h>
#include <TgtFCHBA.h>
#include <Exceptions.h>
#include <Trace.h>
#include <iostream>
#include <iomanip>
#include <cerrno>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#include <stropts.h>
#include <TgtFCHBAPort.h>
#include <HBAList.h>
#include <sun_fc.h>
using namespace std;
{
// Add a target FCHBA port. With fct driver architecuture, all target mode
// FCHBA will have a single port regardless of the multiport support on
// FCA layer.
try {
name += "-";
name += "-Tgt";
} catch (HBAException &e) {
throw e;
}
}
{
return (name);
}
{
int fd;
errno = 0;
throw IllegalIndexException();
}
// Why did we fail?
throw BusyException();
throw TryAgainException();
throw NotSupportedException();
} else {
}
}
try {
if (offset >= 0) {
}
} catch (...) {
throw BadArgumentException();
}
errno = 0;
throw BusyException();
throw TryAgainException();
throw NotSupportedException();
} else {
throw IOError("Unable to fetch adapter attributes");
}
}
/* Now copy over the payload */
return (attributes);
}
{
int fd;
errno = 0;
throw BusyException();
throw TryAgainException();
throw NotSupportedException();
} else {
}
}
try {
if (offset >= 0) {
}
} catch (...) {
throw BadArgumentException();
}
errno = 0;
throw BusyException();
throw TryAgainException();
throw NotSupportedException();
} else {
throw IOError("Unable to reinitialize the link");
}
} else {
return ((int)fctio.fctio_errno);
}
}
{
int fd;
bool retry = false;
int bufSize;
/* Before we do anything, let's see if FCT is on the system */
errno = 0;
"The %s driver is not present."
" Please install the %s package.",
throw NotSupportedException();
} else {
"Can not stat the %s driver for reason \"%s\" "
"Unable to get target mode FC adapters.",
throw IOError("Unable to stat FCSM driver");
}
}
/* construct fcio struct */
/* open the fcsm node so we can send the ioctl to */
errno = 0;
throw BusyException();
throw TryAgainException();
throw NotSupportedException();
throw UnavailableException();
} else {
throw IOError("Unable to open FCT driver");
}
}
do {
retry = false;
errno = 0;
/* Interpret the fcio error code */
"TGT_ADAPTER_LIST failed: "
"Errno: \"%s\"",
delete (tgthbaList);
throw BusyException();
throw TryAgainException();
throw NotSupportedException();
throw UnavailableException();
} else {
throw IOError("Unable to build HBA list");
}
}
"Buffer too small for number of target mode HBAs. Retrying.");
retry = true;
delete (tgthbaList);
}
} while (retry);
for (int i = 0; i < tgthbaList->numPorts; i++) {
try {
hbapath += ".";
// move the row with two dimentional uint8 array for WWN
} catch (...) {
"Ignoring partial failure while loading an HBA");
}
}
delete(tgthbaList);
throw InternalError(
"Exceeds max number of adatpers that VSL supports.");
}
delete (tgthbaList);
}