xref: /illumos-gate/usr/src/man/man9f/scsi_hba_iport_exist.9f (revision 0245b61fd282e95735b173b8d95be0d6688163b4)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright (c) 2017, Joyent, Inc.
13.\"
14.Dd Apr 18, 2017
15.Dt SCSI_HBA_IPORT_EXIST 9F
16.Os
17.Sh NAME
18.Nm scsi_hba_iport_exist ,
19.Nm scsi_hba_iport_find
20.Nd find and check if an iport exists
21.Sh SYNOPSIS
22.In sys/scsi/scsi.h
23.Ft int
24.Fo scsi_hba_iport_exist
25.Fa "dev_info_t *dip"
26.Fc
27.Ft "dev_info_t *"
28.Fo scsi_hba_iport_find
29.Fa "dev_info_t *dip"
30.Fa "char *ua"
31.Fc
32.Sh INTERFACE LEVEL
33.Sy Evolving -
34This interface is still evolving in illumos.
35API and ABI stability is not guaranteed.
36.Sh PARAMETERS
37.Bl -tag -width Fa
38.It Fa dip
39Pointer to
40.Vt dev_info
41structure.
42.It Fa ua
43The unit address of the iport being searched for.
44.El
45.Sh DESCRIPTION
46The
47.Fn scsi_hba_iport_exists
48function is used to determine whether or not
49.Fa dip
50has any child devices that are iports which have been added through
51.Xr scsi_hba_iport_register 9F
52or
53.Xr scsi_hba_iportmap_iport_add 9F .
54For more information on iports, see
55.Xr iport 9 .
56.Pp
57The
58.Fn scsi_hba_iport_find
59function attempts to find a child iport and return its
60.Vt dev_info
61structure if it exists.
62The iport is searched for by its unit address, which is passed in the
63.Fa ua
64argument.
65The unit address for an iport is established when the iport is created.
66.Sh CONTEXT
67The
68.Fn scsi_hba_iport_exist
69and
70.Fn scsi_hba_iport_find
71functions may be called in either
72.Sy user
73or
74.Sy kernel
75context.
76.Sh RETURN VALUES
77The
78.Fn scsi_hba_iport_exists
79function returns
80.Sy 1
81when there is a child iport of
82.Fa dip .
83Otherwise, it returns
84.Sy 0.
85.Pp
86The
87.Fn scsi_hba_iport_find
88function returns a pointer to the iport's
89.Vt dev_info
90structure, if found.
91Otherwise,
92.Dv NULL
93is returned.
94.Sh SEE ALSO
95.Xr iport 9 ,
96.Xr iportmap 9 ,
97.Xr scsi_hba_iport_register 9F ,
98.Xr scsi_hba_iportmap_iport_add 9F
99