cs.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. /* Configuration registers present */
  52. #define PRESENT_OPTION 0x001
  53. #define PRESENT_STATUS 0x002
  54. #define PRESENT_PIN_REPLACE 0x004
  55. #define PRESENT_COPY 0x008
  56. #define PRESENT_EXT_STATUS 0x010
  57. #define PRESENT_IOBASE_0 0x020
  58. #define PRESENT_IOBASE_1 0x040
  59. #define PRESENT_IOBASE_2 0x080
  60. #define PRESENT_IOBASE_3 0x100
  61. #define PRESENT_IOSIZE 0x200
  62. /* For GetMemPage, MapMemPage */
  63. typedef struct memreq_t {
  64. u_int CardOffset;
  65. u_short Page;
  66. } memreq_t;
  67. /* For RequestWindow */
  68. typedef struct win_req_t {
  69. u_int Attributes;
  70. u_long Base;
  71. u_int Size;
  72. u_int AccessSpeed;
  73. } win_req_t;
  74. /* Attributes for RequestWindow */
  75. #define WIN_ADDR_SPACE 0x0001
  76. #define WIN_ADDR_SPACE_MEM 0x0000
  77. #define WIN_ADDR_SPACE_IO 0x0001
  78. #define WIN_MEMORY_TYPE 0x0002
  79. #define WIN_MEMORY_TYPE_CM 0x0000
  80. #define WIN_MEMORY_TYPE_AM 0x0002
  81. #define WIN_ENABLE 0x0004
  82. #define WIN_DATA_WIDTH 0x0018
  83. #define WIN_DATA_WIDTH_8 0x0000
  84. #define WIN_DATA_WIDTH_16 0x0008
  85. #define WIN_DATA_WIDTH_32 0x0010
  86. #define WIN_PAGED 0x0020
  87. #define WIN_SHARED 0x0040
  88. #define WIN_FIRST_SHARED 0x0080
  89. #define WIN_USE_WAIT 0x0100
  90. #define WIN_STRICT_ALIGN 0x0200
  91. #define WIN_MAP_BELOW_1MB 0x0400
  92. #define WIN_PREFETCH 0x0800
  93. #define WIN_CACHEABLE 0x1000
  94. #define WIN_BAR_MASK 0xe000
  95. #define WIN_BAR_SHIFT 13
  96. #endif /* _LINUX_CS_H */