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 15illumos architecture specific (illumos DDI) 16.Sh DESCRIPTION 17A 18.Vt scsi_address 19structure defines the addressing components for a 20.Sy SCSI 21target device. 22The address of the target device is separated into two components: 23target number and logical unit number. 24The two addressing components are used to uniquely identify any type of 25.Sy SCSI 26device; however, most devices can be addressed with the target component of the 27address. 28.Pp 29In the case where only the target component is used to address the device, the 30logical unit should be set to 31.Sy 0 . If the 32.Sy SCSI 33target device supports logical units, then the HBA must interpret the 34logical units field of the data structure. 35.Pp 36The 37.Sy pkt_address 38member of a 39.Xr scsi_pkt 9S 40is initialized by 41.Xr scsi_init_pkt 9F . 42.Ss Complex Addressing 43Drivers may set the flag 44.Dv SCSI_HBA_ADDR_COMPLEX 45in the 46.Fa hba_flags 47argument to 48.Xr scsi_hba_attach_setup 9F . 49When the flag is set, this structure must be treated as opaque. 50Instead of storing a traditional target and LUN, the address is treated 51as the string form of a unit address. 52In addition, rather than storing a pointer to the 53.Xr scsi_hba_tran 9S 54structure, the address structure can store any arbitrary pointer through 55the 56.Xr scsi_device_hba_private_get 9F 57and 58.Xr scsi_device_hba_private_set 9F 59functions. 60.Sh STRUCTURE MEMBERS 61.Bd -literal 62scsi_hba_tran_t *a_hba_tran; /* Transport vectors for the SCSI bus */ 63ushort_t a_target; /* SCSI target id */ 64uchar_t a_lun; /* SCSI logical unit */ 65.Ed 66.Pp 67.Fa a_hba_tran 68is a pointer to the controlling 69.Sy HBA 's 70transport vector 71structure. 72The 73.Sy SCSA 74interface uses this field to pass any transport 75requests from the 76.Sy SCSI 77target device drivers to the 78.Sy HBA 79driver. 80.Pp 81.Fa a_target 82is the target component of the 83.Sy SCSI 84address 85.Pp 86.Fa a_lun 87is the logical unit component of the 88.Sy SCSI 89address. 90The logical unit is used to further distinguish a 91.Sy SCSI 92target device that 93supports multiple logical units from one that does not. 94.Pp 95If the flag, 96.Dv SCSI_HBA_ADDR_COMPLEX 97was set, then the driver 98.Em must not 99dereference any of these fields, the structure contents will have 100changed 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 108.Pp 109.Rs 110.%T Writing Device Drivers 111.Re 112