home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.1 (Developer) [x86] / NeXT Step 3.1 Intel dev.cdr.dmg / NextDeveloper / Headers / driverkit / IOSCSIController.h < prev    next >
Encoding:
Text File  |  1993-04-30  |  2.8 KB  |  99 lines

  1. /*     Copyright (c) 1991 NeXT Computer, Inc.  All rights reserved. 
  2.  *
  3.  * IOSCSIController.h - Abstract SCSI Controller superclass. Public API is in 
  4.  *              bsd/dev/scsiTypes.h.
  5.  *
  6.  * HISTORY
  7.  * 11/9/92    Brian Pinkerton at NeXT
  8.  *      Created from Doug Mitchell's NRW version.
  9.  */
  10.  
  11. #import <driverkit/IODevice.h>
  12. #import <driverkit/i386/directDevice.h>
  13. #import <driverkit/return.h>
  14. #import <driverkit/scsiTypes.h>
  15.  
  16. @interface IOSCSIController : IODirectDevice<IOSCSIControllerExported>
  17. {
  18. @private
  19.     /*
  20.      * Target/lun reservation array. We reserve target SC_HOST_ID for
  21.      * ourself. We keep track of how many active devices are on the bus
  22.      * in _reserveCount.
  23.      */
  24.     id        _reserveArray[SCSI_NTARGETS][SCSI_NLUNS];
  25.     unsigned int    _reserveCount;
  26.     id        _reserveLock;     // NXSpinLock. Protects _reserveArray.
  27.     unsigned     _worstCaseAlign; // worst case DMA alignment. 
  28. }
  29.  
  30. - initFromDeviceDescription    : deviceDescription;
  31. - (IOReturn) attachInterruptPort;
  32.  
  33. - (unsigned int)numReserved;
  34.  
  35. - (IOReturn)getIntValues    : (unsigned *)parameterArray
  36.            forParameter : (IOParameterName)parameterName
  37.               count : (unsigned int *)count;
  38.     
  39. - (IOReturn)setIntValues    : (unsigned *)parameterArray
  40.            forParameter : (IOParameterName)parameterName
  41.               count : (unsigned int)count;
  42.  
  43. - (unsigned int) numQueueSamples;        /* simple statistics */
  44. - (unsigned int) sumQueueLengths;
  45. - (unsigned int) maxQueueLength;
  46.  
  47. - (void)resetStats;                /* zero the above counters */
  48.  
  49. /*
  50.  * Methods in IOEISADirectDevice overridden here. These are nops for
  51.  * EISA machines.
  52.  */
  53. - (void)reserveDMALock;
  54. - (void)releaseDMALock;
  55.  
  56. /*
  57.  * Subclasses of SCSIController must implement the following two 
  58.  * methods of the SCSIControllerExported protocol. 
  59.  * SCSIController's versions of these return SR_IOST_INVALID.
  60.  *
  61.  * - (sc_status_t) executeRequest : (IOSCSIRequest *)scsiReq
  62.  *               buffer : (void *)buffer 
  63.  *               client : (vm_task_t)client;
  64.  *                   
  65.  * - (sc_status_t) resetSCSIBus;            
  66.  *
  67.  *
  68.  * May optionally be overridden by subclass.
  69.  *
  70.  * - (unsigned) maxTransfer;
  71.  * - (void)getDMAAlignment        : (IODMAAlignment *)alignment;
  72.  */
  73.  
  74. /*
  75.  *  These two are called out from the I/O thread; they indicate 
  76.  * the receipt of either an interrupt message or a timeout 
  77.  * (msg_id = IO_TIMEOUT_MSG) message. 
  78.  */
  79. - (void)interruptOccurred;    
  80. - (void)timeoutOccurred;
  81.  
  82. /*
  83.  * May be overridden by subclass to handle device-specific messages received
  84.  * by the I/O thread. Superclass's version merely logs an error.
  85.  */
  86. - (void)handleMessage : (msg_header_t *)message;
  87.  
  88. @end
  89.  
  90. #define IO_IS_A_SCSI_CONTROLLER        "IOIsASCSIController"
  91. #define IO_SCSI_CONTROLLER_STATS    "IOSCSIControllerStatistics"
  92.  
  93. #define IO_SCSI_CONTROLLER_STAT_ARRAY_SIZE    3
  94. #define IO_SCSI_CONTROLLER_MAX_QUEUE_LENGTH    0
  95. #define IO_SCSI_CONTROLLER_QUEUE_SAMPLES    1
  96. #define IO_SCSI_CONTROLLER_QUEUE_TOTAL        2
  97.  
  98.  
  99.