aboutsummaryrefslogtreecommitdiffstats
path: root/include/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-05 12:42:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-05 12:42:59 -0500
commitd9b2c4d0b03c721808c0d259e43a27f1e80205bc (patch)
treef17a4166f62ee14faa1401a6cbd353a4ab8c77cb /include/pcmcia
parent27d16d08717faeaa8afd1b736a096dbaab90f08e (diff)
parent5fa9167a1bf5f5a4b7282f5e7ac56a4a5a1fa044 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (50 commits) pcmcia: rework the irq_req_t typedef pcmcia: remove deprecated handle_to_dev() macro pcmcia: pcmcia_request_window() doesn't need a pointer to a pointer pcmcia: remove unused "window_t" typedef pcmcia: move some window-related code to pcmcia_ioctl.c pcmcia: Change window_handle_t logic to unsigned long pcmcia: Pass struct pcmcia_socket to pcmcia_get_mem_page() pcmcia: Pass struct pcmcia_device to pcmcia_map_mem_page() pcmcia: Pass struct pcmcia_device to pcmcia_release_window() drivers/pcmcia: remove unnecessary kzalloc pcmcia: correct handling for Zoomed Video registers in topic.h pcmcia: fix printk formats pcmcia: autoload module pcmcia pcmcia/staging: update comedi drivers PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket PCMCIA: ss: allow PCI IRQs > 255 PCMCIA: soc_common: remove 'dev' member from soc_pcmcia_socket PCMCIA: soc_common: constify soc_pcmcia_socket ops member PCMCIA: sa1111: remove duplicated initializers PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data ...
Diffstat (limited to 'include/pcmcia')
-rw-r--r--include/pcmcia/cs.h14
-rw-r--r--include/pcmcia/cs_types.h3
-rw-r--r--include/pcmcia/ds.h88
-rw-r--r--include/pcmcia/ss.h13
4 files changed, 42 insertions, 76 deletions
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 904468a191ef..afc2bfb9e917 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -15,6 +15,10 @@
15#ifndef _LINUX_CS_H 15#ifndef _LINUX_CS_H
16#define _LINUX_CS_H 16#define _LINUX_CS_H
17 17
18#ifdef __KERNEL__
19#include <linux/interrupt.h>
20#endif
21
18/* For AccessConfigurationRegister */ 22/* For AccessConfigurationRegister */
19typedef struct conf_reg_t { 23typedef struct conf_reg_t {
20 u_char Function; 24 u_char Function;
@@ -111,11 +115,9 @@ typedef struct io_req_t {
111 115
112/* For RequestIRQ and ReleaseIRQ */ 116/* For RequestIRQ and ReleaseIRQ */
113typedef struct irq_req_t { 117typedef struct irq_req_t {
114 u_int Attributes; 118 u_int Attributes;
115 u_int AssignedIRQ; 119 u_int AssignedIRQ;
116 u_int IRQInfo1, IRQInfo2; /* IRQInfo2 is ignored */ 120 irq_handler_t Handler;
117 void *Handler;
118 void *Instance;
119} irq_req_t; 121} irq_req_t;
120 122
121/* Attributes for RequestIRQ and ReleaseIRQ */ 123/* Attributes for RequestIRQ and ReleaseIRQ */
@@ -125,7 +127,7 @@ typedef struct irq_req_t {
125#define IRQ_TYPE_DYNAMIC_SHARING 0x02 127#define IRQ_TYPE_DYNAMIC_SHARING 0x02
126#define IRQ_FORCED_PULSE 0x04 128#define IRQ_FORCED_PULSE 0x04
127#define IRQ_FIRST_SHARED 0x08 129#define IRQ_FIRST_SHARED 0x08
128#define IRQ_HANDLE_PRESENT 0x10 130//#define IRQ_HANDLE_PRESENT 0x10
129#define IRQ_PULSE_ALLOCATED 0x100 131#define IRQ_PULSE_ALLOCATED 0x100
130 132
131/* Bits in IRQInfo1 field */ 133/* Bits in IRQInfo1 field */
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index 315965a37930..f5e3b8386c8f 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -26,8 +26,7 @@ typedef u_int event_t;
26typedef u_char cisdata_t; 26typedef u_char cisdata_t;
27typedef u_short page_t; 27typedef u_short page_t;
28 28
29struct window_t; 29typedef unsigned long window_handle_t;
30typedef struct window_t *window_handle_t;
31 30
32struct region_t; 31struct region_t;
33typedef struct region_t *memory_handle_t; 32typedef struct region_t *memory_handle_t;
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index a2be80b9a095..d403c12f7978 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -34,6 +34,7 @@
34struct pcmcia_socket; 34struct pcmcia_socket;
35struct pcmcia_device; 35struct pcmcia_device;
36struct config_t; 36struct config_t;
37struct net_device;
37 38
38/* dynamic device IDs for PCMCIA device drivers. See 39/* dynamic device IDs for PCMCIA device drivers. See
39 * Documentation/pcmcia/driver.txt for details. 40 * Documentation/pcmcia/driver.txt for details.
@@ -137,65 +138,39 @@ struct pcmcia_device {
137#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) 138#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
138#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) 139#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
139 140
140/* deprecated -- don't use! */
141#define handle_to_dev(handle) (handle->dev)
142 141
143 142/*
144/* (deprecated) error reporting by PCMCIA devices. Use dev_printk() 143 * CIS access.
145 * or dev_dbg() directly in the driver, without referring to pcmcia_error_func() 144 *
146 * and/or pcmcia_error_ret() for those functions will go away soon. 145 * Please use the following functions to access CIS tuples:
147 */ 146 * - pcmcia_get_tuple()
148enum service { 147 * - pcmcia_loop_tuple()
149 AccessConfigurationRegister, AddSocketServices, 148 * - pcmcia_get_mac_from_cis()
150 AdjustResourceInfo, CheckEraseQueue, CloseMemory, CopyMemory, 149 *
151 DeregisterClient, DeregisterEraseQueue, GetCardServicesInfo, 150 * To parse a tuple_t, pcmcia_parse_tuple() exists. Its interface
152 GetClientInfo, GetConfigurationInfo, GetEventMask, 151 * might change in future.
153 GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple,
154 GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple,
155 GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage,
156 MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow,
157 OpenMemory, ParseTuple, ReadMemory, RegisterClient,
158 RegisterEraseQueue, RegisterMTD, RegisterTimer,
159 ReleaseConfiguration, ReleaseExclusive, ReleaseIO, ReleaseIRQ,
160 ReleaseSocketMask, ReleaseWindow, ReplaceSocketServices,
161 RequestConfiguration, RequestExclusive, RequestIO, RequestIRQ,
162 RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry,
163 SetEventMask, SetRegion, ValidateCIS, VendorSpecific,
164 WriteMemory, BindDevice, BindMTD, ReportError,
165 SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS,
166 GetFirstWindow, GetNextWindow, GetMemPage
167};
168const char *pcmcia_error_func(int func);
169const char *pcmcia_error_ret(int ret);
170
171#define cs_error(p_dev, func, ret) \
172 { \
173 dev_printk(KERN_NOTICE, &p_dev->dev, \
174 "%s : %s\n", \
175 pcmcia_error_func(func), \
176 pcmcia_error_ret(ret)); \
177 }
178
179/* CIS access.
180 * Use the pcmcia_* versions in PCMCIA drivers
181 */ 152 */
182int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse);
183 153
184int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, 154/* get the very first CIS entry of type @code. Note that buf is pointer
185 tuple_t *tuple); 155 * to u8 *buf; and that you need to kfree(buf) afterwards. */
186#define pcmcia_get_first_tuple(p_dev, tuple) \ 156size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code,
187 pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple) 157 u8 **buf);
188 158
189int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, 159/* loop over CIS entries */
190 tuple_t *tuple); 160int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
191#define pcmcia_get_next_tuple(p_dev, tuple) \ 161 int (*loop_tuple) (struct pcmcia_device *p_dev,
192 pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple) 162 tuple_t *tuple,
163 void *priv_data),
164 void *priv_data);
193 165
194int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple); 166/* get the MAC address from CISTPL_FUNCE */
195#define pcmcia_get_tuple_data(p_dev, tuple) \ 167int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev,
196 pccard_get_tuple_data(p_dev->socket, tuple) 168 struct net_device *dev);
197 169
198 170
171/* parse a tuple_t */
172int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse);
173
199/* loop CIS entries for valid configuration */ 174/* loop CIS entries for valid configuration */
200int pcmcia_loop_config(struct pcmcia_device *p_dev, 175int pcmcia_loop_config(struct pcmcia_device *p_dev,
201 int (*conf_check) (struct pcmcia_device *p_dev, 176 int (*conf_check) (struct pcmcia_device *p_dev,
@@ -221,12 +196,11 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req);
221int pcmcia_request_configuration(struct pcmcia_device *p_dev, 196int pcmcia_request_configuration(struct pcmcia_device *p_dev,
222 config_req_t *req); 197 config_req_t *req);
223 198
224int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, 199int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req,
225 window_handle_t *wh); 200 window_handle_t *wh);
226int pcmcia_release_window(window_handle_t win); 201int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win);
227 202int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
228int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); 203 memreq_t *req);
229int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
230 204
231int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); 205int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
232void pcmcia_disable_device(struct pcmcia_device *p_dev); 206void pcmcia_disable_device(struct pcmcia_device *p_dev);
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index e0f6feb8588c..7c23be706f12 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -107,15 +107,6 @@ typedef struct io_window_t {
107 struct resource *res; 107 struct resource *res;
108} io_window_t; 108} io_window_t;
109 109
110#define WINDOW_MAGIC 0xB35C
111typedef struct window_t {
112 u_short magic;
113 u_short index;
114 struct pcmcia_device *handle;
115 struct pcmcia_socket *sock;
116 pccard_mem_map ctl;
117} window_t;
118
119/* Maximum number of IO windows per socket */ 110/* Maximum number of IO windows per socket */
120#define MAX_IO_WIN 2 111#define MAX_IO_WIN 2
121 112
@@ -155,7 +146,7 @@ struct pcmcia_socket {
155 u_int Config; 146 u_int Config;
156 } irq; 147 } irq;
157 io_window_t io[MAX_IO_WIN]; 148 io_window_t io[MAX_IO_WIN];
158 window_t win[MAX_WIN]; 149 pccard_mem_map win[MAX_WIN];
159 struct list_head cis_cache; 150 struct list_head cis_cache;
160 size_t fake_cis_len; 151 size_t fake_cis_len;
161 u8 *fake_cis; 152 u8 *fake_cis;
@@ -172,7 +163,7 @@ struct pcmcia_socket {
172 u_int irq_mask; 163 u_int irq_mask;
173 u_int map_size; 164 u_int map_size;
174 u_int io_offset; 165 u_int io_offset;
175 u_char pci_irq; 166 u_int pci_irq;
176 struct pci_dev * cb_dev; 167 struct pci_dev * cb_dev;
177 168
178 169