cs.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * cs.h
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * The initial developer of the original code is David A. Hinds
  9. * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
  10. * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
  11. *
  12. * (C) 1999 David A. Hinds
  13. */
  14. #ifndef _LINUX_CS_H
  15. #define _LINUX_CS_H
  16. #ifdef __KERNEL__
  17. #include <linux/interrupt.h>
  18. #endif
  19. /* for AdjustResourceInfo */
  20. /* Action field */
  21. #define REMOVE_MANAGED_RESOURCE 1
  22. #define ADD_MANAGED_RESOURCE 2
  23. /* For CardValues field */
  24. #define CV_OPTION_VALUE 0x01
  25. #define CV_STATUS_VALUE 0x02
  26. #define CV_PIN_REPLACEMENT 0x04
  27. #define CV_COPY_VALUE 0x08
  28. #define CV_EXT_STATUS 0x10
  29. /* ModifyConfiguration */
  30. typedef struct modconf_t {
  31. u_int Attributes;
  32. u_int Vcc, Vpp1, Vpp2;
  33. } modconf_t;
  34. /* Attributes for ModifyConfiguration */
  35. #define CONF_IRQ_CHANGE_VALID 0x0100
  36. #define CONF_VCC_CHANGE_VALID 0x0200
  37. #define CONF_VPP1_CHANGE_VALID 0x0400
  38. #define CONF_VPP2_CHANGE_VALID 0x0800
  39. #define CONF_IO_CHANGE_WIDTH 0x1000
  40. /* For RequestConfiguration */
  41. typedef struct config_req_t {
  42. u_int Attributes;
  43. u_int Vpp; /* both Vpp1 and Vpp2 */
  44. u_int IntType;
  45. u_int ConfigBase;
  46. u_char Status, Pin, Copy, ExtStatus;
  47. u_char ConfigIndex;
  48. u_int Present;
  49. } config_req_t;
  50. /* Attributes for RequestConfiguration */
  51. #define CONF_ENABLE_IRQ 0x01
  52. #define CONF_ENABLE_DMA 0x02
  53. #define CONF_ENABLE_SPKR 0x04
  54. #define CONF_ENABLE_PULSE_IRQ 0x08
  55. #define CONF_VALID_CLIENT 0x100
  56. /* IntType field */
  57. #define INT_MEMORY 0x01
  58. #define INT_MEMORY_AND_IO 0x02
  59. #define INT_CARDBUS 0x04
  60. #define INT_ZOOMED_VIDEO 0x08
  61. /* For RequestIO and ReleaseIO */
  62. typedef struct io_req_t {
  63. u_int BasePort1;
  64. u_int NumPorts1;
  65. u_int Attributes1;
  66. u_int BasePort2;
  67. u_int NumPorts2;
  68. u_int Attributes2;
  69. u_int IOAddrLines;
  70. } io_req_t;
  71. /* Attributes for RequestIO and ReleaseIO */
  72. #define IO_SHARED 0x01
  73. #define IO_FIRST_SHARED 0x02
  74. #define IO_FORCE_ALIAS_ACCESS 0x04
  75. #define IO_DATA_PATH_WIDTH 0x18
  76. #define IO_DATA_PATH_WIDTH_8 0x00
  77. #define IO_DATA_PATH_WIDTH_16 0x08
  78. #define IO_DATA_PATH_WIDTH_AUTO 0x10
  79. /* Bits in IRQInfo1 field */
  80. #define IRQ_NMI_ID 0x01
  81. #define IRQ_IOCK_ID 0x02
  82. #define IRQ_BERR_ID 0x04
  83. #define IRQ_VEND_ID 0x08
  84. #define IRQ_INFO2_VALID 0x10
  85. #define IRQ_LEVEL_ID 0x20
  86. #define IRQ_PULSE_ID 0x40
  87. #define IRQ_SHARE_ID 0x80
  88. /* Configuration registers present */
  89. #define PRESENT_OPTION 0x001
  90. #define PRESENT_STATUS 0x002
  91. #define PRESENT_PIN_REPLACE 0x004
  92. #define PRESENT_COPY 0x008
  93. #define PRESENT_EXT_STATUS 0x010
  94. #define PRESENT_IOBASE_0 0x020
  95. #define PRESENT_IOBASE_1 0x040
  96. #define PRESENT_IOBASE_2 0x080
  97. #define PRESENT_IOBASE_3 0x100
  98. #define PRESENT_IOSIZE 0x200
  99. /* For GetMemPage, MapMemPage */
  100. typedef struct memreq_t {
  101. u_int CardOffset;
  102. u_short Page;
  103. } memreq_t;
  104. /* For ModifyWindow */
  105. typedef struct modwin_t {
  106. u_int Attributes;
  107. u_int AccessSpeed;
  108. } modwin_t;
  109. /* For RequestWindow */
  110. typedef struct win_req_t {
  111. u_int Attributes;
  112. u_long Base;
  113. u_int Size;
  114. u_int AccessSpeed;
  115. } win_req_t;
  116. /* Attributes for RequestWindow */
  117. #define WIN_ADDR_SPACE 0x0001
  118. #define WIN_ADDR_SPACE_MEM 0x0000
  119. #define WIN_ADDR_SPACE_IO 0x0001
  120. #define WIN_MEMORY_TYPE 0x0002
  121. #define WIN_MEMORY_TYPE_CM 0x0000
  122. #define WIN_MEMORY_TYPE_AM 0x0002
  123. #define WIN_ENABLE 0x0004
  124. #define WIN_DATA_WIDTH 0x0018
  125. #define WIN_DATA_WIDTH_8 0x0000
  126. #define WIN_DATA_WIDTH_16 0x0008
  127. #define WIN_DATA_WIDTH_32 0x0010
  128. #define WIN_PAGED 0x0020
  129. #define WIN_SHARED 0x0040
  130. #define WIN_FIRST_SHARED 0x0080
  131. #define WIN_USE_WAIT 0x0100
  132. #define WIN_STRICT_ALIGN 0x0200
  133. #define WIN_MAP_BELOW_1MB 0x0400
  134. #define WIN_PREFETCH 0x0800
  135. #define WIN_CACHEABLE 0x1000
  136. #define WIN_BAR_MASK 0xe000
  137. #define WIN_BAR_SHIFT 13
  138. /* Flag to bind to all functions */
  139. #define BIND_FN_ALL 0xff
  140. #endif /* _LINUX_CS_H */