2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _TGTFCHBAPORT_H
2N/A#define _TGTFCHBAPORT_H
2N/A
2N/A
2N/A
2N/A#include <Lockable.h>
2N/A#include <HBAPort.h>
2N/A#include <Exceptions.h>
2N/A#include <string>
2N/A#include <hbaapi.h>
2N/A#include <sys/fctio.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * Represents a single HBA port
2N/A */
2N/Aclass TgtFCHBAPort : public HBAPort {
2N/Apublic:
2N/A TgtFCHBAPort(std::string path);
2N/A virtual std::string getPath()
2N/A { return path; }
2N/A virtual uint64_t getNodeWWN()
2N/A { return nodeWWN; }
2N/A virtual uint64_t getPortWWN()
2N/A { return portWWN; }
2N/A virtual HBA_PORTATTRIBUTES getPortAttributes(
2N/A uint64_t &stateChange);
2N/A virtual HBA_PORTATTRIBUTES getDiscoveredAttributes(
2N/A HBA_UINT32 discoveredport,
2N/A uint64_t &stateChange);
2N/A virtual HBA_PORTATTRIBUTES getDiscoveredAttributes(
2N/A uint64_t wwn,
2N/A uint64_t &stateChange);
2N/A virtual void validatePresent();
2N/A virtual void getTargetMappings(
2N/A PHBA_FCPTARGETMAPPINGV2 userMappings) {
2N/A throw NotSupportedException(); }
2N/A virtual void getRNIDMgmtInfo(PHBA_MGMTINFO info) {
2N/A throw NotSupportedException(); }
2N/A virtual void sendCTPassThru(void *requestBuffer,
2N/A HBA_UINT32 requestSize,
2N/A void *responseBuffer,
2N/A HBA_UINT32 *responseSize) {
2N/A throw NotSupportedException(); }
2N/A virtual void sendRLS(uint64_t destWWN,
2N/A void *pRspBuffer,
2N/A HBA_UINT32 *pRspBufferSize);
2N/A virtual void sendRPL(uint64_t destWWN,
2N/A HBA_UINT32 agent_domain,
2N/A HBA_UINT32 port_index,
2N/A void *pRspBuffer,
2N/A HBA_UINT32 *pRspBufferSize) {
2N/A throw NotSupportedException(); }
2N/A virtual void sendRPS(uint64_t agentWWN,
2N/A HBA_UINT32 agentDomain,
2N/A uint64_t objectWWN,
2N/A HBA_UINT32 objectPortNum,
2N/A void *pRspBuffer,
2N/A HBA_UINT32 *pRspBufferSize) {
2N/A throw NotSupportedException(); }
2N/A virtual void sendSRL(uint64_t destWWN,
2N/A HBA_UINT32 agent_domain,
2N/A void *pRspBuffer,
2N/A HBA_UINT32 *pRspBufferSize) {
2N/A throw NotSupportedException(); }
2N/A virtual void sendLIRR(uint64_t destWWN,
2N/A HBA_UINT8 function,
2N/A HBA_UINT8 type,
2N/A void *pRspBuffer,
2N/A HBA_UINT32 *pRspBufferSize) {
2N/A throw NotSupportedException(); }
2N/A virtual void sendReportLUNs(uint64_t wwn,
2N/A void *responseBuffer, HBA_UINT32 *responseSize,
2N/A HBA_UINT8 *scsiStatus,
2N/A void *senseBuffer, HBA_UINT32 *senseSize) {
2N/A throw NotSupportedException(); }
2N/A virtual void sendScsiInquiry(uint64_t wwn, HBA_UINT64 fcLun,
2N/A HBA_UINT8 cdb1, HBA_UINT8 cdb2,
2N/A void *responseBuffer, HBA_UINT32 *responseSize,
2N/A HBA_UINT8 *scsiStatus, void *senseBuffer,
2N/A HBA_UINT32 *senseSize) {
2N/A throw NotSupportedException(); }
2N/A virtual void sendReadCapacity(uint64_t pwwn,
2N/A HBA_UINT64 fcLun, void *responseBuffer,
2N/A HBA_UINT32 *responseSize, HBA_UINT8 *scsiStatus,
2N/A void *senseBuffer, HBA_UINT32 *senseSize) {
2N/A throw NotSupportedException(); }
2N/A virtual void sendRNID(uint64_t destwwn, HBA_UINT32 destfcid,
2N/A HBA_UINT32 nodeIdDataFormat, void *pRspBuffer,
2N/A HBA_UINT32 *RspBufferSize) {
2N/A throw NotSupportedException(); }
2N/A virtual void setRNID(HBA_MGMTINFO info) {
2N/A throw NotSupportedException(); }
2N/A virtual HBA_PORTNPIVATTRIBUTES getPortNPIVAttributes(
2N/A uint64_t &stateChange) {
2N/A throw NotSupportedException(); }
2N/A virtual uint32_t createNPIVPort(
2N/A uint64_t vnodewwn,
2N/A uint64_t vportwwn,
2N/A uint32_t vindex) {
2N/A throw NotSupportedException(); }
2N/A virtual uint32_t deleteNPIVPort(
2N/A uint64_t vportwwn) {
2N/A throw NotSupportedException(); }
2N/A
2N/Aprivate:
2N/A std::string path;
2N/A uint64_t portWWN;
2N/A uint64_t nodeWWN;
2N/A uint32_t instanceNumber;
2N/A int controllerNumber;
2N/A static const std::string FCT_DRIVER_PATH;
2N/A static const int MAX_FCTIO_MSG_LEN;
2N/A static void transportError(uint32_t fcio_errno, char *message);
2N/A
2N/A // Wrapper routines to handle error cases
2N/A static void fct_ioctl(int cmd, fctio_t *arg);
2N/A};
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _TGTFCHBAPORT_H */