home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / nics / root.2 / usr / include / sys / fddidef.h / fddidef
Text File  |  1998-08-19  |  8KB  |  377 lines

  1. /*
  2.  * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3.  *                                                                         
  4.  *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5.  *                   SANTA CRUZ OPERATION INC.                             
  6.  *                                                                         
  7.  *   The copyright notice above does not evidence any actual or intended   
  8.  *   publication of such source code.                                      
  9.  */
  10.  
  11. #ifndef    _IO_ODI_TSM_FDDIDEF_H
  12. #define    _IO_ODI_TSM_FDDIDEF_H
  13.  
  14. #ident    "@(#)fddidef.h    2.1"
  15. #ident    "$Header: $"
  16.  
  17. #ifdef _KERNEL_HEADERS
  18.  
  19. #include <io/odi/msm/msmstruc.h>
  20.  
  21. #elif defined(_KERNEL)
  22.  
  23. #include <sys/msmstruc.h>
  24.  
  25. #endif /* _KERNEL_HEADERS */
  26.  
  27. /*
  28.  *      Defines
  29.  */
  30.  
  31. /*
  32.  * These are used for indexing into a specific Frame-Type.
  33.  */
  34.  
  35. #define    FDDI_8022_INTERNALID    0
  36. #define    FDDI_SNAP_INTERNALID    1
  37.  
  38. /*
  39.  * These are the NOVELL assigned Frame IDs.
  40.  */
  41.  
  42. #define    FDDI_8022_ID    20
  43. #define    FDDI_SNAP_ID    23
  44.  
  45. /*
  46.  * This defines the size of each Frame-Types MAC Header.
  47.  */
  48.  
  49. #define    SIZE_FDDI        16 /*14*/
  50. #define    SIZE_FDDISNAP        21 /*17*/
  51.  
  52. /*
  53.  * These are used for supporting Assembly HSMs.    
  54.  */
  55.  
  56. #define    FDDI_DESCRIPT_LEN        10
  57. #define    FDDI_SNAP_DESCRIPT_LEN        9
  58.  
  59. /*
  60.  * PktHdr0 Constants.
  61.  */
  62. #define    TOKEN_TYPE_MASK        0xCF     /*Token type mask.*/
  63. #define    TOKEN_TYPE_NONE        0x00    /*No token is required.*/
  64. #define    TOKEN_TYPE_RESTRICT    0x10    /*Restricted Token used.*/
  65. #define    TOKEN_TYPE_UNRESTRICT    0x20    /*Unrestricted Token used.*/
  66. #define    TOKEN_TYPE_BOTH        0x30    /*Restricted & Unrestricted.*/
  67.  
  68. #define    SYNCH_FRAME        0x08    /*Synchronous frame TX.*/
  69. #define    IMM_MODE        0x04    /*Ignore ring_operation.*/
  70. #define    SEND_FIRST        0x02    /*Frame is first sent.*/
  71. #define    BEACON_FRAME        0x01    /*Send only in tx_beacon state.*/
  72.  
  73. /*
  74.  * PktHdr1 Equates.
  75.  */
  76. #define    SEND_LAST        0x40    /*Release token after this*/
  77.                     /*frame is sent.*/
  78. #define    APPEND_CRC        0x20    /*Adapter append CRC.*/
  79.  
  80. #define    TOKEN_SEND_MASK        0xE7    /*Token send mask.*/
  81. #define    TOKEN_SEND_NO_TOKEN    0x00    /*No token released.*/
  82. #define    TOKEN_SEND_UNRESTRICT    0x08    /*Unrestricted token released.*/
  83. #define    TOKEN_SEND_RESTRICT    0x10    /*Restricted token released.*/
  84. #define    TOKEN_SEND_SAME        0x18    /*Save as receive released.*/
  85.  
  86. #define    EXTRA_FS_MASK        0xF8    /*Extra Frame State mask.*/
  87. #define    EXTRA_NONE        0x00    /*TR RR II II.*/
  88. #define    EXTRA_RR        0x01    /*TR RR RR II.*/
  89. #define    EXTRA_SR        0x05    /*TR RR SR II.*/
  90. #define    EXTRA_RS        0x01    /*TR RR RS II.*/
  91. #define    EXTRA_SS        0x06    /*TR RR SS II.*/
  92. #define    EXTRA_RT        0x03    /*TR RR RT II.*/
  93. #define    EXTRA_ST        0x07    /*TR RR ST II.*/
  94.  
  95. /*
  96.  * This is the Maximum size a header can be.
  97.  */
  98. #define    MAX_MAC_HEADER        sizeof (MEDIA_HEADER) + SOURCE_MAX_SIZE    
  99.  
  100. /*
  101.  * This is the Maximum size a packet can be.
  102.  */
  103. #define MAX_PACKET_SIZE        4500 - 9
  104.  
  105. #define    FC_LLC_FRAME        0x51        /*LLC Frame Control.*/
  106. #define  FC_DATA_FRAME          0x10
  107. #define    SOURCE_ROUTING_BIT    0x01        /*Routing field exists.*/
  108. #define    SOURCE_SIZE_MASK    0x1F        /*Routing Size Mask.*/
  109. #define    TX_8022_SNAP        0x03AAAAh    /*SNAP DSAP, SSAP, CTRL0.*/
  110. #define    SNAP_INFO_SIZE        5        /*SNAP header info size.*/
  111. #define    SOURCE_MAX_SIZE        30
  112.  
  113. #define    MULTICASTBIT        0x01
  114. #define    GROUPBIT        0x01
  115. #define    LOCALBIT        0x02
  116. #define    BROADCAST        0xffff
  117.  
  118. /*
  119.  * These bits define 802.2 types.
  120.  */
  121. #define    S_OR_U_FORMAT        0x01
  122. #define    U_FORMAT        0x02
  123.  
  124. /*
  125.  * v3.00 Assembly Statistics Table
  126.  */
  127. #define    STATISTICSMASK        0x0D2813FF
  128. #define    FDDISTATSCOUNT        10
  129. #define    LONGCOUNTER        0x00
  130. #define    LARGECOUNTER        0x01
  131.  
  132. #define    NUMBER_OF_PROMISCUOUS_COUNTERS    32
  133. #define    MAX_MULTICAST        32
  134.  
  135. /*
  136.  * ECB_DataLength bit assignmets for pipeline and ecb aware adapters.
  137.  */
  138. #define    HSM_HAS_BEEN_IN_GETRCB    0x80000000        /* bit 31 */
  139. #define    PSTK_WANTS_FRAME    0x40000000        /* bit 30 */
  140. #define    HSM_TOLD_TO_SKIP    0x007f0000        /* bits 23 through 16 */
  141. #define    HSM_TOLD_TO_COPY    0x0000ffff        /* bits 15 through 0 */
  142.  
  143. /*
  144.  *
  145.  *      TypeDefs
  146.  *
  147.  */
  148.  
  149. typedef struct
  150. {
  151.     UINT8    *MinNodeAddress;
  152.     UINT8    *MaxNodeAddress;
  153.     UINT32    MinRetries;
  154.     UINT32    MaxRetries;
  155.     UINT32    NumberFrames;
  156. }
  157. LANConfigurationLimitStructure;
  158.  
  159. typedef struct    _MEDIA_HEADER_
  160. {
  161.     UINT8        MH_FrameControl;
  162.     NODE_ADDR    MH_Destination;
  163.     NODE_ADDR    MH_Source;
  164.     UINT8        MH_DSAP;
  165.     UINT8        MH_SSAP;
  166.     UINT8        MH_Ctrl0;
  167.     UINT8        MH_SNAP [5];
  168. }
  169. MEDIA_HEADER;
  170.  
  171. typedef    struct    _TCB_FRAGMENTSTRUCT_
  172. {
  173.     UINT32        TCB_FragmentCount;
  174.     FRAGMENTSTRUCT    TCB_Fragment;
  175. }TCB_FRAGMENTSTRUCT;
  176.  
  177. typedef    struct _TCB_
  178. {
  179.     UINT32            TCB_DriverWS[3];
  180.     UINT32            TCB_DataLen;
  181.     TCB_FRAGMENTSTRUCT    *TCB_FragStruct;
  182.     UINT32            TCB_MediaHeaderLen;
  183.     MEDIA_HEADER        TCB_MediaHeader;
  184.     UINT8            TCB_SRPad[SOURCE_MAX_SIZE];
  185. }TCB;
  186.  
  187. typedef struct    _MEDIA_DATA_    {
  188.     UINT32            MaxMulticastAddresses;
  189.     GROUP_ADDR_LIST_NODE        *MulticastAddressList;
  190.     UINT32            MulticastAddressCount;
  191.     TCB            *TCBHead;
  192.     TCB            *TCBList;
  193.     MLID_STATS_TABLE    *NewStatsPtr;
  194.     void            (*TransmitRoutine)(TCB *);
  195.     UINT32            PromiscuousMode;
  196.     UINT8            PromiscuousCounters[NUMBER_OF_PROMISCUOUS_COUNTERS];
  197.     UINT32            RxStatus;
  198. }MEDIA_DATA;
  199.  
  200. typedef    struct    _M_ADAPTER_DS_    
  201. {
  202.     UINT32    MADS_MulticastCount;
  203. }
  204. M_ADAPTER_DS;
  205.  
  206. /*
  207.  *
  208.  *      Prototype Definitions
  209.  *
  210.  */
  211.  
  212. UINT32 CInitializeFDDITSM(
  213.         MODULE_HANDLE *moduleHandle,
  214.         SCREEN_HANDLE    *screenID
  215. );
  216. void CRemoveFDDITSM(
  217.         void
  218. );
  219. ODISTAT    CFDDITSMRegisterHSM(
  220.         DRIVER_PARM_BLOCK    *DriverParameterBlock,
  221.         CONFIG_TABLE        **configTable
  222. );
  223. GROUP_ADDR_LIST_NODE *FDDIFindAddressInMCTable(
  224.         SHARED_DATA        *sharedData,
  225.         NODE_ADDR        *mcAddress
  226. );
  227. ODISTAT    FDDIMediaAdjust(
  228.         FRAME_DATA        *frameData
  229. );
  230. ODISTAT    FDDIMediaInit(
  231.         DRIVER_DATA    *driverData,
  232.         FRAME_DATA        *frameData
  233. );
  234. ODISTAT    FDDIMediaReset(
  235.         DRIVER_DATA    *driverData,
  236.         FRAME_DATA        *frameData
  237. );
  238. ODISTAT    FDDIMediaShutdown(
  239.         DRIVER_DATA    *driverData,
  240.         FRAME_DATA        *frameData,
  241.         UINT32            shutdownType
  242. );
  243. void FDDIMediaSend(
  244.         ECB            *ecb,
  245.         CONFIG_TABLE        *configTable
  246. );
  247. ODISTAT    FDDIMediaAddMulticast(
  248.         DRIVER_DATA        *driverData,
  249.         NODE_ADDR        *McAddress
  250. );
  251. ODISTAT    FDDIMediaDeleteMulticast(
  252.         DRIVER_DATA        *driverData,
  253.         NODE_ADDR        *McAddress
  254. );
  255. ODISTAT    FDDIMediaNodeOverride(
  256.         FRAME_DATA        *frameData,
  257.         MEON            mode
  258. );
  259. ODISTAT    FDDIMediaAdjustNodeAddress(
  260.         FRAME_DATA        *frameData
  261. );
  262. ODISTAT    FDDIMediaSetLookAheadSize(
  263.         DRIVER_DATA        *driverData,
  264.         FRAME_DATA        *frameData,
  265.         UINT32            sizea
  266. );
  267. ODISTAT    FDDIMediaPromiscuousChange(
  268.         DRIVER_DATA        *driverData,
  269.         FRAME_DATA        *frameData,
  270.         UINT32            PromiscuousState,
  271.         UINT32            *PromiscuousMode
  272. );
  273. ODISTAT    FDDIMediaRegisterMonitor(
  274.         DRIVER_DATA    *driverData,
  275.         FRAME_DATA        *frameData,
  276.         void            (*TXRMonRoutine)(TCB *),
  277.         BOOLEAN            MonitorState
  278. );
  279.  
  280. ODISTAT    FDDIMediaGetParameters(
  281.         CONFIG_TABLE        *configTable
  282. );
  283. ODISTAT FDDIMediaGetMulticastInfo(
  284.         struct _DRIVER_DATA_    *driverData,
  285.         ECB            *MulticastInfoECB
  286. );
  287. void FDDIBuildASMStatStrings(
  288.         StatTableEntry        *tableEntry
  289. );
  290. ODISTAT    CFDDITSMUpdateMulticast(
  291.         DRIVER_DATA        *driverData
  292. );
  293. UINT32 FDDICMediaSend8022(
  294.         SHARED_DATA        *sharedData,
  295.         ECB            *ecb,
  296.         TCB            *tcb
  297. );
  298. UINT32 FDDICMediaSendSNAP(
  299.         SHARED_DATA        *sharedData,
  300.         ECB            *ecb,
  301.         TCB            *tcb
  302. );
  303. TCB *CFDDITSMGetNextSend(
  304.         DRIVER_DATA        *driverData,
  305.         CONFIG_TABLE        **configTable,
  306.         UINT32            *lengthToSend,
  307.         void            **TCBPhysicalPtr
  308. );
  309. void CFDDITSMFastSendComplete(
  310.         DRIVER_DATA        *driverData,
  311.         TCB            *tcb,
  312.         UINT32            transmitStatus
  313. );
  314. void CFDDITSMSendComplete(
  315.         DRIVER_DATA        *driverData,
  316.         TCB            *tcb,
  317.         UINT32            transmitStatus
  318. );
  319. RCB *CFDDITSMGetRCB(
  320.         DRIVER_DATA        *driverData,
  321.         UINT8            *packetHdr,
  322.         UINT32            pktSize,
  323.         UINT32            rcvStatus,
  324.         UINT32            *startByte,
  325.         UINT32            *numBytes
  326. );
  327. RCB *CFDDITSMProcessGetRCB(
  328.         DRIVER_DATA        *driverData,
  329.         RCB            *rcb,
  330.         UINT32            pktSize,
  331.         UINT32            rcvStatus,
  332.         UINT32            newRcbSize
  333. );
  334. RCB *CFDDITSMFastProcessGetRCB(
  335.         DRIVER_DATA        *driverData,
  336.         RCB            *rcb,
  337.         UINT32            pktSize,
  338.         UINT32            rcvStatus,
  339.         UINT32            newRcbSize
  340. );
  341. void CFDDITSMFastRcvComplete(
  342.         DRIVER_DATA        *driverData,
  343.         RCB            *rcb
  344. );
  345. void CFDDITSMFastRcvCompleteStatus(
  346.         DRIVER_DATA        *driverData,
  347.         RCB            *rcb,
  348.         UINT32            packetLength,
  349.         UINT32            packetStatusa
  350. );
  351. UINT32    CFDDITSMGetHSMIFLevel(
  352.         void
  353. );
  354.  
  355. void CFDDITSMRcvComplete(
  356.         DRIVER_DATA        *driverData,
  357.         RCB            *rcb
  358. );
  359. void CFDDITSMRcvCompleteStatus(
  360.         DRIVER_DATA        *driverData,
  361.         RCB            *rcb,
  362.         UINT32            packetLength,
  363.         UINT32            packetStatus
  364. );
  365. void CFDDITSMECBRcvComplete(
  366.         DRIVER_DATA        *driverData,
  367.         ECB            *ecb
  368. );
  369. void CFDDITSMPipelineRcvComplete(
  370.         DRIVER_DATA        *driverData,
  371.         ECB            *ecb,
  372.         UINT32            packetLength,
  373.         UINT32            packetStatus
  374. );
  375.  
  376. #endif    /* _IO_TSM_FDDITSM_FDDIDEF_H */
  377.