From 5716d415f8c5a17d44f6e1d5a1e4998f7306a93b Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 11 Jul 2010 09:51:14 +0200 Subject: pcmcia: remove obsolete ioctl Signed-off-by: Dominik Brodowski --- drivers/pcmcia/cs_internal.h | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'drivers/pcmcia/cs_internal.h') diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h index 4126a75445e..a6cc63db8c8 100644 --- a/drivers/pcmcia/cs_internal.h +++ b/drivers/pcmcia/cs_internal.h @@ -60,14 +60,6 @@ struct pccard_resource_ops { struct resource* (*find_mem) (unsigned long base, unsigned long num, unsigned long align, int low, struct pcmcia_socket *s); - int (*add_io) (struct pcmcia_socket *s, - unsigned int action, - unsigned long r_start, - unsigned long r_end); - int (*add_mem) (struct pcmcia_socket *s, - unsigned int action, - unsigned long r_start, - unsigned long r_end); int (*init) (struct pcmcia_socket *s); void (*exit) (struct pcmcia_socket *s); }; @@ -146,6 +138,8 @@ void pcmcia_put_socket(struct pcmcia_socket *skt); /* ds.c */ extern struct bus_type pcmcia_bus_type; +struct pcmcia_device; + /* pcmcia_resource.c */ extern int pcmcia_release_configuration(struct pcmcia_device *p_dev); extern int pcmcia_validate_mem(struct pcmcia_socket *s); @@ -188,34 +182,4 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple); - -#ifdef CONFIG_PCMCIA_IOCTL -/* ds.c */ -extern struct pcmcia_device *pcmcia_get_dev(struct pcmcia_device *p_dev); -extern void pcmcia_put_dev(struct pcmcia_device *p_dev); - -struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, - unsigned int function); - -/* pcmcia_ioctl.c */ -extern void __init pcmcia_setup_ioctl(void); -extern void __exit pcmcia_cleanup_ioctl(void); -extern void handle_event(struct pcmcia_socket *s, event_t event); -extern int handle_request(struct pcmcia_socket *s, event_t event); - -#else /* CONFIG_PCMCIA_IOCTL */ - -static inline void __init pcmcia_setup_ioctl(void) { return; } -static inline void __exit pcmcia_cleanup_ioctl(void) { return; } -static inline void handle_event(struct pcmcia_socket *s, event_t event) -{ - return; -} -static inline int handle_request(struct pcmcia_socket *s, event_t event) -{ - return 0; -} - -#endif /* CONFIG_PCMCIA_IOCTL */ - #endif /* _LINUX_CS_INTERNAL_H */ -- cgit v1.2.3-18-g5258 From 7b24e7988263d3cae25ff35cfeae8a5657d93051 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 11 Jul 2010 10:26:53 +0200 Subject: pcmcia: split up central event handler Split up the central event handler for 16bit cards into three individual functions. Signed-off-by: Dominik Brodowski --- drivers/pcmcia/cs_internal.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/pcmcia/cs_internal.h') diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h index a6cc63db8c8..45e7fd1aa0b 100644 --- a/drivers/pcmcia/cs_internal.h +++ b/drivers/pcmcia/cs_internal.h @@ -10,7 +10,7 @@ * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * (C) 1999 David A. Hinds - * (C) 2003 - 2008 Dominik Brodowski + * (C) 2003 - 2010 Dominik Brodowski * * * This file contains definitions _only_ needed by the PCMCIA core modules. @@ -106,11 +106,12 @@ void cb_free(struct pcmcia_socket *s); struct pcmcia_callback{ struct module *owner; - int (*event) (struct pcmcia_socket *s, - event_t event, int priority); + int (*add) (struct pcmcia_socket *s); + int (*remove) (struct pcmcia_socket *s); void (*requery) (struct pcmcia_socket *s); int (*validate) (struct pcmcia_socket *s, unsigned int *i); int (*suspend) (struct pcmcia_socket *s); + int (*early_resume) (struct pcmcia_socket *s); int (*resume) (struct pcmcia_socket *s); }; -- cgit v1.2.3-18-g5258 From 1d5cc192d431bce2ebe9fde64054ce903200e179 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 24 Jul 2010 12:23:21 +0200 Subject: pcmcia: use pcmica_{read,write}_config_byte Use pcmcia_read_config_byte and pcmcia_write_config_byte instead of pcmcia_access_configuration_register. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-serial@vger.kernel.org CC: Michael Buesch Signed-off-by: Dominik Brodowski --- drivers/pcmcia/cs_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/pcmcia/cs_internal.h') diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h index 45e7fd1aa0b..cebd40da8b9 100644 --- a/drivers/pcmcia/cs_internal.h +++ b/drivers/pcmcia/cs_internal.h @@ -158,8 +158,8 @@ extern struct bin_attribute pccard_cis_attr; int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, u_int len, void *ptr); -void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, - u_int addr, u_int len, void *ptr); +int pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, + u_int addr, u_int len, void *ptr); void release_cis_mem(struct pcmcia_socket *s); void destroy_cis_cache(struct pcmcia_socket *s); int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, -- cgit v1.2.3-18-g5258 From 2ce4905e4da9f512b38f56a53ece9da2072dd164 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 24 Jul 2010 13:14:44 +0200 Subject: pcmcia: use struct resource for PCMCIA devices Introduce a new field into struct pcmcia_device named "resource" and of type struct resource *, which contains the IO port ranges allocated for this device. Memory window ranges and registration with the resource trees will follow at a later date. Signed-off-by: Dominik Brodowski --- drivers/pcmcia/cs_internal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/pcmcia/cs_internal.h') diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h index cebd40da8b9..a85558fc71f 100644 --- a/drivers/pcmcia/cs_internal.h +++ b/drivers/pcmcia/cs_internal.h @@ -35,7 +35,9 @@ typedef struct config_t { unsigned int ConfigBase; unsigned char Status, Pin, Copy, Option, ExtStatus; unsigned int CardValues; - io_req_t io; + + struct resource io[MAX_IO_WIN]; /* io ports */ + struct { u_int Attributes; } irq; -- cgit v1.2.3-18-g5258 From a3d0d4d8dd45779b6e174a8567ffb9b485e472af Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 24 Jul 2010 17:43:10 +0200 Subject: pcmcia: move local definitions out of include/pcmcia/cs.h Signed-off-by: Dominik Brodowski --- drivers/pcmcia/cs_internal.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/pcmcia/cs_internal.h') diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h index a85558fc71f..511ac753b9d 100644 --- a/drivers/pcmcia/cs_internal.h +++ b/drivers/pcmcia/cs_internal.h @@ -26,6 +26,9 @@ /* Flags in client state */ #define CLIENT_WIN_REQ(i) (0x1<<(i)) +/* Flag to access all functions */ +#define BIND_FN_ALL 0xff + /* Each card function gets one of these guys */ typedef struct config_t { struct kref ref; -- cgit v1.2.3-18-g5258 From 0ca724d37af370dbf2d55dc4d6359ead558e5756 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 24 Jul 2010 19:03:02 +0200 Subject: pcmcia: use struct resource for PCMCIA devices, part 2 Use struct resource * also for iomem resources. CC: linux-mtd@lists.infradead.org CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: Jiri Kosina Signed-off-by: Dominik Brodowski --- drivers/pcmcia/cs_internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/pcmcia/cs_internal.h') diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h index 511ac753b9d..37d38b5a197 100644 --- a/drivers/pcmcia/cs_internal.h +++ b/drivers/pcmcia/cs_internal.h @@ -40,6 +40,7 @@ typedef struct config_t { unsigned int CardValues; struct resource io[MAX_IO_WIN]; /* io ports */ + struct resource mem[MAX_WIN]; /* mem areas */ struct { u_int Attributes; -- cgit v1.2.3-18-g5258 From ad0c7be28bc7593da43f494f6d074767ea96ca59 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 25 Jul 2010 13:10:22 +0200 Subject: pcmcia: insert PCMCIA device resources into resource tree Insert PCMCIA device resources into the resource tree. However, this is currently only implemented for sockets which do not statically map the resources. Signed-off-by: Dominik Brodowski --- drivers/pcmcia/cs_internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/pcmcia/cs_internal.h') diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h index 37d38b5a197..da055dc14d9 100644 --- a/drivers/pcmcia/cs_internal.h +++ b/drivers/pcmcia/cs_internal.h @@ -62,7 +62,8 @@ struct pccard_resource_ops { unsigned int attr, unsigned int *base, unsigned int num, - unsigned int align); + unsigned int align, + struct resource **parent); struct resource* (*find_mem) (unsigned long base, unsigned long num, unsigned long align, int low, struct pcmcia_socket *s); -- cgit v1.2.3-18-g5258