diff options
Diffstat (limited to 'include/pcmcia/ss.h')
-rw-r--r-- | include/pcmcia/ss.h | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index cbfba885eb85..32896a773910 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -134,9 +134,9 @@ 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; @@ -200,9 +200,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) */ @@ -225,30 +230,19 @@ struct pcmcia_socket { 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; + /* the PCMCIA card consists of two pseudo devices */ + u8 has_pfc:1; - u8 reserved:3; + u8 reserved:4; } 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 */ - /* cardbus (32-bit) */ -#ifdef CONFIG_CARDBUS - struct resource *cb_cis_res; - void __iomem *cb_cis_virt; -#endif /* CONFIG_CARDBUS */ - /* socket device */ struct device dev; /* data internal to the socket driver */ @@ -263,13 +257,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); |