iPXE
pcmcia.h
Go to the documentation of this file.
00001 //      pcmcia.h - Header file for PCMCIA support
00002 
00003 #ifndef PCMCIA_H
00004 #define PCMCIA_H
00005 
00006 typedef unsigned char   u_char;
00007 typedef unsigned short  u_short;
00008 typedef unsigned int    u_int;
00009 typedef unsigned long   u_long;
00010 
00011 typedef u_short         ioaddr_t;
00012 extern int sockets;
00013 
00014 #define MAXPCCSOCKS     8
00015 #define MAXPCCCONFIGS   8
00016 
00017 typedef enum ebpdriver_t        { I82365, SOMEDRIVER                                            } ebpdriver_t;
00018 typedef enum interface_func_t   { INIT, SHUTDOWN, MAPATTRMEM, UNMAPATTRMEM, SELECTCONFIG        } interface_func_t;
00019 typedef enum ebpstatus_t        { EMPTY, HASCARD, INITIALIZED, SUSPENDED, OTHERDEVICE, UNKNOWN  } ebpstatus_t;
00020 
00021 struct  driver_interact_t {
00022         ebpdriver_t     id;
00023         int             (*f)(interface_func_t,int,int,int,int);
00024         char            *name;
00025 };
00026 struct  pccsock_t {
00027         ebpdriver_t     device;
00028         int             drivernum;
00029         ebpstatus_t     status;
00030                 // Internal usage of the drivers:
00031         int             internalid;
00032         int             flags;
00033         int             ioaddr;
00034         int             type;
00035         int             configoffset;
00036         int             possibleconfignum;
00037         int             stringoffset;
00038         u_int           stringlength;
00039         int             rmask0;
00040 };
00041 
00042 extern struct   pccsock_t       pccsock[MAXPCCSOCKS];
00043 extern u_int    pccsocks;
00044 
00045 struct  pcc_config_t {
00046         u_char  index;
00047         u_char  irq;
00048         int     iowin;
00049         int     iolen;
00050 };
00051 
00052 
00053 int     i82365_interfacer(interface_func_t,int,int,int,void *);
00054 void    sleepticks(int);
00055 
00056 #define EINVAL  22
00057 
00058 
00059 //*********************************************************** cc.h:
00060 /* Definitions for card status flags for GetStatus */
00061 #define SS_WRPROT       0x0001
00062 #define SS_CARDLOCK     0x0002
00063 #define SS_EJECTION     0x0004
00064 #define SS_INSERTION    0x0008
00065 #define SS_BATDEAD      0x0010
00066 #define SS_BATWARN      0x0020
00067 #define SS_READY        0x0040
00068 #define SS_DETECT       0x0080
00069 #define SS_POWERON      0x0100
00070 #define SS_GPI          0x0200
00071 #define SS_STSCHG       0x0400
00072 #define SS_CARDBUS      0x0800
00073 #define SS_3VCARD       0x1000
00074 #define SS_XVCARD       0x2000
00075 #define SS_PENDING      0x4000
00076 
00077 /* cc.h: for InquireSocket */
00078 typedef struct socket_cap_t {
00079     u_int       features;
00080     u_int       irq_mask;
00081     u_int       map_size;
00082     ioaddr_t    io_offset;
00083     u_char      pci_irq;
00084     //struct pci_dev *cb_dev;
00085     //struct bus_operations *bus;
00086     void *cb_dev;
00087     void *bus;
00088 } socket_cap_t;
00089 /* InquireSocket capabilities */
00090 #define SS_CAP_PAGE_REGS        0x0001
00091 #define SS_CAP_VIRTUAL_BUS      0x0002
00092 #define SS_CAP_MEM_ALIGN        0x0004
00093 #define SS_CAP_STATIC_MAP       0x0008
00094 #define SS_CAP_PCCARD           0x4000
00095 #define SS_CAP_CARDBUS          0x8000
00096 
00097 /* for GetSocket, SetSocket */
00098 typedef struct socket_state_t {
00099     u_int       flags;
00100     u_int       csc_mask;
00101     u_char      Vcc, Vpp;
00102     u_char      io_irq;
00103 } socket_state_t;
00104 
00105 extern socket_state_t dead_socket;
00106 
00107 /* Socket configuration flags */
00108 #define SS_PWR_AUTO     0x0010
00109 #define SS_IOCARD       0x0020
00110 #define SS_RESET        0x0040
00111 #define SS_DMA_MODE     0x0080
00112 #define SS_SPKR_ENA     0x0100
00113 #define SS_OUTPUT_ENA   0x0200
00114 #define SS_DEBOUNCED    0x0400  /* Tell driver that the debounce delay has ended */
00115 #define SS_ZVCARD       0x0800
00116 
00117 /* Flags for I/O port and memory windows */
00118 #define MAP_ACTIVE      0x01
00119 #define MAP_16BIT       0x02
00120 #define MAP_AUTOSZ      0x04
00121 #define MAP_0WS         0x08
00122 #define MAP_WRPROT      0x10
00123 #define MAP_ATTRIB      0x20
00124 #define MAP_USE_WAIT    0x40
00125 #define MAP_PREFETCH    0x80
00126 
00127 /* Use this just for bridge windows */
00128 #define MAP_IOSPACE     0x20
00129 
00130 typedef struct pccard_io_map {
00131     u_char      map;
00132     u_char      flags;
00133     u_short     speed;
00134     ioaddr_t    start, stop;
00135 } pccard_io_map;
00136 
00137 
00138 typedef struct pccard_mem_map {
00139     u_char      map;
00140     u_char      flags;
00141     u_short     speed;
00142     u_long      sys_start, sys_stop;
00143     u_int       card_start;
00144 } pccard_mem_map;
00145 
00146 typedef struct cb_bridge_map {
00147     u_char      map;
00148     u_char      flags;
00149     u_int       start, stop;
00150 } cb_bridge_map;
00151 // need the global function pointer struct? *TODO*
00152 //************************************* end cc.h
00153 
00154 
00155 
00156 #endif /* PCMCIA_H */