xref: /openbmc/linux/include/pcmcia/ds.h (revision b19a7275dec4b470ea9abaae6129d21a0d75ab2f)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  * ds.h -- 16-bit PCMCIA core support
31da177e4SLinus Torvalds  *
41da177e4SLinus Torvalds  * This program is free software; you can redistribute it and/or modify
51da177e4SLinus Torvalds  * it under the terms of the GNU General Public License version 2 as
61da177e4SLinus Torvalds  * published by the Free Software Foundation.
71da177e4SLinus Torvalds  *
81da177e4SLinus Torvalds  * The initial developer of the original code is David A. Hinds
91da177e4SLinus Torvalds  * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
101da177e4SLinus Torvalds  * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
111da177e4SLinus Torvalds  *
121da177e4SLinus Torvalds  * (C) 1999		David A. Hinds
13a5835786SDominik Brodowski  * (C) 2003 - 2008	Dominik Brodowski
141da177e4SLinus Torvalds  */
151da177e4SLinus Torvalds 
161da177e4SLinus Torvalds #ifndef _LINUX_DS_H
171da177e4SLinus Torvalds #define _LINUX_DS_H
181da177e4SLinus Torvalds 
198e2f3b70SDominik Brodowski #ifdef __KERNEL__
208e2f3b70SDominik Brodowski #include <linux/mod_devicetable.h>
218e2f3b70SDominik Brodowski #endif
228e2f3b70SDominik Brodowski 
231da177e4SLinus Torvalds #include <pcmcia/cs_types.h>
241ad275e3SDominik Brodowski #include <pcmcia/device_id.h>
251da177e4SLinus Torvalds 
26a5835786SDominik Brodowski #ifdef __KERNEL__
27a5835786SDominik Brodowski #include <linux/device.h>
28a5835786SDominik Brodowski #include <pcmcia/ss.h>
2904de0816SDominik Brodowski #include <asm/atomic.h>
30a5835786SDominik Brodowski 
31a5835786SDominik Brodowski /*
32a5835786SDominik Brodowski  * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus
33a5835786SDominik Brodowski  * a.k.a. PCI drivers
34a5835786SDominik Brodowski  */
35a5835786SDominik Brodowski struct pcmcia_socket;
36a5835786SDominik Brodowski struct pcmcia_device;
37a5835786SDominik Brodowski struct config_t;
3891284224SDominik Brodowski struct net_device;
39a5835786SDominik Brodowski 
40a5835786SDominik Brodowski /* dynamic device IDs for PCMCIA device drivers. See
41a5835786SDominik Brodowski  * Documentation/pcmcia/driver.txt for details.
42a5835786SDominik Brodowski */
43a5835786SDominik Brodowski struct pcmcia_dynids {
443f565232SDominik Brodowski 	struct mutex		lock;
45a5835786SDominik Brodowski 	struct list_head	list;
46a5835786SDominik Brodowski };
47a5835786SDominik Brodowski 
48a5835786SDominik Brodowski struct pcmcia_driver {
49a5835786SDominik Brodowski 	int (*probe)		(struct pcmcia_device *dev);
50a5835786SDominik Brodowski 	void (*remove)		(struct pcmcia_device *dev);
51a5835786SDominik Brodowski 
52a5835786SDominik Brodowski 	int (*suspend)		(struct pcmcia_device *dev);
53a5835786SDominik Brodowski 	int (*resume)		(struct pcmcia_device *dev);
54a5835786SDominik Brodowski 
55a5835786SDominik Brodowski 	struct module		*owner;
56a5835786SDominik Brodowski 	struct pcmcia_device_id	*id_table;
57a5835786SDominik Brodowski 	struct device_driver	drv;
58a5835786SDominik Brodowski 	struct pcmcia_dynids	dynids;
59a5835786SDominik Brodowski };
60a5835786SDominik Brodowski 
61a5835786SDominik Brodowski /* driver registration */
62a5835786SDominik Brodowski int pcmcia_register_driver(struct pcmcia_driver *driver);
63a5835786SDominik Brodowski void pcmcia_unregister_driver(struct pcmcia_driver *driver);
64a5835786SDominik Brodowski 
65a5835786SDominik Brodowski struct pcmcia_device {
66a5835786SDominik Brodowski 	/* the socket and the device_no [for multifunction devices]
67a5835786SDominik Brodowski 	   uniquely define a pcmcia_device */
68a5835786SDominik Brodowski 	struct pcmcia_socket	*socket;
69a5835786SDominik Brodowski 
70a5835786SDominik Brodowski 	char			*devname;
71a5835786SDominik Brodowski 
72a5835786SDominik Brodowski 	u8			device_no;
73a5835786SDominik Brodowski 
74a5835786SDominik Brodowski 	/* the hardware "function" device; certain subdevices can
75a5835786SDominik Brodowski 	 * share one hardware "function" device. */
76a5835786SDominik Brodowski 	u8			func;
77a5835786SDominik Brodowski 	struct config_t		*function_config;
78a5835786SDominik Brodowski 
79a5835786SDominik Brodowski 	struct list_head	socket_device_list;
80a5835786SDominik Brodowski 
81a5835786SDominik Brodowski 	/* deprecated, will be cleaned up soon */
82a5835786SDominik Brodowski 	u_int			open;
83a5835786SDominik Brodowski 	io_req_t		io;
84a5835786SDominik Brodowski 	config_req_t		conf;
85a5835786SDominik Brodowski 	window_handle_t		win;
86a5835786SDominik Brodowski 
876f0f38c4SDominik Brodowski 	/* device setup */
88eb14120fSDominik Brodowski 	unsigned int		irq;
896f0f38c4SDominik Brodowski 
9004de0816SDominik Brodowski 	/* Is the device suspended? */
91a5835786SDominik Brodowski 	u16			suspended:1;
92a5835786SDominik Brodowski 
93a5835786SDominik Brodowski 	/* Flags whether io, irq, win configurations were
94a5835786SDominik Brodowski 	 * requested, and whether the configuration is "locked" */
95a5835786SDominik Brodowski 	u16			_irq:1;
96a5835786SDominik Brodowski 	u16			_io:1;
97a5835786SDominik Brodowski 	u16			_win:4;
98a5835786SDominik Brodowski 	u16			_locked:1;
99a5835786SDominik Brodowski 
100a5835786SDominik Brodowski 	/* Flag whether a "fuzzy" func_id based match is
101a5835786SDominik Brodowski 	 * allowed. */
102a5835786SDominik Brodowski 	u16			allow_func_id_match:1;
103a5835786SDominik Brodowski 
104a5835786SDominik Brodowski 	/* information about this device */
105a5835786SDominik Brodowski 	u16			has_manf_id:1;
106a5835786SDominik Brodowski 	u16			has_card_id:1;
107a5835786SDominik Brodowski 	u16			has_func_id:1;
108a5835786SDominik Brodowski 
10904de0816SDominik Brodowski 	u16			reserved:4;
110a5835786SDominik Brodowski 
111a5835786SDominik Brodowski 	u8			func_id;
112a5835786SDominik Brodowski 	u16			manf_id;
113a5835786SDominik Brodowski 	u16			card_id;
114a5835786SDominik Brodowski 
115a5835786SDominik Brodowski 	char			*prod_id[4];
116a5835786SDominik Brodowski 
117a5835786SDominik Brodowski 	u64			dma_mask;
118a5835786SDominik Brodowski 	struct device		dev;
119a5835786SDominik Brodowski 
120a5835786SDominik Brodowski #ifdef CONFIG_PCMCIA_IOCTL
121a5835786SDominik Brodowski 	/* device driver wanted by cardmgr */
122a5835786SDominik Brodowski 	struct pcmcia_driver	*cardmgr;
123a5835786SDominik Brodowski #endif
124a5835786SDominik Brodowski 
125a5835786SDominik Brodowski 	/* data private to drivers */
126a5835786SDominik Brodowski 	void			*priv;
127a5835786SDominik Brodowski };
128a5835786SDominik Brodowski 
129a5835786SDominik Brodowski #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
130a5835786SDominik Brodowski #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
131a5835786SDominik Brodowski 
132a5835786SDominik Brodowski 
13391284224SDominik Brodowski /*
13491284224SDominik Brodowski  * CIS access.
13591284224SDominik Brodowski  *
13691284224SDominik Brodowski  * Please use the following functions to access CIS tuples:
13791284224SDominik Brodowski  * - pcmcia_get_tuple()
13891284224SDominik Brodowski  * - pcmcia_loop_tuple()
13991284224SDominik Brodowski  * - pcmcia_get_mac_from_cis()
14091284224SDominik Brodowski  *
14191284224SDominik Brodowski  * To parse a tuple_t, pcmcia_parse_tuple() exists. Its interface
14291284224SDominik Brodowski  * might change in future.
143272433e0SDominik Brodowski  */
14491284224SDominik Brodowski 
14591284224SDominik Brodowski /* get the very first CIS entry of type @code. Note that buf is pointer
14691284224SDominik Brodowski  * to u8 *buf; and that you need to kfree(buf) afterwards. */
14791284224SDominik Brodowski size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code,
14891284224SDominik Brodowski 			u8 **buf);
14991284224SDominik Brodowski 
15091284224SDominik Brodowski /* loop over CIS entries */
15191284224SDominik Brodowski int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
15291284224SDominik Brodowski 		      int (*loop_tuple) (struct pcmcia_device *p_dev,
15391284224SDominik Brodowski 					 tuple_t *tuple,
15491284224SDominik Brodowski 					 void *priv_data),
15591284224SDominik Brodowski 		      void *priv_data);
15691284224SDominik Brodowski 
15791284224SDominik Brodowski /* get the MAC address from CISTPL_FUNCE */
15891284224SDominik Brodowski int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev,
15991284224SDominik Brodowski 			    struct net_device *dev);
16091284224SDominik Brodowski 
16191284224SDominik Brodowski 
16291284224SDominik Brodowski /* parse a tuple_t */
163272433e0SDominik Brodowski int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse);
164272433e0SDominik Brodowski 
165272433e0SDominik Brodowski /* loop CIS entries for valid configuration */
166272433e0SDominik Brodowski int pcmcia_loop_config(struct pcmcia_device *p_dev,
167272433e0SDominik Brodowski 		       int	(*conf_check)	(struct pcmcia_device *p_dev,
168272433e0SDominik Brodowski 						 cistpl_cftable_entry_t *cf,
169272433e0SDominik Brodowski 						 cistpl_cftable_entry_t *dflt,
170272433e0SDominik Brodowski 						 unsigned int vcc,
171272433e0SDominik Brodowski 						 void *priv_data),
172272433e0SDominik Brodowski 		       void *priv_data);
173a5835786SDominik Brodowski 
174994917f8SDominik Brodowski /* is the device still there? */
175994917f8SDominik Brodowski struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *p_dev);
176994917f8SDominik Brodowski 
177994917f8SDominik Brodowski /* low-level interface reset */
178994917f8SDominik Brodowski int pcmcia_reset_card(struct pcmcia_socket *skt);
179994917f8SDominik Brodowski 
180994917f8SDominik Brodowski /* CIS config */
181994917f8SDominik Brodowski int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
182994917f8SDominik Brodowski 					 conf_reg_t *reg);
183994917f8SDominik Brodowski 
184994917f8SDominik Brodowski /* device configuration */
185994917f8SDominik Brodowski int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
186eb14120fSDominik Brodowski 
187*b19a7275SDominik Brodowski int __must_check
188*b19a7275SDominik Brodowski __pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
189eb14120fSDominik Brodowski 				irq_handler_t handler);
190*b19a7275SDominik Brodowski static inline __must_check __deprecated int
191*b19a7275SDominik Brodowski pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
192*b19a7275SDominik Brodowski 				irq_handler_t handler)
193*b19a7275SDominik Brodowski {
194*b19a7275SDominik Brodowski 	return __pcmcia_request_exclusive_irq(p_dev, handler);
195*b19a7275SDominik Brodowski }
196*b19a7275SDominik Brodowski 
197eb14120fSDominik Brodowski int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
198eb14120fSDominik Brodowski 				irq_handler_t handler);
199eb14120fSDominik Brodowski 
200994917f8SDominik Brodowski int pcmcia_request_configuration(struct pcmcia_device *p_dev,
201994917f8SDominik Brodowski 				 config_req_t *req);
202994917f8SDominik Brodowski 
2036838b03fSDominik Brodowski int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req,
204994917f8SDominik Brodowski 			  window_handle_t *wh);
205f5560da5SMagnus Damm int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win);
206868575d1SMagnus Damm int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
207868575d1SMagnus Damm 			memreq_t *req);
208994917f8SDominik Brodowski 
209994917f8SDominik Brodowski int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
210994917f8SDominik Brodowski void pcmcia_disable_device(struct pcmcia_device *p_dev);
211994917f8SDominik Brodowski 
212a5835786SDominik Brodowski #endif /* __KERNEL__ */
213a5835786SDominik Brodowski 
214a5835786SDominik Brodowski 
215a5835786SDominik Brodowski 
216a5835786SDominik Brodowski /* Below, there are only definitions which are used by
217a5835786SDominik Brodowski  * - the PCMCIA ioctl
218a5835786SDominik Brodowski  * - deprecated PCMCIA userspace tools only
219a5835786SDominik Brodowski  *
220a5835786SDominik Brodowski  * here be dragons ... here be dragons ... here be dragons ... here be drag
221a5835786SDominik Brodowski  */
222a5835786SDominik Brodowski 
223a5835786SDominik Brodowski #if defined(CONFIG_PCMCIA_IOCTL) || !defined(__KERNEL__)
224a5835786SDominik Brodowski 
225d39bd564SDominik Brodowski #if defined(__arm__) || defined(__mips__) || defined(__avr32__) || \
226d39bd564SDominik Brodowski 	defined(__bfin__)
227d39bd564SDominik Brodowski /* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
228d39bd564SDominik Brodowski typedef u_int   ioaddr_t;
229d39bd564SDominik Brodowski #else
230d39bd564SDominik Brodowski typedef u_short	ioaddr_t;
231d39bd564SDominik Brodowski #endif
232d39bd564SDominik Brodowski 
233a5835786SDominik Brodowski /* for AdjustResourceInfo */
234a5835786SDominik Brodowski typedef struct adjust_t {
235a5835786SDominik Brodowski 	u_int			Action;
236a5835786SDominik Brodowski 	u_int			Resource;
237a5835786SDominik Brodowski 	u_int			Attributes;
238a5835786SDominik Brodowski 	union {
239a5835786SDominik Brodowski 		struct memory {
240a5835786SDominik Brodowski 			u_long		Base;
241a5835786SDominik Brodowski 			u_long		Size;
242a5835786SDominik Brodowski 		} memory;
243a5835786SDominik Brodowski 		struct io {
244a5835786SDominik Brodowski 			ioaddr_t	BasePort;
245a5835786SDominik Brodowski 			ioaddr_t	NumPorts;
246a5835786SDominik Brodowski 			u_int		IOAddrLines;
247a5835786SDominik Brodowski 		} io;
248a5835786SDominik Brodowski 		struct irq {
249a5835786SDominik Brodowski 			u_int		IRQ;
250a5835786SDominik Brodowski 		} irq;
251a5835786SDominik Brodowski 	} resource;
252a5835786SDominik Brodowski } adjust_t;
253a5835786SDominik Brodowski 
254a5835786SDominik Brodowski /* Action field */
255a5835786SDominik Brodowski #define REMOVE_MANAGED_RESOURCE		1
256a5835786SDominik Brodowski #define ADD_MANAGED_RESOURCE		2
257a5835786SDominik Brodowski #define GET_FIRST_MANAGED_RESOURCE	3
258a5835786SDominik Brodowski #define GET_NEXT_MANAGED_RESOURCE	4
259a5835786SDominik Brodowski /* Resource field */
260a5835786SDominik Brodowski #define RES_MEMORY_RANGE		1
261a5835786SDominik Brodowski #define RES_IO_RANGE			2
262a5835786SDominik Brodowski #define RES_IRQ				3
263a5835786SDominik Brodowski /* Attribute field */
264a5835786SDominik Brodowski #define RES_IRQ_TYPE			0x03
265a5835786SDominik Brodowski #define RES_IRQ_TYPE_EXCLUSIVE		0
266a5835786SDominik Brodowski #define RES_IRQ_TYPE_TIME		1
267a5835786SDominik Brodowski #define RES_IRQ_TYPE_DYNAMIC		2
268a5835786SDominik Brodowski #define RES_IRQ_CSC			0x04
269a5835786SDominik Brodowski #define RES_SHARED			0x08
270a5835786SDominik Brodowski #define RES_RESERVED			0x10
271a5835786SDominik Brodowski #define RES_ALLOCATED			0x20
272a5835786SDominik Brodowski #define RES_REMOVED			0x40
273a5835786SDominik Brodowski 
274a5835786SDominik Brodowski 
2751da177e4SLinus Torvalds typedef struct tuple_parse_t {
2761da177e4SLinus Torvalds 	tuple_t			tuple;
2771da177e4SLinus Torvalds 	cisdata_t		data[255];
2781da177e4SLinus Torvalds 	cisparse_t		parse;
2791da177e4SLinus Torvalds } tuple_parse_t;
2801da177e4SLinus Torvalds 
2811da177e4SLinus Torvalds typedef struct win_info_t {
2821da177e4SLinus Torvalds 	window_handle_t		handle;
2831da177e4SLinus Torvalds 	win_req_t		window;
2841da177e4SLinus Torvalds 	memreq_t		map;
2851da177e4SLinus Torvalds } win_info_t;
2861da177e4SLinus Torvalds 
2871da177e4SLinus Torvalds typedef struct bind_info_t {
2881da177e4SLinus Torvalds 	dev_info_t		dev_info;
2891da177e4SLinus Torvalds 	u_char			function;
290fd238232SDominik Brodowski 	struct pcmcia_device	*instance;
2911da177e4SLinus Torvalds 	char			name[DEV_NAME_LEN];
2921da177e4SLinus Torvalds 	u_short			major, minor;
2931da177e4SLinus Torvalds 	void			*next;
2941da177e4SLinus Torvalds } bind_info_t;
2951da177e4SLinus Torvalds 
2961da177e4SLinus Torvalds typedef struct mtd_info_t {
2971da177e4SLinus Torvalds 	dev_info_t     		dev_info;
2981da177e4SLinus Torvalds 	u_int			Attributes;
2991da177e4SLinus Torvalds 	u_int			CardOffset;
3001da177e4SLinus Torvalds } mtd_info_t;
3011da177e4SLinus Torvalds 
302ae49ec92SMagnus Damm typedef struct region_info_t {
303ae49ec92SMagnus Damm 	u_int			Attributes;
304ae49ec92SMagnus Damm 	u_int			CardOffset;
305ae49ec92SMagnus Damm 	u_int			RegionSize;
306ae49ec92SMagnus Damm 	u_int			AccessSpeed;
307ae49ec92SMagnus Damm 	u_int			BlockSize;
308ae49ec92SMagnus Damm 	u_int			PartMultiple;
309ae49ec92SMagnus Damm 	u_char			JedecMfr, JedecInfo;
310ae49ec92SMagnus Damm 	memory_handle_t		next;
311ae49ec92SMagnus Damm } region_info_t;
312a5835786SDominik Brodowski 
313ae49ec92SMagnus Damm #define REGION_TYPE		0x0001
314ae49ec92SMagnus Damm #define REGION_TYPE_CM		0x0000
315ae49ec92SMagnus Damm #define REGION_TYPE_AM		0x0001
316ae49ec92SMagnus Damm #define REGION_PREFETCH		0x0008
317ae49ec92SMagnus Damm #define REGION_CACHEABLE	0x0010
318ae49ec92SMagnus Damm #define REGION_BAR_MASK		0xe000
319ae49ec92SMagnus Damm #define REGION_BAR_SHIFT	13
320ae49ec92SMagnus Damm 
32153efec95SDominik Brodowski /* For ReplaceCIS */
32253efec95SDominik Brodowski typedef struct cisdump_t {
32353efec95SDominik Brodowski 	u_int			Length;
32453efec95SDominik Brodowski 	cisdata_t		Data[CISTPL_MAX_CIS_SIZE];
32553efec95SDominik Brodowski } cisdump_t;
32653efec95SDominik Brodowski 
3271a53088cSDominik Brodowski /* for GetConfigurationInfo */
3281a53088cSDominik Brodowski typedef struct config_info_t {
3291a53088cSDominik Brodowski 	u_char			Function;
3301a53088cSDominik Brodowski 	u_int			Attributes;
3311a53088cSDominik Brodowski 	u_int			Vcc, Vpp1, Vpp2;
3321a53088cSDominik Brodowski 	u_int			IntType;
3331a53088cSDominik Brodowski 	u_int			ConfigBase;
3341a53088cSDominik Brodowski 	u_char			Status, Pin, Copy, Option, ExtStatus;
3351a53088cSDominik Brodowski 	u_int			Present;
3361a53088cSDominik Brodowski 	u_int			CardValues;
3371a53088cSDominik Brodowski 	u_int			AssignedIRQ;
3381a53088cSDominik Brodowski 	u_int			IRQAttributes;
3391a53088cSDominik Brodowski 	ioaddr_t		BasePort1;
3401a53088cSDominik Brodowski 	ioaddr_t		NumPorts1;
3411a53088cSDominik Brodowski 	u_int			Attributes1;
3421a53088cSDominik Brodowski 	ioaddr_t		BasePort2;
3431a53088cSDominik Brodowski 	ioaddr_t		NumPorts2;
3441a53088cSDominik Brodowski 	u_int			Attributes2;
3451a53088cSDominik Brodowski 	u_int			IOAddrLines;
3461a53088cSDominik Brodowski } config_info_t;
3471a53088cSDominik Brodowski 
348a45b3fb1SDominik Brodowski /* For ValidateCIS */
349a45b3fb1SDominik Brodowski typedef struct cisinfo_t {
350a45b3fb1SDominik Brodowski 	u_int			Chains;
351a45b3fb1SDominik Brodowski } cisinfo_t;
352a45b3fb1SDominik Brodowski 
353a45b3fb1SDominik Brodowski typedef struct cs_status_t {
354a45b3fb1SDominik Brodowski 	u_char			Function;
355a45b3fb1SDominik Brodowski 	event_t 		CardState;
356a45b3fb1SDominik Brodowski 	event_t			SocketState;
357a45b3fb1SDominik Brodowski } cs_status_t;
358a45b3fb1SDominik Brodowski 
3591da177e4SLinus Torvalds typedef union ds_ioctl_arg_t {
3601da177e4SLinus Torvalds 	adjust_t		adjust;
3611da177e4SLinus Torvalds 	config_info_t		config;
3621da177e4SLinus Torvalds 	tuple_t			tuple;
3631da177e4SLinus Torvalds 	tuple_parse_t		tuple_parse;
3641da177e4SLinus Torvalds 	client_req_t		client_req;
3651da177e4SLinus Torvalds 	cs_status_t		status;
3661da177e4SLinus Torvalds 	conf_reg_t		conf_reg;
3671da177e4SLinus Torvalds 	cisinfo_t		cisinfo;
3681da177e4SLinus Torvalds 	region_info_t		region;
3691da177e4SLinus Torvalds 	bind_info_t		bind_info;
3701da177e4SLinus Torvalds 	mtd_info_t		mtd_info;
3711da177e4SLinus Torvalds 	win_info_t		win_info;
3721da177e4SLinus Torvalds 	cisdump_t		cisdump;
3731da177e4SLinus Torvalds } ds_ioctl_arg_t;
3741da177e4SLinus Torvalds 
3751da177e4SLinus Torvalds #define DS_ADJUST_RESOURCE_INFO			_IOWR('d',  2, adjust_t)
3761da177e4SLinus Torvalds #define DS_GET_CONFIGURATION_INFO		_IOWR('d',  3, config_info_t)
3771da177e4SLinus Torvalds #define DS_GET_FIRST_TUPLE			_IOWR('d',  4, tuple_t)
3781da177e4SLinus Torvalds #define DS_GET_NEXT_TUPLE			_IOWR('d',  5, tuple_t)
3791da177e4SLinus Torvalds #define DS_GET_TUPLE_DATA			_IOWR('d',  6, tuple_parse_t)
3801da177e4SLinus Torvalds #define DS_PARSE_TUPLE				_IOWR('d',  7, tuple_parse_t)
3811da177e4SLinus Torvalds #define DS_RESET_CARD				_IO  ('d',  8)
3821da177e4SLinus Torvalds #define DS_GET_STATUS				_IOWR('d',  9, cs_status_t)
3831da177e4SLinus Torvalds #define DS_ACCESS_CONFIGURATION_REGISTER	_IOWR('d', 10, conf_reg_t)
3841da177e4SLinus Torvalds #define DS_VALIDATE_CIS				_IOR ('d', 11, cisinfo_t)
3851da177e4SLinus Torvalds #define DS_SUSPEND_CARD				_IO  ('d', 12)
3861da177e4SLinus Torvalds #define DS_RESUME_CARD				_IO  ('d', 13)
3871da177e4SLinus Torvalds #define DS_EJECT_CARD				_IO  ('d', 14)
3881da177e4SLinus Torvalds #define DS_INSERT_CARD				_IO  ('d', 15)
3891da177e4SLinus Torvalds #define DS_GET_FIRST_REGION			_IOWR('d', 16, region_info_t)
3901da177e4SLinus Torvalds #define DS_GET_NEXT_REGION			_IOWR('d', 17, region_info_t)
3911da177e4SLinus Torvalds #define DS_REPLACE_CIS				_IOWR('d', 18, cisdump_t)
3921da177e4SLinus Torvalds #define DS_GET_FIRST_WINDOW			_IOR ('d', 19, win_info_t)
3931da177e4SLinus Torvalds #define DS_GET_NEXT_WINDOW			_IOWR('d', 20, win_info_t)
3941da177e4SLinus Torvalds #define DS_GET_MEM_PAGE				_IOWR('d', 21, win_info_t)
3951da177e4SLinus Torvalds 
3961da177e4SLinus Torvalds #define DS_BIND_REQUEST				_IOWR('d', 60, bind_info_t)
3971da177e4SLinus Torvalds #define DS_GET_DEVICE_INFO			_IOWR('d', 61, bind_info_t)
3981da177e4SLinus Torvalds #define DS_GET_NEXT_DEVICE			_IOWR('d', 62, bind_info_t)
3991da177e4SLinus Torvalds #define DS_UNBIND_REQUEST			_IOW ('d', 63, bind_info_t)
4001da177e4SLinus Torvalds #define DS_BIND_MTD				_IOWR('d', 64, mtd_info_t)
4011da177e4SLinus Torvalds 
402a5835786SDominik Brodowski 
4039c8b7965SDominik Brodowski /* used in userspace only */
4049c8b7965SDominik Brodowski #define CS_IN_USE			0x1e
4059c8b7965SDominik Brodowski 
406994917f8SDominik Brodowski #define INFO_MASTER_CLIENT	0x01
407994917f8SDominik Brodowski #define INFO_IO_CLIENT		0x02
408994917f8SDominik Brodowski #define INFO_MTD_CLIENT		0x04
409994917f8SDominik Brodowski #define INFO_MEM_CLIENT		0x08
410994917f8SDominik Brodowski #define MAX_NUM_CLIENTS		3
411994917f8SDominik Brodowski 
412994917f8SDominik Brodowski #define INFO_CARD_SHARE		0x10
413994917f8SDominik Brodowski #define INFO_CARD_EXCL		0x20
414994917f8SDominik Brodowski 
4151da177e4SLinus Torvalds 
416a5835786SDominik Brodowski #endif /* !defined(__KERNEL__) || defined(CONFIG_PCMCIA_IOCTL) */
4171da177e4SLinus Torvalds 
4181da177e4SLinus Torvalds #endif /* _LINUX_DS_H */
419