xref: /openbmc/linux/include/pcmcia/ds.h (revision eb14120f743d29744d9475bffec56ff4ad43a749)
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 /* Some drivers use dev_node_t to store char or block device information.
66a5835786SDominik Brodowski  * Don't use this in new drivers, though.
67a5835786SDominik Brodowski  */
68a5835786SDominik Brodowski typedef struct dev_node_t {
69a5835786SDominik Brodowski 	char			dev_name[DEV_NAME_LEN];
70a5835786SDominik Brodowski 	u_short			major, minor;
71a5835786SDominik Brodowski 	struct dev_node_t	*next;
72a5835786SDominik Brodowski } dev_node_t;
73a5835786SDominik Brodowski 
74a5835786SDominik Brodowski struct pcmcia_device {
75a5835786SDominik Brodowski 	/* the socket and the device_no [for multifunction devices]
76a5835786SDominik Brodowski 	   uniquely define a pcmcia_device */
77a5835786SDominik Brodowski 	struct pcmcia_socket	*socket;
78a5835786SDominik Brodowski 
79a5835786SDominik Brodowski 	char			*devname;
80a5835786SDominik Brodowski 
81a5835786SDominik Brodowski 	u8			device_no;
82a5835786SDominik Brodowski 
83a5835786SDominik Brodowski 	/* the hardware "function" device; certain subdevices can
84a5835786SDominik Brodowski 	 * share one hardware "function" device. */
85a5835786SDominik Brodowski 	u8			func;
86a5835786SDominik Brodowski 	struct config_t		*function_config;
87a5835786SDominik Brodowski 
88a5835786SDominik Brodowski 	struct list_head	socket_device_list;
89a5835786SDominik Brodowski 
90a5835786SDominik Brodowski 	/* deprecated, will be cleaned up soon */
91a5835786SDominik Brodowski 	dev_node_t		*dev_node;
92a5835786SDominik Brodowski 	u_int			open;
93a5835786SDominik Brodowski 	io_req_t		io;
94a5835786SDominik Brodowski 	config_req_t		conf;
95a5835786SDominik Brodowski 	window_handle_t		win;
96a5835786SDominik Brodowski 
976f0f38c4SDominik Brodowski 	/* device setup */
98*eb14120fSDominik Brodowski 	unsigned int		irq;
996f0f38c4SDominik Brodowski 
10004de0816SDominik Brodowski 	/* Is the device suspended? */
101a5835786SDominik Brodowski 	u16			suspended:1;
102a5835786SDominik Brodowski 
103a5835786SDominik Brodowski 	/* Flags whether io, irq, win configurations were
104a5835786SDominik Brodowski 	 * requested, and whether the configuration is "locked" */
105a5835786SDominik Brodowski 	u16			_irq:1;
106a5835786SDominik Brodowski 	u16			_io:1;
107a5835786SDominik Brodowski 	u16			_win:4;
108a5835786SDominik Brodowski 	u16			_locked:1;
109a5835786SDominik Brodowski 
110a5835786SDominik Brodowski 	/* Flag whether a "fuzzy" func_id based match is
111a5835786SDominik Brodowski 	 * allowed. */
112a5835786SDominik Brodowski 	u16			allow_func_id_match:1;
113a5835786SDominik Brodowski 
114a5835786SDominik Brodowski 	/* information about this device */
115a5835786SDominik Brodowski 	u16			has_manf_id:1;
116a5835786SDominik Brodowski 	u16			has_card_id:1;
117a5835786SDominik Brodowski 	u16			has_func_id:1;
118a5835786SDominik Brodowski 
11904de0816SDominik Brodowski 	u16			reserved:4;
120a5835786SDominik Brodowski 
121a5835786SDominik Brodowski 	u8			func_id;
122a5835786SDominik Brodowski 	u16			manf_id;
123a5835786SDominik Brodowski 	u16			card_id;
124a5835786SDominik Brodowski 
125a5835786SDominik Brodowski 	char			*prod_id[4];
126a5835786SDominik Brodowski 
127a5835786SDominik Brodowski 	u64			dma_mask;
128a5835786SDominik Brodowski 	struct device		dev;
129a5835786SDominik Brodowski 
130a5835786SDominik Brodowski #ifdef CONFIG_PCMCIA_IOCTL
131a5835786SDominik Brodowski 	/* device driver wanted by cardmgr */
132a5835786SDominik Brodowski 	struct pcmcia_driver	*cardmgr;
133a5835786SDominik Brodowski #endif
134a5835786SDominik Brodowski 
135a5835786SDominik Brodowski 	/* data private to drivers */
136a5835786SDominik Brodowski 	void			*priv;
137a5835786SDominik Brodowski };
138a5835786SDominik Brodowski 
139a5835786SDominik Brodowski #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
140a5835786SDominik Brodowski #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
141a5835786SDominik Brodowski 
142a5835786SDominik Brodowski 
14391284224SDominik Brodowski /*
14491284224SDominik Brodowski  * CIS access.
14591284224SDominik Brodowski  *
14691284224SDominik Brodowski  * Please use the following functions to access CIS tuples:
14791284224SDominik Brodowski  * - pcmcia_get_tuple()
14891284224SDominik Brodowski  * - pcmcia_loop_tuple()
14991284224SDominik Brodowski  * - pcmcia_get_mac_from_cis()
15091284224SDominik Brodowski  *
15191284224SDominik Brodowski  * To parse a tuple_t, pcmcia_parse_tuple() exists. Its interface
15291284224SDominik Brodowski  * might change in future.
153272433e0SDominik Brodowski  */
15491284224SDominik Brodowski 
15591284224SDominik Brodowski /* get the very first CIS entry of type @code. Note that buf is pointer
15691284224SDominik Brodowski  * to u8 *buf; and that you need to kfree(buf) afterwards. */
15791284224SDominik Brodowski size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code,
15891284224SDominik Brodowski 			u8 **buf);
15991284224SDominik Brodowski 
16091284224SDominik Brodowski /* loop over CIS entries */
16191284224SDominik Brodowski int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
16291284224SDominik Brodowski 		      int (*loop_tuple) (struct pcmcia_device *p_dev,
16391284224SDominik Brodowski 					 tuple_t *tuple,
16491284224SDominik Brodowski 					 void *priv_data),
16591284224SDominik Brodowski 		      void *priv_data);
16691284224SDominik Brodowski 
16791284224SDominik Brodowski /* get the MAC address from CISTPL_FUNCE */
16891284224SDominik Brodowski int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev,
16991284224SDominik Brodowski 			    struct net_device *dev);
17091284224SDominik Brodowski 
17191284224SDominik Brodowski 
17291284224SDominik Brodowski /* parse a tuple_t */
173272433e0SDominik Brodowski int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse);
174272433e0SDominik Brodowski 
175272433e0SDominik Brodowski /* loop CIS entries for valid configuration */
176272433e0SDominik Brodowski int pcmcia_loop_config(struct pcmcia_device *p_dev,
177272433e0SDominik Brodowski 		       int	(*conf_check)	(struct pcmcia_device *p_dev,
178272433e0SDominik Brodowski 						 cistpl_cftable_entry_t *cf,
179272433e0SDominik Brodowski 						 cistpl_cftable_entry_t *dflt,
180272433e0SDominik Brodowski 						 unsigned int vcc,
181272433e0SDominik Brodowski 						 void *priv_data),
182272433e0SDominik Brodowski 		       void *priv_data);
183a5835786SDominik Brodowski 
184994917f8SDominik Brodowski /* is the device still there? */
185994917f8SDominik Brodowski struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *p_dev);
186994917f8SDominik Brodowski 
187994917f8SDominik Brodowski /* low-level interface reset */
188994917f8SDominik Brodowski int pcmcia_reset_card(struct pcmcia_socket *skt);
189994917f8SDominik Brodowski 
190994917f8SDominik Brodowski /* CIS config */
191994917f8SDominik Brodowski int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
192994917f8SDominik Brodowski 					 conf_reg_t *reg);
193994917f8SDominik Brodowski 
194994917f8SDominik Brodowski /* device configuration */
195994917f8SDominik Brodowski int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
196*eb14120fSDominik Brodowski 
197*eb14120fSDominik Brodowski int __must_check __deprecated
198*eb14120fSDominik Brodowski pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
199*eb14120fSDominik Brodowski 				irq_handler_t handler);
200*eb14120fSDominik Brodowski int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
201*eb14120fSDominik Brodowski 				irq_handler_t handler);
202*eb14120fSDominik Brodowski 
203994917f8SDominik Brodowski int pcmcia_request_configuration(struct pcmcia_device *p_dev,
204994917f8SDominik Brodowski 				 config_req_t *req);
205994917f8SDominik Brodowski 
2066838b03fSDominik Brodowski int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req,
207994917f8SDominik Brodowski 			  window_handle_t *wh);
208f5560da5SMagnus Damm int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win);
209868575d1SMagnus Damm int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
210868575d1SMagnus Damm 			memreq_t *req);
211994917f8SDominik Brodowski 
212994917f8SDominik Brodowski int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
213994917f8SDominik Brodowski void pcmcia_disable_device(struct pcmcia_device *p_dev);
214994917f8SDominik Brodowski 
215a5835786SDominik Brodowski #endif /* __KERNEL__ */
216a5835786SDominik Brodowski 
217a5835786SDominik Brodowski 
218a5835786SDominik Brodowski 
219a5835786SDominik Brodowski /* Below, there are only definitions which are used by
220a5835786SDominik Brodowski  * - the PCMCIA ioctl
221a5835786SDominik Brodowski  * - deprecated PCMCIA userspace tools only
222a5835786SDominik Brodowski  *
223a5835786SDominik Brodowski  * here be dragons ... here be dragons ... here be dragons ... here be drag
224a5835786SDominik Brodowski  */
225a5835786SDominik Brodowski 
226a5835786SDominik Brodowski #if defined(CONFIG_PCMCIA_IOCTL) || !defined(__KERNEL__)
227a5835786SDominik Brodowski 
228d39bd564SDominik Brodowski #if defined(__arm__) || defined(__mips__) || defined(__avr32__) || \
229d39bd564SDominik Brodowski 	defined(__bfin__)
230d39bd564SDominik Brodowski /* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
231d39bd564SDominik Brodowski typedef u_int   ioaddr_t;
232d39bd564SDominik Brodowski #else
233d39bd564SDominik Brodowski typedef u_short	ioaddr_t;
234d39bd564SDominik Brodowski #endif
235d39bd564SDominik Brodowski 
236a5835786SDominik Brodowski /* for AdjustResourceInfo */
237a5835786SDominik Brodowski typedef struct adjust_t {
238a5835786SDominik Brodowski 	u_int			Action;
239a5835786SDominik Brodowski 	u_int			Resource;
240a5835786SDominik Brodowski 	u_int			Attributes;
241a5835786SDominik Brodowski 	union {
242a5835786SDominik Brodowski 		struct memory {
243a5835786SDominik Brodowski 			u_long		Base;
244a5835786SDominik Brodowski 			u_long		Size;
245a5835786SDominik Brodowski 		} memory;
246a5835786SDominik Brodowski 		struct io {
247a5835786SDominik Brodowski 			ioaddr_t	BasePort;
248a5835786SDominik Brodowski 			ioaddr_t	NumPorts;
249a5835786SDominik Brodowski 			u_int		IOAddrLines;
250a5835786SDominik Brodowski 		} io;
251a5835786SDominik Brodowski 		struct irq {
252a5835786SDominik Brodowski 			u_int		IRQ;
253a5835786SDominik Brodowski 		} irq;
254a5835786SDominik Brodowski 	} resource;
255a5835786SDominik Brodowski } adjust_t;
256a5835786SDominik Brodowski 
257a5835786SDominik Brodowski /* Action field */
258a5835786SDominik Brodowski #define REMOVE_MANAGED_RESOURCE		1
259a5835786SDominik Brodowski #define ADD_MANAGED_RESOURCE		2
260a5835786SDominik Brodowski #define GET_FIRST_MANAGED_RESOURCE	3
261a5835786SDominik Brodowski #define GET_NEXT_MANAGED_RESOURCE	4
262a5835786SDominik Brodowski /* Resource field */
263a5835786SDominik Brodowski #define RES_MEMORY_RANGE		1
264a5835786SDominik Brodowski #define RES_IO_RANGE			2
265a5835786SDominik Brodowski #define RES_IRQ				3
266a5835786SDominik Brodowski /* Attribute field */
267a5835786SDominik Brodowski #define RES_IRQ_TYPE			0x03
268a5835786SDominik Brodowski #define RES_IRQ_TYPE_EXCLUSIVE		0
269a5835786SDominik Brodowski #define RES_IRQ_TYPE_TIME		1
270a5835786SDominik Brodowski #define RES_IRQ_TYPE_DYNAMIC		2
271a5835786SDominik Brodowski #define RES_IRQ_CSC			0x04
272a5835786SDominik Brodowski #define RES_SHARED			0x08
273a5835786SDominik Brodowski #define RES_RESERVED			0x10
274a5835786SDominik Brodowski #define RES_ALLOCATED			0x20
275a5835786SDominik Brodowski #define RES_REMOVED			0x40
276a5835786SDominik Brodowski 
277a5835786SDominik Brodowski 
2781da177e4SLinus Torvalds typedef struct tuple_parse_t {
2791da177e4SLinus Torvalds 	tuple_t			tuple;
2801da177e4SLinus Torvalds 	cisdata_t		data[255];
2811da177e4SLinus Torvalds 	cisparse_t		parse;
2821da177e4SLinus Torvalds } tuple_parse_t;
2831da177e4SLinus Torvalds 
2841da177e4SLinus Torvalds typedef struct win_info_t {
2851da177e4SLinus Torvalds 	window_handle_t		handle;
2861da177e4SLinus Torvalds 	win_req_t		window;
2871da177e4SLinus Torvalds 	memreq_t		map;
2881da177e4SLinus Torvalds } win_info_t;
2891da177e4SLinus Torvalds 
2901da177e4SLinus Torvalds typedef struct bind_info_t {
2911da177e4SLinus Torvalds 	dev_info_t		dev_info;
2921da177e4SLinus Torvalds 	u_char			function;
293fd238232SDominik Brodowski 	struct pcmcia_device	*instance;
2941da177e4SLinus Torvalds 	char			name[DEV_NAME_LEN];
2951da177e4SLinus Torvalds 	u_short			major, minor;
2961da177e4SLinus Torvalds 	void			*next;
2971da177e4SLinus Torvalds } bind_info_t;
2981da177e4SLinus Torvalds 
2991da177e4SLinus Torvalds typedef struct mtd_info_t {
3001da177e4SLinus Torvalds 	dev_info_t     		dev_info;
3011da177e4SLinus Torvalds 	u_int			Attributes;
3021da177e4SLinus Torvalds 	u_int			CardOffset;
3031da177e4SLinus Torvalds } mtd_info_t;
3041da177e4SLinus Torvalds 
305ae49ec92SMagnus Damm typedef struct region_info_t {
306ae49ec92SMagnus Damm 	u_int			Attributes;
307ae49ec92SMagnus Damm 	u_int			CardOffset;
308ae49ec92SMagnus Damm 	u_int			RegionSize;
309ae49ec92SMagnus Damm 	u_int			AccessSpeed;
310ae49ec92SMagnus Damm 	u_int			BlockSize;
311ae49ec92SMagnus Damm 	u_int			PartMultiple;
312ae49ec92SMagnus Damm 	u_char			JedecMfr, JedecInfo;
313ae49ec92SMagnus Damm 	memory_handle_t		next;
314ae49ec92SMagnus Damm } region_info_t;
315a5835786SDominik Brodowski 
316ae49ec92SMagnus Damm #define REGION_TYPE		0x0001
317ae49ec92SMagnus Damm #define REGION_TYPE_CM		0x0000
318ae49ec92SMagnus Damm #define REGION_TYPE_AM		0x0001
319ae49ec92SMagnus Damm #define REGION_PREFETCH		0x0008
320ae49ec92SMagnus Damm #define REGION_CACHEABLE	0x0010
321ae49ec92SMagnus Damm #define REGION_BAR_MASK		0xe000
322ae49ec92SMagnus Damm #define REGION_BAR_SHIFT	13
323ae49ec92SMagnus Damm 
32453efec95SDominik Brodowski /* For ReplaceCIS */
32553efec95SDominik Brodowski typedef struct cisdump_t {
32653efec95SDominik Brodowski 	u_int			Length;
32753efec95SDominik Brodowski 	cisdata_t		Data[CISTPL_MAX_CIS_SIZE];
32853efec95SDominik Brodowski } cisdump_t;
32953efec95SDominik Brodowski 
3301a53088cSDominik Brodowski /* for GetConfigurationInfo */
3311a53088cSDominik Brodowski typedef struct config_info_t {
3321a53088cSDominik Brodowski 	u_char			Function;
3331a53088cSDominik Brodowski 	u_int			Attributes;
3341a53088cSDominik Brodowski 	u_int			Vcc, Vpp1, Vpp2;
3351a53088cSDominik Brodowski 	u_int			IntType;
3361a53088cSDominik Brodowski 	u_int			ConfigBase;
3371a53088cSDominik Brodowski 	u_char			Status, Pin, Copy, Option, ExtStatus;
3381a53088cSDominik Brodowski 	u_int			Present;
3391a53088cSDominik Brodowski 	u_int			CardValues;
3401a53088cSDominik Brodowski 	u_int			AssignedIRQ;
3411a53088cSDominik Brodowski 	u_int			IRQAttributes;
3421a53088cSDominik Brodowski 	ioaddr_t		BasePort1;
3431a53088cSDominik Brodowski 	ioaddr_t		NumPorts1;
3441a53088cSDominik Brodowski 	u_int			Attributes1;
3451a53088cSDominik Brodowski 	ioaddr_t		BasePort2;
3461a53088cSDominik Brodowski 	ioaddr_t		NumPorts2;
3471a53088cSDominik Brodowski 	u_int			Attributes2;
3481a53088cSDominik Brodowski 	u_int			IOAddrLines;
3491a53088cSDominik Brodowski } config_info_t;
3501a53088cSDominik Brodowski 
351a45b3fb1SDominik Brodowski /* For ValidateCIS */
352a45b3fb1SDominik Brodowski typedef struct cisinfo_t {
353a45b3fb1SDominik Brodowski 	u_int			Chains;
354a45b3fb1SDominik Brodowski } cisinfo_t;
355a45b3fb1SDominik Brodowski 
356a45b3fb1SDominik Brodowski typedef struct cs_status_t {
357a45b3fb1SDominik Brodowski 	u_char			Function;
358a45b3fb1SDominik Brodowski 	event_t 		CardState;
359a45b3fb1SDominik Brodowski 	event_t			SocketState;
360a45b3fb1SDominik Brodowski } cs_status_t;
361a45b3fb1SDominik Brodowski 
3621da177e4SLinus Torvalds typedef union ds_ioctl_arg_t {
3631da177e4SLinus Torvalds 	adjust_t		adjust;
3641da177e4SLinus Torvalds 	config_info_t		config;
3651da177e4SLinus Torvalds 	tuple_t			tuple;
3661da177e4SLinus Torvalds 	tuple_parse_t		tuple_parse;
3671da177e4SLinus Torvalds 	client_req_t		client_req;
3681da177e4SLinus Torvalds 	cs_status_t		status;
3691da177e4SLinus Torvalds 	conf_reg_t		conf_reg;
3701da177e4SLinus Torvalds 	cisinfo_t		cisinfo;
3711da177e4SLinus Torvalds 	region_info_t		region;
3721da177e4SLinus Torvalds 	bind_info_t		bind_info;
3731da177e4SLinus Torvalds 	mtd_info_t		mtd_info;
3741da177e4SLinus Torvalds 	win_info_t		win_info;
3751da177e4SLinus Torvalds 	cisdump_t		cisdump;
3761da177e4SLinus Torvalds } ds_ioctl_arg_t;
3771da177e4SLinus Torvalds 
3781da177e4SLinus Torvalds #define DS_ADJUST_RESOURCE_INFO			_IOWR('d',  2, adjust_t)
3791da177e4SLinus Torvalds #define DS_GET_CONFIGURATION_INFO		_IOWR('d',  3, config_info_t)
3801da177e4SLinus Torvalds #define DS_GET_FIRST_TUPLE			_IOWR('d',  4, tuple_t)
3811da177e4SLinus Torvalds #define DS_GET_NEXT_TUPLE			_IOWR('d',  5, tuple_t)
3821da177e4SLinus Torvalds #define DS_GET_TUPLE_DATA			_IOWR('d',  6, tuple_parse_t)
3831da177e4SLinus Torvalds #define DS_PARSE_TUPLE				_IOWR('d',  7, tuple_parse_t)
3841da177e4SLinus Torvalds #define DS_RESET_CARD				_IO  ('d',  8)
3851da177e4SLinus Torvalds #define DS_GET_STATUS				_IOWR('d',  9, cs_status_t)
3861da177e4SLinus Torvalds #define DS_ACCESS_CONFIGURATION_REGISTER	_IOWR('d', 10, conf_reg_t)
3871da177e4SLinus Torvalds #define DS_VALIDATE_CIS				_IOR ('d', 11, cisinfo_t)
3881da177e4SLinus Torvalds #define DS_SUSPEND_CARD				_IO  ('d', 12)
3891da177e4SLinus Torvalds #define DS_RESUME_CARD				_IO  ('d', 13)
3901da177e4SLinus Torvalds #define DS_EJECT_CARD				_IO  ('d', 14)
3911da177e4SLinus Torvalds #define DS_INSERT_CARD				_IO  ('d', 15)
3921da177e4SLinus Torvalds #define DS_GET_FIRST_REGION			_IOWR('d', 16, region_info_t)
3931da177e4SLinus Torvalds #define DS_GET_NEXT_REGION			_IOWR('d', 17, region_info_t)
3941da177e4SLinus Torvalds #define DS_REPLACE_CIS				_IOWR('d', 18, cisdump_t)
3951da177e4SLinus Torvalds #define DS_GET_FIRST_WINDOW			_IOR ('d', 19, win_info_t)
3961da177e4SLinus Torvalds #define DS_GET_NEXT_WINDOW			_IOWR('d', 20, win_info_t)
3971da177e4SLinus Torvalds #define DS_GET_MEM_PAGE				_IOWR('d', 21, win_info_t)
3981da177e4SLinus Torvalds 
3991da177e4SLinus Torvalds #define DS_BIND_REQUEST				_IOWR('d', 60, bind_info_t)
4001da177e4SLinus Torvalds #define DS_GET_DEVICE_INFO			_IOWR('d', 61, bind_info_t)
4011da177e4SLinus Torvalds #define DS_GET_NEXT_DEVICE			_IOWR('d', 62, bind_info_t)
4021da177e4SLinus Torvalds #define DS_UNBIND_REQUEST			_IOW ('d', 63, bind_info_t)
4031da177e4SLinus Torvalds #define DS_BIND_MTD				_IOWR('d', 64, mtd_info_t)
4041da177e4SLinus Torvalds 
405a5835786SDominik Brodowski 
4069c8b7965SDominik Brodowski /* used in userspace only */
4079c8b7965SDominik Brodowski #define CS_IN_USE			0x1e
4089c8b7965SDominik Brodowski 
409994917f8SDominik Brodowski #define INFO_MASTER_CLIENT	0x01
410994917f8SDominik Brodowski #define INFO_IO_CLIENT		0x02
411994917f8SDominik Brodowski #define INFO_MTD_CLIENT		0x04
412994917f8SDominik Brodowski #define INFO_MEM_CLIENT		0x08
413994917f8SDominik Brodowski #define MAX_NUM_CLIENTS		3
414994917f8SDominik Brodowski 
415994917f8SDominik Brodowski #define INFO_CARD_SHARE		0x10
416994917f8SDominik Brodowski #define INFO_CARD_EXCL		0x20
417994917f8SDominik Brodowski 
4181da177e4SLinus Torvalds 
419a5835786SDominik Brodowski #endif /* !defined(__KERNEL__) || defined(CONFIG_PCMCIA_IOCTL) */
4201da177e4SLinus Torvalds 
4211da177e4SLinus Torvalds #endif /* _LINUX_DS_H */
422