ss.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * ss.h 1.31 2001/08/24 12:16:13
  3. *
  4. * The contents of this file are subject to the Mozilla Public License
  5. * Version 1.1 (the "License"); you may not use this file except in
  6. * compliance with the License. You may obtain a copy of the License
  7. * at http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS"
  10. * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
  11. * the License for the specific language governing rights and
  12. * limitations under the License.
  13. *
  14. * The initial developer of the original code is David A. Hinds
  15. * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
  16. * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
  17. *
  18. * Alternatively, the contents of this file may be used under the
  19. * terms of the GNU General Public License version 2 (the "GPL"), in
  20. * which case the provisions of the GPL are applicable instead of the
  21. * above. If you wish to allow the use of your version of this file
  22. * only under the terms of the GPL and not to allow others to use
  23. * your version of this file under the MPL, indicate your decision by
  24. * deleting the provisions above and replace them with the notice and
  25. * other provisions required by the GPL. If you do not delete the
  26. * provisions above, a recipient may use your version of this file
  27. * under either the MPL or the GPL.
  28. */
  29. #ifndef _LINUX_SS_H
  30. #define _LINUX_SS_H
  31. /* For RegisterCallback */
  32. typedef struct ss_callback_t {
  33. void (*handler)(void *info, u_int events);
  34. void *info;
  35. } ss_callback_t;
  36. /* Definitions for card status flags for GetStatus */
  37. #define SS_WRPROT 0x0001
  38. #define SS_CARDLOCK 0x0002
  39. #define SS_EJECTION 0x0004
  40. #define SS_INSERTION 0x0008
  41. #define SS_BATDEAD 0x0010
  42. #define SS_BATWARN 0x0020
  43. #define SS_READY 0x0040
  44. #define SS_DETECT 0x0080
  45. #define SS_POWERON 0x0100
  46. #define SS_GPI 0x0200
  47. #define SS_STSCHG 0x0400
  48. #define SS_CARDBUS 0x0800
  49. #define SS_3VCARD 0x1000
  50. #define SS_XVCARD 0x2000
  51. #define SS_PENDING 0x4000
  52. /* for InquireSocket */
  53. typedef struct socket_cap_t {
  54. u_int features;
  55. u_int irq_mask;
  56. u_int map_size;
  57. u_char pci_irq;
  58. u_char cardbus;
  59. struct pci_bus *cb_bus;
  60. struct bus_operations *bus;
  61. } socket_cap_t;
  62. /* InquireSocket capabilities */
  63. #define SS_CAP_PAGE_REGS 0x0001
  64. #define SS_CAP_VIRTUAL_BUS 0x0002
  65. #define SS_CAP_MEM_ALIGN 0x0004
  66. #define SS_CAP_STATIC_MAP 0x0008
  67. #define SS_CAP_PCCARD 0x4000
  68. #define SS_CAP_CARDBUS 0x8000
  69. /* for GetSocket, SetSocket */
  70. typedef struct socket_state_t {
  71. u_int flags;
  72. u_int csc_mask;
  73. u_char Vcc, Vpp;
  74. u_char io_irq;
  75. } socket_state_t;
  76. /* Socket configuration flags */
  77. #define SS_PWR_AUTO 0x0010
  78. #define SS_IOCARD 0x0020
  79. #define SS_RESET 0x0040
  80. #define SS_DMA_MODE 0x0080
  81. #define SS_SPKR_ENA 0x0100
  82. #define SS_OUTPUT_ENA 0x0200
  83. #define SS_ZVCARD 0x0400
  84. /* Flags for I/O port and memory windows */
  85. #define MAP_ACTIVE 0x01
  86. #define MAP_16BIT 0x02
  87. #define MAP_AUTOSZ 0x04
  88. #define MAP_0WS 0x08
  89. #define MAP_WRPROT 0x10
  90. #define MAP_ATTRIB 0x20
  91. #define MAP_USE_WAIT 0x40
  92. #define MAP_PREFETCH 0x80
  93. /* Use this just for bridge windows */
  94. #define MAP_IOSPACE 0x20
  95. typedef struct pccard_io_map {
  96. u_char map;
  97. u_char flags;
  98. u_short speed;
  99. u_short start, stop;
  100. } pccard_io_map;
  101. typedef struct pccard_mem_map {
  102. u_char map;
  103. u_char flags;
  104. u_short speed;
  105. u_long sys_start, sys_stop;
  106. u_int card_start;
  107. } pccard_mem_map;
  108. typedef struct cb_bridge_map {
  109. u_char map;
  110. u_char flags;
  111. u_int start, stop;
  112. } cb_bridge_map;
  113. enum ss_service {
  114. SS_RegisterCallback, SS_InquireSocket,
  115. SS_GetStatus, SS_GetSocket, SS_SetSocket,
  116. SS_GetIOMap, SS_SetIOMap, SS_GetMemMap, SS_SetMemMap,
  117. SS_GetBridge, SS_SetBridge, SS_ProcSetup
  118. };
  119. #endif /* _LINUX_SS_H */