home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Headers / driverkit / IOSCSIController.h < prev    next >
Text File  |  1995-09-27  |  3KB  |  91 lines

  1. /*
  2.  * Copyright (c) 1991, 1992, 1993 NeXT Computer, Inc.
  3.  *
  4.  * Abstract superclass for SCSI controllers.
  5.  *
  6.  * HISTORY
  7.  *
  8.  * 14 June 1995    Doug Mitchell at NeXT
  9.  *    Added SCSI-3 support.
  10.  * 25 June 1993 David E. Bohman at NeXT
  11.  *    Cleaned up some (made machine independent).
  12.  * 11/9/92    Brian Pinkerton at NeXT
  13.  *      Created.
  14.  */
  15.  
  16. #import <driverkit/IODirectDevice.h>
  17. #import <driverkit/return.h>
  18. #import <driverkit/scsiTypes.h>
  19. #import <kernserv/queue.h>
  20.  
  21. #define IOSCSI_RSVD0_SIZE    (SCSI_NTARGETS * SCSI_NLUNS - 2)
  22.  
  23. @interface IOSCSIController : IODirectDevice<IOSCSIControllerExported>
  24. {
  25. @private
  26.     /*
  27.      * Target/lun reservation list. One target is reserved by the 
  28.      * subclass for Host ID. We keep track of how many active 
  29.      * devices are on the bus in _reserveCount.
  30.      */
  31.     queue_head_t    _reserveQ;
  32.     
  33.     /*
  34.      * Space used in 3.3 and previous versions, for backward compatibility.
  35.      */
  36.     unsigned    _IOSCSIController_reserved0[IOSCSI_RSVD0_SIZE];
  37.     
  38.     unsigned int    _reserveCount;
  39.     id        _reserveLock;     // NXLock. Protects _reserveArray.
  40.     unsigned     _worstCaseAlign; // worst case DMA alignment.
  41.     int        _IOSCSIController_reserved1[4];
  42. }
  43.  
  44. - initFromDeviceDescription    : deviceDescription;
  45.  
  46. - (unsigned int)numReserved;
  47.  
  48. - (IOReturn)getIntValues    : (unsigned *)parameterArray
  49.            forParameter : (IOParameterName)parameterName
  50.               count : (unsigned int *)count;
  51.     
  52. - (IOReturn)setIntValues    : (unsigned *)parameterArray
  53.            forParameter : (IOParameterName)parameterName
  54.               count : (unsigned int)count;
  55.  
  56. - (unsigned int) numQueueSamples;        /* simple statistics */
  57. - (unsigned int) sumQueueLengths;
  58. - (unsigned int) maxQueueLength;
  59.  
  60. - (void)resetStats;                /* zero the above counters */
  61.  
  62. /*
  63.  * Subclasses of SCSIController must implement the following two 
  64.  * methods of the SCSIControllerExported protocol. 
  65.  * SCSIController's versions of these return SR_IOST_INVALID.
  66.  * Implementation of executeSCSI3Request:buffer:client is optional.
  67.  *
  68.  * - (sc_status_t) executeRequest : (IOSCSIRequest *)scsiReq
  69.  *               buffer : (void *)buffer 
  70.  *               client : (vm_task_t)client;
  71.  *                   
  72.  * - (sc_status_t) resetSCSIBus;            
  73.  *
  74.  *
  75.  * May optionally be overridden by subclass.
  76.  *
  77.  * - (unsigned) maxTransfer;
  78.  * - (void)getDMAAlignment        : (IODMAAlignment *)alignment;
  79.  * - (int)numberOfTargets;        // IOSCSIController returns 8
  80.  */
  81.  
  82. @end
  83.  
  84. #define IO_IS_A_SCSI_CONTROLLER        "IOIsASCSIController"
  85. #define IO_SCSI_CONTROLLER_STATS    "IOSCSIControllerStatistics"
  86.  
  87. #define IO_SCSI_CONTROLLER_STAT_ARRAY_SIZE    3
  88. #define IO_SCSI_CONTROLLER_MAX_QUEUE_LENGTH    0
  89. #define IO_SCSI_CONTROLLER_QUEUE_SAMPLES    1
  90. #define IO_SCSI_CONTROLLER_QUEUE_TOTAL        2
  91.