home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / driverkit / IOTokenRing.h < prev    next >
Text File  |  1993-08-06  |  3KB  |  114 lines

  1. /*     Copyright (c) 1993 NeXT Computer, Inc.  All rights reserved. 
  2.  *
  3.  * IOTokenRing.h - TokenRing device-independent superclass
  4.  *
  5.  *    The TokenRing superclass contains the device-independent functions
  6.  *    that are common to most token-ring drivers.  The hardware-specific
  7.  *    driver should be a subclass of IOTokenRing.
  8.  *
  9.  * HISTORY
  10.  * 25-Jan-93 
  11.  *    created
  12.  *      
  13.  */
  14.  
  15. #ifdef KERNEL
  16.  
  17. #import <driverkit/IODirectDevice.h>
  18. #import <driverkit/IONetwork.h>
  19. #import <kernserv/ns_timer.h>
  20. #import <net/tokendefs.h>
  21.  
  22.  
  23. @interface IOTokenRing:IODirectDevice<IONetworkDeviceMethods>
  24. {
  25. @private
  26.  
  27.     /* 
  28.      * Interface flags 
  29.      */
  30.     
  31.     struct _trFlags {
  32.     unsigned int        _isRunning:1;        // operational or not
  33.     unsigned int        _isEarlyTokenEnabled:1;    // early token on/off
  34.     unsigned int        _shouldAutoRecover:1;    // auto recovery on/off
  35.     unsigned int        _shouldAttachIP:1;        // tr to ip iface
  36.     unsigned int        _shouldAttachNullSap:1;    // null sap iface
  37.     unsigned int        _doesIPSourceRouting:1;    // ip 802.5 src rtng
  38.     unsigned int        RESERVED:10;
  39.     }    _flags;
  40.  
  41.     /* 
  42.      * Interface parameters 
  43.      */
  44.     
  45.     unsigned     _ringSpeed;        // ring speed (4 or 16)
  46.     unsigned    _ipTokenPriority;    // IP token priority
  47.     unsigned    _ipMtu;            // IP max tran unit for tring
  48.     unsigned    _maxInfoFieldSize;    // MAC-layer info field max
  49.     
  50.     /*
  51.      * Hardware addresses
  52.      */
  53.     
  54.     token_addr_t    _nodeAddress;         // our Node address
  55.     token_addr_t    _groupAddress;        // not supported
  56.     token_addr_t     _functionalAddress;    // not supported
  57.         
  58.     /*
  59.      * Other instance variables
  60.      */
  61.  
  62.     IONetwork    *_netif;
  63.     id        _driverCmd;         
  64.     ns_time_t     _absTimeout;    
  65.     id        _hwLock;    // NXSpinLock; protects access to hdw
  66.     int        _IOTokenRing_reserved[4];
  67. }
  68.  
  69. - initFromDeviceDescription:(IODeviceDescription *)devDesc;
  70. - free;
  71.  
  72. - (BOOL)isRunning;
  73. - (void)setRunning:(BOOL)running;
  74.  
  75. - (unsigned int)relativeTimeout;
  76. - (void)setRelativeTimeout:(unsigned int)timeout;
  77. - (void)clearTimeout;
  78.  
  79. - (BOOL)earlyTokenEnabled;            // defined in Instance.table
  80. - (BOOL)shouldAutoRecover;            // defined in Instance.table
  81. - (unsigned)ringSpeed;                // defined in Instance.table
  82.  
  83. - (unsigned)maxInfoFieldSize;            // based on ring speed, but may
  84. - (void)setMaxInfoFieldSize:(unsigned)size;    // also be hardware dependent
  85.  
  86. /*
  87.  * Hardware Addresses
  88.  */
  89.  
  90. - (token_addr_t)nodeAddress;                // our Node address
  91.  
  92. @end
  93.  
  94. @interface IOTokenRing(DriverInterface)
  95.  
  96. - (BOOL)resetAndEnable:(BOOL)enable;
  97. - (IONetwork *)attachToNetworkWithAddress:(token_addr_t)addrs;
  98.  
  99. /*
  100.  * NOTE:  Use of the transmit: method may be undesirable in cases
  101.  *        where it forces buffer copying, or precludes a subclass
  102.  *      buffer management scheme.  In those cases it is preferable
  103.  *      to override the outputPacket:address: method (and perhaps the 
  104.  *      allocateNetbuf method).  If the outputPacket:address: method is 
  105.  *      overridden, then no transmit method is required.     
  106.  */
  107.  
  108. - (void)transmit:(netbuf_t)pkt; 
  109.  
  110.  
  111. @end
  112.  
  113. #endif
  114.