4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _TGTFCHBAPORT_H
27 #define _TGTFCHBAPORT_H
33 #include <Exceptions.h>
36 #include <sys/fctio.h>
43 * Represents a single HBA port
45 class TgtFCHBAPort
: public HBAPort
{
47 TgtFCHBAPort(std::string path
);
48 virtual std::string
getPath()
50 virtual uint64_t getNodeWWN()
52 virtual uint64_t getPortWWN()
54 virtual HBA_PORTATTRIBUTES
getPortAttributes(
55 uint64_t &stateChange
);
56 virtual HBA_PORTATTRIBUTES
getDiscoveredAttributes(
57 HBA_UINT32 discoveredport
,
58 uint64_t &stateChange
);
59 virtual HBA_PORTATTRIBUTES
getDiscoveredAttributes(
61 uint64_t &stateChange
);
62 virtual void validatePresent();
63 virtual void getTargetMappings(
64 PHBA_FCPTARGETMAPPINGV2 userMappings
) {
65 throw NotSupportedException(); }
66 virtual void getRNIDMgmtInfo(PHBA_MGMTINFO info
) {
67 throw NotSupportedException(); }
68 virtual void sendCTPassThru(void *requestBuffer
,
69 HBA_UINT32 requestSize
,
71 HBA_UINT32
*responseSize
) {
72 throw NotSupportedException(); }
73 virtual void sendRLS(uint64_t destWWN
,
75 HBA_UINT32
*pRspBufferSize
);
76 virtual void sendRPL(uint64_t destWWN
,
77 HBA_UINT32 agent_domain
,
78 HBA_UINT32 port_index
,
80 HBA_UINT32
*pRspBufferSize
) {
81 throw NotSupportedException(); }
82 virtual void sendRPS(uint64_t agentWWN
,
83 HBA_UINT32 agentDomain
,
85 HBA_UINT32 objectPortNum
,
87 HBA_UINT32
*pRspBufferSize
) {
88 throw NotSupportedException(); }
89 virtual void sendSRL(uint64_t destWWN
,
90 HBA_UINT32 agent_domain
,
92 HBA_UINT32
*pRspBufferSize
) {
93 throw NotSupportedException(); }
94 virtual void sendLIRR(uint64_t destWWN
,
98 HBA_UINT32
*pRspBufferSize
) {
99 throw NotSupportedException(); }
100 virtual void sendReportLUNs(uint64_t wwn
,
101 void *responseBuffer
, HBA_UINT32
*responseSize
,
102 HBA_UINT8
*scsiStatus
,
103 void *senseBuffer
, HBA_UINT32
*senseSize
) {
104 throw NotSupportedException(); }
105 virtual void sendScsiInquiry(uint64_t wwn
, HBA_UINT64 fcLun
,
106 HBA_UINT8 cdb1
, HBA_UINT8 cdb2
,
107 void *responseBuffer
, HBA_UINT32
*responseSize
,
108 HBA_UINT8
*scsiStatus
, void *senseBuffer
,
109 HBA_UINT32
*senseSize
) {
110 throw NotSupportedException(); }
111 virtual void sendReadCapacity(uint64_t pwwn
,
112 HBA_UINT64 fcLun
, void *responseBuffer
,
113 HBA_UINT32
*responseSize
, HBA_UINT8
*scsiStatus
,
114 void *senseBuffer
, HBA_UINT32
*senseSize
) {
115 throw NotSupportedException(); }
116 virtual void sendRNID(uint64_t destwwn
, HBA_UINT32 destfcid
,
117 HBA_UINT32 nodeIdDataFormat
, void *pRspBuffer
,
118 HBA_UINT32
*RspBufferSize
) {
119 throw NotSupportedException(); }
120 virtual void setRNID(HBA_MGMTINFO info
) {
121 throw NotSupportedException(); }
122 virtual HBA_PORTNPIVATTRIBUTES
getPortNPIVAttributes(
123 uint64_t &stateChange
) {
124 throw NotSupportedException(); }
125 virtual uint32_t createNPIVPort(
129 throw NotSupportedException(); }
130 virtual uint32_t deleteNPIVPort(
132 throw NotSupportedException(); }
138 uint32_t instanceNumber
;
139 int controllerNumber
;
140 static const std::string FCT_DRIVER_PATH
;
141 static const int MAX_FCTIO_MSG_LEN
;
142 static void transportError(uint32_t fcio_errno
, char *message
);
144 // Wrapper routines to handle error cases
145 static void fct_ioctl(int cmd
, fctio_t
*arg
);
152 #endif /* _TGTFCHBAPORT_H */