xref: /haiku/headers/os/drivers/pcmcia/ss.h (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
1 /*
2  * ss.h 1.23 1999/07/20 16:08:01
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  * <dhinds@hyper.stanford.edu>.  Portions created by David A. Hinds
16  * are Copyright (C) 1998 David A. Hinds.  All Rights Reserved.
17  */
18 
19 #ifndef _LINUX_SS_H
20 #define _LINUX_SS_H
21 
22 /* For RegisterCallback */
23 typedef struct ss_callback_t {
24     void	(*handler)(void *info, u_int events);
25     void	*info;
26 } ss_callback_t;
27 
28 /* Definitions for card status flags for GetStatus */
29 #define SS_WRPROT	0x0001
30 #define SS_CARDLOCK	0x0002
31 #define SS_EJECTION	0x0004
32 #define SS_INSERTION	0x0008
33 #define SS_BATDEAD	0x0010
34 #define SS_BATWARN	0x0020
35 #define SS_READY	0x0040
36 #define SS_DETECT	0x0080
37 #define SS_POWERON	0x0100
38 #define SS_GPI		0x0200
39 #define SS_STSCHG	0x0400
40 #define SS_CARDBUS	0x0800
41 #define SS_3VCARD	0x1000
42 #define SS_XVCARD	0x2000
43 
44 /* for InquireSocket */
45 typedef struct socket_cap_t {
46     u_int	features;
47     u_int	irq_mask;
48     u_int	map_size;
49     u_char	pci_irq;
50     u_char	cardbus;
51     struct pci_bus *cb_bus;
52     struct bus_operations *bus;
53 } socket_cap_t;
54 
55 /* InquireSocket capabilities */
56 #define SS_CAP_PAGE_REGS	0x0001
57 #define SS_CAP_VIRTUAL_BUS	0x0002
58 #define SS_CAP_MEM_ALIGN	0x0004
59 #define SS_CAP_PCCARD		0x4000
60 #define SS_CAP_CARDBUS		0x8000
61 
62 /* for GetSocket, SetSocket */
63 typedef struct socket_state_t {
64     u_int	flags;
65     u_int	csc_mask;
66     u_char	Vcc, Vpp;
67     u_char	io_irq;
68 } socket_state_t;
69 
70 /* Socket configuration flags */
71 #define SS_PWR_AUTO	0x0010
72 #define SS_IOCARD	0x0020
73 #define SS_RESET	0x0040
74 #define SS_DMA_MODE	0x0080
75 #define SS_SPKR_ENA	0x0100
76 #define SS_OUTPUT_ENA	0x0200
77 
78 /* Flags for I/O port and memory windows */
79 #define MAP_ACTIVE	0x01
80 #define MAP_16BIT	0x02
81 #define MAP_AUTOSZ	0x04
82 #define MAP_0WS		0x08
83 #define MAP_WRPROT	0x10
84 #define MAP_ATTRIB	0x20
85 #define MAP_USE_WAIT	0x40
86 #define MAP_PREFETCH	0x80
87 
88 /* Use this just for bridge windows */
89 #define MAP_IOSPACE	0x20
90 
91 typedef struct pccard_io_map {
92     u_char	map;
93     u_char	flags;
94     u_short	speed;
95     u_short	start, stop;
96 } pccard_io_map;
97 
98 typedef struct pccard_mem_map {
99     u_char	map;
100     u_char	flags;
101     u_short	speed;
102     u_long	sys_start, sys_stop;
103     u_int	card_start;
104 } pccard_mem_map;
105 
106 typedef struct cb_bridge_map {
107     u_char	map;
108     u_char	flags;
109     u_int	start, stop;
110 } cb_bridge_map;
111 
112 enum ss_service {
113     SS_RegisterCallback, SS_InquireSocket,
114     SS_GetStatus, SS_GetSocket, SS_SetSocket,
115     SS_GetIOMap, SS_SetIOMap, SS_GetMemMap, SS_SetMemMap,
116     SS_GetBridge, SS_SetBridge, SS_ProcSetup
117 };
118 
119 #endif /* _LINUX_SS_H */
120