home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / DEV / PCMCIA / CLSAMPLE / CLIENT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-14  |  48.2 KB  |  1,145 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /**************************************************************************
  13.  *
  14.  * SOURCE FILE NAME = CLIENT.H
  15.  *
  16.  * DESCRIPTIVE NAME = PCMCIA Client Services sample code header file
  17.  *
  18.  *
  19.  *
  20.  *
  21.  * The following IBM OS/2 2.1 source code is provided to you solely for
  22.  * the purpose of assisting you in your development of OS/2 2.x device
  23.  * drivers. You may use this code in accordance with the IBM License
  24.  * Agreement provided in the IBM Device Driver Source Kit for OS/2. This
  25.  * Copyright statement may not be removed.
  26.  *
  27.  *
  28.  *
  29.  * VERSION =
  30.  *
  31.  * DATE        06/22/93
  32.  *
  33.  * DESCRIPTION
  34.  *
  35.  *
  36.  * FUNCTIONS
  37.  *
  38.  * ENTRY POINTS:
  39.  *
  40.  * DEPENDENCIES:
  41.  *
  42.  * NOTES
  43.  *
  44.  *
  45.  * STRUCTURES
  46.  *
  47.  * EXTERNAL REFERENCES
  48.  *
  49.  * EXTERNAL FUNCTIONS
  50.  *
  51.  ***************************************************************************/
  52.  
  53.  
  54.  
  55. /**************************************************************************
  56.  * Function Definition
  57.  **************************************************************************/
  58.  
  59. #define ADD_SOCKET_SERVICES      0x32
  60. #define ADJUST_RESOURCE_INFO     0x35
  61. #define CHECK_ERASE_QUEUE        0x26
  62. #define CLOSE_MEMORY             0x00
  63. #define COPY_MEMORY              0x01
  64. #define DEREGISTER_CLIENT        0x02
  65. #define DEREGISTER_ERASE_QUEUE   0x25
  66. #define GET_CARDSERVICES_INFO    0x0B
  67. #define GET_CLIENT_INFO          0x03
  68. #define GET_CONFIGURATIONINFO    0x04
  69. #define GET_EVENT_MASK           0x2E
  70. #define GET_FIRST_CLIENT         0x0E
  71. #define GET_FIRST_PARTITION      0x05
  72. #define GET_FIRST_REGION         0x06
  73. #define GET_FIRST_TUPLE          0x07
  74. #define GET_NEXT_CLIENT          0x2A
  75. #define GET_NEXT_PARTITION       0x08
  76. #define GET_NEXT_REGION          0x09
  77. #define GET_NEXT_TUPLE           0x0A
  78. #define GET_STATUS               0x0C
  79. #define GET_TUPLE_DATA           0x0D
  80. #define MAP_LOG_SOCKET           0x12
  81. #define MAP_LOG_WINDOW           0x13
  82. #define MAP_MEM_PAGE             0x14
  83. #define MAP_PHY_SOCKET           0x15
  84. #define MAP_PHY_WINDOW           0x16
  85. #define MODIFY_CONFIGURATION     0x27
  86. #define MODIFY_WINDOW            0x17
  87. #define OPEN_MEMORY              0x18
  88. #define REGISTER_CLIENT          0x10
  89. #define READ_MEMORY              0x19
  90. #define REGISTER_ERASE_QUEUE     0x0F
  91. #define REGISTER_MTD             0x1A
  92. #define REGISTER_TIMER           0x28
  93. #define RELEASE_CONFIGURATION    0x1E
  94. #define RELEASE_EXCLUSIVE        0x2D
  95. #define RELEASE_IO               0x1B
  96. #define RELEASE_IRQ              0x1C
  97. #define RELEASE_SOCKET_MASK      0x2F
  98. #define RELEASE_WINDOW           0x1D
  99. #define REPLACE_SOCKET_SERVICES  0x33
  100. #define REQUEST_CONFIGURATION    0x30
  101. #define REQUEST_EXCLUSIVE        0x2C
  102. #define REQUEST_IO               0x1F
  103. #define REQUEST_IRQ              0x20
  104. #define REQUEST_SOCKET_MASK      0x22
  105. #define REQUEST_WINDOW           0x21
  106. #define RESET_CARD               0x11
  107. #define RETURN_SS_ENTRY          0x23
  108. #define SET_EVENT_MASK           0x31
  109. #define SET_REGION               0x29
  110. #define VALIDATE_CIS             0x2B
  111. #define VENDOR_SPECIFIC          0x34
  112. #define WRITE_MEMORY             0x24
  113.  
  114. /*
  115. ** AddSocketServices (0x32)
  116. */
  117. typedef struct ADD_SS {
  118.    USHORT  usAttributes;                /* information about SS entry point  */
  119.    USHORT  usDDData;                    /* pointer to SS data are            */
  120. } ADD_SS, FAR *PADD_SS, NEAR *NPADD_SS;
  121.  
  122.  
  123. /*
  124. ** AdjustResourceInfo (0x35)
  125. */
  126.  
  127. typedef struct ADJ_RESINFO {
  128.    UCHAR   ucAction;                    /* add/remove resource               */
  129.    UCHAR   ucResource;                  /* resource type to adjust           */
  130. } ADJ_RESINFO, FAR *PADJ_RESINFO, NEAR *NPADJ_RESINFO;
  131.  
  132.    /*
  133.    ** ucAction field definition
  134.    */
  135. #define ARIA_REMOVE              0x00   /* remove                            */
  136. #define ARIA_ADD                 0x01   /* add                               */
  137.  
  138.    /*
  139.    ** ucResource field definition
  140.    */
  141. #define ARIR_MEMORY_RANGE        0x00   /* system mappable memory range      */
  142. #define ARIR_IO_RANGE            0x01   /* system mappable IO range          */
  143. #define ARIR_STEERABLE_IRQ       0x02   /* system steerable IRQ              */
  144.  
  145.    /*
  146.    ** System Mappable Memory Range resource adjustment
  147.    */
  148. typedef struct ADJ_RESINFO_M {
  149.    ADJ_RESINFO  adjResInfo;
  150.    USHORT       usAttributes;           /* attributes of the memory range    */
  151.    ULONG        ulBase;                 /* system base address               */
  152.    ULONG        ulSize;                 /* memory window size                */
  153. } ADJ_RESINFO_M, FAR *PADJ_RESINFO_M, NEAR *NPADJ_RESINFO_M;
  154.  
  155.       /*
  156.       ** usAttributes field definition
  157.       */
  158. #define ARIM_SHARED              0x20   /* shared                            */
  159.  
  160.    /*
  161.    ** System Mappable IO Range resource adjustment
  162.    */
  163. typedef struct ADJ_RESINFO_I {
  164.    ADJ_RESINFO  adjResInfo;
  165.    USHORT       usBasePort;             /* base port address for range       */
  166.    UCHAR        ucNumPort;              /* number of contiguous ports        */
  167.    UCHAR        ucAttributes;           /* ( defined below )                 */
  168.    UCHAR        ucIOAddrLines;          /* num of IO address lines decoded   */
  169. } ADJ_RESINFO_I, FAR *PADJ_RESINFO_I, NEAR *NPADJ_RESINFO_I;
  170.  
  171.       /*
  172.       ** ucAttributes field definition
  173.       */
  174. #define ARII_SHARED              0x01   /* shared                            */
  175.  
  176.    /*
  177.    ** System Steerable IRQ resource adjustment
  178.    */
  179. typedef struct ADJ_RESINFO_Q {
  180.    ADJ_RESINFO  adjResInfo;
  181.    UCHAR        ucAttributes;           /* ( defined below )                 */
  182.    UCHAR        ucIRQ;                  /* IRQ being adjusted                */
  183. } ADJ_RESINFO_Q, FAR *PADJ_RESINFO_Q, NEAR *NPADJ_RESINFO_Q;
  184.  
  185.       /*
  186.       ** ucAttributes field definition
  187.       */
  188. #define ARIQ_EXCLUSIVE           0x00   /* IRQ type - exclusive              */
  189. #define ARIQ_TIME_MULT_SHARED    0x01   /* IRQ type - time multiplexed shared*/
  190. #define ARIQ_DYNAMIC_SHARED      0x02   /* IRQ type - dynamic shared         */
  191.  
  192.  
  193. /*
  194. ** CopyMemory (0x01)
  195. */
  196.  
  197. typedef struct CPY_MEMORY {
  198.    ULONG   ulSourceOff;                 /* card services address             */
  199.    ULONG   ulDestOff;                   /* card destination address          */
  200.    ULONG   ulCount;                     /* number of bytes to transfer       */
  201.    USHORT  usAttributes;                /* ( defined below )                 */
  202. } CPY_MEMORY, FAR *PCPY_MEMORY, NEAR *NPCPY_MEMORY;
  203.  
  204.    /*
  205.    ** usAttributes field definition
  206.    */
  207. #define CMA_DISABLE_ERASE         0x0004
  208. #define CMA_VERIFY                0x0008
  209.  
  210.  
  211. /*
  212. ** GetCardServicesInfo (0x0B)
  213. */
  214.  
  215. typedef struct GET_CSINFO {
  216.    USHORT   usInfoLen;                  /* length of data returned by CS     */
  217.    USHORT   usSignature;                /* ASCII "CS" returned if installed  */
  218.    USHORT   usCount;                    /* number of sockets                 */
  219.    USHORT   usRevision;                 /* BCD value of vendor's CS revision */
  220.    USHORT   usCSLevel;                  /* BCD value of CS release           */
  221.    USHORT   usVStrOff;                  /* offset to vendor string in arg pkt*/
  222.    USHORT   usVStrLen;                  /* vendor string length              */
  223.    UCHAR    VendorString[1];            /* ASCII vendor string buffer area   */
  224. } GET_CSINFO, FAR *PGET_CSINFO, NEAR *NPGET_CSINFO;
  225.  
  226.  
  227. /*
  228. ** GetClientInfo (0x03)
  229. */
  230.  
  231. typedef struct GET_CLINFO {
  232.    USHORT   usMaxLen;                   /* length of this packet             */
  233.    USHORT   usInfoLen;                  /* length of info required by client */
  234.    USHORT   usAttributes;               /* (defined in RegisterClient)       */
  235.    UCHAR    clientinfo[1];              /* client information                */
  236. } GET_CLINFO, FAR *PGET_CLINFO, NEAR *NPGET_CLINFO;
  237.  
  238.    /*
  239.    ** clientinfo field definition
  240.    */
  241. typedef struct CLIENTINFO {
  242.    USHORT  usRevision;                  /* BCD value of vendor client revision*/
  243.    USHORT  usCSLevel;                   /* BCD value of CS release           */
  244.    USHORT  usRevDate;                   /* revision date                     */
  245.    USHORT  usNameOff;                   /* offset to clientname string       */
  246.    USHORT  usNameLen;                   /* length of client name string      */
  247.    USHORT  usVStringOff;                /* offset in pkt to vendor string    */
  248.    USHORT  usVStringLen;                /* length of vendor string           */
  249.    UCHAR   stringArea[1];               /* client name and vendor name       */
  250. } CLIENTINFO, FAR *PCLIENTINFO, NEAR *NPCLIENTINFO;
  251.  
  252.  
  253. /*
  254. ** GetConfigurationInfo (0x04)
  255. */
  256.  
  257. typedef struct GET_CONFGINFO {
  258.    USHORT  usSocket;                    /* Logical socket                    */
  259.    USHORT  usAttributes;                /* (defined  below)                  */
  260.    UCHAR   ucVcc;                       /* Vcc setting                       */
  261.    UCHAR   ucVpp1;                      /* Vpp1 setting                      */
  262.    UCHAR   ucVpp2;                      /* Vpp2 setting                      */
  263.    UCHAR   ucIntType;                   /* memory or memory+I/O interface    */
  264.    ULONG   ucConfigBase;                /* card base addr of config registers*/
  265.    UCHAR   ucStatus;                    /* card status register setting      */
  266.    UCHAR   ucPin;                       /* card pin register setting         */
  267.    UCHAR   ucCopy;                      /* card/scket copy register setting  */
  268.    UCHAR   ucOption;                    /* card option register setting      */
  269.    UCHAR   ucPresent;                   /* card cinfig registers present     */
  270.    UCHAR   ucFirstDevType;              /* from device ID tuple              */
  271.    UCHAR   ucFuncCode;                  /* from function ID tuple            */
  272.    UCHAR   ucSysInitMask;               /* from finction ID tuple            */
  273.    USHORT  usManufCode;                 /* from manufacture ID tuple         */
  274.    USHORT  usManuInfo;                  /* from manufacture ID tuple         */
  275.    UCHAR   ucCardValues;                /* valid card register values        */
  276.    UCHAR   ucAssignedIRQ;               /* IRQ assigned to PC card           */
  277.    USHORT  usIRQAttributes;             /* attributes fir assigned IRQ       */
  278.    USHORT  usBasePort1;                 /* base port address for range       */
  279.    UCHAR   ucNumPort1;                  /* number of contiguous ports        */
  280.    UCHAR   ucAttributes1;               /*                                   */
  281.    USHORT  usBasePort2;                 /* base port address for range       */
  282.    UCHAR   ucNumPort2;                  /* number of contiguous ports        */
  283.    UCHAR   ucAttributes2;               /*                                   */
  284.    UCHAR   ucIOAddrLines;               /* number of IO addr lines decoded   */
  285. } GET_CONFGINFO, FAR *PGET_CONFGINFO, NEAR *NPGET_CONFGINFO;
  286.  
  287.    /*
  288.    ** usAttributes field definition
  289.    */
  290. #define GCA_EXCLUSIVE         0x0001    /* exclusively used ( set = true     */
  291.  
  292.    /*
  293.    ** ucCardValues field definition
  294.    */
  295. #define GCCV_OPTION_VALID       0x01    /* option value valid in card config */
  296. #define GCCV_STATUS_VALID       0x02    /* status value valid in card config */
  297. #define GCCV_PIN_VALID          0x04    /* pin value valid in card config    */
  298. #define GCCV_COPY_VALID         0x08    /* copy value valid in card config   */
  299.  
  300.  
  301. /*
  302. ** GetEventMask (0x2E)
  303. */
  304.  
  305. typedef struct GET_EVEMASK {
  306.    USHORT usAttributes;                 /* (defined below.)                  */
  307.    USHORT usEventMask;                  /* (defined below.)                  */
  308.    USHORT usSocket;                     /* logical socket                    */
  309. } GET_EVEMASK, FAR *PGET_EVEMASK, NEAR *NPGET_EVEMASK;
  310.  
  311.    /*
  312.    ** usAttributes field definition
  313.    */
  314. #define EMA_THIS_COCKET_ONLY    0x0001  /* event mask of this socket only    */
  315.  
  316.    /*
  317.    ** usEventMask field definition
  318.    */
  319. #define EM_SS_UPDATED           0x0400  /* SS update                         */
  320. #define EM_RESET                0x0200  /* reset events                      */
  321. #define EM_PM_CHANGE            0x0100  /* PM change                         */
  322. #define EM_CARD_DETECT_CHANGE   0x0080  /* card detect change                */
  323. #define EM_READY_CHANGE         0x0040  /* ready change                      */
  324. #define EM_BATTERY_LOW          0x0020  /* battery low                       */
  325. #define EM_BATTERY_DEAD         0x0010  /* battery dead                      */
  326. #define EM_INSERTION_REQUEST    0x0008  /* insertion request                 */
  327. #define EM_EJECTION_REQUEST     0x0004  /* ejection request                  */
  328. #define EM_CARD_LOCK_CHANGE     0x0002  /* card lock change                  */
  329. #define EM_WP_CHANGE            0x0001  /* write protect                     */
  330.  
  331. #define EM_ALL_EVENTS           0xFFFF
  332.  
  333.  
  334. /*
  335. ** GetFirstClient (0x0E) / GetNextClient (0x2A)
  336. */
  337.  
  338. typedef struct GET_CLIENT {
  339.    USHORT usSocket;                     /* logical socket                    */
  340.    USHORT usAttributes;                 /* (define below)                    */
  341. } GET_CLIENT, FAR *PGET_CLIENT, NEAR *NPGET_CLIENT;
  342.  
  343.    /*
  344.    ** usAttributes field definition
  345.    */
  346. #define GFCA_THIS_COCKET_ONLY   0x0001  /* client for this socket only       */
  347.  
  348.  
  349. /*
  350. ** GetFirstPartition (0x05) / GetNextPartition (0x08)
  351. */
  352.  
  353. typedef struct GET_PARTITION {
  354.    USHORT usSocket;                     /* logical socket                    */
  355.    USHORT usAttributes;                 /* (defined below)                   */
  356.    UCHAR  ucTupleMask;                  /* (defined below)                   */
  357.    UCHAR  ucAccessSpeed;                /* window speed field                */
  358.    USHORT usFlag;                       /* CS partition flags data           */
  359.    ULONG  ulLinkOff;                    /* CS partition link data            */
  360.    ULONG  ulCISOff;                     /* CS partition CIS data             */
  361.    ULONG  ulCardOff;                    /* card memory region offset         */
  362.    ULONG  ulPartSize;                   /* partition size                    */
  363.    ULONG  ulEffBlockSize;               /* erase block size                  */
  364.    USHORT usPartMultiple;               /* partition multiple                */
  365.    USHORT usJEDECID;                    /* partition JEDEC memory ID code    */
  366.    USHORT usPartType;                   /* partition type field              */
  367. } GET_PARTITION, FAR *PGET_PARTITION, NEAR *NPGET_PARTITION;
  368.  
  369.    /*
  370.    ** usAttributes field definition
  371.    */
  372. #define PA_MEMORY_TYPE        0x0001    /* memory type (1=attributes,0=common*/
  373. #define PA_VIRTUAL_PARTITION  0x0100    /* virtual partition                 */
  374. #define PA_WRITE_WO_ERASE     0x0000    /* write without erase               */
  375. #define PA_WRITE_W_ERASE      0x0200    /* write with erase                  */
  376. #define PA_WRITE_W_DERASE     0x0600    /* write with disableable erase      */
  377. #define FA_WRITE_W_VERIFY     0x0800    /* write with verify                 */
  378. #define FA_ERASE_SUPPORTED    0x1000    /* erase requests supported          */
  379.  
  380.    /*
  381.    ** ucTupleMask field definition
  382.    */
  383. #define TM_ACCESS_SPEED         0x01    /* access speed from tuples          */
  384. #define TM_CARD_OFFSET          0x02    /* card offset from tuples           */
  385. #define TM_PART_SIZE            0x04    /* part size from tuples             */
  386. #define TM_EFFBLOCKSIZE         0x08    /* effblocksize from tuples          */
  387. #define TM_PART_MULTIPLE        0x10    /* part multiple from tuples         */
  388. #define TM_JEDEC_ID             0x20    /* JEDEC ID from tuples              */
  389. #define TM_PART_TYPE            0x40    /* part type from tuples             */
  390.  
  391.    /*
  392.    ** ucAceesSpeed field definition
  393.    */
  394. #define AS_250NSEC              0x02    /* 250 nsec                          */
  395. #define AS_200NSEC              0x04    /* 200 nsec                          */
  396. #define AS_150NSEC              0x08    /* 150 nsec                          */
  397. #define AS_100NSEC              0x10    /* 100 nsec                          */
  398.  
  399.    /*
  400.    ** ucPartType field definition
  401.    */
  402. #define PT_NO_PARTITION       0x0000    /* no partition information tuple    */
  403. #define PT_DOS_BPB_FAT        0x0001    /* DOS BPB/FAT partition             */
  404. #define PT_FFS_1              0x0002    /* FFS 1 partition                   */
  405. #define PT_FFS_2              0x0003    /* FFS 2 partition                   */
  406. #define PT_XIP                0x0004    /* XIP partition                     */
  407. #define PT_UNKNOWN            0x7FFF    /* unknown partition                 */
  408.  
  409.  
  410. /*
  411. ** GetFirstRegion (0x06) / GetNextRegion (0x09)
  412. */
  413.  
  414. typedef struct GET_REGION {
  415.    USHORT usSocket;                     /* logical socket                    */
  416.    USHORT usAttributes;                 /* (defined in GetFirstPartition)    */
  417.    UCHAR  ucTupleMask;                  /* (defined in GetFirstPartition)    */
  418.    UCHAR  ucAccessSpeed;                /* window speed field                */
  419.    USHORT usFlag;                       /* CS partition flags data           */
  420.    ULONG  ulLinkOff;                    /* CS partition link data            */
  421.    ULONG  ulCISOff;                     /* CS partition CIS data             */
  422.    ULONG  ulCardOff;                    /* card memory region offset         */
  423.    ULONG  ulRegionSize;                 /* region size                       */
  424.    ULONG  ulEffBlockSize;               /* erase block size                  */
  425.    USHORT usPartMultiple;               /* partition multiple                */
  426.    USHORT usJEDECID;                    /* region JEDEC memory ID code       */
  427. } GET_REGION, FAR *PGET_REGION, NEAR *NPGET_REGION;
  428.  
  429.  
  430. /*
  431. ** GetFirstTuple (0x07) / GetNextTuple (0x0A)
  432. */
  433.  
  434. typedef struct GET_TUPLE {
  435.    USHORT usSocket;                     /* logical socket                    */
  436.    USHORT usAttributes;                 /* (defined below)                   */
  437.    UCHAR  usDesiredTuple;               /* desired tuple code value          */
  438.    UCHAR  usReserved;                   /* reserved (reset to zero)          */
  439.    USHORT usFlags;                      /* CS tuple flag data                */
  440.    ULONG  ulLinkOff;                    /* CS link state information         */
  441.    ULONG  ulCISOff;                     /* CS CIS state information          */
  442.    UCHAR  ucTupleCode;                  /* tuple found                       */
  443.    UCHAR  ucTupleLink;                  /* link value for tuple found        */
  444. } GET_TUPLE, FAR *PGET_TUPLE, NEAR *NPGET_TUPLE;
  445.  
  446.    /*
  447.    ** usAttributes field definition
  448.    */
  449. #define GFTA_RETURN_LINK_TUPLE  0x0001  /* return link tuple                 */
  450.  
  451.  
  452. /*
  453. ** GetStatus (0x0C)
  454. */
  455.  
  456. typedef struct GETSTATUS {
  457.    USHORT usSocket;                     /* logical socket                    */
  458.    USHORT usCardState;                  /* card state output data            */
  459.    USHORT usSocketState;                /* socket state output data          */
  460. } GETSTATUS, FAR *PGETSTATUS, NEAR *NPGETSTATUS;
  461.  
  462.    /*
  463.    ** usCardState field definition
  464.    */
  465. #define GSC_WRITE_PROTECT       0x0001  /* write proteced                    */
  466. #define GSC_CARD_LOCKED         0x0002  /* card locked                       */
  467. #define GSC_EJECTION_REQUEST    0x0004  /* ejection request                  */
  468. #define GSC_INSERTION_REQUEST   0x0008  /* insertion request                 */
  469. #define GSC_BVD1                0x0010  /* battery voltage detect 1 (1=dead) */
  470. #define GSC_BVD2                0x0020  /* bvd2 (1=warning)                  */
  471. #define GSC_READY               0x0040  /* ready/busy (1=ready)              */
  472. #define GSC_CARD_DETECTED       0x0080  /* card detected                     */
  473.  
  474.    /*
  475.    ** usSocketState field definition
  476.    */
  477. #define GSS_WRITE_PROTECT       0x0001  /* write protect change              */
  478. #define GSS_CARD_LOCK           0x0002  /* card lock change                  */
  479. #define GSS_EJECTION_PENDING    0x0004  /* ejection request pending          */
  480. #define GSS_INSERTION_PENDING   0x0008  /* insertion request pending         */
  481. #define GSS_BATTERY_DEAD        0x0010  /* battery dead change               */
  482. #define GSS_BATTERY_WARNING     0x0020  /* battery warning change            */
  483. #define GSS_READY               0x0040  /* ready change                      */
  484. #define GSS_CARD_DETECT         0x0080  /* card detect change                */
  485.  
  486.  
  487. /*
  488. ** GetTupleData (0x0D)
  489. */
  490.  
  491. typedef struct GET_TUPLEDATA {
  492.    USHORT usSocket;                     /* logical socket                    */
  493.    USHORT usAttributes;                 /* (defined in GetFirstTuple)        */
  494.    UCHAR  ucDesiredTuple;               /* desired tuple code value          */
  495.    UCHAR  ucTupleOff;                   /* offset into tuple from link byte  */
  496.    USHORT usFlags;                      /* CS tuple flags data               */
  497.    ULONG  ulLinkOff;                    /* CS linke state information        */
  498.    ULONG  ulCISOff;                     /* CS CIS state information          */
  499.    USHORT usTupleDataMax;               /* maximum size of tuple data area   */
  500.    USHORT usTupleDataLen;               /* number of bytes in tuple body     */
  501.    UCHAR  TupleData[1];                 /* tuple data                        */
  502. } GET_TUPLEDATA, FAR *PGET_TUPLEDATA, NEAR *NPGET_TUPLEDATA;
  503.  
  504.  
  505. /*
  506. ** MapLogSocket (0x12)
  507. */
  508.  
  509. typedef struct MAP_LOGSOCKET {
  510.    USHORT usLogSocket;                  /* logical socket                    */
  511.    UCHAR  ucPhyAddr;                    /* physical adapter number           */
  512.    UCHAR  ucPhySocket;                  /* physical socket number            */
  513. } MAP_LOGSOCKET, FAR *PMAP_LOGSOCKET, NEAR *NPMAP_LOGSOCKET;
  514.  
  515.  
  516. /*
  517. ** MapLogWindow (0x13)
  518. */
  519.  
  520. typedef struct MAP_LOGWINDOW {
  521.    UCHAR ucPhyAddr;                     /* physical adapter number           */
  522.    UCHAR ucPhyWindow;                   /* physical window number            */
  523. } MAP_LOGWINDOW, FAR *PMAP_LOGWINDOW, NEAR *NPMAP_LOGWINDOW;
  524.  
  525.  
  526. /*
  527. ** MapMemPage (0x14)
  528. */
  529.  
  530. typedef struct MAP_MEMPAGE {
  531.    ULONG ulCardOff;                     /* card offset address               */
  532.    UCHAR ucPage;                        /* page number                       */
  533. } MAP_MEMPAGE, FAR *PMAP_MEMPAGE, NEAR *NPMAP_MEMPAGE;
  534.  
  535.  
  536. /*
  537. ** MapPhySocket (0x15)
  538. */
  539.  
  540. typedef struct MAP_PHYSOCKET {
  541.    USHORT usLogSocket;                  /* logical socket                    */
  542.    UCHAR  ucPhyAdapter;                 /* physical adapter number           */
  543.    UCHAR  ucPhySocket;                  /* physical socket number            */
  544. } MAP_PHYSOCKET, FAR *PMAP_PHYSOCKET, NEAR *NPMAP_PHYSOCKET;
  545.  
  546.  
  547. /*
  548. ** MapPhyWindow (0x16)
  549. */
  550.  
  551. typedef struct MAP_PHYWINDOW {
  552.    UCHAR ucPhyAdapter;                  /* physical adapter number           */
  553.    UCHAR ucPhyWindow;                   /* physical socket number            */
  554. } MAP_PHYWINDOW, FAR *PMAP_PHYWINDOW, NEAR *NPMAP_PHYWINDOW;
  555.  
  556.  
  557. /*
  558. ** ModifyConfiguration (0x27)
  559. */
  560.  
  561. typedef struct MODIFY_CONFIG {
  562.    USHORT usSocket;                     /* logical socket                    */
  563.    USHORT usAttributes;                 /* ( defined below )                 */
  564.    UCHAR  ucVcc;                        /* Vcc setting                       */
  565.    UCHAR  ucVpp1;                       /* Vpp1 setting                      */
  566.    UCHAR  ucVpp2;                       /* Vpp2 setting                      */
  567. } MODIFY_CONFIG, FAR *PMODIFY_CONFIG, NEAR *NPMODIFY_CONFIG;
  568.  
  569.    /*
  570.    ** usAttributes field definition
  571.    */
  572. #define MCA_ENABLE_IRQ_STEERING 0x0002  /* enable IRQ steering               */
  573. #define MCA_IRQ_CHANGE_VALID    0x0004  /* IRQ change valid                  */
  574. #define MCA_VCC_CHANGE_VALID    0x0008  /* Vcc change valid                  */
  575. #define MCA_VPP1_CHANGE_VALID   0x0010  /* Vpp1 change valid                 */
  576. #define MCA_VPP2_CHANGE_VALID   0x0020  /* Vpp2 change valid                 */
  577.  
  578.  
  579. /*
  580. ** ModifyWindow (0x17)
  581. */
  582.  
  583. typedef struct MODIFY_WIN {
  584.    USHORT usAttributes;                 /* window attributes field           */
  585.    UCHAR  ucAccessSpeed;                /* window speed                      */
  586. } MODIFY_WIN, FAR *PMODIFY_WIN, NEAR *NPMODIFY_WIN;
  587.  
  588.    /*
  589.    ** usAttributes field definition
  590.    */
  591. #define MWA_MEMORY              0x0002  /* memory type ( 1=attributes )      */
  592. #define MWA_ENABLE              0x0004  /* enable                            */
  593. #define MWA_ACCESS_SPEED        0x0008  /* access speed valid                */
  594.  
  595.  
  596. /*
  597. ** OpenMemory (0x18)
  598. */
  599.  
  600. typedef struct OPN_MEMORY {
  601.    USHORT  usSocket;                    /* logical socket                    */
  602.    USHORT  usAttributes;                /* attributes of mem are to be access*/
  603.    ULONG   ulOffset;                    /* card offset for are to open       */
  604. } OPN_MEMORY, FAR *POPN_MEMORY, NEAR *NPOPN_MEMORY;
  605.  
  606.    /*
  607.    ** usAttributes field definition
  608.    */
  609. #define OMA_ATTRIBUTE_MEMORY    0x0001  /* memory type (1=attributes)        */
  610. #define OMA_EXCLUSIVE           0x0002  /* exclusive                         */
  611.  
  612.  
  613. /*
  614. ** RegisterClient (0x10)
  615. */
  616.  
  617. typedef struct REG_CLIENT {
  618.    USHORT  usAttributes;                /* (defined below )                  */
  619.    USHORT  usEventMask;                 /* events to notify client           */
  620.    USHORT  usClientData[4];             /* data for client (binding specific)*/
  621.    USHORT  usVersion;                   /* card services version             */
  622. } REG_CLIENT, FAR *PREG_CLIENT, NEAR *NPREG_CLIENT;
  623.  
  624.    /*
  625.    ** usAttributes field definition
  626.    */
  627. #define RCA_MEMORY_CDD          0x0001  /* memory client device driver       */
  628. #define RCA_MTD                 0x0002  /* memory technology driver          */
  629. #define RCA_IO_CDD              0x0004  /* IO client device driver           */
  630. #define RCA_CI_SHARABLE         0x0008  /* CARD_INSERTION fot sharable PC card*/
  631. #define RCA_CI_EXCLUSIVE        0x0010  /* CARD_INSERTION for exclusively used*/
  632.  
  633.  
  634. /*
  635. ** ReadMemory (0x19)
  636. */
  637.  
  638. typedef struct READ_MEM {
  639.    ULONG   ulCardOff;                   /* card source offset                */
  640.    ULONG   ulCount;                     /* number of bytes to transfer       */
  641. } READ_MEM, FAR *PREAD_MEM, NEAR *NPREAD_MEM;
  642.  
  643.  
  644. /*
  645. ** RegisterEraseQueue (0x0F)
  646. */
  647.  
  648.    /*
  649.    ** QueueEntry field definition
  650.    */
  651. typedef struct QUEUE_ENTRY {
  652.    USHORT  usHandle;                    /* memory handle                     */
  653.    UCHAR   ucEntryState;                /* state of this erase queue entry   */
  654.    UCHAR   ucSize;                      /* size of area to be erased         */
  655.    ULONG   ulOffset;                    /* offset of area to be erased       */
  656.    UCHAR   ucOptional[1];               /* additional bytes for client use   */
  657. } QUEUE_ENTRY, FAR *PQUEUE_ENTRY, NEAR *NPQUEUE_ENTRY;
  658.  
  659.  
  660. typedef struct REG_ERASEQUEUE {
  661.    USHORT      usEntryLen;              /* number of bytes to transfer       */
  662.    USHORT      usNumEntry;              /* number of bytes to transfer       */
  663.    QUEUE_ENTRY QueueEntry[1];           /* number of bytes to transfer       */
  664. } REG_ERASEQUEUE, FAR *PREG_ERASEQUEUE, NEAR *NPREG_ERASEQUEUE;
  665.  
  666.       /*
  667.       ** ucEntryState field definition
  668.       */
  669. #define EQES_IDLE                 0xFF
  670. #define EQES_QUEUE_FOR_ERASE      0x00
  671. #define EQES_ERASE_IN_PROG01      0x01
  672. #define EQES_ERASE_PASSED         0xE0
  673. #define EQES_ERASE_FAILED         0xE1
  674. #define EQES_MEDIA_WP             0x84
  675. #define EQES_MEDIA_NOT_ERASABLE   0x86
  676. #define EQES_MEDIA_MISSING        0x80
  677. #define EQES_MEDIA_NOT_WRITABLE   0x87
  678. #define EQES_BAD_SOCKET           0xC3
  679. #define EQES_BAD_TECHNOLOGY       0xC2
  680. #define EQES_BAD_OFFSET           0xC1
  681. #define EQES_BAD_VCC              0xC4
  682. #define EQES_BAD_VPP              0xC5
  683. #define EQES_BAD_SIZE             0xC6
  684.  
  685.  
  686. /*
  687. ** RegisterMTD (0x1A)
  688. */
  689.  
  690. typedef struct REG_MTD {
  691.    USHORT usSocket;                     /* logical socket                    */
  692.    USHORT usAttributes;                 /* (defined in GetFirstPartition)    */
  693.    ULONG  ulOffset;                     /* card offset for region MTD support*/
  694.    USHORT usMTDMediaID;                 /* token for MTD use to identify media*/
  695. } REG_MTD, FAR *PREG_MTD, NEAR *NPREG_MTD;
  696.  
  697.  
  698. /*
  699. ** RegisterTimer (0x28)
  700. */
  701.  
  702. typedef struct REG_TIMER {
  703.    USHORT usWait;                       /* number of ticks to wait           */
  704. } REG_TIMER, FAR *PREG_TIMER, NEAR *NPREG_TIMER;
  705.  
  706.  
  707. /*
  708. ** ReleaseConfiguration (0x1E)
  709. */
  710.  
  711. typedef struct REL_CONFG {
  712.    USHORT usSocket;                     /* logical socket                    */
  713. } REL_CONFG, FAR *PREL_CONFG, NEAR *NPREL_CONFG;
  714.  
  715.  
  716. /*
  717. ** ReleaseExclusive (0x2D) / RequestExclusive (0x2C)
  718. */
  719.  
  720. typedef struct REQ_EXCLUSIVE {
  721.    USHORT  usSocket;                    /* logical socket                    */
  722.    USHORT  usAttributes;                /* all reserved                      */
  723. } REQ_EXCLUSIVE, FAR *PREQ_EXCLUSIVE, NEAR *NPREQ_EXCLUSIVE;
  724.  
  725.  
  726. /*
  727. ** ReleaseIO (0x1B) / RequestIO (0x1F)
  728. */
  729.  
  730. typedef struct REQ_IO {
  731.    USHORT usSocket;                     /* logical socket                    */
  732.    USHORT usBasePort1;                  /* base port address for range 1     */
  733.    UCHAR  ucNumPorts1;                  /* number of contiguous ports        */
  734.    UCHAR  ucAttributes1;                /* (defined below in RequestIO)      */
  735.    USHORT usBasePort2;                  /* base port address for range 2     */
  736.    UCHAR  ucNumPorts2;                  /* number of contiguous ports        */
  737.    UCHAR  ucAttributes2;                /* (defined below in RequestIO)      */
  738.    UCHAR  ucIOAddrLines;                /* number of IO address lined decoded*/
  739. } REQ_IO, FAR *PREQ_IO, NEAR *NPREQ_IO;
  740.  
  741.    /*
  742.    ** ucAttrobute1/2 field definition
  743.    */
  744. #define RIOA_SHARED               0x01  /* shared                            */
  745. #define RIOA_FIRST_SHARED         0x02  /* first shared                      */
  746. #define RIOA_FORCE_ALIAS_ACCESS   0x04  /* force alias accessibility         */
  747. #define RIOA_DATA_PATH_WIDTH      0x08  /* data path width for I/O range     */
  748.  
  749.  
  750. /*
  751. ** ReleaseIRQ (0x1C)
  752. */
  753.  
  754. typedef struct REL_IRQ {
  755.    USHORT usSocket;                     /* logical socket                    */
  756.    USHORT usAttributes;                 /* (defined in RequestIRQ)           */
  757.    UCHAR  ucAssignedIRQ;                /* IRQ number assigned by CS         */
  758. } REL_IRQ, FAR *PREL_IRQ, NEAR *NPREL_IRQ;
  759.  
  760.  
  761. /*
  762. ** ReleaseSocketMask (0x2F)
  763. */
  764.  
  765. typedef struct REL_SOCKETMASK {
  766.    USHORT usSocket;                     /* logical socket                    */
  767. } REL_SOCKETMASK, FAR *PREL_SOCKETMASK, NEAR *NPSOCKETMASK;
  768.  
  769.  
  770. /*
  771. ** ReleaseWindow (0x1D) / RequestWindow (0x21)
  772. */
  773.  
  774. typedef struct REQ_WINDOW {
  775.    USHORT usSocket;                     /* logical socket                    */
  776.    USHORT usAttributes;                 /* memory window attribute field     */
  777.    ULONG  ulBase;                       /* system base address               */
  778.    ULONG  ulSize;                       /* memory window size                */
  779.    UCHAR  ucAccessSpeed;                /* window speed field                */
  780. } REQ_WINDOW, FAR *PREQ_WINDOW, NEAR *NPREQ_WINDOW;
  781.  
  782.    /*
  783.    ** usAttributes field definition
  784.    */
  785. #define RWA_MEMORY_TYPE         0x0002  /* memory type 1=attribute           */
  786. #define RWA_ENABLED             0x0004  /* enabled                           */
  787. #define RWA_DATA_PATH_WIDTH     0x0008  /* data path width (0=8bit/1=16but)  */
  788. #define RWA_PAGED               0x0010  /* paged                             */
  789. #define RWA_SHARED              0x0020  /* shared                            */
  790. #define RWA_FIRST_SHARED        0x0040  /* first shared                      */
  791. #define RWA_OFFSET_WINDOW_SIZE  0x0100  /* card offset are window sized      */
  792.  
  793.  
  794. /*
  795. ** ReplaceSocketServices (0x33)
  796. */
  797.  
  798. typedef struct REPLACE_SS {
  799.    USHORT usSocket;                     /* logical socket                    */
  800.    USHORT usNumSockets;                 /* number of sockets to replace      */
  801.    USHORT usAttributes;                 /* information about SS entry point  */
  802.    USHORT usDataPtr;                    /* pointer for SS data area          */
  803. } REPLACE_SS, FAR *PREPLACE_SS, NEAR *NPREPLACE_SS;
  804.  
  805.  
  806. /*
  807. ** RequestConfiguration (0x30)
  808. */
  809.  
  810. typedef struct REQ_CONFG {
  811.    USHORT usSocket;                     /* logical socket                    */
  812.    USHORT usAttributes;                 /* (defined below)                   */
  813.    UCHAR  ucVcc;                        /* Vcc setting                       */
  814.    UCHAR  ucVpp1;                       /* Vpp1 setting                      */
  815.    UCHAR  ucVpp2;                       /* Vpp2 setting                      */
  816.    UCHAR  ucIntType;                    /* memory or memory+I/O interface    */
  817.    ULONG  ulConfigBase;                 /* card base addr. of config registers*/
  818.    UCHAR  ucStatus;                     /* card state register setting       */
  819.    UCHAR  ucPin;                        /* card pin register setting         */
  820.    UCHAR  ucCopy;                       /* card socket/copy register setting */
  821.    UCHAR  ucConfiIndex;                 /* card option register setting      */
  822.    UCHAR  ucPresent;                    /* card configuration register present*/
  823. } REQ_CONFG, FAR *PREQ_CONFG, NEAR *NPREQ_CONFG;
  824.  
  825.    /*
  826.    ** usAttributes field definition
  827.    */
  828. #define RCA_ENABLE_IRQ          0x0002  /* enable IRQ setting                */
  829.  
  830.    /*
  831.    ** ucPresent field definition
  832.    */
  833. #define RCP_OPTION                0x01  /* option                            */
  834. #define RCP_STATUS                0x02  /* status                            */
  835. #define RCP_PIN_REPLACEMENT       0x04  /* pin replacement                   */
  836. #define RCP_COPY                  0x08  /* copy                              */
  837.  
  838.    /*
  839.    ** ucIntType field definition
  840.    */
  841. #define RCT_MEMORY                0x01  /* memory                            */
  842. #define RCT_MEMORY_IO             0x02  /* memory and I/O                    */
  843.  
  844.  
  845. /*
  846. ** RequestIRQ (0x20)
  847. */
  848.  
  849. typedef struct REQ_IRQ {
  850.    USHORT usSocket;                     /* logical socket                    */
  851.    USHORT usAttributes;                 /* (defined below)                   */
  852.    UCHAR  ucAssignedIRQ;                /* IRQ number assigned by CS         */
  853.    UCHAR  ucIRQInfo1;                   /* first PCMCIA IRQ byte             */
  854.    UCHAR  ucIRQInfo2;                   /* optional PCMCIA IRQ byte          */
  855. } REQ_IRQ, FAR *PREQ_IRQ, NEAR *NPREQ_IRQ;
  856.  
  857.    /*
  858.    ** usAttributes field definition
  859.    */
  860. #define RIA_TYPE_EXCLUSIVE      0x0000  /* IRQtype - exclusive               */
  861. #define RIA_TYPE_TIME_SHARE     0x0001  /* IRQtype - time multiplexed share  */
  862. #define RIA_TYPE_DYNAMIC_SHARE  0x0002  /* IRQtype - dynamic sharing         */
  863.  
  864. #define RIA_FORCE_PULSE         0x0004  /* forse pulse                       */
  865. #define RIA_FIRST_SHARED        0x0008  /* first shared                      */
  866. #define RIA_PULSE_IRQ_ALLOCATED 0x0100  /* pulse IRQ allocated               */
  867.  
  868.    /*
  869.    ** ucIRQInfo1 field definition
  870.    */
  871. #define RII1_NMI                0x01    /* NMI                               */
  872. #define RII1_LOCK               0x02    /* LOCK                              */
  873. #define RII1_BERR               0x04    /* BERR                              */
  874. #define RII1_VEND               0x08    /* VEND                              */
  875. #define RII1_INFO2_VALID        0x10    /* 1=>IRQInfo2 is valid              */
  876. #define RII1_LEVEL              0x20    /* level                             */
  877. #define RII1_PULSE              0x40    /* pulse                             */
  878. #define RII1_SHARE              0x80    /* share                             */
  879.  
  880.    /*
  881.    ** ucIRQInfo2 field definition
  882.    */
  883. #define RII2_IRQ0               0x0001  /* IOQ0                              */
  884. #define RII2_IRQ1               0x0002  /* IOQ1                              */
  885. #define RII2_IRQ2               0x0004  /* IOQ2                              */
  886. #define RII2_IRQ3               0x0008  /* IOQ3                              */
  887. #define RII2_IRQ4               0x0010  /* IOQ4                              */
  888. #define RII2_IRQ5               0x0020  /* IOQ5                              */
  889. #define RII2_IRQ6               0x0040  /* IOQ6                              */
  890. #define RII2_IRQ7               0x0080  /* IOQ7                              */
  891. #define RII2_IRA8               0x0100  /* IOQ8                              */
  892. #define RII2_IRA9               0x0200  /* IOQ9                              */
  893. #define RII2_IRA10              0x0400  /* IOQ10                             */
  894. #define RII2_IRA11              0x0800  /* IOQ11                             */
  895. #define RII2_IRA12              0x1000  /* IOQ12                             */
  896. #define RII2_IRA13              0x2000  /* IOQ13                             */
  897. #define RII2_IRA14              0x4000  /* IOQ14                             */
  898. #define RII2_IRA15              0x8000  /* IOQ15                             */
  899.  
  900.  
  901. /*
  902. ** RequestSocketMask (0x22)
  903. */
  904.  
  905. typedef struct REQ_SOCKETMASK {
  906.    USHORT usSocket;                     /* logical socket                    */
  907.    USHORT usEventMask;                  /* (defined in GetEventMask)         */
  908. } REQ_SOCKETMASK, FAR *PREQ_SOCKETMASK, NEAR *NPREQ_SOCKETMASK;
  909.  
  910.  
  911. /*
  912. ** ResetCard (0x11)
  913. */
  914.  
  915. typedef struct RESETCARD {
  916.    USHORT usSocket;                     /* logical socket                    */
  917.    USHORT usAttributes;                 /* all reserved                      */
  918. } RESETCARD, FAR *PRESETCARD, NEAR *NPRESETCARD;
  919.  
  920.  
  921. /*
  922. ** ReturnSSEntry (0x23)
  923. */
  924.  
  925. typedef struct RETURN_SSENTRY {
  926.    USHORT usAttributes;                 /* information about SS entry point  */
  927. } RETURN_SSENTRY, FAR *PRETURN_SSENTRY, NEAR *NPSSENTRY;
  928.  
  929.  
  930. /*
  931. ** SetEventMask (0x31)
  932. */
  933.  
  934. typedef struct SET_EVENTMASK {
  935.    USHORT usAttributes;                 /* defined in GetEventMask           */
  936.    USHORT usEventMask;                  /* defined in GetEventMask           */
  937.    USHORT usSocket;                     /* logical socket                    */
  938. } SET_EVENTMASK, FAR *PSET_EVENTMASK, NEAR *NPSET_EVENTMASK;
  939.  
  940.  
  941. /*
  942. ** SetRegion (0x29)
  943. */
  944.  
  945. typedef struct SETREGION {
  946.    USHORT usSocket;                     /* logical socket                    */
  947.    USHORT usAttributes;                 /* defined below                     */
  948.    ULONG  ulCardOffset;                 /* card memory region offset         */
  949.    ULONG  ulRegionSize;                 /* region size                       */
  950.    ULONG  ulEffBlockSize;               /* erase block size                  */
  951.    USHORT usPartMultiple;               /* partition multiple                */
  952.    USHORT usJEDECID;                    /* partition JEDEC memory ID code    */
  953.    ULONG  ulBiasOffset;                 /* address bias for MTD              */
  954.    UCHAR  ucAccessSpeed;                /* window speed field                */
  955. } SETREGION, FAR *PSETREGION, NEAR *NPSETREGION;
  956.  
  957.    /*
  958.    ** usAttributes field definition
  959.    */
  960. #define SRA_MEMORY_TYPE         0x0001  /* memory type                       */
  961. #define SRA_DELETE_REGION       0x0002  /* delete region                     */
  962. #define SRA_VIRTUAL_REGION      0x0100  /* virtual region                    */
  963.  
  964.  
  965. /*
  966. ** ValidateCIS (0x2B)
  967. */
  968.  
  969. typedef struct VALIDATECIS {
  970.    USHORT usSocket;                     /* logical socket                    */
  971.    USHORT usChains;                     /* number of chains validated        */
  972. } VALIDATECIS, FAR *PVALIDATECIS, NEAR *NPVALIDATECIS;
  973.  
  974.  
  975. /*
  976. ** VendorSpecific (0x34)
  977. */
  978.  
  979. typedef struct VENDOR_SPEC {
  980.    USHORT usInfoLen;                    /* length of returned info packet    */
  981.    UCHAR  VendorData[1];                /* vendor specific data              */
  982. } VENDOR_SPEC, FAR *PVENDOR_SPEC, NEAR *NPVENDOR_SPEC;
  983.  
  984.  
  985. /*
  986. ** WriteMemory (0x24)
  987. */
  988.  
  989. typedef struct WRITE_MEM {
  990.    ULONG  ulCardOffset;                 /* card destination address          */
  991.    ULONG  ulCount;                      /* number of butes to trnasfer       */
  992.    USHORT usAttributes;                 /* defined below                     */
  993. } WRITE_MEM, FAR *PWRITE_MEM, NEAR *NPWRITE_MEM;
  994.  
  995.    /*
  996.    ** usAttributes field definition
  997.    */
  998. #define WMA_DISABLE_ERASE       0x0004  /* disable erase                     */
  999. #define WMA_VERIFY              0x0008  /* verify                            */
  1000.  
  1001.  
  1002.  
  1003. /**************************************************************************
  1004.  * Events Definition
  1005.  **************************************************************************/
  1006.  
  1007. #define BATTERY_DEAD            0x01
  1008. #define BATEERY_LOW             0x02
  1009. #define CARD_INSERTION          0x40
  1010. #define CARD_READY              0x04
  1011. #define CARD_REMOVAL            0x05
  1012. #define CARD_RESET              0x11
  1013. #define CARD_LOCK               0x03
  1014. #define CARD_UNLOCK             0x06
  1015. #define CLIENT_INFO             0x14
  1016. #define EJECTION_REQUEST        0x08
  1017. #define EJECTION_COMPLETE       0x07
  1018. #define ERASE_COMPLETE          0x81
  1019. #define EXCLUSIVE_REQUEST       0x0E
  1020. #define EXCLUSIVE_COMPLETE      0x0D
  1021. #define INSERTION_REQUEST       0x0A
  1022. #define INSERTION_COMPLETE      0x09
  1023. #define MTD_REQUEST             0x12
  1024. #define PM_RESUME               0x0B
  1025. #define PM_SUSPEND              0x0C
  1026. #define REGISTRATION_COMPLETE   0x82
  1027. #define RESET_COMPLETE          0x80
  1028. #define RESET_PHYSICAL          0x0F
  1029. #define RESET_REQUEST           0x10
  1030. #define SS_UPDATED              0x16
  1031. #define TIMER_EXPIRED           0x15
  1032.  
  1033. /*
  1034. ** MTD request packet
  1035. */
  1036.  
  1037. typedef struct MTD_REQPKT {
  1038.    USHORT  lnMTDreqpkt;                 /* length of this packet             */
  1039.    USHORT  usSocket;                    /* socket containing PC card to access*/
  1040.    ULONG   ulSrcCardOff;                /* source card offset for request    */
  1041.    ULONG   ulDestCardOff;               /* dest. card offset for request     */
  1042.    ULONG   ulTransferLen;               /* length of request                 */
  1043.    UCHAR   ucFunction;                  /* MTD request function              */
  1044.    UCHAR   ucAccessSpeed;               /* access speed for region           */
  1045.    USHORT  usMTDID;                     /* MTD's token from registerMTD      */
  1046.    USHORT  usMTDStatus;                 /* MTD returned status               */
  1047.    USHORT  usTimeout;                   /* timer count for timer delayed req.*/
  1048.    UCHAR   MediaAccessTbl[1];           /* media access table                */
  1049. } MTD_REQPKT, FAR *PMTD_REQPKT, NEAR *NPMTD_REQPKT;
  1050.  
  1051.    /*
  1052.    ** MTD request function
  1053.    */
  1054. #define MTD_ERASE               0x00    /* command Erase                     */
  1055. #define MTD_READ                0x01    /* command Read                      */
  1056. #define MTD_WRITE               0x02    /* command Write                     */
  1057. #define MTD_COPY                0x03    /* command Copy                      */
  1058. #define MTD_DISABPLE_ERASE      0x04    /* DisableEraseBeforeWrite           */
  1059. #define MTD_VERIFY_AFTER_WRITE  0x08    /* VerifyAfterWrite                  */
  1060. #define MTD_READY_CONTINUED     0x10    /* Ready Continued                   */
  1061. #define MTD_TIMEOUT_CONTINUED   0x20    /* Timeout Continued                 */
  1062. #define MTD_LAST_IN_SEQUENCE    0x40    /* Last in Sequesnce                 */
  1063. #define MTD_FIRST_IN_SEQUESNCE  0x80    /* First Sequence                    */
  1064.  
  1065.    /*
  1066.    ** MTD status
  1067.    */
  1068. #define MTD_WAITREQ             0x0000  /* not currently able to service req.*/
  1069. #define MTD_WAITTIMER           0x0001  /* waiting for specified period      */
  1070. #define MTD_WAITRDY             0x0002  /* waiting for RDY                   */
  1071. #define MTD_WAITPOWER           0x0003  /* not able to service               */
  1072.  
  1073.  
  1074. /**************************************************************************
  1075.  * Return Code Definition
  1076.  **************************************************************************/
  1077.  
  1078. #define SUCCESS                 0x0000  /* the request succeeded              */
  1079. #define BAD_ADAPTER             0x0001  /* specified adapter is invalid       */
  1080. #define BAD_ATTRIBUTE           0x0002  /* value specified for attr is invalid*/
  1081. #define BAD_BASE                0x0003  /* base system memory addr. is invalid*/
  1082. #define BAD_EDC                 0x0004  /* EDC generator is invalid           */
  1083. #define BAD_IRQ                 0x0006  /* IRQ level is invalid               */
  1084. #define BAD_OFFSET              0x0007  /* PC card memory array off is invalid*/
  1085. #define BAD_PAGE                0x0008  /* page is invalid                    */
  1086. #define READ_FAILURE            0x0009  /* unable to complete read request    */
  1087. #define BAD_SIZE                0x000A  /* size is invalid                    */
  1088. #define BAD_SOCKET              0x000B  /* socket is invalid (logical or phys)*/
  1089. #define BAD_TYPE                0x000D  /* window or interface type is invalid*/
  1090. #define BAD_VCC                 0x000E  /* Vcc power level index is invalid   */
  1091. #define BAD_VPP                 0x000F  /* Vpp1 or Vpp2 power level invalid   */
  1092. #define BAD_WINDOW              0x0011  /* window is invalid                  */
  1093. #define WRITE_FAILURE           0x0012  /* unable to complete write request   */
  1094. #define NO_CARD                 0x0014  /* no PC card in socket               */
  1095. #define UNSUPPORTED_FUNCTION    0x0015  /* does not support function          */
  1096. #define UNSUPPORTED_MODE        0x0016  /* processor mode is not supported    */
  1097. #define BAD_SPEED               0x0017  /* speed is unavailable               */
  1098. #define BUSY                    0x0018  /* unable to process request - retry  */
  1099. #define GENERAL_FAILURE         0x0019  /* undefined error has occurred       */
  1100. #define WRITE_PROTECTED         0x001A  /* media is write-protected           */
  1101. #define BAD_ARG_LENGTH          0x001B  /* ArgLength argument is invalid      */
  1102. #define BAD_ARGS                0x001C  /* values in Argument pkt are invalid */
  1103. #define CONFIGURATION_LOCKED    0x001D  /* configuration has locked           */
  1104. #define IN_USE                  0x001E  /* resource is being used by a client */
  1105. #define NO_MORE_ITEMS           0x001F  /* there are no more the req. item    */
  1106. #define OUT_OF_RESOURCE         0x0020  /* CS has exhausted resource          */
  1107. #define BAD_HANDLE              0x0021  /* client handle is invliad           */
  1108.  
  1109.  
  1110. /**************************************************************************
  1111.  * COM Inter Device Driver Client Interface Definition
  1112.  **************************************************************************/
  1113.  
  1114. /*
  1115. ** COM IDC parameter packet
  1116. */
  1117.  
  1118. typedef struct COM_PARMPKT {
  1119.    USHORT  usFunction;                  /* function code                     */
  1120.    USHORT  usPortNumber;                /* COM port number                   */
  1121.    USHORT  usPortAddr;                  /* COM port address                  */
  1122.    USHORT  usPortIRQ;                   /* COM port IRQ                      */
  1123.    USHORT  usReturnCode;                /* return code                       */
  1124. } COM_PARMPKT, FAR *PCOM_PARMPKT, NEAR *NPCOM_PARMPKT;
  1125.  
  1126.    /*
  1127.    ** COM IDC function definition
  1128.    */
  1129. #define COM_DEINSTALL           0x0000  /* deinstall COM port drive          */
  1130. #define COM_INSTALL             0x0001  /* install COM port drive            */
  1131.  
  1132.    /*
  1133.    ** COM IDC Port Number definition
  1134.    */
  1135. #define COM1_PORT               0x0001  /* COM1 port selection               */
  1136. #define COM2_PORT               0x0002  /* COM2 port selection               */
  1137. #define COM3_PORT               0x0003  /* COM3 port selection               */
  1138. #define COM4_PORT               0x0004  /* COM4 port selection               */
  1139.  
  1140.    /*
  1141.    ** COM IDC return codes are defined in DDK\H\BSEERR.H
  1142.    */
  1143.  
  1144.  
  1145.