You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pcmcia.h 3.8KB

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