Chameleon

Chameleon Svn Source Tree

Root/branches/JrCs/i386/include/IOKit/scsi/SCSICmds_REPORT_LUNS_Definitions.h

1/*
2 * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_
25#define _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_
26
27
28#if KERNEL
29#include <IOKit/IOTypes.h>
30#else
31#include <CoreFoundation/CoreFoundation.h>
32#endif
33
34
35/*! @header SCSI Request Sense Definitions
36@discussion
37This file contains all definitions for the data returned from
38the REPORT_LUNS (0xA0) command.
39*/
40
41
42/*!
43@struct SCSICmd_REPORT_LUNS_LUN_ENTRY
44@discussion
45This structure represents a single LUN entry in a LUN list
46returned via the REPORT_LUNS command.
47*/
48typedef struct SCSICmd_REPORT_LUNS_LUN_ENTRY
49{
50UInt16FIRST_LEVEL_ADDRESSING;
51UInt16SECOND_LEVEL_ADDRESSING;
52UInt16THIRD_LEVEL_ADDRESSING;
53UInt16FOURTH_LEVEL_ADDRESSING;
54} SCSICmd_REPORT_LUNS_LUN_ENTRY;
55
56
57/*!
58@constant kREPORT_LUNS_HeaderSize
59@discussion
60Size of the REPORT_LUNS header as defined in the SPC-3 specification.
61*/
62#define kREPORT_LUNS_HeaderSize8
63
64/*!
65@enum REPORT_LUNS addressing methods.
66@discussion
67REPORT_LUNS addressing methods described in
68SAM-2 documents.
69@constant kREPORT_LUNS_ADDRESS_METHOD_PERIPHERAL_DEVICE
70Peripheral Device Addressing Method.
71@constant kREPORT_LUNS_ADDRESS_DEVICE_TYPE_SPECIFIC
72Device Type Specific Addressing Method.
73@constant kREPORT_LUNS_ADDRESS_METHOD_LOGICAL_UNIT
74Logical Unit Specific Addressing Method.
75@constant kREPORT_LUNS_ADDRESS_METHOD_OFFSET
76Offset to the address method data.
77*/
78enum
79{
80kREPORT_LUNS_ADDRESS_METHOD_PERIPHERAL_DEVICE= 0,
81kREPORT_LUNS_ADDRESS_DEVICE_TYPE_SPECIFIC= 1,
82kREPORT_LUNS_ADDRESS_METHOD_LOGICAL_UNIT = 2,
83// Reserved [3]
84kREPORT_LUNS_ADDRESS_METHOD_OFFSET= 14
85};
86
87
88/*!
89@struct REPORT_LUNS_LOGICAL_UNIT_ADDRESSING
90@discussion
91This structure represents a LUN Addressing scheme.
92*/
93typedef struct REPORT_LUNS_LOGICAL_UNIT_ADDRESSING
94{
95#ifdef __LITTLE_ENDIAN__
96UInt16LUN: 5;
97UInt16BUS_NUMBER: 3;
98UInt16TARGET: 6;
99UInt16reserved2: 1;
100UInt16reserved: 1;
101#else /* !__LITTLE_ENDIAN__ */
102UInt16reserved: 1;
103UInt16reserved2: 1;
104UInt16TARGET: 6;
105UInt16BUS_NUMBER: 3;
106UInt16LUN: 5;
107#endif /* !__LITTLE_ENDIAN__ */
108} REPORT_LUNS_LOGICAL_UNIT_ADDRESSING;
109
110
111/*!
112@struct REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING
113@discussion
114This structure represents a Peripheral Device Addressing scheme.
115*/
116typedef struct REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING
117{
118#ifdef __LITTLE_ENDIAN__
119UInt16TARGET_LUN: 8;
120UInt16BUS_IDENTIFIER: 6;
121UInt16reserved2: 1;
122UInt16reserved: 1;
123#else /* !__LITTLE_ENDIAN__ */
124UInt16reserved: 1;
125UInt16reserved2: 1;
126UInt16BUS_IDENTIFIER: 6;
127UInt16TARGET_LUN: 8;
128#endif /* !__LITTLE_ENDIAN__ */
129} REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING;
130
131
132/*!
133@struct SCSICmd_REPORT_LUNS_Header
134@discussion
135This structure defines the format of the data that is returned for
136the REPORT_LUNS command.
137*/
138typedef struct SCSICmd_REPORT_LUNS_Header
139{
140UInt32LUN_LIST_LENGTH;// LUN list length in bytes.
141UInt32RESERVED;
142SCSICmd_REPORT_LUNS_LUN_ENTRYLUN[1];// Variable length list. Must have at least LUN 0 if
143} SCSICmd_REPORT_LUNS_Header;// Target supports REPORT_LUNS command.
144
145
146#endif/* _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ */
147

Archive Download this file

Revision: 1466