cs.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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_DATA_PATH_WIDTH 0x18
  63. #define IO_DATA_PATH_WIDTH_8 0x00
  64. #define IO_DATA_PATH_WIDTH_16 0x08
  65. #define IO_DATA_PATH_WIDTH_AUTO 0x10
  66. /* Bits in IRQInfo1 field */
  67. #define IRQ_NMI_ID 0x01
  68. #define IRQ_IOCK_ID 0x02
  69. #define IRQ_BERR_ID 0x04
  70. #define IRQ_VEND_ID 0x08
  71. #define IRQ_INFO2_VALID 0x10
  72. #define IRQ_LEVEL_ID 0x20
  73. #define IRQ_PULSE_ID 0x40
  74. #define IRQ_SHARE_ID 0x80
  75. /* Configuration registers present */
  76. #define PRESENT_OPTION 0x001
  77. #define PRESENT_STATUS 0x002
  78. #define PRESENT_PIN_REPLACE 0x004
  79. #define PRESENT_COPY 0x008
  80. #define PRESENT_EXT_STATUS 0x010
  81. #define PRESENT_IOBASE_0 0x020
  82. #define PRESENT_IOBASE_1 0x040
  83. #define PRESENT_IOBASE_2 0x080
  84. #define PRESENT_IOBASE_3 0x100
  85. #define PRESENT_IOSIZE 0x200
  86. /* For GetMemPage, MapMemPage */
  87. typedef struct memreq_t {
  88. u_int CardOffset;
  89. u_short Page;
  90. } memreq_t;
  91. /* For ModifyWindow */
  92. typedef struct modwin_t {
  93. u_int Attributes;
  94. u_int AccessSpeed;
  95. } modwin_t;
  96. /* For RequestWindow */
  97. typedef struct win_req_t {
  98. u_int Attributes;
  99. u_long Base;
  100. u_int Size;
  101. u_int AccessSpeed;
  102. } win_req_t;
  103. /* Attributes for RequestWindow */
  104. #define WIN_ADDR_SPACE 0x0001
  105. #define WIN_ADDR_SPACE_MEM 0x0000
  106. #define WIN_ADDR_SPACE_IO 0x0001
  107. #define WIN_MEMORY_TYPE 0x0002
  108. #define WIN_MEMORY_TYPE_CM 0x0000
  109. #define WIN_MEMORY_TYPE_AM 0x0002
  110. #define WIN_ENABLE 0x0004
  111. #define WIN_DATA_WIDTH 0x0018
  112. #define WIN_DATA_WIDTH_8 0x0000
  113. #define WIN_DATA_WIDTH_16 0x0008
  114. #define WIN_DATA_WIDTH_32 0x0010
  115. #define WIN_PAGED 0x0020
  116. #define WIN_SHARED 0x0040
  117. #define WIN_FIRST_SHARED 0x0080
  118. #define WIN_USE_WAIT 0x0100
  119. #define WIN_STRICT_ALIGN 0x0200
  120. #define WIN_MAP_BELOW_1MB 0x0400
  121. #define WIN_PREFETCH 0x0800
  122. #define WIN_CACHEABLE 0x1000
  123. #define WIN_BAR_MASK 0xe000
  124. #define WIN_BAR_SHIFT 13
  125. /* Flag to bind to all functions */
  126. #define BIND_FN_ALL 0xff
  127. #endif /* _LINUX_CS_H */