cs.h 3.1 KB

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