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.

300 lines
6.0 KiB

  1. /*
  2. // This header file describes the data structure for the Dongle
  3. // Author : Kishor Padmanabhan
  4. // Company : National Semiconductor Corp.
  5. // Date : 10 Sept 1996
  6. * Portions Copyright (C) 1996-2001 National Semiconductor Corp.
  7. * All rights reserved.
  8. * Copyright (C) 1996-2001 Microsoft Corporation. All Rights Reserved.
  9. */
  10. #include "defs.h"
  11. #ifndef DONGLE
  12. #define DONGLE
  13. // This is the structure which descibes Dongle capabilities
  14. //
  15. // This is a 12 word structure with bit fields defined by the specs to be soon
  16. // published by Franco Iacobelli
  17. // There is an extra field for the OEM differentiation.
  18. //
  19. typedef struct Dingle
  20. {
  21. union {
  22. UINT Data;
  23. struct
  24. {
  25. UINT DSVFLAG:1;
  26. UINT IADP:1;
  27. UINT MVFLAG:1;
  28. UINT Reserved:2;
  29. UINT GCERR:3;
  30. UINT NumPorts:2;
  31. UINT TrcvrCode:5;
  32. UINT Reserved2:1;
  33. } bits;
  34. } WORD0;
  35. union {
  36. UINT Data;
  37. struct
  38. {
  39. UINT CurSelMode;
  40. } bits;
  41. } WORD1;
  42. union {
  43. UINT Data;
  44. struct
  45. {
  46. UINT Reserved;
  47. } bits;
  48. } WORD2;
  49. union {
  50. UINT Data;
  51. struct
  52. {
  53. UINT LowPower:1;
  54. UINT TxDefPwrLevel:3;
  55. UINT RxDefSensitivity:3;
  56. UINT CirDemod:1;
  57. UINT Reserved:8;
  58. } bits;
  59. } WORD3;
  60. union {
  61. UINT Data;
  62. struct
  63. {
  64. UINT SirRxRecoveryTime:6;
  65. UINT IrRecoveryTimeUnits:2;
  66. UINT Reserved:8;
  67. } bits;
  68. } WORD4;
  69. union {
  70. UINT Data;
  71. struct
  72. {
  73. UINT Reserved;
  74. } bits;
  75. } WORD5;
  76. union {
  77. UINT Data;
  78. struct
  79. {
  80. UINT SirRxStability:8;
  81. UINT Reserved:8;
  82. } bits;
  83. } WORD6;
  84. union {
  85. UINT Data;
  86. struct
  87. {
  88. UINT SIR:1;
  89. UINT MIR:1;
  90. UINT FIR:1;
  91. UINT Sharp_IR:1;
  92. UINT Reserved:8;
  93. UINT CirOvrLowSpeed:1;
  94. UINT CirOvrMedSpeed:1;
  95. UINT CirOvrHiSpeed:1;
  96. } bits;
  97. } WORD7;
  98. union {
  99. UINT Data;
  100. struct
  101. {
  102. UINT Reserved:2;
  103. UINT Cir30k:1;
  104. UINT Cir31k:1;
  105. UINT Cir32k:1;
  106. UINT Cir33k:1;
  107. UINT Cir34k:1;
  108. UINT Cir35k:1;
  109. UINT Cir36k:1;
  110. UINT Cir37k:1;
  111. UINT Cir38k:1;
  112. UINT Cir39k:1;
  113. UINT Cir40k:1;
  114. UINT Cir41k:1;
  115. UINT Cir42k:1;
  116. UINT Cir43k:1;
  117. } bits;
  118. } WORD8;
  119. union {
  120. UINT Data;
  121. struct
  122. {
  123. UINT Cir44k:1;
  124. UINT Cir45k:1;
  125. UINT Cir46k:1;
  126. UINT Cir47k:1;
  127. UINT Cir48k:1;
  128. UINT Cir49k:1;
  129. UINT Cir50k:1;
  130. UINT Cir51k:1;
  131. UINT Cir52k:1;
  132. UINT Cir53k:1;
  133. UINT Cir54k:1;
  134. UINT Cir55k:1;
  135. UINT Cir56k:1;
  136. UINT Cir57k:1;
  137. UINT Reserved:3;
  138. } bits;
  139. } WORD9;
  140. union {
  141. UINT Data;
  142. struct
  143. {
  144. UINT Reserved:1;
  145. UINT Cir450k:1;
  146. UINT Cir480k:1;
  147. UINT Reserved2:13;
  148. } bits;
  149. } WORD10;
  150. union {
  151. UINT Data;
  152. struct
  153. {
  154. UINT Reserved;
  155. } bits ;
  156. } WORD11;
  157. UINT PlugPlay; // Describes whether dongle is a plug and play or not
  158. } DongleParam; // Assuming two ports
  159. enum PwMode{NORMAl,LOWPOWER};
  160. // The structure pre-requisite for calling the Get Capabilities
  161. //
  162. typedef struct
  163. {
  164. char * ComPort; // Address of the com port
  165. UINT Signature; // Two byte value
  166. UINT XcvrNum; // Defaults to 0. In case, there are more than 1 port
  167. UINT ModeReq; // IR Mode request.
  168. enum PwMode Power;
  169. } UIR;
  170. // Error Codes
  171. #define XCVR_DISCONNECT 2
  172. #define UNIMPLEMENTED 3
  173. #define UNSUPPORTED 4
  174. #define ERROR_GETCAPAB 5
  175. // Define Adapter code
  176. #define PC87108 0x0
  177. #define PC87308 0x1
  178. #define PC87338 0x2
  179. #define PNPUIR 0x3
  180. #define PC87560 0x8
  181. #define PUMA108 0x4
  182. //
  183. // Define Dongle Manufactures Code
  184. #define NoDongle 0x000F //No dongle connected - Not used anymore
  185. #define SirOnly 0x000E //SIR only dongle
  186. #define PnpDong 0x8000 //Plug-n-Play dongle
  187. #define Hp1100 0x000C //HP HSDL-1100/2100, TI TSLM1100, Sharp RY6FD11E/RY6FD1SE
  188. #define Hp2300 0x0008 //HP HSDL_2300/3600
  189. #define Temic6000 0x0009 //TEMIC TFDS-6000, IBM31T1100, Siemens IRMS/T6400
  190. #define Temic6500 0x000B //TEMIC TFDS-6500
  191. #define SharpRY5HD01 0x0004 //SHARP RY5HD01/RY5KD01
  192. #define Dell1997 0x0010 //DELL Titanium (dual xcvr)
  193. #define Ibm20H2987 0x0011 //IBM SouthernCross (dual xcvr)
  194. //
  195. // Valid types of dongle, this has to be correlated with INF.
  196. //
  197. #define VALID_DONGLETYPES \
  198. { \
  199. SirOnly, \
  200. Hp1100, \
  201. Hp2300, \
  202. Temic6000, \
  203. SharpRY5HD01, \
  204. Hp1100, \
  205. Temic6000, \
  206. Temic6500, \
  207. Temic6000, \
  208. Hp1100, \
  209. Ibm20H2987, \
  210. Dell1997 \
  211. }
  212. // Bank Selection patterns for the register BSR
  213. //
  214. #ifdef NDIS50_MINIPORT
  215. #define BANK0 0x0
  216. #define BANK1 0x1
  217. #define BANK2 0x2
  218. #define BANK3 0x3
  219. #define BANK4 0x4
  220. #define BANK5 0x5
  221. #define BANK6 0x6
  222. #define BANK7 0x7
  223. #define ALL 0x8
  224. #else
  225. #define BANK0 0x03
  226. #define BANK1 0x80
  227. #define BANK2 0xE0
  228. #define BANK3 0xE4
  229. #define BANK4 0xE8
  230. #define BANK5 0xEC
  231. #define BANK6 0xF0
  232. #define BANK7 0xF4
  233. #define ALL 0xFF
  234. #endif
  235. // Recovery and Stabilization table
  236. //
  237. #define HpRecovery (UINT)0x05
  238. #define TemicRecovery (UINT)0x05
  239. #define SharpRecovery (UINT)0x05
  240. #define HpBofs (UINT)8
  241. #define TemicBofs (UINT)8
  242. #define SharpBofs (UINT)12
  243. typedef struct _SYNC_DONGLE {
  244. UIR * Com;
  245. DongleParam *Dingle;
  246. } SYNC_DONGLE, *PSYNC_DONGLE;
  247. // Putting all the stuff required for the dongle stuff in one place
  248. DongleParam *GetDongleCapabilities(PSYNC_DONGLE SyncDongle);
  249. int SetDongleCapabilities(PSYNC_DONGLE SyncDongle);
  250. #endif