cs.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. /* ModifyConfiguration */
  20. typedef struct modconf_t {
  21. u_int Attributes;
  22. u_int Vcc, Vpp1, Vpp2;
  23. } modconf_t;
  24. /* Attributes for ModifyConfiguration */
  25. #define CONF_IRQ_CHANGE_VALID 0x0100
  26. #define CONF_VCC_CHANGE_VALID 0x0200
  27. #define CONF_VPP1_CHANGE_VALID 0x0400
  28. #define CONF_VPP2_CHANGE_VALID 0x0800
  29. #define CONF_IO_CHANGE_WIDTH 0x1000
  30. /* For RequestConfiguration */
  31. typedef struct config_req_t {
  32. u_int Attributes;
  33. u_int Vpp; /* both Vpp1 and Vpp2 */
  34. u_int IntType;
  35. u_int ConfigBase;
  36. u_char Status, Pin, Copy, ExtStatus;
  37. u_char ConfigIndex;
  38. u_int Present;
  39. } config_req_t;
  40. /* Attributes for RequestConfiguration */
  41. #define CONF_ENABLE_IRQ 0x01
  42. #define CONF_ENABLE_DMA 0x02
  43. #define CONF_ENABLE_SPKR 0x04
  44. #define CONF_ENABLE_PULSE_IRQ 0x08
  45. #define CONF_VALID_CLIENT 0x100
  46. /* IntType field */
  47. #define INT_MEMORY 0x01
  48. #define INT_MEMORY_AND_IO 0x02
  49. #define INT_CARDBUS 0x04
  50. #define INT_ZOOMED_VIDEO 0x08
  51. /* For RequestIO and ReleaseIO */
  52. typedef struct io_req_t {
  53. u_int BasePort1;
  54. u_int NumPorts1;
  55. u_int Attributes1;
  56. u_int BasePort2;
  57. u_int NumPorts2;
  58. u_int Attributes2;
  59. u_int IOAddrLines;
  60. } io_req_t;
  61. /* Attributes for RequestIO and ReleaseIO */
  62. #define IO_SHARED 0x01
  63. #define IO_FIRST_SHARED 0x02
  64. #define IO_FORCE_ALIAS_ACCESS 0x04
  65. #define IO_DATA_PATH_WIDTH 0x18
  66. #define IO_DATA_PATH_WIDTH_8 0x00
  67. #define IO_DATA_PATH_WIDTH_16 0x08
  68. #define IO_DATA_PATH_WIDTH_AUTO 0x10
  69. /* Bits in IRQInfo1 field */
  70. #define IRQ_NMI_ID 0x01
  71. #define IRQ_IOCK_ID 0x02
  72. #define IRQ_BERR_ID 0x04
  73. #define IRQ_VEND_ID 0x08
  74. #define IRQ_INFO2_VALID 0x10
  75. #define IRQ_LEVEL_ID 0x20
  76. #define IRQ_PULSE_ID 0x40
  77. #define IRQ_SHARE_ID 0x80
  78. /* Configuration registers present */
  79. #define PRESENT_OPTION 0x001
  80. #define PRESENT_STATUS 0x002
  81. #define PRESENT_PIN_REPLACE 0x004
  82. #define PRESENT_COPY 0x008
  83. #define PRESENT_EXT_STATUS 0x010
  84. #define PRESENT_IOBASE_0 0x020
  85. #define PRESENT_IOBASE_1 0x040
  86. #define PRESENT_IOBASE_2 0x080
  87. #define PRESENT_IOBASE_3 0x100
  88. #define PRESENT_IOSIZE 0x200
  89. /* For GetMemPage, MapMemPage */
  90. typedef struct memreq_t {
  91. u_int CardOffset;
  92. u_short Page;
  93. } memreq_t;
  94. /* For ModifyWindow */
  95. typedef struct modwin_t {
  96. u_int Attributes;
  97. u_int AccessSpeed;
  98. } modwin_t;
  99. /* For RequestWindow */
  100. typedef struct win_req_t {
  101. u_int Attributes;
  102. u_long Base;
  103. u_int Size;
  104. u_int AccessSpeed;
  105. } win_req_t;
  106. /* Attributes for RequestWindow */
  107. #define WIN_ADDR_SPACE 0x0001
  108. #define WIN_ADDR_SPACE_MEM 0x0000
  109. #define WIN_ADDR_SPACE_IO 0x0001
  110. #define WIN_MEMORY_TYPE 0x0002
  111. #define WIN_MEMORY_TYPE_CM 0x0000
  112. #define WIN_MEMORY_TYPE_AM 0x0002
  113. #define WIN_ENABLE 0x0004
  114. #define WIN_DATA_WIDTH 0x0018
  115. #define WIN_DATA_WIDTH_8 0x0000
  116. #define WIN_DATA_WIDTH_16 0x0008
  117. #define WIN_DATA_WIDTH_32 0x0010
  118. #define WIN_PAGED 0x0020
  119. #define WIN_SHARED 0x0040
  120. #define WIN_FIRST_SHARED 0x0080
  121. #define WIN_USE_WAIT 0x0100
  122. #define WIN_STRICT_ALIGN 0x0200
  123. #define WIN_MAP_BELOW_1MB 0x0400
  124. #define WIN_PREFETCH 0x0800
  125. #define WIN_CACHEABLE 0x1000
  126. #define WIN_BAR_MASK 0xe000
  127. #define WIN_BAR_SHIFT 13
  128. /* Flag to bind to all functions */
  129. #define BIND_FN_ALL 0xff
  130. #endif /* _LINUX_CS_H */