home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
- *
- * SCSIGeneric.h - ObjC Interface to Generic SCSI Driver.
- *
- * HISTORY
- * 19-Aug-92 Doug Mitchell at NeXT
- * Created.
- */
-
- #ifndef _DRIVERKIT_SCSIGENERIC_H_
- #define _DRIVERKIT_SCSIGENERIC_H_
-
- #import <driverkit/IODevice.h>
- #import <driverkit/return.h>
- #import <driverkit/scsiTypes.h>
-
- @interface SCSIGeneric:IODevice
- {
- unsigned char _target;
- unsigned char _lun;
- unsigned _controllerNum; // SCSIController unit number
- unsigned _autoSense:1,
- _isReserved,
- _targLunValid:1;
- id _controller; // SCSIController to which
- // we're attached
- id _openLock; // NXLock; serializes opens
- // and closes
- id _owner; // nil means no owner
- }
-
- + (BOOL)probe : deviceDescription;
- + (IODeviceStyle)deviceStyle;
- + (Protocol **)requiredProtocols;
-
- - (int)sgInit : (unsigned)unitNum
- controller : controller;
-
- - (unsigned char)target;
- - (unsigned char)lun;
-
- /*
- * Acquire and release, to allow exclusive access to this device.
- * -acquire returns non-zero if device in use, else marks device as in use
- * and returns zero. -release returns non-zero if device not currently
- * in use by 'caller'.
- */
- - (int)acquire : caller;
- - (int)release : caller;
-
- /*
- * ioctl equivalents.
- */
-
- /*
- * Set target and lun. If isRoot is true, this will succeed even if specified
- * target/lun are currently reserved.
- */
- - (IOReturn)setTarget : (unsigned char)target
- lun:(unsigned char)lun
- isRoot:(BOOL)isRoot;
-
- /*
- * Set controller number.
- */
- - (IOReturn)setController : (unsigned)controllerNum;
-
- /*
- * Enable/disable 'autosense' mechanism.
- */
- - (IOReturn)enableAutoSense;
- - (IOReturn)disableAutoSense;
-
- /*
- * Execute CDB. *sense will contain sense data if autosense is enabled
- * and command resulted in Check status.
- */
- - (sc_status_t)executeRequest : (IOSCSIRequest *)scsiReq
- buffer:(void *)buffer /* data destination */
- client:(vm_task_t)client
- senseBuf:(esense_reply_t *)senseBuf;
-
- /*
- * Reset SCSI bus. We can't authorize this; caller should ensure that
- * client is root!
- */
- - (sc_status_t) resetSCSIBus;
-
- - controller;
-
- @end
-
- #endif _DRIVERKIT_SCSIGENERIC_H_
-
-
-