diff options
Diffstat (limited to 'include/pcmcia/ss.h')
| -rw-r--r-- | include/pcmcia/ss.h | 81 |
1 files changed, 29 insertions, 52 deletions
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index cbfba885eb8..731cde010f4 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -19,8 +19,6 @@ #include <linux/sched.h> /* task_struct, completion */ #include <linux/mutex.h> -#include <pcmcia/cs_types.h> -#include <pcmcia/cs.h> #ifdef CONFIG_CARDBUS #include <linux/pci.h> #endif @@ -134,17 +132,13 @@ struct pccard_operations { struct pcmcia_socket { struct module *owner; - spinlock_t lock; socket_state_t socket; u_int state; + u_int suspended_state; /* state before suspend */ u_short functions; u_short lock_count; pccard_mem_map cis_mem; void __iomem *cis_virt; - struct { - u_int AssignedIRQ; - u_int Config; - } irq; io_window_t io[MAX_IO_WIN]; pccard_mem_map win[MAX_WIN]; struct list_head cis_cache; @@ -166,17 +160,10 @@ struct pcmcia_socket { u_int pci_irq; struct pci_dev *cb_dev; - /* socket setup is done so resources should be able to be allocated. * Only if set to 1, calls to find_{io,mem}_region are handled, and * insertio events are actually managed by the PCMCIA layer.*/ - u8 resource_setup_done:1; - - /* It's old if resource setup is done using adjust_resource_info() */ - u8 resource_setup_old:1; - u8 resource_setup_new:1; - - u8 reserved:5; + u8 resource_setup_done; /* socket operations */ struct pccard_operations *ops; @@ -200,9 +187,14 @@ struct pcmcia_socket { struct task_struct *thread; struct completion thread_done; unsigned int thread_events; - /* protects socket h/w state */ + unsigned int sysfs_events; + + /* For the non-trivial interaction between these locks, + * see Documentation/pcmcia/locking.txt */ struct mutex skt_mutex; - /* protects thread_events */ + struct mutex ops_mutex; + + /* protects thread_events and sysfs_events */ spinlock_t thread_lock; /* pcmcia (16-bit) */ @@ -217,37 +209,16 @@ struct pcmcia_socket { * incorrectness and change */ u8 device_count; - /* 16-bit state: */ - struct { - /* PCMCIA card is present in socket */ - u8 present:1; - /* "master" ioctl is used */ - u8 busy:1; - /* pcmcia module is being unloaded */ - u8 dead:1; - /* a multifunction-device add event is pending */ - u8 device_add_pending:1; - /* the pending event adds a mfc (1) or pfc (0) */ - u8 mfc_pfc:1; - - u8 reserved:3; - } pcmcia_state; - - - /* for adding further pseudo-multifunction devices */ - struct work_struct device_add; - -#ifdef CONFIG_PCMCIA_IOCTL - struct user_info_t *user; - wait_queue_head_t queue; -#endif /* CONFIG_PCMCIA_IOCTL */ -#endif /* CONFIG_PCMCIA */ + /* does the PCMCIA card consist of two pseudo devices? */ + u8 pcmcia_pfc; - /* cardbus (32-bit) */ -#ifdef CONFIG_CARDBUS - struct resource *cb_cis_res; - void __iomem *cb_cis_virt; -#endif /* CONFIG_CARDBUS */ + /* non-zero if PCMCIA card is present */ + atomic_t present; + + /* IRQ to be used by PCMCIA devices. May not be IRQ 0. */ + unsigned int pcmcia_irq; + +#endif /* CONFIG_PCMCIA */ /* socket device */ struct device dev; @@ -263,19 +234,25 @@ struct pcmcia_socket { * - pccard_static_ops iomem and ioport areas are assigned statically * - pccard_iodyn_ops iomem areas is assigned statically, ioport * areas dynamically + * If this option is selected, use + * "select PCCARD_IODYN" in Kconfig. * - pccard_nonstatic_ops iomem and ioport areas are assigned dynamically. * If this option is selected, use * "select PCCARD_NONSTATIC" in Kconfig. + * */ extern struct pccard_resource_ops pccard_static_ops; +#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE) extern struct pccard_resource_ops pccard_iodyn_ops; extern struct pccard_resource_ops pccard_nonstatic_ops; +#else +/* If PCMCIA is not used, but only CARDBUS, these functions are not used + * at all. Therefore, do not use the large (240K!) rsrc_nonstatic module + */ +#define pccard_iodyn_ops pccard_static_ops +#define pccard_nonstatic_ops pccard_static_ops +#endif -/* socket drivers are expected to use these callbacks in their .drv struct */ -extern int pcmcia_socket_dev_suspend(struct device *dev); -extern void pcmcia_socket_dev_early_resume(struct device *dev); -extern void pcmcia_socket_dev_late_resume(struct device *dev); -extern int pcmcia_socket_dev_resume(struct device *dev); /* socket drivers use this callback in their IRQ handler */ extern void pcmcia_parse_events(struct pcmcia_socket *socket, |
