home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / nics / root.2 / usr / include / sys / msm.h / msm
Text File  |  1998-08-19  |  21KB  |  633 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_MSM_MSM_H   /* wrapper symbol for kernel use */
  12. #define _IO_MSM_MSM_H   /* subject to change without notice */
  13.  
  14. #ident    "@(#)msm.h    2.1"
  15. #ident    "$Header: $"
  16.  
  17. #ifdef  _KERNEL_HEADERS
  18.  
  19. #include <io/odi/msm/msmnbi.h>
  20.  
  21. #elif defined(_KERNEL)
  22.  
  23. #include <sys/msmnbi.h>
  24.  
  25. #endif
  26.  
  27. struct    _DRIVER_PARM_BLOCK_;
  28. struct    _TSM_PARM_BLOCK_;
  29. struct    _MEDIA_DATA_;
  30. struct    _MSM_PROTECTION_OBJ_;
  31. struct    _DRIVER_DATA_;
  32.  
  33. #define    ALL_ONES        -1
  34. #define MAX_FRAME_TYPES        4
  35.  
  36. /*
  37.  * portable alias definitions.
  38.  */
  39.  
  40. #define    COPY_UINT16(dest_addr, src_addr)    \
  41.                     COPY_WORD(src_addr, dest_addr)
  42. #define    COPY_UINT32(dest_addr, src_addr)    \
  43.                     COPY_LONG(src_addr, dest_addr)
  44. #define    COPY_ADDR(dest_addr, src_addr)    COPY_NODE(src_addr, dest_addr)
  45.  
  46. #define    GET_UINT16(addr)        GET_WORD(addr)
  47. #define    GET_UINT32(addr)        GET_LONG(addr)
  48. #define    PUT_UINT16(addr, value)        PUT_WORD(value, addr)
  49. #define    PUT_UINT32(addr, value)        PUT_LONG(value, addr)
  50.  
  51. #define    GET_HILO_UINT16(addr)        GET_HILO_WORD(addr)
  52. #define    GET_HILO_UINT32(addr)        GET_HILO_LONG(addr)
  53. #define    GET_LOHI_UINT16(addr)        GET_LOHI_WORD(addr)
  54. #define    GET_LOHI_UINT32(addr)        GET_LOHI_LONG(addr)
  55.  
  56. #define    PUT_HILO_UINT16(addr, value)    PUT_HILO_WORD(value, addr)
  57. #define    PUT_HILO_UINT32(addr, value)    PUT_HILO_LONG(value, addr)
  58. #define    PUT_LOHI_UINT16(addr, value)    PUT_LOHI_WORD(value, addr)
  59. #define    PUT_LOHI_UINT32(addr, value)    PUT_LOHI_LONG(value, addr)
  60.  
  61. #define    VALUE_TO_HILO_UINT16(addr)    VALUE_TO_HILO_WORD(addr)
  62. #define    VALUE_TO_HILO_UINT32(addr)    VALUE_TO_HILO_LONG(addr)
  63. #define    VALUE_TO_LOHI_UINT16(addr)    VALUE_TO_LOHI_WORD(addr)
  64. #define    VALUE_TO_LOHI_UINT32(addr)    VALUE_TO_LOHI_LONG(addr)
  65.  
  66. #define    VALUE_FROM_HILO_UINT16(addr)    VALUE_FROM_HILO_WORD(addr)
  67. #define    VALUE_FROM_HILO_UINT32(addr)    VALUE_FROM_HILO_LONG(addr)
  68. #define    VALUE_FROM_LOHI_UINT16(addr)    VALUE_FROM_LOHI_WORD(addr)
  69. #define    VALUE_FROM_LOHI_UINT32(addr)    VALUE_FROM_LOHI_LONG(addr)
  70.  
  71. #define    COPY_TO_HILO_UINT16(dest_addr, src_addr)    \
  72.                     COPY_TO_HILO_WORD(src_addr, dest_addr)
  73. #define    COPY_TO_HILO_UINT32(dest_addr, src_addr)    \
  74.                     COPY_TO_HILO_LONG(src_addr, dest_addr)
  75. #define    COPY_TO_LOHI_UINT16(dest_addr, src_addr)    \
  76.                     COPY_TO_LOHI_WORD(src_addr, dest_addr)
  77. #define    COPY_TO_LOHI_UINT32(dest_addr, src_addr)    \
  78.                     COPY_TO_LOHI_LONG(src_addr, dest_addr)
  79.  
  80. #define    COPY_FROM_HILO_UINT16(dest_addr, src_addr)    \
  81.                     COPY_FROM_HILO_WORD(src_addr, dest_addr)
  82. #define    COPY_FROM_HILO_UINT32(dest_addr, src_addr)    \
  83.                     COPY_FROM_HILO_LONG(src_addr, dest_addr)
  84. #define    COPY_FROM_LOHI_UINT16(dest_addr, src_addr)    \
  85.                     COPY_FROM_LOHI_WORD(src_addr, dest_addr)
  86. #define    COPY_FROM_LOHI_UINT32(dest_addr, src_addr)    \
  87.                     COPY_FROM_LOHI_LONG(src_addr, dest_addr)
  88.  
  89. #define    HOST_TO_HILO_UINT16(addr)    HOST_TO_HILO_WORD(addr)
  90. #define    HOST_TO_HILO_UINT32(addr)    HOST_TO_HILO_LONG(addr)
  91. #define    HOST_TO_LOHI_UINT16(addr)    HOST_TO_LOHI_WORD(addr)
  92. #define    HOST_TO_LOHI_UINT32(addr)    HOST_TO_LOHI_LONG(addr)
  93.  
  94. #define    HOST_FROM_HILO_UINT16(addr)    HOST_FROM_HILO_WORD(addr)
  95. #define    HOST_FROM_HILO_UINT32(addr)    HOST_FROM_HILO_LONG(addr)
  96. #define    HOST_FROM_LOHI_UINT16(addr)    HOST_FROM_LOHI_WORD(addr)
  97. #define    HOST_FROM_LOHI_UINT32(addr)    HOST_FROM_LOHI_LONG(addr)
  98.  
  99. #define    UINT16_EQUAL(addr1, addr2)    WORD_EQUAL(addr1, addr2)
  100. #define    UINT32_EQUAL(addr1, addr2)    LONG_EQUAL(addr1, addr2)
  101. #define    ADDR_EQUAL(addr1, addr2)    NODE_EQUAL(addr1, addr2)
  102.  
  103. typedef struct _FRAGMENT_LIST_STRUCT_ {
  104.     UINT32        FragmentCount;
  105.     FRAGMENT_STRUCT    FragmentStruct[1];
  106. } FRAGMENT_LIST_STRUCT;
  107.  
  108. typedef struct _MSM_TCB_FRAGMENTSTRUCT_ {
  109.     UINT32        TCB_FragmentCount;
  110.     FRAGMENTSTRUCT    TCB_Fragment;
  111. } MSM_TCB_FRAGMENTSTRUCT;
  112.  
  113. typedef struct _MSM_TCB_ {
  114.     UINT32            TCB_DriverWS[3];
  115.     UINT32            TCB_DataLen;
  116.     MSM_TCB_FRAGMENTSTRUCT    *TCB_FragStruct;
  117. } MSM_TCB;
  118.  
  119. typedef enum _CHSM_COMPLETE_ {
  120.     CHSM_COMPLETE_STATISTICS = 0,
  121.     CHSM_COMPLETE_MULTICAST = 1,
  122.     CHSM_COMPLETE_SHUTDOWN = 2,
  123.     CHSM_COMPLETE_RESET = 3,
  124.     CHSM_COMPLETE_LOOK_AHEAD = 4,
  125.     CHSM_COMPLETE_PROMISCUOUS = 5
  126. } CHSM_COMPLETE;
  127.  
  128. typedef enum _AES_TYPE_ {
  129.     AES_TYPE_PRIVILEGED_ONE_SHOT    = 0,
  130.     AES_TYPE_PRIVILEGED_CONTINUOUS    = 1,
  131.     AES_TYPE_PROCESS_ONE_SHOT    = 2,
  132.     AES_TYPE_PROCESS_CONTINUOUS    = 3
  133. } AES_TYPE;
  134.  
  135. typedef struct _MLID_AES_ECB_ {
  136.     struct _MLID_AES_ECB_    *NextLink;
  137.     void            (* _cdecl DriverAES)(struct _DRIVER_DATA_ *,
  138.                     CONFIG_TABLE *, ...);
  139.     AES_TYPE        AesType;
  140.     UINT32            TimeInterval;
  141.     void            *AesContext;
  142.     UINT8            AesReserved[30];
  143. } MLID_AES_ECB;
  144.  
  145. typedef struct    _EXTRA_CONFIG_ISR_ {
  146.     UINT32            (_cdecl * ISRRoutine)(void *MagicNumber);
  147.     void            *ISRReserved0;
  148.     void            *ISRReserved1;
  149.     void            *ISRReserved2;
  150.     void            *ISRReserved3;
  151. } EXTRA_CONFIG_ISR;
  152.  
  153. typedef struct _EXTRA_CONFIG_ {
  154.     struct _EXTRA_CONFIG_    *NextLink;
  155.     UINT32            (_cdecl * ISRRoutine0)(void *MagicNumber);
  156.     void            *ISR0Reserved0;
  157.     void            *ISR0Reserved1;
  158.     void            *ISR0Reserved2;
  159.     UINT32            InterruptCookie0;
  160.     UINT32            (_cdecl * ISRRoutine1)(void *MagicNumber);
  161.     void            *ISR1Reserved0;
  162.     void            *ISR1Reserved1;
  163.     void            *ISR1Reserved2;
  164.     UINT32            InterruptCookie1;
  165.     IO_CONFIG        IOConfig;
  166. } EXTRA_CONFIG;
  167.  
  168. typedef enum _REG_TYPE_ {
  169.     REG_TYPE_NEW_ADAPTER,
  170.     REG_TYPE_NEW_FRAME,
  171.     REG_TYPE_NEW_CHANNEL,
  172.     REG_TYPE_FAIL
  173. } REG_TYPE;
  174.  
  175. typedef    struct _RCB_ {
  176.     union {
  177.         UINT8    RWs_i8val[8];
  178.         UINT16    RWs_i16val[4];
  179.         UINT32    RWs_i32val[2];
  180.         UINT64    RWs_I64val;
  181.     } RCBDriverWS;
  182.     UINT8        RCBReserved[(UINT32)&(((struct ECB *)0)->
  183.                 ECB_FragmentCount) -
  184.                 (UINT32)&(((struct ECB *)0)->ECB_Status)];
  185.     UINT32        RCBFragCount;
  186.     FRAGMENTSTRUCT    RCBFragStruct;
  187. } RCB;
  188.  
  189. #define    SPARE_ECB_STATUS    0xeeee
  190.  
  191. typedef    struct    _SHARED_DATA_ {
  192. #ifdef IAPX386
  193.     UINT32                CMSMReservedForCHSM[18];
  194.     UINT32                CMSMAsmHSMUpdate;
  195.     struct _MSTATS_            *CMSMAsmStatsPtr;
  196. #else
  197.     UINT32                CMSMReservedForCHSM[20];
  198. #endif
  199.     struct _DRIVER_PARM_BLOCK_    *CMSMAsmParmBlock;
  200.     UINT32                CMSMAdapterIntDisabled;
  201.     UINT32                CMSMNeedContiguousECB;
  202.     struct _GENERIC_STATS_        *CMSMGenericStatsPtr;
  203.     struct _MSM_PROTECTION_OBJ_    *CMSMProtectionObject;
  204.     UINT32                CMSMMaxFrameHeaderSize;
  205.     UINT8                CMSMPhysNodeAddress[8];
  206.     void                *CMSMSendListHead;
  207.     void                *CMSMSendListTail;
  208.     struct _DRIVER_PARM_BLOCK_    *CMSMDPBlockPtr;
  209.     void                *CMSMMediaDataPtr;
  210.     CONFIG_TABLE            *CMSMDefaultVirtualBoard;
  211.     UINT32                CMSMDriverInterrupt;
  212.     UINT32                CMSMInCriticalSection;
  213.     MLID_STATS_TABLE        *CMSMStatsPtr;
  214.     CONFIG_TABLE            *CMSMVirtualBoardLink[4];
  215.     UINT32                CMSMStatusFlags;
  216.     volatile UINT32            CMSMTxFreeCount;
  217. } SHARED_DATA;
  218.  
  219. #define    DADSP_TO_CMSMADSP(n)    ((SHARED_DATA *)n - 1)
  220.  
  221. #define    PERMANENT_SHUTDOWN    0
  222. #define    TEMPORARY_SHUTDOWN    1
  223.  
  224. /*
  225.  * CMSMStatusFlags bit definitions.
  226.  */
  227. #define    SHUTDOWN        0x01
  228. #define    TXQUEUED        0x02
  229.  
  230. struct    _TCB_;
  231. struct    _TCB_FRAGMENTSTRUCT_;
  232. struct    _MEDIA_HEADER_;
  233.  
  234. typedef    struct _FRAME_DATA_ {
  235.     CONFIG_TABLE            ConfigTable;
  236.     void                *Reserved[20];
  237.     void                *DriverData;
  238.     UINT32                InternalMediaID;
  239.     UINT32                MediaHeaderSize;
  240.     UINT8                PacketType[8];
  241.     UINT32                BitSwapAddressFlag;
  242.     struct _DRIVER_PARM_BLOCK_    *DPBlock;
  243.     struct _TSM_PARM_BLOCK_        *MPBlock;
  244.     void                *FirmwareBuffer;
  245.     UINT32                HardwareIsRegistered;
  246.     void                (_cdecl * SendEntry)(ECB *ecb,
  247.                         CONFIG_TABLE *configTable);
  248.     UINT32                (_cdecl * SendRoutine)(
  249.                         SHARED_DATA *sharedData,
  250.                         ECB *ecb,
  251.                         struct _TCB_ *tcb);
  252.     UINT32                (_cdecl * Driver_Control)(void);
  253.     void                *Nothing;
  254. } FRAME_DATA;
  255.  
  256. #define CONFIG_TO_MSM(n)    (FRAME_DATA *)((UINT8 *)n -    \
  257.                 (UINT32)&((FRAME_DATA *)0)->ConfigTable)
  258. #define AES_TO_MLID(n)        (MLID_AES_ECB *)((UINT8 *)n -    \
  259.                 (UINT32)&((MLID_AES_ECB *)0)->AesReserved)
  260.  
  261. typedef struct ScreenStruct {
  262.     void    *filler;
  263. } SCREEN_HANDLE;
  264.  
  265. typedef struct _CHSM_STACK_ {
  266.     struct _MODULE_HANDLE_    *ModuleHandle;        /* just an int */
  267.     SCREEN_HANDLE        *ScreenHandle;        /* NULL */
  268.     MEON            *CommandLine;
  269.     MEON            *ModuleLoadPath;     /* NULL */
  270.     UINT32            UnitializedDataLength;     /* 0 */
  271.     void            *CustomDataFileHandle;
  272.     UINT32            (* FileRead)(void *FileHandle, /* NULL */
  273.                     UINT32 FileOffset,
  274.                     void *FileBuffer,
  275.                     UINT32 FileSize);
  276.     UINT32                  *CustomDataOffset;    /* NULL */
  277.     UINT32            CustomDataSize;        /* NULL */
  278.     UINT32            NumMsgs;        /* NULL */
  279.     MEON            **Msgs;            /* msg file name */
  280. } CHSM_STACK;
  281.  
  282. typedef struct _DRIVER_PARM_BLOCK_ {
  283.     UINT32            DriverParameterSize;
  284.     CHSM_STACK        *DriverInitParmPointer;
  285.     PVOID            DriverModuleHandle;
  286.     void            *DBP_Reserved0;
  287.     void            *DriverAdapterPointer;
  288.     CONFIG_TABLE        *DriverConfigTemplatePtr;
  289.     UINT32            DriverFirmwareSize;
  290.     void            *DriverFirmwareBuffer;
  291.     UINT32                  DPB_Reserved1;
  292.     void            *DPB_Reserved2;
  293.     void            *DPB_Reserved3;
  294.     void            *DPB_Reserved4;
  295.     UINT32            DriverAdapterDataSpaceSize;
  296.     struct _DRIVER_DATA_    *DriverAdapterDataSpacePtr;
  297.     UINT32            DriverStatisticsTableOffset;
  298.     UINT32            DriverEndOfChainFlag;
  299.     UINT32            DriverSendWantsECBs;
  300.     UINT32            DriverMaxMulticast;
  301.     UINT32            DriverNeedsBelow16Meg;
  302.     void            *DPB_Reserved5;
  303.     void            *DPB_Reserved6;
  304.     void            (_cdecl * DriverISRPtr)(struct _DRIVER_DATA_
  305.                     *driverData);
  306.     ODISTAT            (_cdecl * DriverMulticastChangePtr)(struct
  307.                     _DRIVER_DATA_ *driverData,
  308.                     CONFIG_TABLE *configTable,
  309.                     GROUP_ADDR_LIST_NODE *mcTable,
  310.                     UINT32 numEntries, UINT32
  311.                     functionalTable);
  312.     void            (_cdecl * DriverPollPtr)(struct _DRIVER_DATA_
  313.                     *driverData, CONFIG_TABLE
  314.                     *configTable);
  315.     ODISTAT            (_cdecl * DriverResetPtr)(struct _DRIVER_DATA_
  316.                     *driverData, CONFIG_TABLE
  317.                     *configTable);
  318.      void            (_cdecl * DriverSendPtr)(struct _DRIVER_DATA_
  319.                     *driverData, CONFIG_TABLE
  320.                     *configTable, struct _TCB_ *tcb,
  321.                     UINT32 pktSize, void *PhysTcb);
  322.     ODISTAT            (_cdecl * DriverShutdownPtr)(struct
  323.                     _DRIVER_DATA_ *driverData,
  324.                     CONFIG_TABLE *configTable,
  325.                     UINT32 shutDownType);
  326.     void            (_cdecl * DriverTxTimeoutPtr)(struct
  327.                     _DRIVER_DATA_ *driverData,
  328.                     CONFIG_TABLE *configTable);
  329.     ODISTAT            (_cdecl * DriverPromiscuousChangePtr)(struct
  330.                     _DRIVER_DATA_ *driverData,
  331.                     CONFIG_TABLE *configTable, UINT32
  332.                     promiscuousMode);
  333.     ODISTAT            (_cdecl * DriverStatisticsChangePtr)(struct
  334.                     _DRIVER_DATA_ *driverData,
  335.                     CONFIG_TABLE *configTable);
  336.     ODISTAT            (_cdecl * DriverRxLookAheadChangePtr)(struct
  337.                     _DRIVER_DATA_ *driverData,
  338.                     CONFIG_TABLE *configTable);
  339.     ODISTAT            (_cdecl * DriverManagementPtr)(struct
  340.                     _DRIVER_DATA_ *driverData,
  341.                     CONFIG_TABLE *configTable,
  342.                     struct ECB *ecb);
  343.     void            (_cdecl * DriverEnableInterruptPtr)(struct
  344.                     _DRIVER_DATA_ *driverData);
  345.     BOOLEAN            (_cdecl * DriverDisableInterruptPtr)(struct
  346.                     _DRIVER_DATA_ *driverData,
  347.                     BOOLEAN switchVal);
  348.     void            (_cdecl * DriverISRPtr2)(struct _DRIVER_DATA_
  349.                     *driverData);
  350.     MEON            ***DriverMessagesPtr;
  351.     MEON_STRING        *HSMSpecVersionStringPtr;
  352.  
  353. } DRIVER_PARM_BLOCK;
  354.  
  355. #define    ASM_DPBLOCK_SIZE    136
  356.  
  357. #ifdef    IAPX386
  358.  
  359. /*
  360.  * v3.00 Assembly HSMs stats table.
  361.  */
  362. typedef struct _MSTATS_ {
  363.     UINT8        MSTATS_MajorVer;
  364.     UINT8        MSTATS_MinorVer;
  365.     UINT16        MSTATS_NumGenericCounters;
  366.     UINT32        MSTATS_ValidMask0;
  367.     GENERIC_STATS    MSTATS_Generic;
  368. } MSTATS;
  369.  
  370. #endif
  371.  
  372. struct    _MODULE_HANDLE_;
  373. struct    _DRIVER_OPTION_;
  374.  
  375. /*
  376.  * MSM Specific declarations.
  377.  */
  378. extern    UINT8    MSMBitSwapTable[];
  379.  
  380. void    _cdecl    CMSMAddToCounter(STAT_TABLE_ENTRY *statTableEntryPtr,
  381.             UINT32 value);
  382. void *    _cdecl    CMSMAlloc(const struct _DRIVER_DATA_ *driverData,
  383.             UINT32 nBytes);
  384. void *    _cdecl    CMSMAllocPages(const struct _DRIVER_DATA_ *driverData,
  385.             UINT32 nBytes);
  386. RCB *    _cdecl    CMSMAllocateRCB(const struct _DRIVER_DATA_ *driverData,
  387.             UINT32 nBytes, void **PhysicalRCB);
  388. void    _cdecl    CMSMControlComplete(struct _DRIVER_DATA_ *driverData,
  389.             CHSM_COMPLETE controlFunction, ODISTAT
  390.             completionStatus);
  391. void    _cdecl    CMSMDisableHardwareInterrupt(const struct _DRIVER_DATA_
  392.             *driverData);
  393. void    _cdecl    CMSMDriverRemove(struct _MODULE_HANDLE_ *);
  394.  
  395. /*
  396.  * the following two functions are used to get the original ECB (with
  397.  * Logical addresses in its frag list) back if the driver has set the
  398.  * MM_FRAGS_PHYS_BIT and needs Logical fragments. the original ECB is
  399.  * stored in the ECB_ESR field.
  400.  */
  401. ECB *    _cdecl    CMSMECBPhysToLogFrags(ECB *ecb);
  402. ECB *    _cdecl    CMSMTCBPhysToLogFrags(struct _TCB_ *tcb);
  403. void    _cdecl    CMSMEnableHardwareInterrupt(const struct _DRIVER_DATA_
  404.             *driverData);
  405. ODISTAT    _cdecl    CMSMEnablePolling(const struct _DRIVER_DATA_ *driverData);
  406. void    _cdecl    CMSMEnqueueSend(FRAME_DATA *frameData, const struct
  407.             _DRIVER_DATA_ *driverData, struct ECB *ecb);
  408. void    _cdecl    CMSMFree(const struct _DRIVER_DATA_ *driverData, void *dataPtr);
  409. void    _cdecl    CMSMFreePages(const struct _DRIVER_DATA_ *driverData,
  410.             void *dataPtr);
  411. UINT32    _cdecl    CMSMGetCurrentTime(void);
  412. UINT32    _cdecl    CMSMGetMicroTimer(void);
  413. void *    _cdecl    CMSMGetPhysical(void *logicalAddr);
  414. ECB *    _cdecl    CMSMGetPhysicalECB(struct _DRIVER_DATA_ *driverData, ECB *ecb);
  415. UINT32    _cdecl    CMSMGetPollSupportLevel(void);
  416. void    _cdecl    CMSMIncrCounter(STAT_TABLE_ENTRY *statTableEntryPtr);
  417. void *    _cdecl    CMSMInitAlloc(UINT32 nbytes);
  418.  
  419. ODISTAT    _cdecl    CMSMParseDriverParameters(DRIVER_PARM_BLOCK *hsmParmBlock,
  420.             struct _DRIVER_OPTION_ *driverOption);
  421. ODISTAT    _cdecl    CMSMParseCTSMParameters(CONFIG_TABLE *configTable,
  422.             struct _DRIVER_OPTION_ *driverOption);
  423. ODISTAT        CMSMASCIINodeToHex(CONFIG_TABLE *configTable,
  424.             MEON_STRING *asciiNode);
  425.  
  426. typedef    enum _MSG_TYPE_ {
  427.     MSG_TYPE_INIT_INFO,
  428.     MSG_TYPE_INIT_WARNING,
  429.     MSG_TYPE_INIT_ERROR,
  430.     MSG_TYPE_RUNTIME_INFO,
  431.     MSG_TYPE_RUNTIME_WARNING,
  432.     MSG_TYPE_RUNTIME_ERROR
  433. } MSG_TYPE;
  434.  
  435. void    _cdecl    CMSMPrintString(const CONFIG_TABLE *configTable, MSG_TYPE
  436.             msgType, MEON_STRING *msg, void *parm1, void *parm2);
  437. void    _cdecl    CMSMReadPhysicalMemory(UINT32 nbytes, void *destAddr,
  438.             void *srcBusTag, const void *physSrcAddr);
  439. REG_TYPE _cdecl    CMSMRegisterHardwareOptions(CONFIG_TABLE *configTable,
  440.             struct _DRIVER_DATA_ **driverData);
  441. ODISTAT    _cdecl    CMSMRegisterMLID(struct _DRIVER_DATA_ *driverData,
  442.             CONFIG_TABLE *configTable);
  443. ODISTAT    _cdecl    CMSMRegisterResource(const struct _DRIVER_DATA_    *driverData,
  444.             CONFIG_TABLE *configTable, EXTRA_CONFIG *extraConfig);
  445. ODISTAT    _cdecl    CMSMRegisterTSM(DRIVER_PARM_BLOCK *DriverParameterBlock,
  446.             TSM_PARM_BLOCK *MediaParameterBlock, CONFIG_TABLE
  447.             **configTable);
  448. void    _cdecl    CMSMReturnDriverResources(const CONFIG_TABLE *configTable);
  449. ECB *    _cdecl    CMSMReturnPhysicalECB(const struct _DRIVER_DATA_
  450.             *driverData, ECB *ecb);
  451. void    _cdecl    CMSMReturnRCB(const struct _DRIVER_DATA_ *driverData,
  452.             RCB *rcb);
  453. ODISTAT    _cdecl    CMSMScheduleAES(const struct _DRIVER_DATA_ *driverData,
  454.             MLID_AES_ECB *mlidAESECB);
  455. void    _cdecl    CMSMServiceEvents(void);
  456. void    _cdecl    CMSMYieldWithDelay(void);
  457.  
  458. ODISTAT    _cdecl    CMSMSetHardwareInterrupt(struct _DRIVER_DATA_ *driverData,
  459.             const CONFIG_TABLE *configTable);
  460. void    _cdecl    CMSMWritePhysicalMemory(UINT32 nbytes, void *destBusTag,
  461.             void *physDestAddr, const void *srcAddr);
  462.  
  463. UINT32    _cdecl    CMSMGetAlignment (UINT32 type );
  464. ODI_NBI    _cdecl    CMSMGetBusInfo(void *busTag, UINT32 *physicalMemAddressSize,
  465.             UINT32 *ioAddrSize );
  466. ODI_NBI    _cdecl    CMSMGetBusName(void *busTag, MEON_STRING **busName );
  467. ODI_NBI _cdecl    CMSMGetBusSpecificInfo(void *busTag, UINT32 size,
  468.             void *busSpecificInfo);
  469. ODI_NBI    _cdecl    CMSMGetBusTag(const MEON_STRING    *busName, void **busTag );
  470. ODI_NBI    _cdecl    CMSMGetBusType(void *busTag, UINT32 *busType );
  471. ODI_NBI _cdecl    CMSMGetCardConfigInfo(void *busTag, UINT32 uniqueIdentifier,
  472.         UINT32 size, UINT32 parm1, UINT32 parm2, void *configInfo);
  473. ODI_NBI    _cdecl    CMSMGetSlot(void *busTag, MEON_STRING *slotName, UINT16 *slot);
  474. ODI_NBI    _cdecl    CMSMGetSlotName(void *busTag, UINT16 slot,
  475.             MEON_STRING **slotName);
  476. ODI_NBI _cdecl    CMSMGetUniqueIdentifier(void *busTag, UINT32 *parameters,
  477.             UINT32 parameterCount, UINT32 *uniqueIdentifier);
  478. ODI_NBI _cdecl    CMSMGetUniqueIdentifierParameters(void *busTag,
  479.             UINT32 uniqueIdentifier, UINT32 parameterCount,
  480.             UINT32 *parameters);
  481. ODI_NBI _cdecl    CMSMGetInstanceNumber(void *busTag, UINT32 uniqueIdentifier,
  482.             UINT16 *instanceNumber);
  483. ODI_NBI _cdecl    CMSMGetInstanceNumberMapping(UINT16 instanceNumber,
  484.             void **busTag, UINT32 *uniqueIdentifier);
  485. UINT8    _cdecl    CMSMRdConfigSpace8(void *busTag,  UINT32 uniqueIdentifier,
  486.             UINT32 offset);
  487. UINT16    _cdecl    CMSMRdConfigSpace16(void *busTag,  UINT32 uniqueIdentifier,
  488.             UINT32 offset);
  489. UINT32    _cdecl    CMSMRdConfigSpace32(void *busTag,  UINT32 uniqueIdentifier,
  490.             UINT32 offset);
  491. ODI_NBI    _cdecl    CMSMScanBusInfo(UINT32 *scanSequence, void **busTag,
  492.             UINT32 *busType, MEON_STRING **busName );
  493. ODI_NBI _cdecl  CMSMSearchAdapter(UINT32 *scanSequence, UINT32 busType,
  494.             UINT32 productIDLen, const MEON *productID,
  495.             void **busTag, UINT32 *uniqueIdentifier);
  496. void     _cdecl    CMSMWrtConfigSpace8(void *busTag, UINT32 uniqueIdentifier,
  497.             UINT32 offset, UINT8 writeVal);
  498. void     _cdecl    CMSMWrtConfigSpace16(void *busTag, UINT32 uniqueIdentifier,
  499.             UINT32 offset, UINT16 writeVal);
  500. void     _cdecl    CMSMWrtConfigSpace32(void *busTag, UINT32 uniqueIdentifier,
  501.             UINT32 offset, UINT32 writeVal);
  502.  
  503. /* TODO NESL
  504. UINT32     _cdecl    CMSMNESLDeRegisterConsumer(NESL_ECB *Consumer);
  505. UINT32    _cdecl    CMSMNESLDeRegisterProducer(NESL_ECB *Producer);
  506. void     _cdecl    CMSMNESLProduceEvent(NESL_ECB *ProducerNecb,
  507.             NESL_ECB **ConsumerNecb, EPB *EventParmBlock,
  508.             struct DRIVER_DATA *driverData);
  509. UINT32    _cdecl    CMSMNESLRegisterConsumer(NESL_ECB *Consumer);
  510. UINT32    _cdecl    CMSMNESLRegisterProducer(NESL_ECB *Producer);
  511. */
  512.  
  513. #define CMP_NODE(a,b) ( \
  514.     ((UINT32 *)(a))[0] == ((UINT32 *)(b))[0] &&\
  515.     ((UINT16 *)(a))[2] == ((UINT16 *)(b))[2] \
  516. )
  517.  
  518. struct IOOptionStructure {
  519.         UINT32  NumberOfOptions;
  520.         UINT32  OptionData[1];
  521. };
  522.  
  523. typedef struct AdapterOptionDefinitionStructure {
  524.         struct IOOptionStructure *IOSlot;
  525.         struct IOOptionStructure *IOPort0;
  526.         struct IOOptionStructure *IOLength0;
  527.         struct IOOptionStructure *IOPort1;
  528.         struct IOOptionStructure *IOLength1;
  529.         struct IOOptionStructure *MemoryDecode0;
  530.         struct IOOptionStructure *MemoryLength0;
  531.         struct IOOptionStructure *MemoryDecode1;
  532.         struct IOOptionStructure *MemoryLength1;
  533.         struct IOOptionStructure *Interrupt0;
  534.         struct IOOptionStructure *Interrupt1;
  535.         struct IOOptionStructure *DMA0;
  536.         struct IOOptionStructure *DMA1;
  537.         struct IOOptionStructure *Channel;
  538. } HSM_OPTIONS;
  539.  
  540. /*
  541.  * flags that can be set on the OptionData 
  542.  */
  543. #define OD_IS_RANGE                     0x80000000
  544. #define OD_HAS_INCREMENT            0x40000000
  545.  
  546. /*
  547.  * ParseIOParameters bits
  548.  */
  549. #define NeedsSlotBit                    0x00000001
  550. #define NeedsIOPort0Bit                 0x00000002
  551. #define NeedsIOLength0Bit               0x00000004
  552. #define NeedsIOPort1Bit                 0x00000008
  553. #define NeedsIOLength1Bit               0x00000010
  554. #define NeedsMemoryDecode0Bit       0x00000020
  555. #define NeedsMemoryLength0Bit       0x00000040
  556. #define NeedsMemoryDecode1Bit       0x00000080
  557. #define NeedsMemoryLength1Bit       0x00000100
  558. #define NeedsInterrupt0Bit              0x00000200
  559. #define NeedsInterrupt1Bit              0x00000400
  560. #define NeedsDMA0Bit                    0x00000800
  561. #define NeedsDMA1Bit                    0x00001000
  562. #define NeedsChannelBit                 0x00002000
  563.  
  564. /*
  565.  * ParseLANParameters needFlags defines
  566.  */
  567. #define CAN_SET_NODE_ADDRESS        0x40000000
  568. #define MUST_SET_NODE_ADDRESS       0x80000000
  569.  
  570. #define CALLS_INTO_HSM 15
  571.  
  572. typedef struct _MSM_PROTECTION_OBJ_ {
  573.         lock_t                  *AdapterSpinLock;
  574.         lock_t                  *unused;
  575. } MSM_PROTECTION_OBJ;
  576.  
  577. /*
  578.  * flags for msm_read_eisa_config.
  579.  */
  580. #define    MSM_EISA_SUCCESS            0x0
  581. #define    MSM_EISA_INVALID_SLOT            0x80
  582. #define    MSM_EISA_INVALID_FUNC            0x81
  583. #define    MSM_EISA_EMPTY_SLOT            0x83
  584. #define    MSM_EISA_NOMEM                0x87
  585.  
  586. #ifdef IAPX386
  587.  
  588. #define CMSM_MLID_CFG_MAJOR             1
  589. #define CMSM_MLID_CFG_MINOR             20
  590. #define CMSM_ORIG_CFG_MAJOR             1
  591. #define CMSM_ORIG_CFG_MINOR             20
  592.  
  593. #define AMSM_MLID_CFG_MAJOR             1
  594. #define AMSM_MLID_CFG_MINOR             12
  595.  
  596. #define CMSM_IO_CFG_MAJOR               1
  597. #define CMSM_IO_CFG_MINOR               0
  598.  
  599. #define ASM_STAT_WAIT_TIME              4 * 18
  600. #define ASM_STYLE_TABLE_FLAG            0x10000000
  601.  
  602. #endif
  603.  
  604. #define FORMAT_STRING_LEN 128                   /* size for FormatString */
  605.  
  606. /*
  607.  * stuff for reading in message file.
  608.  */
  609. #define    MSM_MESSAGE_COUNT_OFFSET        110
  610. #define    MSM_MESSAGE_POINTER_OFFSET        118
  611. #define    MSM_MAX_MSG_COUNT            0x00020000
  612.  
  613. #define    BROADCASTSIZE                8
  614. #define    DEFLOOKAHEADSIZE            18
  615.  
  616. #ifdef DEBUG
  617.  
  618. /*
  619.  * variant of LOCK_OWNED assertion at load time.
  620.  */
  621. extern    void                    *lsl_current_adapterdata;
  622.  
  623. #define    ODI_ASSERT(a)                ASSERT(a ||        \
  624.                         lsl_current_adapterdata)
  625.  
  626. #else
  627.  
  628. #define    ODI_ASSERT(a)
  629.  
  630. #endif
  631.  
  632. #endif /* _IO_MSM_MSM_H */
  633.