Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / lib / hbaapi / common / hbaapi-sun.h
blob1a4dc0fe41eb8e9c71cb0b0ecc7dbd1c83848f9c
1 /*
2 * *****************************************************************************
4 * Description
5 * hbaapi.h - header file for Sun extension for target mode adaptor
6 * support.
8 * License:
9 * The contents of this file are subject to the SNIA Public License
10 * Version 1.0 (the "License"); you may not use this file except in
11 * compliance with the License. You may obtain a copy of the License at
13 * http://www.snia.org/English/Resources/Code/OpenSource.html
15 * Software distributed under the License is distributed on an "AS IS"
16 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17 * the License for the specific language governing rights and limitations
18 * under the License.
20 * *******************************************************************************
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
32 #ifndef _HBA_API_SUN_H
33 #define _HBA_API_SUN_H
35 #include <hbaapi.h>
37 #define HBA_CREATE_WWN_RANDOM 1
38 #define HBA_CREATE_WWN_FACTORY 2
40 typedef struct HBA_NPIVPortList {
41 uint32_t numPorts;
42 char hbaPaths[1][1024];
43 } HBA_NPIVPORTLIST, *PHBA_NPIVPORTLIST;
45 typedef struct HBA_PortNPIVAttributes {
46 HBA_INT32 npivflag;
47 HBA_WWN NodeWWN;
48 HBA_WWN PortWWN;
49 HBA_UINT32 MaxNumberOfNPIVPorts;
50 HBA_UINT32 NumberOfNPIVPorts;
51 } HBA_PORTNPIVATTRIBUTES, *PHBA_PORTNPIVATTRIBUTES;
53 typedef struct HBA_NPIVAttributes {
54 HBA_WWN NodeWWN;
55 HBA_WWN PortWWN;
56 } HBA_NPIVATTRIBUTES, *PHBA_NPIVATTRIBUTES;
58 typedef struct HBA_NPIVCreateEntry {
59 HBA_WWN VNodeWWN;
60 HBA_WWN VPortWWN;
61 uint32_t vindex;
62 } HBA_NPIVCREATEENTRY, *PHBA_NPIVCREATEENTRY;
64 /* Device Level Events */
65 #define HBA_EVENT_DEVICE_UNKNOWN 0x600
66 #define HBA_EVENT_DEVICE_OFFLINE 0x601
67 #define HBA_EVENT_DEVICE_ONLINE 0x602
69 HBA_API HBA_UINT32 Sun_HBA_GetNumberOfTgtAdapters();
71 HBA_API HBA_STATUS Sun_HBA_GetTgtAdapterName(
72 HBA_UINT32 adapterindex,
73 char *adaptername
76 HBA_API HBA_HANDLE Sun_HBA_OpenTgtAdapter(
77 char* adaptername
80 HBA_API HBA_STATUS Sun_HBA_OpenTgtAdapterByWWN(
81 HBA_HANDLE *handle,
82 HBA_WWN wwn
85 HBA_API HBA_STATUS Sun_HBA_NPIVGetAdapterAttributes(
86 HBA_HANDLE handle,
87 HBA_ADAPTERATTRIBUTES
88 *hbaattributes
90 HBA_API HBA_STATUS Sun_HBA_GetNPIVPortInfo(
91 HBA_HANDLE handle,
92 HBA_UINT32 portindex,
93 HBA_UINT32 vportindex,
94 HBA_NPIVATTRIBUTES *attributes
96 HBA_API HBA_STATUS Sun_HBA_DeleteNPIVPort(
97 HBA_HANDLE handle,
98 HBA_UINT32 portindex,
99 HBA_WWN vportWWN
101 HBA_API HBA_STATUS Sun_HBA_CreateNPIVPort(
102 HBA_HANDLE handle,
103 HBA_UINT32 portindex,
104 HBA_WWN vnodeWWN,
105 HBA_WWN vportWWN,
106 HBA_UINT32 *npivportindex
108 HBA_API HBA_STATUS Sun_HBA_GetPortNPIVAttributes(
109 HBA_HANDLE handle,
110 HBA_UINT32 portindex,
111 HBA_PORTNPIVATTRIBUTES *portnpivattributes
114 HBA_STATUS Sun_HBA_AdapterCreateWWN(
115 HBA_HANDLE handle,
116 HBA_UINT32 portindex,
117 HBA_WWN *nwwn,
118 HBA_WWN *pwwn,
119 HBA_WWN *OUI,
120 HBA_INT32 method
123 HBA_STATUS Sun_HBA_AdapterReturnWWN(
124 HBA_HANDLE handle,
125 HBA_UINT32 portindex,
126 HBA_WWN *nwwn,
127 HBA_WWN *pwwn
130 HBA_API HBA_STATUS Sun_HBA_RegisterForAdapterDeviceEvents(
131 void (*callback)(
132 void *data,
133 HBA_WWN PortWWN,
134 HBA_UINT32 eventType,
135 HBA_UINT32 fabricPortID
137 void *userData,
138 HBA_HANDLE handle,
139 HBA_WWN PortWWN,
140 HBA_CALLBACKHANDLE *callbackHandle
143 HBA_API HBA_STATUS Sun_HBA_ForceLip(
144 HBA_HANDLE handle,
145 int *rval);
147 #endif /* HBA_API_SUN_H */
149 #ifdef __cplusplus
151 #endif /* _HBA_API_SUN_H */