aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-06-27 19:28:47 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 21:03:18 -0400
commit9a5555b81fde402119a6b4f2b38d3373d272ff69 (patch)
tree68f5af92d99dc320e7d2954fd1173fa14780f8a8 /drivers/pcmcia
parent3c29976a6469b81a7858812dc2d4b8430d74004a (diff)
[PATCH] pcmcia: add a config option for the PCMICA ioctl
Add a new config option to control the building of the PCMCIA IOCTL. Currently, it is not yet made public, though the help text is there already. Signed-off-by: Dominik Brodowski <linux@dominikbrodowksi.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/Kconfig28
-rw-r--r--drivers/pcmcia/ds.c36
2 files changed, 53 insertions, 11 deletions
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 22f7e8ca6584..85af1fb2a309 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -14,8 +14,8 @@ config PCCARD
14 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux 14 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux
15 computer. These are credit-card size devices such as network cards, 15 computer. These are credit-card size devices such as network cards,
16 modems or hard drives often used with laptops computers. There are 16 modems or hard drives often used with laptops computers. There are
17 actually two varieties of these cards: the older 16 bit PCMCIA cards 17 actually two varieties of these cards: 16 bit PCMCIA and 32 bit
18 and the newer 32 bit CardBus cards. 18 CardBus cards.
19 19
20 To compile this driver as modules, choose M here: the 20 To compile this driver as modules, choose M here: the
21 module will be called pcmcia_core. 21 module will be called pcmcia_core.
@@ -48,10 +48,9 @@ config PCMCIA
48 PC-cards are such 16-bit PCMCIA cards, so unless you know you're 48 PC-cards are such 16-bit PCMCIA cards, so unless you know you're
49 only using 32-bit CardBus cards, say Y or M here. 49 only using 32-bit CardBus cards, say Y or M here.
50 50
51 To use 16-bit PCMCIA cards, you will need supporting software from 51 To use 16-bit PCMCIA cards, you will need supporting software in
52 David Hinds' pcmcia-cs package (see the file <file:Documentation/Changes> 52 most cases. (see the file <file:Documentation/Changes> for
53 for location). Please also read the PCMCIA-HOWTO, available from 53 location and details).
54 <http://www.tldp.org/docs.html#howto>.
55 54
56 To compile this driver as modules, choose M here: the 55 To compile this driver as modules, choose M here: the
57 module will be called pcmcia. 56 module will be called pcmcia.
@@ -72,6 +71,21 @@ config PCMCIA_LOAD_CIS
72 71
73 If unsure, say Y. 72 If unsure, say Y.
74 73
74config PCMCIA_IOCTL
75 bool
76 depends on PCMCIA
77 default y
78 help
79 If you say Y here, the deprecated ioctl interface to the PCMCIA
80 subsystem will be built. It is needed by cardmgr and cardctl
81 (pcmcia-cs) to function properly.
82
83 If you do not use the new pcmciautils package, and have a
84 yenta, Cirrus PD6729, i82092, i82365 or tcic compatible bridge,
85 you need to say Y here to be able to use 16-bit PCMCIA cards.
86
87 If unsure, say Y.
88
75config CARDBUS 89config CARDBUS
76 bool "32-bit CardBus support" 90 bool "32-bit CardBus support"
77 depends on PCI 91 depends on PCI
@@ -91,8 +105,6 @@ comment "PC-card bridges"
91 105
92config YENTA 106config YENTA
93 tristate "CardBus yenta-compatible bridge support" 107 tristate "CardBus yenta-compatible bridge support"
94 depends on PCI
95#fixme: remove dependendcy on CARDBUS
96 depends on CARDBUS 108 depends on CARDBUS
97 select PCCARD_NONSTATIC 109 select PCCARD_NONSTATIC
98 ---help--- 110 ---help---
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 2c3c3da5368e..0c7dc5b38757 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -116,8 +116,13 @@ static struct bus_type pcmcia_bus_type;
116#define DS_SOCKET_DEAD 0x80 116#define DS_SOCKET_DEAD 0x80
117 117
118/*====================================================================*/ 118/*====================================================================*/
119#ifdef CONFIG_PCMCIA_IOCTL
119 120
120static int major_dev = -1; 121static int major_dev = -1;
122static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr);
123static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
124
125#endif
121 126
122static int unbind_request(struct pcmcia_bus_socket *s); 127static int unbind_request(struct pcmcia_bus_socket *s);
123 128
@@ -356,8 +361,6 @@ static inline int pcmcia_load_firmware(struct pcmcia_device *dev, char * filenam
356 361
357/*======================================================================*/ 362/*======================================================================*/
358 363
359static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
360static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr);
361 364
362static void pcmcia_release_bus_socket(struct kref *refcount) 365static void pcmcia_release_bus_socket(struct kref *refcount)
363{ 366{
@@ -411,6 +414,7 @@ void pcmcia_unregister_driver(struct pcmcia_driver *driver)
411} 414}
412EXPORT_SYMBOL(pcmcia_unregister_driver); 415EXPORT_SYMBOL(pcmcia_unregister_driver);
413 416
417#ifdef CONFIG_PCMCIA_IOCTL
414#ifdef CONFIG_PROC_FS 418#ifdef CONFIG_PROC_FS
415static struct proc_dir_entry *proc_pccard = NULL; 419static struct proc_dir_entry *proc_pccard = NULL;
416 420
@@ -443,6 +447,7 @@ static int proc_read_drivers(char *buf, char **start, off_t pos,
443 return (p - buf); 447 return (p - buf);
444} 448}
445#endif 449#endif
450#endif
446 451
447/* pcmcia_device handling */ 452/* pcmcia_device handling */
448 453
@@ -998,6 +1003,8 @@ static struct device_attribute pcmcia_dev_attrs[] = {
998 1003
999======================================================================*/ 1004======================================================================*/
1000 1005
1006#ifdef CONFIG_PCMCIA_IOCTL
1007
1001static int queue_empty(user_info_t *user) 1008static int queue_empty(user_info_t *user)
1002{ 1009{
1003 return (user->event_head == user->event_tail); 1010 return (user->event_head == user->event_tail);
@@ -1024,6 +1031,11 @@ static void handle_event(struct pcmcia_bus_socket *s, event_t event)
1024 queue_event(user, event); 1031 queue_event(user, event);
1025 wake_up_interruptible(&s->queue); 1032 wake_up_interruptible(&s->queue);
1026} 1033}
1034#else
1035static inline void handle_event(struct pcmcia_bus_socket *s, event_t event) { return; }
1036static inline int handle_request(struct pcmcia_bus_socket *s, event_t event) { return CS_SUCCESS; }
1037#endif
1038
1027 1039
1028 1040
1029/*====================================================================== 1041/*======================================================================
@@ -1142,6 +1154,8 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
1142 1154
1143======================================================================*/ 1155======================================================================*/
1144 1156
1157#ifdef CONFIG_PCMCIA_IOCTL
1158
1145static int bind_request(struct pcmcia_bus_socket *s, bind_info_t *bind_info) 1159static int bind_request(struct pcmcia_bus_socket *s, bind_info_t *bind_info)
1146{ 1160{
1147 struct pcmcia_driver *p_drv; 1161 struct pcmcia_driver *p_drv;
@@ -1237,6 +1251,8 @@ rescan:
1237 return (ret); 1251 return (ret);
1238} /* bind_request */ 1252} /* bind_request */
1239 1253
1254#endif
1255
1240 1256
1241int pcmcia_register_client(client_handle_t *handle, client_reg_t *req) 1257int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
1242{ 1258{
@@ -1334,6 +1350,7 @@ EXPORT_SYMBOL(pcmcia_register_client);
1334 1350
1335 1351
1336/*====================================================================*/ 1352/*====================================================================*/
1353#ifdef CONFIG_PCMCIA_IOCTL
1337 1354
1338extern struct pci_bus *pcmcia_lookup_bus(struct pcmcia_socket *s); 1355extern struct pci_bus *pcmcia_lookup_bus(struct pcmcia_socket *s);
1339 1356
@@ -1422,6 +1439,8 @@ static int get_device_info(struct pcmcia_bus_socket *s, bind_info_t *bind_info,
1422 return (ret); 1439 return (ret);
1423} /* get_device_info */ 1440} /* get_device_info */
1424 1441
1442#endif
1443
1425/*====================================================================*/ 1444/*====================================================================*/
1426 1445
1427/* unbind _all_ devices attached to a given pcmcia_bus_socket. The 1446/* unbind _all_ devices attached to a given pcmcia_bus_socket. The
@@ -1495,6 +1514,8 @@ EXPORT_SYMBOL(pcmcia_deregister_client);
1495 1514
1496======================================================================*/ 1515======================================================================*/
1497 1516
1517#ifdef CONFIG_PCMCIA_IOCTL
1518
1498static int ds_open(struct inode *inode, struct file *file) 1519static int ds_open(struct inode *inode, struct file *file)
1499{ 1520{
1500 socket_t i = iminor(inode); 1521 socket_t i = iminor(inode);
@@ -1855,6 +1876,8 @@ static struct file_operations ds_fops = {
1855 .poll = ds_poll, 1876 .poll = ds_poll,
1856}; 1877};
1857 1878
1879#endif
1880
1858static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev) 1881static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
1859{ 1882{
1860 struct pcmcia_socket *socket = class_get_devdata(class_dev); 1883 struct pcmcia_socket *socket = class_get_devdata(class_dev);
@@ -1939,13 +1962,16 @@ static struct bus_type pcmcia_bus_type = {
1939 1962
1940static int __init init_pcmcia_bus(void) 1963static int __init init_pcmcia_bus(void)
1941{ 1964{
1965#ifdef CONFIG_PCMCIA_IOCTL
1942 int i; 1966 int i;
1967#endif
1943 1968
1944 spin_lock_init(&pcmcia_dev_list_lock); 1969 spin_lock_init(&pcmcia_dev_list_lock);
1945 1970
1946 bus_register(&pcmcia_bus_type); 1971 bus_register(&pcmcia_bus_type);
1947 class_interface_register(&pcmcia_bus_interface); 1972 class_interface_register(&pcmcia_bus_interface);
1948 1973
1974#ifdef CONFIG_PCMCIA_IOCTL
1949 /* Set up character device for user mode clients */ 1975 /* Set up character device for user mode clients */
1950 i = register_chrdev(0, "pcmcia", &ds_fops); 1976 i = register_chrdev(0, "pcmcia", &ds_fops);
1951 if (i < 0) 1977 if (i < 0)
@@ -1959,6 +1985,7 @@ static int __init init_pcmcia_bus(void)
1959 if (proc_pccard) 1985 if (proc_pccard)
1960 create_proc_read_entry("drivers",0,proc_pccard,proc_read_drivers,NULL); 1986 create_proc_read_entry("drivers",0,proc_pccard,proc_read_drivers,NULL);
1961#endif 1987#endif
1988#endif
1962 1989
1963 return 0; 1990 return 0;
1964} 1991}
@@ -1970,6 +1997,7 @@ static void __exit exit_pcmcia_bus(void)
1970{ 1997{
1971 class_interface_unregister(&pcmcia_bus_interface); 1998 class_interface_unregister(&pcmcia_bus_interface);
1972 1999
2000#ifdef CONFIG_PCMCIA_IOCTL
1973#ifdef CONFIG_PROC_FS 2001#ifdef CONFIG_PROC_FS
1974 if (proc_pccard) { 2002 if (proc_pccard) {
1975 remove_proc_entry("drivers", proc_pccard); 2003 remove_proc_entry("drivers", proc_pccard);
@@ -1978,6 +2006,7 @@ static void __exit exit_pcmcia_bus(void)
1978#endif 2006#endif
1979 if (major_dev != -1) 2007 if (major_dev != -1)
1980 unregister_chrdev(major_dev, "pcmcia"); 2008 unregister_chrdev(major_dev, "pcmcia");
2009#endif
1981 2010
1982 bus_unregister(&pcmcia_bus_type); 2011 bus_unregister(&pcmcia_bus_type);
1983} 2012}
@@ -1986,7 +2015,7 @@ module_exit(exit_pcmcia_bus);
1986 2015
1987 2016
1988/* helpers for backwards-compatible functions */ 2017/* helpers for backwards-compatible functions */
1989 2018#ifdef CONFIG_PCMCIA_IOCTL
1990static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr) 2019static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr)
1991{ 2020{
1992 struct pcmcia_socket * s = pcmcia_get_socket_by_nr(nr); 2021 struct pcmcia_socket * s = pcmcia_get_socket_by_nr(nr);
@@ -2011,5 +2040,6 @@ static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info)
2011 2040
2012 return (p_drv); 2041 return (p_drv);
2013} 2042}
2043#endif
2014 2044
2015MODULE_ALIAS("ds"); 2045MODULE_ALIAS("ds");