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.
32 #include "Exceptions.h"
34 #include <sys/types.h>
35 #include <sys/mkdev.h>
45 * @memo Retrieves the mapping between FCP targets and OS
47 * @return HBA_STATUS_OK if userMappings contains valid response data
48 * @return HBA_STATUS_ERROR if an error was encountered. The
49 * contents of userMappings is undefined
50 * @param handle The HBA to fetch mappings on
51 * @param portWWN The HBA Port to fetch mappings on
52 * @param userMappings a pre-allocated user structure to store
53 * the mappings within. NumberOfEntries must be set
54 * to indicate the size of the allocated buffer.
57 HBA_STATUS
Sun_fcGetFcpTargetMappingV2(HBA_HANDLE handle
, HBA_WWN portWWN
,
58 PHBA_FCPTARGETMAPPINGV2 userMappings
) {
59 Trace
log("Sun_fcGetFcpTargetMappingV2");
62 Handle
*myHandle
= Handle::findHandle(handle
);
63 HBA
*hba
= myHandle
->getHBA();
64 HBAPort
*port
= hba
->getPort(wwnConversion(portWWN
.wwn
));
65 port
->getTargetMappings(userMappings
);
66 return (HBA_STATUS_OK
);
67 } catch (HBAException
&e
) {
68 return (e
.getErrorCode());
71 "Uncaught exception");
72 return (HBA_STATUS_ERROR
);