1/*
2 * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
3 *
4 * IMPORTANT:  This Apple software is supplied to you by Apple Inc. ("Apple") in
5 * consideration of your agreement to the following terms, and your use, installation,
6 * modification or redistribution of this Apple software constitutes acceptance of these
7 * terms.  If you do not agree with these terms, please do not use, install, modify or
8 * redistribute this Apple software.
9 *
10 * In consideration of your agreement to abide by the following terms, and subject to these
11 * terms, Apple grants you a personal, non exclusive license, under Apple�s copyrights in this
12 * original Apple software (the �Apple Software�), to use, reproduce, modify and redistribute
13 * the Apple Software, with or without modifications, in source and/or binary forms; provided
14 * that if you redistribute the Apple Software in its entirety and without modifications, you
15 * must retain this notice and the following text and disclaimers in all such redistributions
16 * of the Apple Software.  Neither the name, trademarks, service marks or logos of Apple
17 * Computer, Inc. may be used to endorse or promote products derived from the Apple Software
18 * without specific prior written permission from Apple. Except as expressly stated in this
19 * notice, no other rights or licenses, express or implied, are granted by Apple herein,
20 * including but not limited to any patent rights that may be infringed by your derivative
21 * works or by other works in which the Apple Software may be incorporated.
22 *
23 * The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO WARRANTIES,
24 * EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-
25 * INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE
26 * SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
27 *
28 * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
30 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE,
31 * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND
32 * WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
33 * OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */
35
36
37//�����������������������������������������������������������������������������
38//	Imports
39//�����������������������������������������������������������������������������
40
41#import "FakeSCSIInitiator.h"
42
43static int sDomainID = 0;
44
45
46//�����������������������������������������������������������������������������
47//	Implementation
48//�����������������������������������������������������������������������������
49
50
51@implementation FakeSCSIInitiator
52
53
54- ( id ) init
55{
56
57	int i = 0;
58
59	self = [ super init ];
60
61	if ( self != nil )
62	{
63
64		initiatorID = 7;
65		domainID	= sDomainID++;
66
67		for ( i = 0; i < 16; i++ )
68		{
69
70			SCSIDevice *	device = [ [ SCSIDevice alloc ] init ];
71
72			if ( i == initiatorID )
73			{
74
75				[ device setPhysicalInterconnect: @"SCSI Parallel Interface" ];
76
77				if ( ( domainID & 1 ) == 1 )
78				{
79					[ device setManufacturer: @"LSILogic" ];
80					[ device setModel: @"LSI,1030" ];
81				}
82				else
83				{
84					[ device setManufacturer: @"ATTO" ];
85					[ device setModel: @"ATTO,UL4D" ];
86				}
87
88				[ device setImage: [ NSImage imageNamed: @"pcicard" ] ];
89				[ device setRevision: @"1.52b4" ];
90				[ device setDomainIdentifier: [ NSNumber numberWithInt: domainID ] ];
91				[ device setDeviceIdentifier: [ NSNumber numberWithInt: i ] ];
92				[ device setPeripheralDeviceType: @"N/A" ];
93				[ device setFeatures: [ NSArray arrayWithObjects: @"Fast", @"Wide", nil ] ];
94				[ device setIsInitiator: YES ];
95				[ device setDevicePresent: YES ];
96				[ devices addObject: device ];
97				initiatorDevice = device;
98				[ device release ];
99
100			}
101
102			else if ( i == 4 )
103			{
104
105				[ device setImage: [ NSImage imageNamed: @"nothing" ] ];
106				[ device setIsInitiator: NO ];
107				[ device setDevicePresent: NO ];
108				[ device setDomainIdentifier: [ NSNumber numberWithInt: domainID ] ];
109				[ device setDeviceIdentifier: [ NSNumber numberWithInt: i ] ];
110				[ devices addObject: device ];
111				[ device release ];
112
113			}
114
115			else
116			{
117
118				[ device setPhysicalInterconnect: @"SCSI Parallel Interface" ];
119
120				if ( ( domainID & 1 ) == 1 )
121				{
122
123					[ device setManufacturer: @"Seagate" ];
124					[ device setModel: @"Cheetah" ];
125					[ device setRevision: @"1.0b1" ];
126
127				}
128
129				else
130				{
131
132					[ device setManufacturer: @"IBM" ];
133					[ device setModel: @"SuperFastDisk" ];
134					[ device setRevision: @"H641" ];
135
136				}
137
138				[ device setImage: [ NSImage imageNamed: @"hd" ] ];
139				[ device setIsInitiator: NO ];
140				[ device setDevicePresent: YES ];
141				[ device setDomainIdentifier: [ NSNumber numberWithInt: domainID ] ];
142				[ device setDeviceIdentifier: [ NSNumber numberWithInt: i ] ];
143				[ device setPeripheralDeviceType: @"0" ];
144				[ device setFeatures: [ NSArray arrayWithObjects: @"Fast", @"Wide", @"DT", @"IU", @"QAS", nil ] ];
145				[ devices addObject: device ];
146				[ device release ];
147
148			}
149
150		}
151
152	}
153
154	return self;
155
156}
157
158
159@end