1*7836SJohn.Forte@Sun.COM /* 2*7836SJohn.Forte@Sun.COM * CDDL HEADER START 3*7836SJohn.Forte@Sun.COM * 4*7836SJohn.Forte@Sun.COM * The contents of this file are subject to the terms of the 5*7836SJohn.Forte@Sun.COM * Common Development and Distribution License (the "License"). 6*7836SJohn.Forte@Sun.COM * You may not use this file except in compliance with the License. 7*7836SJohn.Forte@Sun.COM * 8*7836SJohn.Forte@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*7836SJohn.Forte@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*7836SJohn.Forte@Sun.COM * See the License for the specific language governing permissions 11*7836SJohn.Forte@Sun.COM * and limitations under the License. 12*7836SJohn.Forte@Sun.COM * 13*7836SJohn.Forte@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*7836SJohn.Forte@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*7836SJohn.Forte@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*7836SJohn.Forte@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*7836SJohn.Forte@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*7836SJohn.Forte@Sun.COM * 19*7836SJohn.Forte@Sun.COM * CDDL HEADER END 20*7836SJohn.Forte@Sun.COM */ 21*7836SJohn.Forte@Sun.COM /* 22*7836SJohn.Forte@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23*7836SJohn.Forte@Sun.COM * Use is subject to license terms. 24*7836SJohn.Forte@Sun.COM */ 25*7836SJohn.Forte@Sun.COM 26*7836SJohn.Forte@Sun.COM #ifndef _TGTFCHBAPORT_H 27*7836SJohn.Forte@Sun.COM #define _TGTFCHBAPORT_H 28*7836SJohn.Forte@Sun.COM 29*7836SJohn.Forte@Sun.COM 30*7836SJohn.Forte@Sun.COM 31*7836SJohn.Forte@Sun.COM #include <Lockable.h> 32*7836SJohn.Forte@Sun.COM #include <HBAPort.h> 33*7836SJohn.Forte@Sun.COM #include <Exceptions.h> 34*7836SJohn.Forte@Sun.COM #include <string> 35*7836SJohn.Forte@Sun.COM #include <hbaapi.h> 36*7836SJohn.Forte@Sun.COM #include <sys/fctio.h> 37*7836SJohn.Forte@Sun.COM 38*7836SJohn.Forte@Sun.COM #ifdef __cplusplus 39*7836SJohn.Forte@Sun.COM extern "C" { 40*7836SJohn.Forte@Sun.COM #endif 41*7836SJohn.Forte@Sun.COM 42*7836SJohn.Forte@Sun.COM /* 43*7836SJohn.Forte@Sun.COM * Represents a single HBA port 44*7836SJohn.Forte@Sun.COM */ 45*7836SJohn.Forte@Sun.COM class TgtFCHBAPort : public HBAPort { 46*7836SJohn.Forte@Sun.COM public: 47*7836SJohn.Forte@Sun.COM TgtFCHBAPort(std::string path); getPath()48*7836SJohn.Forte@Sun.COM virtual std::string getPath() 49*7836SJohn.Forte@Sun.COM { return path; } getNodeWWN()50*7836SJohn.Forte@Sun.COM virtual uint64_t getNodeWWN() 51*7836SJohn.Forte@Sun.COM { return nodeWWN; } getPortWWN()52*7836SJohn.Forte@Sun.COM virtual uint64_t getPortWWN() 53*7836SJohn.Forte@Sun.COM { return portWWN; } 54*7836SJohn.Forte@Sun.COM virtual HBA_PORTATTRIBUTES getPortAttributes( 55*7836SJohn.Forte@Sun.COM uint64_t &stateChange); 56*7836SJohn.Forte@Sun.COM virtual HBA_PORTATTRIBUTES getDiscoveredAttributes( 57*7836SJohn.Forte@Sun.COM HBA_UINT32 discoveredport, 58*7836SJohn.Forte@Sun.COM uint64_t &stateChange); 59*7836SJohn.Forte@Sun.COM virtual HBA_PORTATTRIBUTES getDiscoveredAttributes( 60*7836SJohn.Forte@Sun.COM uint64_t wwn, 61*7836SJohn.Forte@Sun.COM uint64_t &stateChange); 62*7836SJohn.Forte@Sun.COM virtual void validatePresent(); getTargetMappings(PHBA_FCPTARGETMAPPINGV2 userMappings)63*7836SJohn.Forte@Sun.COM virtual void getTargetMappings( 64*7836SJohn.Forte@Sun.COM PHBA_FCPTARGETMAPPINGV2 userMappings) { 65*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } getRNIDMgmtInfo(PHBA_MGMTINFO info)66*7836SJohn.Forte@Sun.COM virtual void getRNIDMgmtInfo(PHBA_MGMTINFO info) { 67*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } sendCTPassThru(void * requestBuffer,HBA_UINT32 requestSize,void * responseBuffer,HBA_UINT32 * responseSize)68*7836SJohn.Forte@Sun.COM virtual void sendCTPassThru(void *requestBuffer, 69*7836SJohn.Forte@Sun.COM HBA_UINT32 requestSize, 70*7836SJohn.Forte@Sun.COM void *responseBuffer, 71*7836SJohn.Forte@Sun.COM HBA_UINT32 *responseSize) { 72*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } 73*7836SJohn.Forte@Sun.COM virtual void sendRLS(uint64_t destWWN, 74*7836SJohn.Forte@Sun.COM void *pRspBuffer, 75*7836SJohn.Forte@Sun.COM HBA_UINT32 *pRspBufferSize); sendRPL(uint64_t destWWN,HBA_UINT32 agent_domain,HBA_UINT32 port_index,void * pRspBuffer,HBA_UINT32 * pRspBufferSize)76*7836SJohn.Forte@Sun.COM virtual void sendRPL(uint64_t destWWN, 77*7836SJohn.Forte@Sun.COM HBA_UINT32 agent_domain, 78*7836SJohn.Forte@Sun.COM HBA_UINT32 port_index, 79*7836SJohn.Forte@Sun.COM void *pRspBuffer, 80*7836SJohn.Forte@Sun.COM HBA_UINT32 *pRspBufferSize) { 81*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } sendRPS(uint64_t agentWWN,HBA_UINT32 agentDomain,uint64_t objectWWN,HBA_UINT32 objectPortNum,void * pRspBuffer,HBA_UINT32 * pRspBufferSize)82*7836SJohn.Forte@Sun.COM virtual void sendRPS(uint64_t agentWWN, 83*7836SJohn.Forte@Sun.COM HBA_UINT32 agentDomain, 84*7836SJohn.Forte@Sun.COM uint64_t objectWWN, 85*7836SJohn.Forte@Sun.COM HBA_UINT32 objectPortNum, 86*7836SJohn.Forte@Sun.COM void *pRspBuffer, 87*7836SJohn.Forte@Sun.COM HBA_UINT32 *pRspBufferSize) { 88*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } sendSRL(uint64_t destWWN,HBA_UINT32 agent_domain,void * pRspBuffer,HBA_UINT32 * pRspBufferSize)89*7836SJohn.Forte@Sun.COM virtual void sendSRL(uint64_t destWWN, 90*7836SJohn.Forte@Sun.COM HBA_UINT32 agent_domain, 91*7836SJohn.Forte@Sun.COM void *pRspBuffer, 92*7836SJohn.Forte@Sun.COM HBA_UINT32 *pRspBufferSize) { 93*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } sendLIRR(uint64_t destWWN,HBA_UINT8 function,HBA_UINT8 type,void * pRspBuffer,HBA_UINT32 * pRspBufferSize)94*7836SJohn.Forte@Sun.COM virtual void sendLIRR(uint64_t destWWN, 95*7836SJohn.Forte@Sun.COM HBA_UINT8 function, 96*7836SJohn.Forte@Sun.COM HBA_UINT8 type, 97*7836SJohn.Forte@Sun.COM void *pRspBuffer, 98*7836SJohn.Forte@Sun.COM HBA_UINT32 *pRspBufferSize) { 99*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } sendReportLUNs(uint64_t wwn,void * responseBuffer,HBA_UINT32 * responseSize,HBA_UINT8 * scsiStatus,void * senseBuffer,HBA_UINT32 * senseSize)100*7836SJohn.Forte@Sun.COM virtual void sendReportLUNs(uint64_t wwn, 101*7836SJohn.Forte@Sun.COM void *responseBuffer, HBA_UINT32 *responseSize, 102*7836SJohn.Forte@Sun.COM HBA_UINT8 *scsiStatus, 103*7836SJohn.Forte@Sun.COM void *senseBuffer, HBA_UINT32 *senseSize) { 104*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } sendScsiInquiry(uint64_t wwn,HBA_UINT64 fcLun,HBA_UINT8 cdb1,HBA_UINT8 cdb2,void * responseBuffer,HBA_UINT32 * responseSize,HBA_UINT8 * scsiStatus,void * senseBuffer,HBA_UINT32 * senseSize)105*7836SJohn.Forte@Sun.COM virtual void sendScsiInquiry(uint64_t wwn, HBA_UINT64 fcLun, 106*7836SJohn.Forte@Sun.COM HBA_UINT8 cdb1, HBA_UINT8 cdb2, 107*7836SJohn.Forte@Sun.COM void *responseBuffer, HBA_UINT32 *responseSize, 108*7836SJohn.Forte@Sun.COM HBA_UINT8 *scsiStatus, void *senseBuffer, 109*7836SJohn.Forte@Sun.COM HBA_UINT32 *senseSize) { 110*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } sendReadCapacity(uint64_t pwwn,HBA_UINT64 fcLun,void * responseBuffer,HBA_UINT32 * responseSize,HBA_UINT8 * scsiStatus,void * senseBuffer,HBA_UINT32 * senseSize)111*7836SJohn.Forte@Sun.COM virtual void sendReadCapacity(uint64_t pwwn, 112*7836SJohn.Forte@Sun.COM HBA_UINT64 fcLun, void *responseBuffer, 113*7836SJohn.Forte@Sun.COM HBA_UINT32 *responseSize, HBA_UINT8 *scsiStatus, 114*7836SJohn.Forte@Sun.COM void *senseBuffer, HBA_UINT32 *senseSize) { 115*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } sendRNID(uint64_t destwwn,HBA_UINT32 destfcid,HBA_UINT32 nodeIdDataFormat,void * pRspBuffer,HBA_UINT32 * RspBufferSize)116*7836SJohn.Forte@Sun.COM virtual void sendRNID(uint64_t destwwn, HBA_UINT32 destfcid, 117*7836SJohn.Forte@Sun.COM HBA_UINT32 nodeIdDataFormat, void *pRspBuffer, 118*7836SJohn.Forte@Sun.COM HBA_UINT32 *RspBufferSize) { 119*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } setRNID(HBA_MGMTINFO info)120*7836SJohn.Forte@Sun.COM virtual void setRNID(HBA_MGMTINFO info) { 121*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } getPortNPIVAttributes(uint64_t & stateChange)122*7836SJohn.Forte@Sun.COM virtual HBA_PORTNPIVATTRIBUTES getPortNPIVAttributes( 123*7836SJohn.Forte@Sun.COM uint64_t &stateChange) { 124*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } createNPIVPort(uint64_t vnodewwn,uint64_t vportwwn,uint32_t vindex)125*7836SJohn.Forte@Sun.COM virtual uint32_t createNPIVPort( 126*7836SJohn.Forte@Sun.COM uint64_t vnodewwn, 127*7836SJohn.Forte@Sun.COM uint64_t vportwwn, 128*7836SJohn.Forte@Sun.COM uint32_t vindex) { 129*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } deleteNPIVPort(uint64_t vportwwn)130*7836SJohn.Forte@Sun.COM virtual uint32_t deleteNPIVPort( 131*7836SJohn.Forte@Sun.COM uint64_t vportwwn) { 132*7836SJohn.Forte@Sun.COM throw NotSupportedException(); } 133*7836SJohn.Forte@Sun.COM 134*7836SJohn.Forte@Sun.COM private: 135*7836SJohn.Forte@Sun.COM std::string path; 136*7836SJohn.Forte@Sun.COM uint64_t portWWN; 137*7836SJohn.Forte@Sun.COM uint64_t nodeWWN; 138*7836SJohn.Forte@Sun.COM uint32_t instanceNumber; 139*7836SJohn.Forte@Sun.COM int controllerNumber; 140*7836SJohn.Forte@Sun.COM static const std::string FCT_DRIVER_PATH; 141*7836SJohn.Forte@Sun.COM static const int MAX_FCTIO_MSG_LEN; 142*7836SJohn.Forte@Sun.COM static void transportError(uint32_t fcio_errno, char *message); 143*7836SJohn.Forte@Sun.COM 144*7836SJohn.Forte@Sun.COM // Wrapper routines to handle error cases 145*7836SJohn.Forte@Sun.COM static void fct_ioctl(int cmd, fctio_t *arg); 146*7836SJohn.Forte@Sun.COM }; 147*7836SJohn.Forte@Sun.COM 148*7836SJohn.Forte@Sun.COM #ifdef __cplusplus 149*7836SJohn.Forte@Sun.COM } 150*7836SJohn.Forte@Sun.COM #endif 151*7836SJohn.Forte@Sun.COM 152*7836SJohn.Forte@Sun.COM #endif /* _TGTFCHBAPORT_H */ 153