Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

270 lines
9.5 KiB

  1. /*****************************************************************************
  2. @doc INT EXT
  3. ******************************************************************************
  4. * $ProjectName: $
  5. * $ProjectRevision: $
  6. *-----------------------------------------------------------------------------
  7. * $Source: z:/pr/cmbp0/sw/cmbp0.ms/rcs/cmbp0scr.h $
  8. * $Revision: 1.3 $
  9. *-----------------------------------------------------------------------------
  10. * $Author: WFrischauf $
  11. *-----------------------------------------------------------------------------
  12. * History: see EOF
  13. *-----------------------------------------------------------------------------
  14. *
  15. * Copyright 2000 OMNIKEY AG
  16. ******************************************************************************/
  17. #if !defined ( __CMMOB_PNP_SCR_H__ )
  18. #define __CMMOB_PNP_SCR_H__
  19. #define ADDR_WRITEREG_FLAGS0 0x00
  20. #define ADDR_WRITEREG_FLAGS1 0x01
  21. #define ADDR_WRITEREG_PROCEDURE_T0 0x02
  22. #define ADDR_WRITEREG_BUFFER_ADDR 0x03
  23. #define ADDR_WRITEREG_BUFFER_DATA 0x04
  24. #define ADDR_WRITEREG_MESSAGE_LENGTH 0x05
  25. #define ADDR_WRITEREG_BAUDRATE 0x06
  26. #define ADDR_WRITEREG_STOPBITS 0x07
  27. #define ADDR_READREG_FLAGS0 0x00
  28. #define ADDR_READREG_LASTPROCEDURE_T0 0x01
  29. #define ADDR_READREG_BYTESTORECEIVE_T1 0x01
  30. #define ADDR_READREG_BYTES_RECEIVED 0x02
  31. #define ADDR_READREG_FLAGS1 0x03
  32. #define ADDR_READREG_BUFFER_DATA 0x04
  33. // Flags 0 Read Register
  34. #define FLAG_INSERTED 0x01
  35. #define FLAG_POWERED 0x02
  36. #define FLAG_BYTES_RECEIVED_B9 0x04
  37. // meaning of the flag: Receiving T1
  38. // Receiving T0 finished
  39. // Reader detection
  40. #define FLAG_RECEIVE 0x08
  41. // Flag 1 Read Register
  42. #define FLAG_NOPROCEDURE_RECEIVED 0x80
  43. // Flags 1 Write Register
  44. #define FLAG_BAUDRATE_HIGH 0x01
  45. #define FLAG_INVERS_PARITY 0x02
  46. #define FLAG_CLOCK_8MHZ 0x04
  47. #define FLAG_T0_WRITE 0x08
  48. #define FLAG_BUFFER_ADDR_B9 0x10
  49. #define FLAG_TACTIVE 0x20
  50. #define FLAG_CHECK_PRESENCE 0x40
  51. #define FLAG_READ_CIS 0x80
  52. // Flags 0 Write Register (Commands)
  53. #define CMD_RESET_SM 0x80
  54. #define CMD_POWERON_COLD 0x44
  55. #define CMD_POWERON_WARM 0x46
  56. #define CMD_POWEROFF 0x42
  57. #define CMD_WRITE_T0 0x48
  58. #define CMD_WRITE_T1 0x50
  59. NTSTATUS CMMOB_CardPower (
  60. IN PSMARTCARD_EXTENSION SmartcardExtension
  61. );
  62. NTSTATUS CMMOB_PowerOnCard (
  63. IN PSMARTCARD_EXTENSION SmartcardExtension,
  64. IN PUCHAR pbATR,
  65. IN BOOLEAN fMaxWaitTime,
  66. OUT PULONG pulATRLength
  67. );
  68. NTSTATUS CMMOB_PowerOffCard (
  69. IN PSMARTCARD_EXTENSION SmartcardExtension
  70. );
  71. NTSTATUS CMMOB_Transmit (
  72. IN PSMARTCARD_EXTENSION SmartcardExtension
  73. );
  74. NTSTATUS CMMOB_TransmitT0 (
  75. PSMARTCARD_EXTENSION SmartcardExtension
  76. );
  77. NTSTATUS CMMOB_TransmitT1 (
  78. PSMARTCARD_EXTENSION SmartcardExtension
  79. );
  80. NTSTATUS CMMOB_SetProtocol (
  81. IN PSMARTCARD_EXTENSION SmartcardExtension
  82. );
  83. NTSTATUS CMMOB_SetFlags1 (
  84. PREADER_EXTENSION ReaderExtension
  85. );
  86. NTSTATUS CMMOB_IoCtlVendor (
  87. IN PSMARTCARD_EXTENSION SmartcardExtension
  88. );
  89. NTSTATUS CMMOB_SetHighSpeed_CR80S_SAMOS (
  90. IN PSMARTCARD_EXTENSION SmartcardExtension
  91. );
  92. NTSTATUS CMMOB_SetSpeed (
  93. IN PSMARTCARD_EXTENSION SmartcardExtension,
  94. IN PUCHAR abFIDICommand
  95. );
  96. NTSTATUS CMMOB_SetReader_9600Baud (
  97. IN PSMARTCARD_EXTENSION SmartcardExtension
  98. );
  99. NTSTATUS CMMOB_SetReader_38400Baud (
  100. IN PSMARTCARD_EXTENSION SmartcardExtension
  101. );
  102. NTSTATUS CMMOB_ReadDeviceDescription(
  103. IN PSMARTCARD_EXTENSION SmartcardExtension
  104. );
  105. NTSTATUS CMMOB_GetFWVersion (
  106. IN PSMARTCARD_EXTENSION SmartcardExtension
  107. );
  108. NTSTATUS CMMOB_CardTracking (
  109. IN PSMARTCARD_EXTENSION SmartcardExtension
  110. );
  111. VOID CMMOB_CompleteCardTracking(
  112. IN PSMARTCARD_EXTENSION SmartcardExtension
  113. );
  114. NTSTATUS CMMOB_CancelCardTracking(
  115. PDEVICE_OBJECT DeviceObject,
  116. PIRP Irp
  117. );
  118. NTSTATUS CMMOB_StartCardTracking(
  119. IN PDEVICE_OBJECT DeviceObject
  120. );
  121. VOID CMMOB_StopCardTracking(
  122. IN PDEVICE_OBJECT DeviceObject
  123. );
  124. VOID CMMOB_UpdateCurrentStateThread(
  125. IN PVOID Context
  126. );
  127. NTSTATUS CMMOB_UpdateCurrentState(
  128. IN PSMARTCARD_EXTENSION SmartcardExtension
  129. );
  130. NTSTATUS CMMOB_ResetReader(
  131. IN PREADER_EXTENSION ReaderExtension
  132. );
  133. NTSTATUS CMMOB_BytesReceived(
  134. IN PREADER_EXTENSION ReaderExtension,
  135. OUT PULONG pulBytesReceived
  136. );
  137. NTSTATUS CMMOB_SetCardParameters(
  138. IN PREADER_EXTENSION ReaderExtension
  139. );
  140. BOOLEAN CMMOB_CardInserted(
  141. IN PREADER_EXTENSION ReaderExtension
  142. );
  143. BOOLEAN CMMOB_CardPowered(
  144. IN PREADER_EXTENSION ReaderExtension
  145. );
  146. BOOLEAN CMMOB_ProcedureReceived(
  147. IN PREADER_EXTENSION ReaderExtension
  148. );
  149. BOOLEAN CMMOB_GetReceiveFlag(
  150. IN PREADER_EXTENSION ReaderExtension
  151. );
  152. NTSTATUS CMMOB_GetProcedureByte(
  153. IN PREADER_EXTENSION ReaderExtension,
  154. OUT PUCHAR pbProcedureByte
  155. );
  156. NTSTATUS CMMOB_ReadRegister(
  157. IN PREADER_EXTENSION ReaderExtension,
  158. IN USHORT usAddress,
  159. OUT PUCHAR pbData
  160. );
  161. NTSTATUS CMMOB_WriteRegister(
  162. IN PREADER_EXTENSION ReaderExtension,
  163. IN USHORT usAddress,
  164. IN UCHAR bData
  165. );
  166. NTSTATUS CMMOB_ReadBuffer(
  167. IN PREADER_EXTENSION ReaderExtension,
  168. IN ULONG ulOffset,
  169. IN ULONG ulLength,
  170. OUT PUCHAR pbData
  171. );
  172. NTSTATUS CMMOB_WriteBuffer(
  173. IN PREADER_EXTENSION ReaderExtension,
  174. IN ULONG ulLength,
  175. IN PUCHAR pbData
  176. );
  177. NTSTATUS CMMOB_ReadT0(
  178. IN PREADER_EXTENSION ReaderExtension,
  179. IN ULONG ulBytesToRead,
  180. IN ULONG ulBytesSent,
  181. IN ULONG ulCWT,
  182. OUT PUCHAR pbData,
  183. OUT PULONG pulBytesRead,
  184. OUT PBOOLEAN pfDataSent
  185. );
  186. NTSTATUS CMMOB_ReadT1(
  187. IN PREADER_EXTENSION ReaderExtension,
  188. IN LONG ulBytesToRead,
  189. IN ULONG ulBWT,
  190. IN ULONG ulCWT,
  191. OUT PUCHAR pbData,
  192. OUT PULONG pulBytesRead
  193. );
  194. NTSTATUS CMMOB_WriteT0(
  195. IN PREADER_EXTENSION ReaderExtension,
  196. IN ULONG ulBytesToWrite,
  197. IN ULONG ulBytesToReceive,
  198. IN PUCHAR pbData
  199. );
  200. NTSTATUS CMMOB_WriteT1(
  201. IN PREADER_EXTENSION ReaderExtension,
  202. IN ULONG ulBytesToWrite,
  203. IN PUCHAR pbData
  204. );
  205. VOID CMMOB_InverseBuffer (
  206. PUCHAR pbBuffer,
  207. ULONG ulBufferSize
  208. );
  209. #endif // __CMMOB_PNP_SCR_H__
  210. /*****************************************************************************
  211. * History:
  212. * $Log: cmbp0scr.h $
  213. * Revision 1.3 2000/07/27 13:53:05 WFrischauf
  214. * No comment given
  215. *
  216. *
  217. ******************************************************************************/