'\" te .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. .TH HBA_OpenAdapter 3HBAAPI "1 Sep 2003" "SunOS 5.11" "Common Fibre Channel HBA Information Library Functions" .SH NAME HBA_OpenAdapter, HBA_OpenAdapterByWWN, HBA_CloseAdapter \- open and close a specific adapter .SH SYNOPSIS .LP .nf cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lHBAAPI\fR [ \fIlibrary\fR\&.\|.\|. ] #include \fBHBA_HANDLE\fR \fBHBA_OpenAdapter\fR(\fBchar *\fR\fIadaptername\fR); .fi .LP .nf \fBHBA_STATUS\fR \fBHBA_OpenAdapterByWWN\fR(\fBHBA_HANDLE *\fR\fIhandle\fR, \fBHBA_WWN\fR \fIwwn\fR); .fi .LP .nf \fBvoid\fR \fBHBA_CloseAdapter\fR(\fBHBA_HANDLE\fR \fIhandle\fR); .fi .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIadaptername\fR\fR .ad .RS 15n .rt the name of the adapter to open, as returned by \fBHBA_GetAdapterName\fR(3HBAAPI) .RE .sp .ne 2 .mk .na \fB\fIhandle\fR\fR .ad .RS 15n .rt .sp .ne 2 .mk .na \fB\fBHBA_OpenAdapterByWWN()\fR\fR .ad .RS 26n .rt a pointer to an \fBHBA_HANDLE\fR .RE .sp .ne 2 .mk .na \fB\fBHBA_CloseAdapter()\fR\fR .ad .RS 26n .rt the open handle of the adapter to close, as returned by HBA_OpenAdapter(3HBAAPI) .RE .RE .sp .ne 2 .mk .na \fB\fIwwn\fR\fR .ad .RS 15n .rt the WWN to match the Node WWN or Port WWN of the HBA to open .RE .SH DESCRIPTION .sp .LP The \fBHBA_OpenAdapter()\fR function opens the adapter specified by \fIadaptername\fR and returns a handle used for subsequent operations on the HBA. .sp .LP The \fBHBA_OpenAdapterByWWN()\fR function opens a handle to the HBA whose Node or Port WWN matches the \fIwwn\fR argument. .sp .LP The \fBHBA_CloseAdapter()\fR function closes the open handle. .SH RETURN VALUES .sp .LP Upon successful completion, \fBHBA_OpenAdapter()\fR returns a valid \fBHBA_HANDLE\fR with a numeric value greater than 0. Otherwise, 0 is returned. .sp .LP The \fBHBA_OpenAdapterByWWN()\fR function returns the following values: .sp .ne 2 .mk .na \fB\fBHBA_STATUS_OK\fR\fR .ad .sp .6 .RS 4n The \fIhandle\fR argument contains a valid HBA handle. .RE .sp .ne 2 .mk .na \fB\fBHBA_STATUS_ERROR_ILLEGAL_WWN\fR\fR .ad .sp .6 .RS 4n The \fIwwn\fR argument is not a valid port WWN on the specified HBA. .RE .sp .ne 2 .mk .na \fB\fBHBA_STATUS_ERROR_AMBIGUOUS_WWN\fR\fR .ad .sp .6 .RS 4n The WWN is matched to multiple adapters. .RE .sp .ne 2 .mk .na \fB\fBHBA_STATUS_ERROR\fR\fR .ad .sp .6 .RS 4n An error occurred while opening the adapter. .RE .SH EXAMPLES .LP \fBExample 1 \fROpen an adapter. .sp .LP The following example opens the specified adapter. .sp .in +2 .nf handle = HBA_OpenAdapter(adaptername); if (handle == 0) { fprintf(stderr, "Unable to open HBA %d with name " "\e"%s\e".\en", hbaCount, adaptername); continue; } .fi .in -2 .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ T{ Standard: FC-HBA Version 4 (API version 2) T} _ MT-LevelSafe _ StandardFC-MI 1.92 (API version 1) .TE .SH SEE ALSO .sp .LP \fBHBA_GetAdapterName\fR(3HBAAPI), HBA_OpenAdapter(3HBAAPI), \fBlibhbaapi\fR(3LIB), \fBattributes\fR(5) .sp .LP T11 FC-MI Specification