Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

pcmcia.h 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. // pcmcia.h - Header file for PCMCIA support
  2. #ifndef PCMCIA_H
  3. #define PCMCIA_H
  4. typedef unsigned char u_char;
  5. typedef unsigned short u_short;
  6. typedef unsigned int u_int;
  7. typedef unsigned long u_long;
  8. typedef u_short ioaddr_t;
  9. extern int sockets;
  10. #define MAXPCCSOCKS 8
  11. #define MAXPCCCONFIGS 8
  12. typedef enum ebpdriver_t { I82365, SOMEDRIVER } ebpdriver_t;
  13. typedef enum interface_func_t { INIT, SHUTDOWN, MAPATTRMEM, UNMAPATTRMEM, SELECTCONFIG } interface_func_t;
  14. typedef enum ebpstatus_t { EMPTY, HASCARD, INITIALIZED, SUSPENDED, OTHERDEVICE, UNKNOWN } ebpstatus_t;
  15. struct driver_interact_t {
  16. ebpdriver_t id;
  17. int (*f)(interface_func_t,int,int,int,int);
  18. char *name;
  19. };
  20. struct pccsock_t {
  21. ebpdriver_t device;
  22. int drivernum;
  23. ebpstatus_t status;
  24. // Internal usage of the drivers:
  25. int internalid;
  26. int flags;
  27. int ioaddr;
  28. int type;
  29. int configoffset;
  30. int possibleconfignum;
  31. int stringoffset;
  32. u_int stringlength;
  33. int rmask0;
  34. };
  35. extern struct pccsock_t pccsock[MAXPCCSOCKS];
  36. extern u_int pccsocks;
  37. struct pcc_config_t {
  38. u_char index;
  39. u_char irq;
  40. int iowin;
  41. int iolen;
  42. };
  43. int i82365_interfacer(interface_func_t,int,int,int,void *);
  44. void sleepticks(int);
  45. #define EINVAL 22
  46. //*********************************************************** cc.h:
  47. /* Definitions for card status flags for GetStatus */
  48. #define SS_WRPROT 0x0001
  49. #define SS_CARDLOCK 0x0002
  50. #define SS_EJECTION 0x0004
  51. #define SS_INSERTION 0x0008
  52. #define SS_BATDEAD 0x0010
  53. #define SS_BATWARN 0x0020
  54. #define SS_READY 0x0040
  55. #define SS_DETECT 0x0080
  56. #define SS_POWERON 0x0100
  57. #define SS_GPI 0x0200
  58. #define SS_STSCHG 0x0400
  59. #define SS_CARDBUS 0x0800
  60. #define SS_3VCARD 0x1000
  61. #define SS_XVCARD 0x2000
  62. #define SS_PENDING 0x4000
  63. /* cc.h: for InquireSocket */
  64. typedef struct socket_cap_t {
  65. u_int features;
  66. u_int irq_mask;
  67. u_int map_size;
  68. ioaddr_t io_offset;
  69. u_char pci_irq;
  70. //struct pci_dev *cb_dev;
  71. //struct bus_operations *bus;
  72. void *cb_dev;
  73. void *bus;
  74. } socket_cap_t;
  75. /* InquireSocket capabilities */
  76. #define SS_CAP_PAGE_REGS 0x0001
  77. #define SS_CAP_VIRTUAL_BUS 0x0002
  78. #define SS_CAP_MEM_ALIGN 0x0004
  79. #define SS_CAP_STATIC_MAP 0x0008
  80. #define SS_CAP_PCCARD 0x4000
  81. #define SS_CAP_CARDBUS 0x8000
  82. /* for GetSocket, SetSocket */
  83. typedef struct socket_state_t {
  84. u_int flags;
  85. u_int csc_mask;
  86. u_char Vcc, Vpp;
  87. u_char io_irq;
  88. } socket_state_t;
  89. extern socket_state_t dead_socket;
  90. /* Socket configuration flags */
  91. #define SS_PWR_AUTO 0x0010
  92. #define SS_IOCARD 0x0020
  93. #define SS_RESET 0x0040
  94. #define SS_DMA_MODE 0x0080
  95. #define SS_SPKR_ENA 0x0100
  96. #define SS_OUTPUT_ENA 0x0200
  97. #define SS_DEBOUNCED 0x0400 /* Tell driver that the debounce delay has ended */
  98. #define SS_ZVCARD 0x0800
  99. /* Flags for I/O port and memory windows */
  100. #define MAP_ACTIVE 0x01
  101. #define MAP_16BIT 0x02
  102. #define MAP_AUTOSZ 0x04
  103. #define MAP_0WS 0x08
  104. #define MAP_WRPROT 0x10
  105. #define MAP_ATTRIB 0x20
  106. #define MAP_USE_WAIT 0x40
  107. #define MAP_PREFETCH 0x80
  108. /* Use this just for bridge windows */
  109. #define MAP_IOSPACE 0x20
  110. typedef struct pccard_io_map {
  111. u_char map;
  112. u_char flags;
  113. u_short speed;
  114. ioaddr_t start, stop;
  115. } pccard_io_map;
  116. typedef struct pccard_mem_map {
  117. u_char map;
  118. u_char flags;
  119. u_short speed;
  120. u_long sys_start, sys_stop;
  121. u_int card_start;
  122. } pccard_mem_map;
  123. typedef struct cb_bridge_map {
  124. u_char map;
  125. u_char flags;
  126. u_int start, stop;
  127. } cb_bridge_map;
  128. // need the global function pointer struct? *TODO*
  129. //************************************* end cc.h
  130. #endif /* PCMCIA_H */