From dbb22f0d65ccc2e9dfeb4c420942f2757a80f8d2 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Tue, 10 Jan 2006 20:41:27 +0100 Subject: [PATCH] pcmcia: access config_t using pointer instead of array Access the PCMCIA config_t struct (one per device function) using a pointer in struct pcmcia_device, instead of looking them up in an array. Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 8e2a9639647..ac11fb1e8d6 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -131,6 +131,7 @@ typedef struct dev_link_t { struct pcmcia_socket; +struct config_t; struct pcmcia_driver { int (*probe) (struct pcmcia_device *dev); @@ -160,6 +161,7 @@ struct pcmcia_device { /* the hardware "function" device; certain subdevices can * share one hardware "function" device. */ u8 func; + struct config_t* function_config; struct list_head socket_device_list; -- cgit v1.2.3 From 360b65b95bae96f854a2413093ee9b79c31203ae Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Tue, 10 Jan 2006 20:50:39 +0100 Subject: [PATCH] pcmcia: make config_t independent, add reference counting Handle config_t structs independent of struct pcmcia_socket, and add reference counting for them. Signed-off-by: Dominik Brodowski --- include/pcmcia/ss.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 2889a69a7a8..6529ccc7651 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -186,7 +186,6 @@ struct pcmcia_socket { u_short lock_count; pccard_mem_map cis_mem; void __iomem *cis_virt; - struct config_t *config; struct { u_int AssignedIRQ; u_int Config; -- cgit v1.2.3 From cbbddd1046d44d90d31c7f246ed0207117602b89 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Tue, 10 Jan 2006 20:54:46 +0100 Subject: [PATCH] pcmcia: remove unused defines Remove unused fields and declarations. Signed-off-by: Dominik Brodowski --- include/pcmcia/cs.h | 11 ----------- include/pcmcia/ds.h | 1 - 2 files changed, 12 deletions(-) (limited to 'include') diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 52660f32663..df9b7f70634 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -109,17 +109,6 @@ typedef struct client_req_t { #define CLIENT_THIS_SOCKET 0x01 -/* For RegisterClient */ -typedef struct client_reg_t { - dev_info_t *dev_info; - u_int Attributes; /* UNUSED */ - u_int EventMask; - int (*event_handler)(event_t event, int priority, - event_callback_args_t *); - event_callback_args_t event_callback_args; - u_int Version; -} client_reg_t; - /* ModifyConfiguration */ typedef struct modconf_t { u_int Attributes; diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index ac11fb1e8d6..8512cf9a121 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -106,7 +106,6 @@ typedef struct dev_node_t { typedef struct dev_link_t { dev_node_t *dev; u_int state, open; - wait_queue_head_t pending; client_handle_t handle; io_req_t io; irq_req_t irq; -- cgit v1.2.3 From 7fe908dd11e0c947bb72baa5b001d7abe5a420d5 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Tue, 10 Jan 2006 21:20:36 +0100 Subject: [PATCH] pcmcia: use mutexes instead of semaphores Use mutexes in the PCMICA core, as they suffice for what needs to be done. Includes a bugfix from and Signed-off-by Andrew Morton. Signed-off-by: Dominik Brodowski --- include/pcmcia/ss.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 6529ccc7651..fa527c2ef5e 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -18,6 +18,7 @@ #include #include #include /* task_struct, completion */ +#include #include #include @@ -240,7 +241,7 @@ struct pcmcia_socket { #endif /* state thread */ - struct semaphore skt_sem; /* protects socket h/w state */ + struct mutex skt_mutex; /* protects socket h/w state */ struct task_struct *thread; struct completion thread_done; -- cgit v1.2.3 From 1540eec5e5549b2e41704ce77f3f4ba880d2434c Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 15 Jan 2006 00:51:53 +0100 Subject: [PATCH] pcmcia: remove pcmcia_compat.c Remove the compatibility wrappers, as they can (now) also be implemented using macros. Please continue using these wrappers instead of new functions until a new API has stabilized. Signed-off-by: Dominik Brodowski --- include/pcmcia/cistpl.h | 21 ++++++++++++++++----- include/pcmcia/cs.h | 6 +++++- 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h index c6a069554fd..d3bbb19caf8 100644 --- a/include/pcmcia/cistpl.h +++ b/include/pcmcia/cistpl.h @@ -586,12 +586,7 @@ typedef struct cisdump_t { cisdata_t Data[CISTPL_MAX_CIS_SIZE]; } cisdump_t; -int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple); -int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple); -int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple); -int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse); -int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info); int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis); /* don't use outside of PCMCIA core yet */ @@ -602,4 +597,20 @@ int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse); int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info); +/* ... but use these wrappers instead */ +#define pcmcia_get_first_tuple(p_dev, tuple) \ + pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple) + +#define pcmcia_get_next_tuple(p_dev, tuple) \ + pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple) + +#define pcmcia_get_tuple_data(p_dev, tuple) \ + pccard_get_tuple_data(p_dev->socket, tuple) + +#define pcmcia_parse_tuple(p_dev, tuple, parse) \ + pccard_parse_tuple(tuple, parse) + +#define pcmcia_validate_cis(p_dev, info) \ + pccard_validate_cis(p_dev->socket, p_dev->func, info) + #endif /* LINUX_CISTPL_H */ diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index df9b7f70634..eda32a59581 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -386,15 +386,19 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req) int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh); -int pcmcia_reset_card(struct pcmcia_device *p_dev, client_req_t *req); int pcmcia_suspend_card(struct pcmcia_socket *skt); int pcmcia_resume_card(struct pcmcia_socket *skt); int pcmcia_eject_card(struct pcmcia_socket *skt); int pcmcia_insert_card(struct pcmcia_socket *skt); +int pccard_reset_card(struct pcmcia_socket *skt); struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); void pcmcia_put_socket(struct pcmcia_socket *skt); +/* compatibility functions */ +#define pcmcia_reset_card(p_dev, req) \ + pccard_reset_card(p_dev->socket) + #endif /* __KERNEL__ */ #endif /* _LINUX_CS_H */ -- cgit v1.2.3 From 0e0fad8f71a8a23fad223b7d72b4ba06d57f764f Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 15 Jan 2006 01:14:31 +0100 Subject: [PATCH] pcmcia: size reduction if ioctl isn't compiled If the kernel is configured to not include the deprecated PCMCIA ioctl, some code doesn't need to be built. Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 8512cf9a121..ce76ab587df 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -183,10 +183,12 @@ struct pcmcia_device { char * prod_id[4]; + struct device dev; + +#ifdef CONFIG_PCMCIA_IOCTL /* device driver wanted by cardmgr */ struct pcmcia_driver * cardmgr; - - struct device dev; +#endif }; #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) -- cgit v1.2.3 From c7d006935dfda9174187aa557e94a137ced10c30 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 15 Jan 2006 08:04:43 +0100 Subject: [PATCH] pcmcia: remove duplicate fields in io_window_t BasePort, NumPorts and Attributes are or can be embedded in struct resource, so remove them. Signed-off-by: Dominik Brodowski --- include/pcmcia/ss.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index fa527c2ef5e..d0a15125f24 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -153,8 +153,6 @@ extern struct pccard_resource_ops pccard_nonstatic_ops; struct pcmcia_socket; typedef struct io_window_t { - u_int Attributes; - kio_addr_t BasePort, NumPorts; kio_addr_t InUse, Config; struct resource *res; } io_window_t; -- cgit v1.2.3 From 159fe8a8358c7012d4f1fdacfcf69009ea15b52e Mon Sep 17 00:00:00 2001 From: Komuro Date: Sun, 5 Feb 2006 09:56:59 +0100 Subject: [PATCH] pcmcia: remove wrong comment in ciscode.h Remove misleading comment. Signed-off-by: Komuro Signed-off-by: Dominik Brodowski --- include/pcmcia/ciscode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index da19c297dd6..951cdb5d549 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h @@ -1,5 +1,5 @@ /* - * ciscode.h -- Definitions for bulk memory services + * ciscode.h * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as -- cgit v1.2.3 From 2c1f3b7a30286c16ba151fadb0abf0b20e2a1e45 Mon Sep 17 00:00:00 2001 From: Andrew Victor Date: Tue, 21 Feb 2006 12:56:52 +0200 Subject: [PATCH] pcmcia: AT91RM9200 Compact Flash driver This patch adds support for the Compact Flash controller integrated in the Atmel AT91RM9200 processor. Signed-off-by: Andrew Victor --- include/asm-arm/arch-at91rm9200/hardware.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h index 2646c01f8e9..59e6f44d3a0 100644 --- a/include/asm-arm/arch-at91rm9200/hardware.h +++ b/include/asm-arm/arch-at91rm9200/hardware.h @@ -65,6 +65,9 @@ /* SmartMedia */ #define AT91_SMARTMEDIA_BASE 0x40000000 /* NCS3: Smartmedia physical base address */ +/* Compact Flash */ +#define AT91_CF_BASE 0x50000000 /* NCS4-NCS6: Compact Flash physical base address */ + /* Multi-Master Memory controller */ #define AT91_UHP_BASE 0x00300000 /* USB Host controller */ -- cgit v1.2.3 From 5f2a71fcb7995633b335a1e380ac63a968e61320 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 15 Jan 2006 09:32:39 +0100 Subject: [PATCH] pcmcia: add pcmcia_disable_device pcmcia_disable_device(struct pcmcia_device *p_dev) performs the necessary cleanups upon device or driver removal: it calls the appropriate pcmcia_release_* functions, and can replace (most) of the current drivers' _release() functions. Signed-off-by: Dominik Brodowski --- include/pcmcia/cs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index eda32a59581..a5d8df24d56 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -392,6 +392,8 @@ int pcmcia_eject_card(struct pcmcia_socket *skt); int pcmcia_insert_card(struct pcmcia_socket *skt); int pccard_reset_card(struct pcmcia_socket *skt); +void pcmcia_disable_device(struct pcmcia_device *p_dev); + struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); void pcmcia_put_socket(struct pcmcia_socket *skt); -- cgit v1.2.3 From 50db3fdbbc98260fb538c1cc3f8cc597ba7bffe7 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 15 Jan 2006 10:05:19 +0100 Subject: [PATCH] pcmcia: convert remaining users of pcmcia_release_io and _irq Convert the remaining drivers which use pcmcia_release_io or pcmcia_release_irq, and remove the EXPORT of these symbols. Signed-off-by: Dominik Brodowski --- include/pcmcia/cs.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index a5d8df24d56..7b915200c11 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -379,8 +379,6 @@ int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); int pcmcia_release_configuration(struct pcmcia_device *p_dev); -int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req); -int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req); int pcmcia_release_window(window_handle_t win); int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); -- cgit v1.2.3 From 8661bb5b4af1849c1f5a4e80c4e275fd13c155d6 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Thu, 2 Mar 2006 00:02:33 +0100 Subject: [PATCH] pcmcia: default suspend and resume handling In all but one case, the suspend and resume functions of PCMCIA drivers contain mostly of calls to pcmcia_release_configuration() and pcmcia_request_configuration(). Therefore, move this code out of the drivers and into the core. Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index ce76ab587df..8a6a95ea26e 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -118,8 +118,7 @@ typedef struct dev_link_t { /* Flags for device state */ #define DEV_PRESENT 0x01 #define DEV_CONFIG 0x02 -#define DEV_STALE_CONFIG 0x04 /* release on close */ -#define DEV_STALE_LINK 0x08 /* detach on release */ +#define DEV_SUSPEND_NORELEASE 0x04 #define DEV_CONFIG_PENDING 0x10 #define DEV_RELEASE_PENDING 0x20 #define DEV_SUSPEND 0x40 -- cgit v1.2.3 From 4bbed5231468014b500b048d7370a1c6c349231a Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 15 Jan 2006 11:18:12 +0100 Subject: [PATCH] pcmcia: remove export of pcmcia_release_configuration Handle the _modifying_ operation sm91c92_cs requires in pcmcia_modify_configuration, so that the only remaining users of pcmcia_release_configuration() are within the pcmcia core module. Signed-off-by: Dominik Brodowski --- include/pcmcia/cs.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 7b915200c11..087b3bc0489 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -116,10 +116,11 @@ typedef struct modconf_t { } modconf_t; /* Attributes for ModifyConfiguration */ -#define CONF_IRQ_CHANGE_VALID 0x100 -#define CONF_VCC_CHANGE_VALID 0x200 -#define CONF_VPP1_CHANGE_VALID 0x400 -#define CONF_VPP2_CHANGE_VALID 0x800 +#define CONF_IRQ_CHANGE_VALID 0x0100 +#define CONF_VCC_CHANGE_VALID 0x0200 +#define CONF_VPP1_CHANGE_VALID 0x0400 +#define CONF_VPP2_CHANGE_VALID 0x0800 +#define CONF_IO_CHANGE_WIDTH 0x1000 /* For RequestConfiguration */ typedef struct config_req_t { @@ -378,7 +379,6 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status); int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); -int pcmcia_release_configuration(struct pcmcia_device *p_dev); int pcmcia_release_window(window_handle_t win); int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); -- cgit v1.2.3 From 70294b468302fd7a0a99dad935c7ba5322989345 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 15 Jan 2006 12:43:16 +0100 Subject: [PATCH] pcmcia: remove unneeded Vcc pseudo setting As we do not allow setting Vcc in the pcmcia core, and Vpp1 and Vpp2 can only be set to the same value, a lot of code can be streamlined. Signed-off-by: Dominik Brodowski --- include/pcmcia/cs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 087b3bc0489..e0835d612b7 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -125,7 +125,7 @@ typedef struct modconf_t { /* For RequestConfiguration */ typedef struct config_req_t { u_int Attributes; - u_int Vcc, Vpp1, Vpp2; + u_int Vpp; /* both Vpp1 and Vpp2 */ u_int IntType; u_int ConfigBase; u_char Status, Pin, Copy, ExtStatus; -- cgit v1.2.3 From a78f4dd331a4f6a396eb5849656a4a72a70a56d7 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 15 Jan 2006 16:26:00 +0100 Subject: [PATCH] pcmcia: rename pcmcia_device.state Rename pcmcia_device.state (which is used in very few places) to p_state in order to avoid a namespace collision when moving the deprecated dev_link_t into struct pcmcia_device Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 8a6a95ea26e..7f712df3e29 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -166,7 +166,7 @@ struct pcmcia_device { /* deprecated, a cleaned up version will be moved into this struct soon */ dev_link_t *instance; - u_int state; + u_int p_state; /* information about this device */ u8 has_manf_id:1; -- cgit v1.2.3 From fd238232cd0ff4840ae6946bb338502154096d88 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 5 Mar 2006 10:45:09 +0100 Subject: [PATCH] pcmcia: embed dev_link_t into struct pcmcia_device Embed dev_link_t into struct pcmcia_device(), as they basically address the same entity. The actual contents of dev_link_t will be cleaned up step by step. This patch includes a bugfix from and signed-off-by Andrew Morton. Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 7f712df3e29..61f7d2dec19 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -39,7 +39,7 @@ typedef struct win_info_t { typedef struct bind_info_t { dev_info_t dev_info; u_char function; - struct dev_link_t *instance; + struct pcmcia_device *instance; char name[DEV_NAME_LEN]; u_short major, minor; void *next; @@ -103,18 +103,6 @@ typedef struct dev_node_t { struct dev_node_t *next; } dev_node_t; -typedef struct dev_link_t { - dev_node_t *dev; - u_int state, open; - client_handle_t handle; - io_req_t io; - irq_req_t irq; - config_req_t conf; - window_handle_t win; - void *priv; - struct dev_link_t *next; -} dev_link_t; - /* Flags for device state */ #define DEV_PRESENT 0x01 #define DEV_CONFIG 0x02 @@ -163,9 +151,17 @@ struct pcmcia_device { struct list_head socket_device_list; - /* deprecated, a cleaned up version will be moved into this - struct soon */ - dev_link_t *instance; + /* deprecated, will be cleaned up soon */ + dev_node_t *dev_node; + u_int state; + u_int open; + struct pcmcia_device *handle; + io_req_t io; + irq_req_t irq; + config_req_t conf; + window_handle_t win; + void *priv; + u_int p_state; /* information about this device */ @@ -189,6 +185,7 @@ struct pcmcia_device { struct pcmcia_driver * cardmgr; #endif }; +typedef struct pcmcia_device dev_link_t; #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) @@ -196,7 +193,7 @@ struct pcmcia_device { #define handle_to_pdev(handle) (handle) #define handle_to_dev(handle) (handle->dev) -#define dev_to_instance(dev) (dev->instance) +#define dev_to_instance(dev) (dev) /* error reporting */ void cs_error(client_handle_t handle, int func, int ret); -- cgit v1.2.3 From fba395eee7d3f342ca739c20f5b3ee635d0420a0 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Fri, 31 Mar 2006 17:21:06 +0200 Subject: [PATCH] pcmcia: remove dev_link_t and client_handle_t indirection dev_link_t * and client_handle_t both mean struct pcmcai_device * by now. Therefore, remove all such indirections. Signed-off-by: Dominik Brodowski --- include/pcmcia/bulkmem.h | 4 ++-- include/pcmcia/ds.h | 7 +------ include/pcmcia/ss.h | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/pcmcia/bulkmem.h b/include/pcmcia/bulkmem.h index b53b78d497b..6bc7472293b 100644 --- a/include/pcmcia/bulkmem.h +++ b/include/pcmcia/bulkmem.h @@ -35,7 +35,7 @@ typedef struct region_info_t { #define REGION_BAR_MASK 0xe000 #define REGION_BAR_SHIFT 13 -int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn); -int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn); +int pcmcia_get_first_region(struct pcmcia_device *handle, region_info_t *rgn); +int pcmcia_get_next_region(struct pcmcia_device *handle, region_info_t *rgn); #endif /* _LINUX_BULKMEM_H */ diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 61f7d2dec19..557d8aea1a8 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -155,7 +155,6 @@ struct pcmcia_device { dev_node_t *dev_node; u_int state; u_int open; - struct pcmcia_device *handle; io_req_t io; irq_req_t irq; config_req_t conf; @@ -185,18 +184,14 @@ struct pcmcia_device { struct pcmcia_driver * cardmgr; #endif }; -typedef struct pcmcia_device dev_link_t; #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) -#define handle_to_pdev(handle) (handle) #define handle_to_dev(handle) (handle->dev) -#define dev_to_instance(dev) (dev) - /* error reporting */ -void cs_error(client_handle_t handle, int func, int ret); +void cs_error(struct pcmcia_device *handle, int func, int ret); #endif /* __KERNEL__ */ #endif /* _LINUX_DS_H */ diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index d0a15125f24..35e469dea6e 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -161,7 +161,7 @@ typedef struct io_window_t { typedef struct window_t { u_short magic; u_short index; - client_handle_t handle; + struct pcmcia_device *handle; struct pcmcia_socket *sock; pccard_mem_map ctl; } window_t; -- cgit v1.2.3 From f6fbe01ac976f3ec618cd5fb71ad9ce2cfa7ab2b Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Fri, 20 Jan 2006 15:10:23 +0100 Subject: [PATCH] pcmcia: remove unused p_dev->state flags Remove the unused DEV_RELEASE_PENDING flag, and move the DEV_SUSPEND flag into the p_dev structure, and make use of it at the core level. Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 557d8aea1a8..93a7ebc3415 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -108,8 +108,6 @@ typedef struct dev_node_t { #define DEV_CONFIG 0x02 #define DEV_SUSPEND_NORELEASE 0x04 #define DEV_CONFIG_PENDING 0x10 -#define DEV_RELEASE_PENDING 0x20 -#define DEV_SUSPEND 0x40 #define DEV_BUSY 0x80 #define DEV_OK(l) \ @@ -163,13 +161,15 @@ struct pcmcia_device { u_int p_state; + u8 suspended:1; + u8 reserved:3; + /* information about this device */ u8 has_manf_id:1; u8 has_card_id:1; u8 has_func_id:1; u8 allow_func_id_match:1; - u8 reserved:4; u8 func_id; u16 manf_id; -- cgit v1.2.3 From e2d4096365e06b9a3799afbadc28b4519c0b3526 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Thu, 2 Mar 2006 00:09:29 +0100 Subject: [PATCH] pcmcia: use bitfield instead of p_state and state Instead of the two status values struct pcmcia_device->p_state and state, use descriptive bitfields. Most value-checking in drivers was invalid, as the core now only calls the ->remove() (a.k.a. detach) function in case the attachement _and_ configuration was successful. Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 93a7ebc3415..a8ce8fc1151 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -96,6 +96,7 @@ typedef union ds_ioctl_arg_t { #ifdef __KERNEL__ #include +#include typedef struct dev_node_t { char dev_name[DEV_NAME_LEN]; @@ -103,15 +104,11 @@ typedef struct dev_node_t { struct dev_node_t *next; } dev_node_t; -/* Flags for device state */ -#define DEV_PRESENT 0x01 -#define DEV_CONFIG 0x02 -#define DEV_SUSPEND_NORELEASE 0x04 -#define DEV_CONFIG_PENDING 0x10 -#define DEV_BUSY 0x80 +#define pcmcia_dev_present(p_dev) \ + (p_dev->socket->pcmcia_state.present) #define DEV_OK(l) \ - ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT))) + ((l) && (!l->suspended) && pcmcia_dev_present(l)) struct pcmcia_socket; @@ -133,6 +130,7 @@ struct pcmcia_driver { int pcmcia_register_driver(struct pcmcia_driver *driver); void pcmcia_unregister_driver(struct pcmcia_driver *driver); + struct pcmcia_device { /* the socket and the device_no [for multifunction devices] uniquely define a pcmcia_device */ @@ -151,25 +149,32 @@ struct pcmcia_device { /* deprecated, will be cleaned up soon */ dev_node_t *dev_node; - u_int state; u_int open; io_req_t io; irq_req_t irq; config_req_t conf; window_handle_t win; - void *priv; - u_int p_state; + /* Is the device suspended? */ + u16 suspended:1; + + /* Flags whether io, irq, win configurations were + * requested, and whether the configuration is "locked" */ + u16 _irq:1; + u16 _io:1; + u16 _win:4; + u16 _locked:1; - u8 suspended:1; - u8 reserved:3; + /* Flag whether a "fuzzy" func_id based match is + * allowed. */ + u16 allow_func_id_match:1; /* information about this device */ - u8 has_manf_id:1; - u8 has_card_id:1; - u8 has_func_id:1; + u16 has_manf_id:1; + u16 has_card_id:1; + u16 has_func_id:1; - u8 allow_func_id_match:1; + u16 reserved:4; u8 func_id; u16 manf_id; @@ -183,6 +188,9 @@ struct pcmcia_device { /* device driver wanted by cardmgr */ struct pcmcia_driver * cardmgr; #endif + + /* data private to drivers */ + void *priv; }; #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) -- cgit v1.2.3 From 9940ec3617fec1db13e589bbc3f37e37878c7683 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 5 Mar 2006 11:04:33 +0100 Subject: [PATCH] pcmcia: convert DEV_OK to pcmcia_dev_present Instead of the DEV_OK macro, drivers should use pcmcia_dev_present(). Signed-off-by: Dominik Brodowski --- include/pcmcia/cs.h | 1 + include/pcmcia/ds.h | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index e0835d612b7..d5838c30d20 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -390,6 +390,7 @@ int pcmcia_eject_card(struct pcmcia_socket *skt); int pcmcia_insert_card(struct pcmcia_socket *skt); int pccard_reset_card(struct pcmcia_socket *skt); +struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *p_dev); void pcmcia_disable_device(struct pcmcia_device *p_dev); struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index a8ce8fc1151..8c339f5678c 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -104,12 +104,6 @@ typedef struct dev_node_t { struct dev_node_t *next; } dev_node_t; -#define pcmcia_dev_present(p_dev) \ - (p_dev->socket->pcmcia_state.present) - -#define DEV_OK(l) \ - ((l) && (!l->suspended) && pcmcia_dev_present(l)) - struct pcmcia_socket; struct config_t; @@ -155,8 +149,10 @@ struct pcmcia_device { config_req_t conf; window_handle_t win; - /* Is the device suspended? */ + /* Is the device suspended, or in the process of + * being removed? */ u16 suspended:1; + u16 _removed:1; /* Flags whether io, irq, win configurations were * requested, and whether the configuration is "locked" */ @@ -174,7 +170,7 @@ struct pcmcia_device { u16 has_card_id:1; u16 has_func_id:1; - u16 reserved:4; + u16 reserved:3; u8 func_id; u16 manf_id; -- cgit v1.2.3 From 30bac7aa0e3678c79ff00fc9372f34712eeb34fc Mon Sep 17 00:00:00 2001 From: Petr Vandrovec Date: Fri, 10 Feb 2006 02:04:00 -0800 Subject: [PATCH] pcmcia: Add support for Possio GCC AKA PCMCIA Siemens MC45 This ugly hack add support for Siemens MC45 PCMCIA GPRS card (which is identical to Possio GCC, and which is offered by one of our local GPRS providers). Card has unfortunate feature that after poweron oxcf950 chip is fully powered and works, but attached MC45 modem is powered down :-( There is a special sequence (which takes 1 sec :-( ) to poweron MC45 (and after MC45 powers on, it takes more than 2 secs until firmware fully boots...) which needs to be executed after all powerons. I'm really not familiar with PCMCIA subsystem, so I have no idea whether I should issue request_region() on rest of oxcf950 address range (0-7 is UART, 8-F are special configuration registers), or how this should be better integrated with PM system and so on - I just put it in same place where another hack already lived... Card uses 18.432MHz XTAL, so to get it to work you must add lines below to the /etc/pcmcia/serial.opts. case "$MANFID-$FUNCID-$PRODID_1-$PRODID_2-$PRODID_3-$PRODID_4" in '030c,0003-2-GPRS-CARD--') SERIAL_OPTS="baud_base 1152000" ;; esac Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Dominik Brodowski --- include/pcmcia/ciscode.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index 951cdb5d549..c1da8558339 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h @@ -122,4 +122,7 @@ #define MANFID_XIRCOM 0x0105 +#define MANFID_POSSIO 0x030c +#define PRODID_POSSIO_GCC 0x0003 + #endif /* _LINUX_CISCODE_H */ -- cgit v1.2.3 From 553ee5dc1a7a1fb04a6286b0c779481f7035bbd1 Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Fri, 31 Mar 2006 16:37:25 -0600 Subject: [PATCH] pcmcia: declare pccard_iodyn_ops (fix m8xx_pcmcia.c compilation error) Apparently the pccard_iodyn_ops declaration has been forgotten, which results in a compilation error for m8xx_pcmcia.c Signed-off-by: Marcelo Tosatti Signed-off-by: Dominik Brodowski --- include/pcmcia/ss.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 35e469dea6e..5e0a01ab221 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -147,6 +147,9 @@ extern struct pccard_resource_ops pccard_static_ops; /* !SS_CAP_STATIC_MAP */ extern struct pccard_resource_ops pccard_nonstatic_ops; +/* static mem, dynamic IO sockets */ +extern struct pccard_resource_ops pccard_iodyn_ops; + /* * Calls to set up low-level "Socket Services" drivers */ -- cgit v1.2.3