[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>
This commit is contained in:
parent
3c29976a64
commit
9a5555b81f
|
@ -14,8 +14,8 @@ config PCCARD
|
||||||
Say Y here if you want to attach PCMCIA- or PC-cards to your Linux
|
Say Y here if you want to attach PCMCIA- or PC-cards to your Linux
|
||||||
computer. These are credit-card size devices such as network cards,
|
computer. These are credit-card size devices such as network cards,
|
||||||
modems or hard drives often used with laptops computers. There are
|
modems or hard drives often used with laptops computers. There are
|
||||||
actually two varieties of these cards: the older 16 bit PCMCIA cards
|
actually two varieties of these cards: 16 bit PCMCIA and 32 bit
|
||||||
and the newer 32 bit CardBus cards.
|
CardBus cards.
|
||||||
|
|
||||||
To compile this driver as modules, choose M here: the
|
To compile this driver as modules, choose M here: the
|
||||||
module will be called pcmcia_core.
|
module will be called pcmcia_core.
|
||||||
|
@ -48,10 +48,9 @@ config PCMCIA
|
||||||
PC-cards are such 16-bit PCMCIA cards, so unless you know you're
|
PC-cards are such 16-bit PCMCIA cards, so unless you know you're
|
||||||
only using 32-bit CardBus cards, say Y or M here.
|
only using 32-bit CardBus cards, say Y or M here.
|
||||||
|
|
||||||
To use 16-bit PCMCIA cards, you will need supporting software from
|
To use 16-bit PCMCIA cards, you will need supporting software in
|
||||||
David Hinds' pcmcia-cs package (see the file <file:Documentation/Changes>
|
most cases. (see the file <file:Documentation/Changes> for
|
||||||
for location). Please also read the PCMCIA-HOWTO, available from
|
location and details).
|
||||||
<http://www.tldp.org/docs.html#howto>.
|
|
||||||
|
|
||||||
To compile this driver as modules, choose M here: the
|
To compile this driver as modules, choose M here: the
|
||||||
module will be called pcmcia.
|
module will be called pcmcia.
|
||||||
|
@ -72,6 +71,21 @@ config PCMCIA_LOAD_CIS
|
||||||
|
|
||||||
If unsure, say Y.
|
If unsure, say Y.
|
||||||
|
|
||||||
|
config PCMCIA_IOCTL
|
||||||
|
bool
|
||||||
|
depends on PCMCIA
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
If you say Y here, the deprecated ioctl interface to the PCMCIA
|
||||||
|
subsystem will be built. It is needed by cardmgr and cardctl
|
||||||
|
(pcmcia-cs) to function properly.
|
||||||
|
|
||||||
|
If you do not use the new pcmciautils package, and have a
|
||||||
|
yenta, Cirrus PD6729, i82092, i82365 or tcic compatible bridge,
|
||||||
|
you need to say Y here to be able to use 16-bit PCMCIA cards.
|
||||||
|
|
||||||
|
If unsure, say Y.
|
||||||
|
|
||||||
config CARDBUS
|
config CARDBUS
|
||||||
bool "32-bit CardBus support"
|
bool "32-bit CardBus support"
|
||||||
depends on PCI
|
depends on PCI
|
||||||
|
@ -91,8 +105,6 @@ comment "PC-card bridges"
|
||||||
|
|
||||||
config YENTA
|
config YENTA
|
||||||
tristate "CardBus yenta-compatible bridge support"
|
tristate "CardBus yenta-compatible bridge support"
|
||||||
depends on PCI
|
|
||||||
#fixme: remove dependendcy on CARDBUS
|
|
||||||
depends on CARDBUS
|
depends on CARDBUS
|
||||||
select PCCARD_NONSTATIC
|
select PCCARD_NONSTATIC
|
||||||
---help---
|
---help---
|
||||||
|
|
|
@ -116,8 +116,13 @@ static struct bus_type pcmcia_bus_type;
|
||||||
#define DS_SOCKET_DEAD 0x80
|
#define DS_SOCKET_DEAD 0x80
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
|
|
||||||
static int major_dev = -1;
|
static int major_dev = -1;
|
||||||
|
static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr);
|
||||||
|
static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static int unbind_request(struct pcmcia_bus_socket *s);
|
static int unbind_request(struct pcmcia_bus_socket *s);
|
||||||
|
|
||||||
|
@ -356,8 +361,6 @@ static inline int pcmcia_load_firmware(struct pcmcia_device *dev, char * filenam
|
||||||
|
|
||||||
/*======================================================================*/
|
/*======================================================================*/
|
||||||
|
|
||||||
static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
|
|
||||||
static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr);
|
|
||||||
|
|
||||||
static void pcmcia_release_bus_socket(struct kref *refcount)
|
static void pcmcia_release_bus_socket(struct kref *refcount)
|
||||||
{
|
{
|
||||||
|
@ -411,6 +414,7 @@ void pcmcia_unregister_driver(struct pcmcia_driver *driver)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(pcmcia_unregister_driver);
|
EXPORT_SYMBOL(pcmcia_unregister_driver);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
#ifdef CONFIG_PROC_FS
|
#ifdef CONFIG_PROC_FS
|
||||||
static struct proc_dir_entry *proc_pccard = NULL;
|
static struct proc_dir_entry *proc_pccard = NULL;
|
||||||
|
|
||||||
|
@ -443,6 +447,7 @@ static int proc_read_drivers(char *buf, char **start, off_t pos,
|
||||||
return (p - buf);
|
return (p - buf);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* pcmcia_device handling */
|
/* pcmcia_device handling */
|
||||||
|
|
||||||
|
@ -998,6 +1003,8 @@ static struct device_attribute pcmcia_dev_attrs[] = {
|
||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
|
|
||||||
static int queue_empty(user_info_t *user)
|
static int queue_empty(user_info_t *user)
|
||||||
{
|
{
|
||||||
return (user->event_head == user->event_tail);
|
return (user->event_head == user->event_tail);
|
||||||
|
@ -1024,6 +1031,11 @@ static void handle_event(struct pcmcia_bus_socket *s, event_t event)
|
||||||
queue_event(user, event);
|
queue_event(user, event);
|
||||||
wake_up_interruptible(&s->queue);
|
wake_up_interruptible(&s->queue);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static inline void handle_event(struct pcmcia_bus_socket *s, event_t event) { return; }
|
||||||
|
static inline int handle_request(struct pcmcia_bus_socket *s, event_t event) { return CS_SUCCESS; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
|
@ -1142,6 +1154,8 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
|
||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
|
|
||||||
static int bind_request(struct pcmcia_bus_socket *s, bind_info_t *bind_info)
|
static int bind_request(struct pcmcia_bus_socket *s, bind_info_t *bind_info)
|
||||||
{
|
{
|
||||||
struct pcmcia_driver *p_drv;
|
struct pcmcia_driver *p_drv;
|
||||||
|
@ -1237,6 +1251,8 @@ rescan:
|
||||||
return (ret);
|
return (ret);
|
||||||
} /* bind_request */
|
} /* bind_request */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
|
int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
|
||||||
{
|
{
|
||||||
|
@ -1334,6 +1350,7 @@ EXPORT_SYMBOL(pcmcia_register_client);
|
||||||
|
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
|
|
||||||
extern struct pci_bus *pcmcia_lookup_bus(struct pcmcia_socket *s);
|
extern struct pci_bus *pcmcia_lookup_bus(struct pcmcia_socket *s);
|
||||||
|
|
||||||
|
@ -1422,6 +1439,8 @@ static int get_device_info(struct pcmcia_bus_socket *s, bind_info_t *bind_info,
|
||||||
return (ret);
|
return (ret);
|
||||||
} /* get_device_info */
|
} /* get_device_info */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
|
|
||||||
/* unbind _all_ devices attached to a given pcmcia_bus_socket. The
|
/* unbind _all_ devices attached to a given pcmcia_bus_socket. The
|
||||||
|
@ -1495,6 +1514,8 @@ EXPORT_SYMBOL(pcmcia_deregister_client);
|
||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
|
|
||||||
static int ds_open(struct inode *inode, struct file *file)
|
static int ds_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
socket_t i = iminor(inode);
|
socket_t i = iminor(inode);
|
||||||
|
@ -1855,6 +1876,8 @@ static struct file_operations ds_fops = {
|
||||||
.poll = ds_poll,
|
.poll = ds_poll,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
|
static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
|
||||||
{
|
{
|
||||||
struct pcmcia_socket *socket = class_get_devdata(class_dev);
|
struct pcmcia_socket *socket = class_get_devdata(class_dev);
|
||||||
|
@ -1939,13 +1962,16 @@ static struct bus_type pcmcia_bus_type = {
|
||||||
|
|
||||||
static int __init init_pcmcia_bus(void)
|
static int __init init_pcmcia_bus(void)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
int i;
|
int i;
|
||||||
|
#endif
|
||||||
|
|
||||||
spin_lock_init(&pcmcia_dev_list_lock);
|
spin_lock_init(&pcmcia_dev_list_lock);
|
||||||
|
|
||||||
bus_register(&pcmcia_bus_type);
|
bus_register(&pcmcia_bus_type);
|
||||||
class_interface_register(&pcmcia_bus_interface);
|
class_interface_register(&pcmcia_bus_interface);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
/* Set up character device for user mode clients */
|
/* Set up character device for user mode clients */
|
||||||
i = register_chrdev(0, "pcmcia", &ds_fops);
|
i = register_chrdev(0, "pcmcia", &ds_fops);
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
|
@ -1958,6 +1984,7 @@ static int __init init_pcmcia_bus(void)
|
||||||
proc_pccard = proc_mkdir("pccard", proc_bus);
|
proc_pccard = proc_mkdir("pccard", proc_bus);
|
||||||
if (proc_pccard)
|
if (proc_pccard)
|
||||||
create_proc_read_entry("drivers",0,proc_pccard,proc_read_drivers,NULL);
|
create_proc_read_entry("drivers",0,proc_pccard,proc_read_drivers,NULL);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1970,6 +1997,7 @@ static void __exit exit_pcmcia_bus(void)
|
||||||
{
|
{
|
||||||
class_interface_unregister(&pcmcia_bus_interface);
|
class_interface_unregister(&pcmcia_bus_interface);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
#ifdef CONFIG_PROC_FS
|
#ifdef CONFIG_PROC_FS
|
||||||
if (proc_pccard) {
|
if (proc_pccard) {
|
||||||
remove_proc_entry("drivers", proc_pccard);
|
remove_proc_entry("drivers", proc_pccard);
|
||||||
|
@ -1978,6 +2006,7 @@ static void __exit exit_pcmcia_bus(void)
|
||||||
#endif
|
#endif
|
||||||
if (major_dev != -1)
|
if (major_dev != -1)
|
||||||
unregister_chrdev(major_dev, "pcmcia");
|
unregister_chrdev(major_dev, "pcmcia");
|
||||||
|
#endif
|
||||||
|
|
||||||
bus_unregister(&pcmcia_bus_type);
|
bus_unregister(&pcmcia_bus_type);
|
||||||
}
|
}
|
||||||
|
@ -1986,7 +2015,7 @@ module_exit(exit_pcmcia_bus);
|
||||||
|
|
||||||
|
|
||||||
/* helpers for backwards-compatible functions */
|
/* helpers for backwards-compatible functions */
|
||||||
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr)
|
static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr)
|
||||||
{
|
{
|
||||||
struct pcmcia_socket * s = pcmcia_get_socket_by_nr(nr);
|
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)
|
||||||
|
|
||||||
return (p_drv);
|
return (p_drv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
MODULE_ALIAS("ds");
|
MODULE_ALIAS("ds");
|
||||||
|
|
Loading…
Reference in New Issue