home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / DEV / PCMCIA / SOCKET / SSDEFS.INC < prev    next >
Text File  |  1995-04-14  |  16KB  |  478 lines

  1. ;*DDK*************************************************************************/
  2. ;
  3. ; COPYRIGHT (C) Award Software International Inc., 1994
  4. ; COPYRIGHT    Copyright (C) 1995 IBM Corporation
  5. ;
  6. ;    The following IBM OS/2 WARP source code is provided to you solely for
  7. ;    the purpose of assisting you in your development of OS/2 WARP device
  8. ;    drivers. You may use this code in accordance with the IBM License
  9. ;    Agreement provided in the IBM Device Driver Source Kit for OS/2. This
  10. ;    Copyright statement may not be removed.;
  11. ;*****************************************************************************/
  12. ;******************************************************************************
  13. ;*
  14. ;*                              File SSDEFS.INC
  15. ;*
  16. ;*                       Socket Services Definitions
  17. ;*
  18. ;*
  19. ;*
  20. ;******************************************************************************
  21.  
  22. ifndef   __SSDEFS_INC_
  23. __SSDEFS_INC_   equ     1
  24.  
  25. ;----------------------------------- Version ----------------------------------
  26.  
  27. RELEASE_NUM     equ     0200h               ; (Target release is 0200h)
  28. PCMCIA_LEVEL    equ     0210h               ; PCMCIA Socket Services Specifi-
  29.                                             ;  cation compliance level
  30. EXCA_LEVEL      equ     0150h               ; ExCA Compliance level
  31.  
  32. ; ----- Function Code Definitions
  33.  
  34. GET_ADP_CNT     equ     80h
  35.                                             ; 81h and 82h reserved for
  36.                                             ;  historical purposes
  37. GET_SS_INFO     equ     83h
  38. INQ_ADAPTER     equ     84h
  39. GET_ADAPTER     equ     85h
  40. SET_ADAPTER     equ     86h
  41. INQ_WINDOW      equ     87h
  42. GET_WINDOW      equ     88h
  43. SET_WINDOW      equ     89h
  44. GET_PAGE        equ     8Ah
  45. SET_PAGE        equ     8Bh
  46. INQ_SOCKET      equ     8Ch
  47. GET_SOCKET      equ     8Dh
  48. SET_SOCKET      equ     8Eh
  49. GET_STATUS      equ     8Fh
  50. RESET_SOCKET    equ     90h
  51.                                             ; 91h thru 94h reserved for
  52.                                             ;  historical purposes
  53. INQ_EDC         equ     95h
  54. GET_EDC         equ     96h
  55. SET_EDC         equ     97h
  56. START_EDC       equ     98h
  57. PAUSE_EDC       equ     99h
  58. RESUME_EDC      equ     9Ah
  59. STOP_EDC        equ     9Bh
  60. READ_EDC        equ     9Ch
  61. GET_VENDOR_INFO equ     9Dh
  62. ACK_INTERRUPT   equ     9Eh
  63. PRIOR_HANDLER   equ     9Fh
  64. SS_ADDR         equ     0A0h
  65. ACCESS_OFFSETS  equ     0A1h
  66.                                             ; A2h thru ADH are reserved
  67.                                             ;  for expansion
  68. VEND_SPECIFIC   equ     0AEh
  69. CARD_SERVICES   equ     0AFh
  70.  
  71. SS_INT          equ     1Ah                 ; Socket Services Int vector
  72.  
  73. ; ----- Return codes
  74.  
  75. SUCCESS         equ     00h
  76. BAD_ADAPTER     equ     01h
  77. BAD_ATTRIBUTE   equ     02h
  78. BAD_BASE        equ     03h
  79. BAD_EDC         equ     04h
  80.                                             ; 5 reserved for historical purposes
  81. BAD_IRQ         equ     06h
  82. BAD_OFFSET      equ     07h
  83. BAD_PAGE        equ     08h
  84. READ_FAILURE    equ     09h
  85. BAD_SIZE        equ     0Ah
  86. BAD_SOCKET      equ     0Bh
  87. BAD_TYPE        equ     0Dh
  88. BAD_VCC         equ     0Eh
  89. BAD_VPP         equ     0Fh
  90.                                             ; 0Fh and 10h are reserved for
  91.                                             ;  historical purposes
  92. BAD_WINDOW      equ     11h
  93. WRITE_FAILURE   equ     12h
  94.                                             ; 13h is reserved for
  95.                                             ;  historical purposes
  96. NO_CARD         equ     14h
  97. BAD_FUNCTION    equ     15h
  98. BAD_MODE        equ     16h
  99. BAD_SPEED       equ     17h
  100. BUSY            equ     18h
  101. GENERAL_FAILURE equ     19h
  102.  
  103. ; ----- Defined data types
  104.  
  105. ADAPTER         TYPEDEF BYTE
  106. BASE            TYPEDEF WORD
  107. BUFFER          TYPEDEF DWORD
  108. BCD             TYPEDEF WORD
  109. COUNT           TYPEDEF BYTE
  110. EDC             TYPEDEF BYTE
  111. FLAGS8          TYPEDEF BYTE
  112. FLAGS16         TYPEDEF WORD
  113. FLAGS32         TYPEDEF DWORD
  114. IRQ             TYPEDEF BYTE
  115. COFFSET         TYPEDEF WORD                ; COFFSET replaces OFFSET  (keyword)
  116. WPAGE           TYPEDEF BYTE                ; WPAGE   replaces PAGE    (keyword)
  117. PWRINDEX        TYPEDEF BYTE
  118. RETCODE         TYPEDEF BYTE
  119. SIGNATURE       TYPEDEF WORD
  120. WSIZE           TYPEDEF WORD                ; WSIZE   replaces SIZE    (keyword)
  121. SOCKET          TYPEDEF BYTE
  122. SPEED           TYPEDEF BYTE
  123. WINDOW          TYPEDEF BYTE
  124.  
  125. ; ----- Local Functon Definitions
  126.  
  127. GET_RAW_ADAPTER equ     0B0h
  128. GET_RAW_SOCKET  equ     0B1h
  129. GET_RAW_WINDOW  equ     0B2h
  130.  
  131. ; ----- Card Services Definitions
  132.  
  133. GET_CARD_SERVICES_INFO equ 0Bh
  134.  
  135. ; ----- Size Definitions
  136.  
  137. S4K             equ     1000h               ;  4 KiloBytes
  138. S16K            equ     4000h               ; 16 KiloBytes
  139. S64K            equ     10000h              ; 64 KiloBytes
  140. S1M             equ     100000h             ;  1 MegaBytes
  141. S16M            equ     1000000h            ; 16 MegaBytes
  142.  
  143. SS_SIGNATURE    equ     'SS'                ; Socket Services signature
  144. CS_SIGNATURE    equ     'SC'
  145.  
  146.  
  147.                 SUBTTL  Miscelaneous equates
  148.                 PAGE
  149.  
  150. ; ----- Validation bit-masks
  151.  
  152. BM_ADAPTER      equ     00000001b
  153. BM_WINDOW       equ     00000010b
  154. BM_SOCKET       equ     00000100b
  155. BM_PAGE         equ     00001000b
  156. BM_CARD         equ     00010000b
  157.  
  158. ; ----- Structures
  159.  
  160. PWRENTRY        STRUCT                      ; Power level and valid signals
  161. PowerLevel      FLAGS8  ?                   ; as returned by InquireAdapter
  162. ValidSignals    FLAGS8  ?
  163. PWRENTRY        ENDS
  164.  
  165.  
  166. CHARTBL         STRUCT                      ; Info returned by Inquire Adapter
  167.                                             ; and Inquire Socket
  168.                 UNION
  169. AdpCaps         FLAGS16 ?
  170. SktCaps         FLAGS16 ?
  171.                 ENDS
  172. ActiveHi        FLAGS32 ?
  173. ActiveLo        FLAGS32 ?
  174.  
  175. CHARTBL ENDS
  176.  
  177. MEMWINTBL       STRUCT                      ; Info returned by Inquire Window
  178.                                             ; for Memory Windows
  179. MemWndCaps      FLAGS16 ?                   ; Window Capabilities Flags
  180. FirstByte       BASE    ?                   ; System Address of First Byte
  181. LastByte        BASE    ?                   ; System Address of Last Byte
  182. MinSize         WSIZE   ?                   ; Minimum Window Size
  183. MaxSize         WSIZE   ?                   ; Maximum Window Size
  184. ReqGran         WSIZE   ?                   ; Size Granularity
  185. ReqBase         WSIZE   ?                   ; Window Base Alignment requirement
  186. ReqOffset       WSIZE   ?                   ; Alignment Requirement for offsets
  187. Slowest         SPEED   ?                   ; Slowest Access Speed for Window
  188. Fastest         SPEED   ?                   ; Fastest Access Speed for Window
  189.  
  190. MEMWINTBL       ENDS
  191.  
  192.  
  193. IOWINTBL        STRUCT                      ; Info returned by Inquire Window
  194.                                             ; for IO Windows
  195. IOWndCaps       FLAGS16 ?                   ; Window Capabilities Flags
  196. FirstByte       BASE    ?                   ; System Address of First Byte
  197. LastByte        BASE    ?                   ; System Address of Last Byte
  198. MinSize         WSIZE   ?                   ; Minimum Window Size
  199. MaxSize         WSIZE   ?                   ; Maximum Window Size
  200. ReqGran         WSIZE   ?                   ; Size Granularity
  201. AddrLines       COUNT   ?                   ; Number of Address Lines Decoded
  202.                                             ; by Window
  203. EISASlot        FLAGS8  ?                   ; Upper 4 I/O Address lines for
  204.                                             ; EISA Slot-Specific Addr.
  205.  
  206. IOWINTBL        ENDS
  207.  
  208.  
  209. WIN_INFO        UNION
  210.         m       MEMWINTBL       {?}
  211.         i       IOWINTBL        {?}
  212.  
  213. WIN_INFO        ENDS
  214.  
  215. ; ----- Card Services Structure
  216.  
  217. GetCSInfoARGS   STRUC
  218.  
  219.         wInfoLen        WORD    ?
  220.         wSignature      WORD    ?
  221.         wCount          WORD    ?
  222.         wRevision       WORD    ?
  223.         wCSLevel        WORD    ?
  224.         wVStrOff        WORD    ?
  225.         wVStrLen        WORD    ?
  226.         szVendorString  BYTE    82 DUP (?)
  227.  
  228. GetCSInfoARGS   ENDS
  229.  
  230. ; ----- For Reference Only
  231.  
  232. ;AISTRUCT       STRUCT                      ; Filled by InquireAdapter
  233. ;
  234. ;wBufferLength  WORD    ?
  235. ;wDataLength    WORD
  236. ;CharTable      CHARTBL {?}
  237. ;wNumPwrEntries WORD    ?
  238. ;PwrEntry[MAX_PWR_ENTRIES] PWRENTRY {?}
  239. ;
  240. ;AISTRUCT       ENDS
  241.  
  242. ; ----- For Reference Only
  243.  
  244. BUFFSIZE        equ     256
  245.  
  246. VISTRUCT        STRUCT
  247. wBufferLength   WORD    ?
  248. wDataLength     WORD    ?
  249. szImplementor   BYTE    (BUFFSIZE - 4) DUP (?)
  250. VISTRUCT        ENDS
  251.  
  252.  
  253.  
  254. ; ----- Valid power level bit-masks
  255.  
  256. VCC             equ     10000000b
  257. VPP1            equ     01000000b
  258. VPP2            equ     00100000b
  259.  
  260. ; ----- Adapter capabilities bit-masks
  261.  
  262. AC_IND          equ     0000000000000001b
  263. AC_PWR          equ     0000000000000010b
  264. AC_DBW          equ     0000000000000100b
  265.  
  266. ; ----- Adapter state
  267.  
  268. AS_POWERDOWN    equ     00000001b
  269. AS_MAINTAIN     equ     00000010b
  270.  
  271. ; ----- Generic window capabilities bit-masks
  272.  
  273. WC_COMMON       equ     00000001b           ; Implies Memory Window Capability
  274. WC_ATTRIBUTE    equ     00000010b           ; Implies Memory Window Capability
  275. WC_IO           equ     00000100b
  276. WC_WAIT         equ     10000000b
  277.  
  278. ; ----- Memory and I/O window capabilities bit-masks
  279.  
  280. WC_BASE         equ     0000000000000001b
  281. WC_SIZE         equ     0000000000000010b
  282. WC_WENABLE      equ     0000000000000100b
  283. WC_8BIT         equ     0000000000001000b
  284. WC_16BIT        equ     0000000000010000b
  285. WC_BALIGN       equ     0000000000100000b
  286. WC_POW2         equ     0000000001000000b
  287. WC_CALIGN       equ     0000000010000000b
  288.  
  289. ; ----- Memory window (page) capabilities only
  290.  
  291. WC_PAVAIL       equ     0000000100000000b
  292. WC_PSHARED      equ     0000001000000000b
  293. WC_PENABLE      equ     0000010000000000b
  294. WC_WP           equ     0000100000000000b
  295.  
  296. ; ----- I/O window capabilities only
  297.  
  298. WC_INPACK       equ     0000000010000000b
  299. WC_EISA         equ     0000000100000000b
  300. WC_CENABLE      equ     0000001000000000b
  301.  
  302. ; ----- Generic window state
  303.  
  304. WS_IO           equ     00000001b
  305. WS_ENABLED      equ     00000010b
  306. WS_16BIT        equ     00000100b
  307.  
  308. ; ----- Memory window state
  309.  
  310. WS_PAGED        equ     00001000b
  311.  
  312. ; ----- I/O window state
  313.  
  314. WS_EISA         equ     00001000b
  315. WS_CENABLE      equ     00010000b
  316.  
  317. ; ----- Page state
  318.  
  319. PS_ATTRIBUTE    equ     00000001b
  320. PS_ENABLED      equ     00000010b
  321. PS_WP           equ     00000100b
  322.  
  323. ; ----- IRQ level bit-masks (low word of 32-bit mask)
  324.  
  325. IRQ_0           equ     0000000000000001b
  326. IRQ_1           equ     0000000000000010b
  327. IRQ_2           equ     0000000000000100b
  328. IRQ_3           equ     0000000000001000b
  329. IRQ_4           equ     0000000000010000b
  330. IRQ_5           equ     0000000000100000b
  331. IRQ_6           equ     0000000001000000b
  332. IRQ_7           equ     0000000010000000b
  333. IRQ_8           equ     0000000100000000b
  334. IRQ_9           equ     0000001000000000b
  335. IRQ_10          equ     0000010000000000b
  336. IRQ_11          equ     0000100000000000b
  337. IRQ_12          equ     0001000000000000b
  338. IRQ_13          equ     0010000000000000b
  339. IRQ_14          equ     0100000000000000b
  340. IRQ_15          equ     1000000000000000b
  341.  
  342. ; ----- IRQ level bit-masks (high word of 32-bit mask)
  343.  
  344. IRQ_NMI         equ     0000000000000001b
  345. IRQ_IO          equ     0000000000000010b
  346. IRQ_BUSERR      equ     0000000000000100b
  347.  
  348. ; ----- IRQ state bit-masks
  349.  
  350. IRQ_LEVEL_MSK   equ     00011111b
  351. IFDEF _INTEL_EPG
  352. IRQ_HIGH        equ     00100000b           ; modified for intel
  353. ELSE
  354. IRQ_HIGH        equ     01000000b           ; PCMCIA Setting
  355. ENDIF
  356.  
  357. IRQ_ENABLED     equ     10000000b
  358.  
  359. P_IRQ00         equ     00000000b
  360. P_IRQ01         equ     00000001b
  361. P_IRQ02         equ     00000010b
  362. P_IRQ03         equ     00000011b
  363. P_IRQ04         equ     00000100b
  364. P_IRQ05         equ     00000101b
  365. P_IRQ06         equ     00000110b
  366. P_IRQ07         equ     00000111b
  367. P_IRQ08         equ     00001000b
  368. P_IRQ09         equ     00001001b
  369. P_IRQ10         equ     00001010b
  370. P_IRQ11         equ     00001011b
  371. P_IRQ12         equ     00001100b
  372. P_IRQ13         equ     00001101b
  373. P_IRQ14         equ     00001110b
  374. P_IRQ15         equ     00001111b
  375.  
  376. ; ----- Socket bit-masks
  377.  
  378. SBM_WP          equ     00000001b
  379. SBM_LOCKED      equ     00000010b
  380. SBM_EJECT       equ     00000100b
  381. SBM_INSERT      equ     00001000b
  382. SBM_BVD1        equ     00010000b
  383. SBM_BVD2        equ     00100000b
  384. SBM_RDYBSY      equ     01000000b
  385. SBM_CD          equ     10000000b
  386.  
  387. SBM_LOCK        equ     00010000b
  388. SBM_BATT        equ     00100000b
  389. SBM_BUSY        equ     01000000b
  390. SBM_XIP         equ     10000000b
  391.  
  392. ; ----- Interface bit-masks
  393.  
  394. IF_MEMORY       equ     00000001b
  395. IF_IO           equ     00000010b
  396.  
  397. ; ----- EDC definitions
  398.  
  399. EC_UNI          equ     00000001b
  400. EC_BI           equ     00000010b
  401. EC_REGISTER     equ     00000100b
  402. EC_MEMORY       equ     00001000b
  403. EC_PAUSABLE     equ     00010000b
  404.  
  405. EC_WRITE        equ     00000010b
  406.  
  407. ET_CHECK8       equ     00000001b
  408. ET_SDLC16       equ     00000010b
  409.  
  410. SS_ADDR_MAIN    STRUCT                      ; SubFunc 0 buffer definition
  411.  
  412. wCodeBaseLo     DW      ?
  413. wCodeBaseHi     DW      ?
  414. wCodeSizeLo     DW      ?
  415. wCodeSizeHi     DW      ?
  416. wCodeEntryLo    DW      ?
  417. wCodeEntryHi    DW      ?
  418. wDataBaseLo     DW      ?
  419. wDataBaseHi     DW      ?
  420. wDataSizeLo     DW      ?
  421. wDataSizeHi     DW      ?
  422. wDataOffsetLo   DW      ?
  423. wDataOffsetHi   DW      ?
  424.  
  425. SS_ADDR_MAIN    ENDS
  426.  
  427. ;--------------------------------- Speed byte  --------------------------------
  428.  
  429. DSPEED_NULL     equ     0
  430. DSPEED_250NS    equ     1
  431. DSPEED_200NS    equ     2
  432. DSPEED_150NS    equ     3
  433. DSPEED_100NS    equ     4
  434.  
  435. MANTISSA_BITS   equ     01111000b
  436. EXPONENT_BITS   equ     00000111b
  437. EXT_BIT         equ     10000000b
  438.  
  439. ;------------------------------ Speed constantes ------------------------------
  440.  
  441. SPEED_0100_NS   equ     (01h SHL 3) OR 2
  442. SPEED_0120_NS   equ     (02h SHL 3) OR 2
  443. SPEED_0130_NS   equ     (03h SHL 3) OR 2
  444. SPEED_0150_NS   equ     (04h SHL 3) OR 2
  445. SPEED_0200_NS   equ     (05h SHL 3) OR 2
  446. SPEED_0250_NS   equ     (06h SHL 3) OR 2
  447. SPEED_0300_NS   equ     (07h SHL 3) OR 2
  448. SPEED_0350_NS   equ     (08h SHL 3) OR 2
  449. SPEED_0400_NS   equ     (09h SHL 3) OR 2
  450. SPEED_0450_NS   equ     (0Ah SHL 3) OR 2
  451. SPEED_0500_NS   equ     (0Bh SHL 3) OR 2
  452. SPEED_0550_NS   equ     (0Ch SHL 3) OR 2
  453. SPEED_0600_NS   equ     (0Dh SHL 3) OR 2
  454. SPEED_0700_NS   equ     (0Eh SHL 3) OR 2
  455. SPEED_0800_NS   equ     (0Fh SHL 3) OR 2
  456. SPEED_1000_NS   equ     (01h SHL 3) OR 3
  457. SPEED_1200_NS   equ     (02h SHL 3) OR 3
  458. SPEED_1300_NS   equ     (03h SHL 3) OR 3
  459. SPEED_1500_NS   equ     (04h SHL 3) OR 3
  460. SPEED_2000_NS   equ     (05h SHL 3) OR 3
  461.  
  462. ;----------------------------------- Timing -----------------------------------
  463.  
  464. RESET_WAIT      equ     40                  ; Wait after Reset mSecs
  465. POWERON_WAIT    equ     20                  ; Wait after Poweron to set output enable
  466.                                             ; PC CARD Standard 2.01 Page 4-9
  467.                                             ; Section 4.3.6
  468. PROG_POWER_WAIT equ     100                 ; Wait after programming of Vpp
  469.  
  470. ;---------------------------------- CPU Mode ----------------------------------
  471.  
  472. RSSE_REAL_MODE  equ     000h                ; Real Mode
  473. RSSE_PROT_1616  equ     001h                ; 16:16 Protected mode
  474. RSSE_PROT_1632  equ     002h                ; 16:32 Protected mode
  475. RSSE_PROT_FLAT  equ     003h                ; 00:32 Protected mode (Flat Model)
  476.  
  477. endif                                           ; __SSDEFS_INC_
  478.