[patch 18/21] pcmcia: make rsrc_nonstatic an independend module
Dominik Brodowski
linux at dominikbrodowski.de
Fri Dec 17 05:10:12 EST 2004
Make rsrc_nonstatic an independent module.
Signed-off-by: Dominik Brodowski <linux at brodo.de>
---
drivers/pcmcia/Kconfig | 9 +++++++++
drivers/pcmcia/Makefile | 4 +++-
drivers/pcmcia/cistpl.c | 2 ++
drivers/pcmcia/cs.c | 8 ++------
drivers/pcmcia/cs_internal.h | 2 --
drivers/pcmcia/hd64465_ss.c | 1 +
drivers/pcmcia/i82092.c | 1 +
drivers/pcmcia/i82365.c | 1 +
drivers/pcmcia/m32r_cfc.c | 1 +
drivers/pcmcia/m32r_pcc.c | 1 +
drivers/pcmcia/pd6729.c | 1 +
drivers/pcmcia/rsrc_mgr.c | 1 +
drivers/pcmcia/rsrc_nonstatic.c | 4 ++++
drivers/pcmcia/soc_common.c | 1 +
drivers/pcmcia/tcic.c | 3 ++-
drivers/pcmcia/yenta_socket.c | 1 +
include/pcmcia/ss.h | 4 ++++
17 files changed, 35 insertions(+), 10 deletions(-)
Index: 2.6.10-rc3/drivers/pcmcia/Kconfig
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/Kconfig 2004-12-15 00:17:22.285133845 +0100
+++ 2.6.10-rc3/drivers/pcmcia/Kconfig 2004-12-15 00:17:31.743807196 +0100
@@ -80,6 +80,7 @@
depends on PCCARD && PCI
#fixme: remove dependendcy on CARDBUS
depends on CARDBUS
+ select PCCARD_NONSTATIC
---help---
This option enables support for CardBus host bridges. Virtually
all modern PCMCIA bridges are CardBus compatible. A "bridge" is
@@ -94,6 +95,7 @@
config PD6729
tristate "Cirrus PD6729 compatible bridge support"
depends on PCMCIA && PCI
+ select PCCARD_NONSTATIC
help
This provides support for the Cirrus PD6729 PCI-to-PCMCIA bridge
device, found in some older laptops and PCMCIA card readers.
@@ -101,6 +103,7 @@
config I82092
tristate "i82092 compatible bridge support"
depends on PCMCIA && PCI
+ select PCCARD_NONSTATIC
help
This provides support for the Intel I82092AA PCI-to-PCMCIA bridge device,
found in some older laptops and more commonly in evaluation boards for the
@@ -109,6 +112,7 @@
config I82365
tristate "i82365 compatible bridge support"
depends on PCMCIA && ISA
+ select PCCARD_NONSTATIC
help
Say Y here to include support for ISA-bus PCMCIA host bridges that
are register compatible with the Intel i82365. These are found on
@@ -119,6 +123,7 @@
config TCIC
tristate "Databook TCIC host bridge support"
depends on PCMCIA
+ select PCCARD_NONSTATIC
help
Say Y here to include support for the Databook TCIC family of PCMCIA
host bridges. These are only found on a handful of old systems.
@@ -178,4 +183,8 @@
help
Set the number of M32R CF slots.
+config PCCARD_NONSTATIC
+ tristate
+ depends on PCCARD
+
endmenu
Index: 2.6.10-rc3/drivers/pcmcia/Makefile
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/Makefile 2004-12-15 00:17:31.132892881 +0100
+++ 2.6.10-rc3/drivers/pcmcia/Makefile 2004-12-15 00:17:31.743807196 +0100
@@ -6,13 +6,15 @@
EXTRA_CFLAGS += -DDEBUG
endif
-pcmcia_core-y += cs.o cistpl.o rsrc_mgr.o socket_sysfs.o rsrc_nonstatic.o
+pcmcia_core-y += cs.o cistpl.o rsrc_mgr.o socket_sysfs.o
pcmcia_core-$(CONFIG_CARDBUS) += cardbus.o
obj-$(CONFIG_PCCARD) += pcmcia_core.o
pcmcia-y += ds.o pcmcia_compat.o
obj-$(CONFIG_PCMCIA) += pcmcia.o
+obj-$(CONFIG_PCCARD_NONSTATIC) += rsrc_nonstatic.o
+
# socket drivers
Index: 2.6.10-rc3/drivers/pcmcia/cistpl.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/cistpl.c 2004-12-15 00:17:25.209723650 +0100
+++ 2.6.10-rc3/drivers/pcmcia/cistpl.c 2004-12-15 00:17:31.745806915 +0100
@@ -78,6 +78,7 @@
s->cis_virt = NULL;
}
}
+EXPORT_SYMBOL(release_cis_mem);
/*
* Map the card memory at "card_offset" into virtual space.
@@ -320,6 +321,7 @@
s->fake_cis = NULL;
}
}
+EXPORT_SYMBOL(destroy_cis_cache);
/*======================================================================
Index: 2.6.10-rc3/drivers/pcmcia/cs.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/cs.c 2004-12-15 00:17:27.852353001 +0100
+++ 2.6.10-rc3/drivers/pcmcia/cs.c 2004-12-15 00:17:31.746806775 +0100
@@ -212,7 +212,7 @@
{
int ret;
- if (!socket || !socket->ops || !socket->dev.dev)
+ if (!socket || !socket->ops || !socket->dev.dev || !socket->resource_ops)
return -EINVAL;
cs_dbg(socket, 0, "pcmcia_register_socket(0x%p)\n", socket->ops);
@@ -250,11 +250,7 @@
socket->cis_mem.flags = 0;
socket->cis_mem.speed = cis_speed;
- /* init resource handling */
- if (socket->features & SS_CAP_STATIC_MAP)
- socket->resource_ops = &pccard_static_ops;
- else
- socket->resource_ops = &pccard_nonstatic_ops;
+
socket->mem_db.next = &socket->mem_db;
socket->io_db.next = &socket->io_db;
Index: 2.6.10-rc3/drivers/pcmcia/cs_internal.h
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/cs_internal.h 2004-12-15 00:17:27.853352861 +0100
+++ 2.6.10-rc3/drivers/pcmcia/cs_internal.h 2004-12-15 00:17:31.759804952 +0100
@@ -144,8 +144,6 @@
void undo_irq(u_int Attributes, int irq);
int adjust_resource_info(client_handle_t handle, adjust_t *adj);
void release_resource_db(struct pcmcia_socket *s);
-extern struct pccard_resource_ops pccard_static_ops;
-extern struct pccard_resource_ops pccard_nonstatic_ops;
/* In socket_sysfs.c */
extern struct class_interface pccard_sysfs_interface;
Index: 2.6.10-rc3/drivers/pcmcia/hd64465_ss.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/hd64465_ss.c 2004-12-14 23:44:23.515671029 +0100
+++ 2.6.10-rc3/drivers/pcmcia/hd64465_ss.c 2004-12-15 00:17:31.760804812 +0100
@@ -922,6 +922,7 @@
hs_set_voltages(&hs_sockets[i], 0, 0);
hs_sockets[i].socket.features |= SS_CAP_PCCARD | SS_CAP_STATIC_MAP; /* mappings are fixed in host memory */
+ hs_sockets[i].socket.resource_ops = &pccard_static_ops;
hs_sockets[i].socket.irq_mask = 0xffde;/*0xffff*/ /* IRQs mapped in s/w so can do any, really */
hs_sockets[i].socket.map_size = HD64465_PCC_WINDOW; /* 16MB fixed window size */
Index: 2.6.10-rc3/drivers/pcmcia/i82092.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/i82092.c 2004-12-14 23:44:23.516670889 +0100
+++ 2.6.10-rc3/drivers/pcmcia/i82092.c 2004-12-15 00:17:31.761804672 +0100
@@ -162,6 +162,7 @@
for (i = 0; i<socket_count; i++) {
sockets[i].socket.dev.dev = &dev->dev;
sockets[i].socket.ops = &i82092aa_operations;
+ sockets[i].socket.resource_ops = &pccard_nonstatic_ops;
ret = pcmcia_register_socket(&sockets[i].socket);
if (ret) {
goto err_out_free_sockets;
Index: 2.6.10-rc3/drivers/pcmcia/i82365.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/i82365.c 2004-12-14 23:44:23.516670889 +0100
+++ 2.6.10-rc3/drivers/pcmcia/i82365.c 2004-12-15 00:17:31.762804531 +0100
@@ -1400,6 +1400,7 @@
for (i = 0; i < sockets; i++) {
socket[i].socket.dev.dev = &i82365_device.dev;
socket[i].socket.ops = &pcic_operations;
+ socket[i].socket.resource_ops = &pccard_nonstatic_ops;
socket[i].socket.owner = THIS_MODULE;
socket[i].number = i;
ret = pcmcia_register_socket(&socket[i].socket);
Index: 2.6.10-rc3/drivers/pcmcia/m32r_cfc.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/m32r_cfc.c 2004-12-14 23:44:23.517670748 +0100
+++ 2.6.10-rc3/drivers/pcmcia/m32r_cfc.c 2004-12-15 00:17:31.763804391 +0100
@@ -831,6 +831,7 @@
for (i = 0 ; i < pcc_sockets ; i++) {
socket[i].socket.dev.dev = &pcc_device.dev;
socket[i].socket.ops = &pcc_operations;
+ socket[i].socket.resource_ops = &pccard_static_ops;
socket[i].socket.owner = THIS_MODULE;
socket[i].number = i;
ret = pcmcia_register_socket(&socket[i].socket);
Index: 2.6.10-rc3/drivers/pcmcia/m32r_pcc.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/m32r_pcc.c 2004-12-14 23:44:23.517670748 +0100
+++ 2.6.10-rc3/drivers/pcmcia/m32r_pcc.c 2004-12-15 00:17:31.764804251 +0100
@@ -768,6 +768,7 @@
for (i = 0 ; i < pcc_sockets ; i++) {
socket[i].socket.dev.dev = &pcc_device.dev;
socket[i].socket.ops = &pcc_operations;
+ socket[i].socket.resource_ops = &pccard_static_ops;
socket[i].socket.owner = THIS_MODULE;
socket[i].number = i;
ret = pcmcia_register_socket(&socket[i].socket);
Index: 2.6.10-rc3/drivers/pcmcia/pd6729.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/pd6729.c 2004-12-15 00:08:47.650315219 +0100
+++ 2.6.10-rc3/drivers/pcmcia/pd6729.c 2004-12-15 00:17:31.765804111 +0100
@@ -759,6 +759,7 @@
socket[i].number = i;
socket[i].socket.ops = &pd6729_operations;
+ socket[i].socket.resource_ops = &pccard_nonstatic_ops;
socket[i].socket.dev.dev = &dev->dev;
socket[i].socket.driver_data = &socket[i];
}
Index: 2.6.10-rc3/drivers/pcmcia/rsrc_mgr.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/rsrc_mgr.c 2004-12-15 00:17:31.134892601 +0100
+++ 2.6.10-rc3/drivers/pcmcia/rsrc_mgr.c 2004-12-15 00:17:31.765804111 +0100
@@ -290,3 +290,4 @@
.adjust_resource = NULL,
.exit = NULL,
};
+EXPORT_SYMBOL(pccard_static_ops);
Index: 2.6.10-rc3/drivers/pcmcia/rsrc_nonstatic.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/rsrc_nonstatic.c 2004-12-15 00:17:31.136892320 +0100
+++ 2.6.10-rc3/drivers/pcmcia/rsrc_nonstatic.c 2004-12-15 00:17:31.766803970 +0100
@@ -34,6 +34,9 @@
#include <pcmcia/cistpl.h>
#include "cs_internal.h"
+MODULE_AUTHOR("David A. Hinds, Dominik Brodowski");
+MODULE_LICENSE("GPL");
+
/* Parameters that can be set with 'insmod' */
#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444)
@@ -769,3 +772,4 @@
.adjust_resource = nonstatic_adjust_resource_info,
.exit = nonstatic_release_resource_db,
};
+EXPORT_SYMBOL(pccard_nonstatic_ops);
Index: 2.6.10-rc3/drivers/pcmcia/soc_common.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/soc_common.c 2004-12-14 23:44:23.520670328 +0100
+++ 2.6.10-rc3/drivers/pcmcia/soc_common.c 2004-12-15 00:17:31.767803830 +0100
@@ -758,6 +758,7 @@
goto out_err_6;
skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
+ skt->socket.resource_ops = &pccard_static_ops;
skt->socket.irq_mask = 0;
skt->socket.map_size = PAGE_SIZE;
skt->socket.pci_irq = skt->irq;
Index: 2.6.10-rc3/drivers/pcmcia/tcic.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/tcic.c 2004-12-14 23:44:23.520670328 +0100
+++ 2.6.10-rc3/drivers/pcmcia/tcic.c 2004-12-15 00:17:31.768803690 +0100
@@ -531,8 +531,9 @@
for (i = 0; i < sockets; i++) {
socket_table[i].socket.ops = &tcic_operations;
+ socket_table[i].socket.resource_ops = &pccard_nonstatic_ops;
socket_table[i].socket.dev.dev = &tcic_device.dev;
- ret = pcmcia_register_socket(&socket_table[i].socket);
+ ret = pcmcia_register_socket(&socket_table[i].socket);
if (ret && i)
pcmcia_unregister_socket(&socket_table[0].socket);
}
Index: 2.6.10-rc3/drivers/pcmcia/yenta_socket.c
===================================================================
--- 2.6.10-rc3.orig/drivers/pcmcia/yenta_socket.c 2004-12-14 23:44:23.521670187 +0100
+++ 2.6.10-rc3/drivers/pcmcia/yenta_socket.c 2004-12-15 00:17:31.769803550 +0100
@@ -914,6 +914,7 @@
/* prepare pcmcia_socket */
socket->socket.ops = ¥ta_socket_operations;
+ socket->socket.resource_ops = &pccard_nonstatic_ops;
socket->socket.dev.dev = &dev->dev;
socket->socket.driver_data = socket;
socket->socket.owner = THIS_MODULE;
Index: 2.6.10-rc3/include/pcmcia/ss.h
===================================================================
--- 2.6.10-rc3.orig/include/pcmcia/ss.h 2004-12-15 00:17:30.424992170 +0100
+++ 2.6.10-rc3/include/pcmcia/ss.h 2004-12-15 00:17:31.770803409 +0100
@@ -131,6 +131,10 @@
adjust_t *adj);
void (*exit) (struct pcmcia_socket *s);
};
+/* SS_CAP_STATIC_MAP */
+extern struct pccard_resource_ops pccard_static_ops;
+/* !SS_CAP_STATIC_MAP */
+extern struct pccard_resource_ops pccard_nonstatic_ops;
/*
* Calls to set up low-level "Socket Services" drivers
More information about the linux-pcmcia
mailing list