Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / share / man / man9s / scsi_address.9s
blob65fc9a017f50902db0122fa988a98cbe8310f605
1 .\"  Copyright (c) 2000, Sun Microsystems, Inc.,  All Rights Reserved
2 .\" Copyright (c) 2017, Joyent, Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .Dd Apr 23, 2017
7 .Dt SCSI_ADDRESS 9S
8 .Os
9 .Sh NAME
10 .Nm scsi_address
11 .Nd SCSI address structure
12 .Sh SYNOPSIS
13 .In sys/scsi/scsi.h
14 .Sh INTERFACE LEVEL
15 illumos architecture specific (illumos DDI)
16 .Sh DESCRIPTION
18 .Vt scsi_address
19 structure defines the addressing components for a
20 .Sy SCSI
21 target device.
22 The address of the target device is separated into two components:
23 target number and logical unit number.
24 The two addressing components are used to uniquely identify any type of
25 .Sy SCSI
26 device; however, most devices can be addressed with the target component of the
27 address.
28 .Pp
29 In the case where only the target component is used to address the device, the
30 logical unit should be set to
31 .Sy 0 . If the
32 .Sy SCSI
33 target device supports logical units, then the HBA must interpret the
34 logical units field of the data structure.
35 .Pp
36 The
37 .Sy pkt_address
38 member of a
39 .Xr scsi_pkt 9S
40 is initialized by
41 .Xr scsi_init_pkt 9F .
42 .Ss Complex Addressing
43 Drivers may set the flag
44 .Dv SCSI_HBA_ADDR_COMPLEX
45 in the
46 .Fa hba_flags
47 argument to
48 .Xr scsi_hba_attach_setup 9F .
49 When the flag is set, this structure must be treated as opaque.
50 Instead of storing a traditional target and LUN, the address is treated
51 as the string form of a unit address.
52 In addition, rather than storing a pointer to the
53 .Xr scsi_hba_tran 9S
54 structure, the address structure can store any arbitrary pointer through
55 the
56 .Xr scsi_device_hba_private_get 9F
57 and
58 .Xr scsi_device_hba_private_set 9F
59 functions.
60 .Sh STRUCTURE MEMBERS
61 .Bd -literal
62 scsi_hba_tran_t   *a_hba_tran;  /* Transport vectors for the SCSI bus */
63 ushort_t          a_target;     /* SCSI target id */
64 uchar_t           a_lun;        /* SCSI logical unit */
65 .Ed
66 .Pp
67 .Fa a_hba_tran
68 is a pointer to the controlling
69 .Sy HBA 's
70 transport vector
71 structure.
72 The
73 .Sy SCSA
74 interface uses this field to pass any transport
75 requests from the
76 .Sy SCSI
77 target device drivers to the
78 .Sy HBA
79 driver.
80 .Pp
81 .Fa a_target
82 is the target component of the
83 .Sy SCSI
84 address
85 .Pp
86 .Fa a_lun
87 is the logical unit component of the
88 .Sy SCSI
89 address.
90 The logical unit is used to further distinguish a
91 .Sy SCSI
92 target device that
93 supports multiple logical units from one that does not.
94 .Pp
95 If the flag,
96 .Dv SCSI_HBA_ADDR_COMPLEX
97 was set, then the driver
98 .Em must not
99 dereference any of these fields, the structure contents will have
100 changed and should be considered opaque.
101 .Sh SEE ALSO
102 .Xr scsi_device_hba_private_get 9F ,
103 .Xr scsi_device_hba_private_set 9F ,
104 .Xr scsi_hba_attach_setup 9F ,
105 .Xr scsi_init_pkt 9F ,
106 .Xr scsi_hba_tran 9S ,
107 .Xr scsi_pkt 9S
110 .%T Writing Device Drivers