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.

137 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. dbsocket.h
  5. Abstract:
  6. Definitions and structures for Databook TCIC support.
  7. Author(s):
  8. John Keys - Databook Inc. 7-Apr-1995
  9. Revisions:
  10. --*/
  11. #ifndef _dbsocket_h_ // prevent multiple includes
  12. #define _dbsocket_h_
  13. #include "pcmcia.h"
  14. typedef struct _DBSOCKET {
  15. SOCKET skt; /* PCMCIA.H SOCKET structure */
  16. UCHAR busyLed; /* Busy LED state */
  17. USHORT timerStarted; /* indicate if the BusyLED timer up */
  18. ULONG physPortAddr; /* unmapped port address */
  19. USHORT chipType; /* TCIC silicon ID */
  20. USHORT dflt_vcc5v; /* default 5V Vcc bits */
  21. USHORT dflt_wctl; /* default AR_WCTL bits */
  22. USHORT dflt_syscfg; /* default AR_SYSCFG bits */
  23. USHORT dflt_ilock; /* default AR_ILOCK bits */
  24. USHORT dflt_wrmctl; /* default IR_WRMCTL bits */
  25. USHORT dflt_scfg1; /* default IR_SCFG1 bits */
  26. USHORT clkdiv; /* clock rate divisor (SHFT CNT.) */
  27. UCHAR IRQMapTbl[16]; /* IRQ map */
  28. UCHAR niowins; /* number of io windows */
  29. UCHAR nmemwins; /* number of mem windows */
  30. }DBSOCKET, *PDBSOCKET;
  31. /* Codes for various useful bits of information:
  32. */
  33. #define TCIC_IS270 0x01 /* New TCIC at base+0x400 */
  34. #define TCIC_ALIAS800 0x02 /* Aliased at base+0x800 */
  35. #define TCIC_IS140 0x04 /* Aliased at base+0x10 */
  36. #define TCIC_ALIAS400 0x08 /* Aliased at base+0x400 */
  37. #define TCIC_ALIAS 1
  38. #define TCIC_NOALIAS 2
  39. #define TCIC_NONE 0
  40. /* For tagging wonky-looking IRQ lines:
  41. */
  42. #define TCIC_BADIRQ 0x80
  43. #define ICODEMASK 0x7f
  44. /* Memory offsets used in looking for TCICs at fixed distances from a base
  45. * address:
  46. */
  47. #define TCIC_OFFSET_400 0x400
  48. #define TCIC_OFFSET_800 0x800
  49. #define TCIC_ALIAS_OFFSET 0x010
  50. /*
  51. * Constants for power tables
  52. */
  53. #define SPWR_VCC_SUPPLY 0x8000
  54. #define SPWR_VPP_SUPPLY 0x6000
  55. #define SPWR_ALL_SUPPLY (SPWR_VCC_SUPPLY | SPWR_VPP_SUPPLY)
  56. #define SPWR_0p0V 0
  57. #define SPWR_5p0V 50
  58. #define SPWR_12p0V 120
  59. #define PWRTBL_WORDS 9
  60. #define PWRTBL_SIZE (PWRTBL_WORDS * sizeof(unsigned short))
  61. /*
  62. * Fixed point integer type and handler macros
  63. */
  64. typedef unsigned long FIXEDPT;
  65. #define FIXEDPT_FRACBITS 8
  66. #define INT2FXP(n) (((FIXEDPT)(n)) << FIXEDPT_FRACBITS)
  67. #define ISx84(x) (((x) == SILID_DB86084_1) || ((x) == SILID_DB86084A) || ((x) == SILID_DB86184_1))
  68. #define ISPNP(x) (((x) == SILID_DB86084_1) || ((x) == SILID_DB86084A) || ((x) == SILID_DB86184_1))
  69. /*
  70. *Chip Properties - matches capabilites to a Chip ID
  71. */
  72. typedef struct ChipProps_t {
  73. USHORT chip_id; /* The Silicon ID for this chip */
  74. PUSHORT privpwrtbl; /* the power table that applies */
  75. UCHAR reserved_1; /* Alignment byte */
  76. PUCHAR irqcaps; /* table of possible IRQs */
  77. USHORT maxsockets; /* max # of skts for this chip */
  78. USHORT niowins; /* # I/O wins supported */
  79. USHORT nmemwins; /* # mem wins supported */
  80. USHORT fprops; /* Various properties flags */
  81. # define fIS_PNP 1 /* chip is Plug-n-Play */
  82. # define fEXTBUF_CHK 2 /* chip may need ext buffering check*/
  83. # define fSKTIRQPIN 4 /* chip has socket IRQ pin */
  84. # define fINVALID 8 /* Can't get good flags */
  85. }CHIPPROPS;
  86. /* MODE_AR_SYSCFG must have, with j = ***read*** (***, R_AUX)
  87. and k = (j>>9)&7:
  88. if (k&4) k == 5
  89. And also:
  90. j&0x0f is none of 2, 8, 9, b, c, d, f
  91. if (j&8) must have (j&3 == 2)
  92. Can't have j==2
  93. */
  94. #define INVALID_AR_SYSCFG(x) ((((x)&0x1000) && (((x)&0x0c00) != 0x0200)) \
  95. || (((((x)&0x08) == 0) || (((x)&0x03) == 2)) \
  96. && ((x) != 0x02)))
  97. /* AR_ILOCK must have bits 6 and 7 the same:
  98. */
  99. #define INVALID_AR_ILOCK(x) ((((x)&0xc0) != 0) && (((x)&0xc0) != 0xc0))
  100. /* AR_TEST has some reserved bits:
  101. */
  102. #define INVALID_AR_TEST(x) (((x)&0154) != 0)
  103. /* Wait state codes */
  104. #define WCTL_300NS 8
  105. /**** end of dbsocket.H ****/
  106. #endif /* _dbsocket_H_ */