Import 2.3.18pre1
[davej-history.git] / include / pcmcia / ss.h
blobe39477e2e4a1be8aa4d5dfb05903f9d0b5d57763
1 /*
2 * ss.h 1.24 1999/08/28 04:12:33
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/
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.
14 * The initial developer of the original code is David A. Hinds
15 * <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds
16 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
18 * Alternatively, the contents of this file may be used under the
19 * terms of the GNU Public License version 2 (the "GPL"), in which
20 * 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.
30 #ifndef _LINUX_SS_H
31 #define _LINUX_SS_H
33 /* For RegisterCallback */
34 typedef struct ss_callback_t {
35 void (*handler)(void *info, u_int events);
36 void *info;
37 } ss_callback_t;
39 /* Definitions for card status flags for GetStatus */
40 #define SS_WRPROT 0x0001
41 #define SS_CARDLOCK 0x0002
42 #define SS_EJECTION 0x0004
43 #define SS_INSERTION 0x0008
44 #define SS_BATDEAD 0x0010
45 #define SS_BATWARN 0x0020
46 #define SS_READY 0x0040
47 #define SS_DETECT 0x0080
48 #define SS_POWERON 0x0100
49 #define SS_GPI 0x0200
50 #define SS_STSCHG 0x0400
51 #define SS_CARDBUS 0x0800
52 #define SS_3VCARD 0x1000
53 #define SS_XVCARD 0x2000
55 /* for InquireSocket */
56 typedef struct socket_cap_t {
57 u_int features;
58 u_int irq_mask;
59 u_int map_size;
60 u_char pci_irq;
61 u_char cardbus;
62 struct pci_bus *cb_bus;
63 struct bus_operations *bus;
64 } socket_cap_t;
66 /* InquireSocket capabilities */
67 #define SS_CAP_PAGE_REGS 0x0001
68 #define SS_CAP_VIRTUAL_BUS 0x0002
69 #define SS_CAP_MEM_ALIGN 0x0004
70 #define SS_CAP_PCCARD 0x4000
71 #define SS_CAP_CARDBUS 0x8000
73 /* for GetSocket, SetSocket */
74 typedef struct socket_state_t {
75 u_int flags;
76 u_int csc_mask;
77 u_char Vcc, Vpp;
78 u_char io_irq;
79 } socket_state_t;
81 /* Socket configuration flags */
82 #define SS_PWR_AUTO 0x0010
83 #define SS_IOCARD 0x0020
84 #define SS_RESET 0x0040
85 #define SS_DMA_MODE 0x0080
86 #define SS_SPKR_ENA 0x0100
87 #define SS_OUTPUT_ENA 0x0200
89 /* Flags for I/O port and memory windows */
90 #define MAP_ACTIVE 0x01
91 #define MAP_16BIT 0x02
92 #define MAP_AUTOSZ 0x04
93 #define MAP_0WS 0x08
94 #define MAP_WRPROT 0x10
95 #define MAP_ATTRIB 0x20
96 #define MAP_USE_WAIT 0x40
97 #define MAP_PREFETCH 0x80
99 /* Use this just for bridge windows */
100 #define MAP_IOSPACE 0x20
102 typedef struct pccard_io_map {
103 u_char map;
104 u_char flags;
105 u_short speed;
106 u_short start, stop;
107 } pccard_io_map;
109 typedef struct pccard_mem_map {
110 u_char map;
111 u_char flags;
112 u_short speed;
113 u_long sys_start, sys_stop;
114 u_int card_start;
115 } pccard_mem_map;
117 typedef struct cb_bridge_map {
118 u_char map;
119 u_char flags;
120 u_int start, stop;
121 } cb_bridge_map;
123 enum ss_service {
124 SS_RegisterCallback, SS_InquireSocket,
125 SS_GetStatus, SS_GetSocket, SS_SetSocket,
126 SS_GetIOMap, SS_SetIOMap, SS_GetMemMap, SS_SetMemMap,
127 SS_GetBridge, SS_SetBridge, SS_ProcSetup
130 #endif /* _LINUX_SS_H */