cs.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 RequestWindow */
  63. typedef struct win_req_t {
  64. u_int Attributes;
  65. u_long Base;
  66. u_int Size;
  67. u_int AccessSpeed;
  68. } win_req_t;
  69. /* Attributes for RequestWindow */
  70. #define WIN_MEMORY_TYPE_CM 0x00 /* default */
  71. #define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */
  72. #define WIN_DATA_WIDTH_8 0x00 /* default */
  73. #define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */
  74. #define WIN_ENABLE 0x01 /* MAP_ACTIVE */
  75. #define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */
  76. #define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE |
  77. MAP_USE_WAIT */
  78. #define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]:
  79. 0x04 -> 0
  80. 0x08 -> 1
  81. 0x0c -> 2
  82. 0x10 -> 3 */
  83. #endif /* _LINUX_CS_H */