aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/Kconfig17
-rw-r--r--drivers/pcmcia/au1000_generic.h1
-rw-r--r--drivers/pcmcia/au1000_pb1x00.c1
-rw-r--r--drivers/pcmcia/au1000_xxs1500.c1
-rw-r--r--drivers/pcmcia/cardbus.c1
-rw-r--r--drivers/pcmcia/cs.c16
-rw-r--r--drivers/pcmcia/cs_internal.h16
-rw-r--r--drivers/pcmcia/ds.c99
-rw-r--r--drivers/pcmcia/hd64465_ss.c1
-rw-r--r--drivers/pcmcia/i82365.c9
-rw-r--r--drivers/pcmcia/m32r_cfc.c1
-rw-r--r--drivers/pcmcia/m32r_pcc.c1
-rw-r--r--drivers/pcmcia/pcmcia_compat.c48
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c27
-rw-r--r--drivers/pcmcia/pcmcia_resource.c143
-rw-r--r--drivers/pcmcia/sa1100_generic.c1
-rw-r--r--drivers/pcmcia/soc_common.h1
-rw-r--r--drivers/pcmcia/socket_sysfs.c1
-rw-r--r--drivers/pcmcia/tcic.c1
-rw-r--r--drivers/pcmcia/ti113x.h4
-rw-r--r--drivers/pcmcia/yenta_socket.c11
21 files changed, 126 insertions, 275 deletions
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 52ea34594363..6485f75d2fb3 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -1,8 +1,5 @@
1# 1#
2# PCMCIA bus subsystem configuration 2# PCCARD (PCMCIA/CardBus) bus subsystem configuration
3#
4# Right now the non-CardBus choices are not supported
5# by the integrated kernel driver.
6# 3#
7 4
8menu "PCCARD (PCMCIA/CardBus) support" 5menu "PCCARD (PCMCIA/CardBus) support"
@@ -32,7 +29,7 @@ config PCMCIA_DEBUG
32 29
33 The kernel command line options are: 30 The kernel command line options are:
34 pcmcia_core.pc_debug=N 31 pcmcia_core.pc_debug=N
35 ds.pc_debug=N 32 pcmcia.pc_debug=N
36 sa11xx_core.pc_debug=N 33 sa11xx_core.pc_debug=N
37 34
38 The module option is called pc_debug=N 35 The module option is called pc_debug=N
@@ -73,7 +70,7 @@ config PCMCIA_LOAD_CIS
73 If unsure, say Y. 70 If unsure, say Y.
74 71
75config PCMCIA_IOCTL 72config PCMCIA_IOCTL
76 bool 73 bool "PCMCIA control ioctl (obsolete)"
77 depends on PCMCIA 74 depends on PCMCIA
78 default y 75 default y
79 help 76 help
@@ -81,9 +78,8 @@ config PCMCIA_IOCTL
81 subsystem will be built. It is needed by cardmgr and cardctl 78 subsystem will be built. It is needed by cardmgr and cardctl
82 (pcmcia-cs) to function properly. 79 (pcmcia-cs) to function properly.
83 80
84 If you do not use the new pcmciautils package, and have a 81 You should use the new pcmciautils package instead (see
85 yenta, Cirrus PD6729, i82092, i82365 or tcic compatible bridge, 82 <file:Documentation/Changes> for location and details).
86 you need to say Y here to be able to use 16-bit PCMCIA cards.
87 83
88 If unsure, say Y. 84 If unsure, say Y.
89 85
@@ -106,7 +102,8 @@ comment "PC-card bridges"
106 102
107config YENTA 103config YENTA
108 tristate "CardBus yenta-compatible bridge support" 104 tristate "CardBus yenta-compatible bridge support"
109 depends on CARDBUS 105 depends on PCI
106 select CARDBUS if !EMBEDDED
110 select PCCARD_NONSTATIC 107 select PCCARD_NONSTATIC
111 ---help--- 108 ---help---
112 This option enables support for CardBus host bridges. Virtually 109 This option enables support for CardBus host bridges. Virtually
diff --git a/drivers/pcmcia/au1000_generic.h b/drivers/pcmcia/au1000_generic.h
index 417bc1500bad..d5122b1ea94b 100644
--- a/drivers/pcmcia/au1000_generic.h
+++ b/drivers/pcmcia/au1000_generic.h
@@ -22,7 +22,6 @@
22#define __ASM_AU1000_PCMCIA_H 22#define __ASM_AU1000_PCMCIA_H
23 23
24/* include the world */ 24/* include the world */
25#include <pcmcia/version.h>
26#include <pcmcia/cs_types.h> 25#include <pcmcia/cs_types.h>
27#include <pcmcia/cs.h> 26#include <pcmcia/cs.h>
28#include <pcmcia/ss.h> 27#include <pcmcia/ss.h>
diff --git a/drivers/pcmcia/au1000_pb1x00.c b/drivers/pcmcia/au1000_pb1x00.c
index df19ce1ea4f3..d414a3bb50b9 100644
--- a/drivers/pcmcia/au1000_pb1x00.c
+++ b/drivers/pcmcia/au1000_pb1x00.c
@@ -33,7 +33,6 @@
33#include <linux/version.h> 33#include <linux/version.h>
34#include <linux/types.h> 34#include <linux/types.h>
35 35
36#include <pcmcia/version.h>
37#include <pcmcia/cs_types.h> 36#include <pcmcia/cs_types.h>
38#include <pcmcia/cs.h> 37#include <pcmcia/cs.h>
39#include <pcmcia/ss.h> 38#include <pcmcia/ss.h>
diff --git a/drivers/pcmcia/au1000_xxs1500.c b/drivers/pcmcia/au1000_xxs1500.c
index 1dfc77653660..f113b69d699b 100644
--- a/drivers/pcmcia/au1000_xxs1500.c
+++ b/drivers/pcmcia/au1000_xxs1500.c
@@ -38,7 +38,6 @@
38#include <linux/version.h> 38#include <linux/version.h>
39#include <linux/types.h> 39#include <linux/types.h>
40 40
41#include <pcmcia/version.h>
42#include <pcmcia/cs_types.h> 41#include <pcmcia/cs_types.h>
43#include <pcmcia/cs.h> 42#include <pcmcia/cs.h>
44#include <pcmcia/ss.h> 43#include <pcmcia/ss.h>
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index 3ccb5247ec50..1d755e20880c 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -31,7 +31,6 @@
31#include <asm/io.h> 31#include <asm/io.h>
32 32
33#define IN_CARD_SERVICES 33#define IN_CARD_SERVICES
34#include <pcmcia/version.h>
35#include <pcmcia/cs_types.h> 34#include <pcmcia/cs_types.h>
36#include <pcmcia/ss.h> 35#include <pcmcia/ss.h>
37#include <pcmcia/cs.h> 36#include <pcmcia/cs.h>
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index e82859d3227a..e39178fc59d0 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -33,7 +33,6 @@
33#include <asm/irq.h> 33#include <asm/irq.h>
34 34
35#define IN_CARD_SERVICES 35#define IN_CARD_SERVICES
36#include <pcmcia/version.h>
37#include <pcmcia/cs_types.h> 36#include <pcmcia/cs_types.h>
38#include <pcmcia/ss.h> 37#include <pcmcia/ss.h>
39#include <pcmcia/cs.h> 38#include <pcmcia/cs.h>
@@ -216,6 +215,13 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
216 list_add_tail(&socket->socket_list, &pcmcia_socket_list); 215 list_add_tail(&socket->socket_list, &pcmcia_socket_list);
217 up_write(&pcmcia_socket_list_rwsem); 216 up_write(&pcmcia_socket_list_rwsem);
218 217
218#ifndef CONFIG_CARDBUS
219 /*
220 * If we do not support Cardbus, ensure that
221 * the Cardbus socket capability is disabled.
222 */
223 socket->features &= ~SS_CAP_CARDBUS;
224#endif
219 225
220 /* set proper values in socket->dev */ 226 /* set proper values in socket->dev */
221 socket->dev.class_data = socket; 227 socket->dev.class_data = socket;
@@ -449,11 +455,11 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
449 } 455 }
450 456
451 if (status & SS_CARDBUS) { 457 if (status & SS_CARDBUS) {
458 if (!(skt->features & SS_CAP_CARDBUS)) {
459 cs_err(skt, "cardbus cards are not supported.\n");
460 return CS_BAD_TYPE;
461 }
452 skt->state |= SOCKET_CARDBUS; 462 skt->state |= SOCKET_CARDBUS;
453#ifndef CONFIG_CARDBUS
454 cs_err(skt, "cardbus cards are not supported.\n");
455 return CS_BAD_TYPE;
456#endif
457 } 463 }
458 464
459 /* 465 /*
diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index 0b4c18edfa49..6bbfbd0e02a5 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -99,23 +99,11 @@ static inline void cs_socket_put(struct pcmcia_socket *skt)
99 } 99 }
100} 100}
101 101
102#define CHECK_HANDLE(h) \
103 (((h) == NULL) || ((h)->client_magic != CLIENT_MAGIC))
104
105#define CHECK_SOCKET(s) \ 102#define CHECK_SOCKET(s) \
106 (((s) >= sockets) || (socket_table[s]->ops == NULL)) 103 (((s) >= sockets) || (socket_table[s]->ops == NULL))
107 104
108#define SOCKET(h) (h->Socket) 105#define SOCKET(h) (h->socket)
109#define CONFIG(h) (&SOCKET(h)->config[(h)->Function]) 106#define CONFIG(h) (&SOCKET(h)->config[(h)->func])
110
111#define CHECK_REGION(r) \
112 (((r) == NULL) || ((r)->region_magic != REGION_MAGIC))
113
114#define CHECK_ERASEQ(q) \
115 (((q) == NULL) || ((q)->eraseq_magic != ERASEQ_MAGIC))
116
117#define EVENT(h, e, p) \
118 ((h)->event_handler((e), (p), &(h)->event_callback_args))
119 107
120/* In cardbus.c */ 108/* In cardbus.c */
121int cb_alloc(struct pcmcia_socket *s); 109int cb_alloc(struct pcmcia_socket *s);
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index d5afd557fe37..3e3c6f12bbe6 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -158,17 +158,15 @@ static const lookup_t service_table[] = {
158}; 158};
159 159
160 160
161static int pcmcia_report_error(client_handle_t handle, error_info_t *err) 161static int pcmcia_report_error(struct pcmcia_device *p_dev, error_info_t *err)
162{ 162{
163 int i; 163 int i;
164 char *serv; 164 char *serv;
165 165
166 if (CHECK_HANDLE(handle)) 166 if (!p_dev)
167 printk(KERN_NOTICE); 167 printk(KERN_NOTICE);
168 else { 168 else
169 struct pcmcia_device *p_dev = handle_to_pdev(handle);
170 printk(KERN_NOTICE "%s: ", p_dev->dev.bus_id); 169 printk(KERN_NOTICE "%s: ", p_dev->dev.bus_id);
171 }
172 170
173 for (i = 0; i < ARRAY_SIZE(service_table); i++) 171 for (i = 0; i < ARRAY_SIZE(service_table); i++)
174 if (service_table[i].key == err->func) 172 if (service_table[i].key == err->func)
@@ -193,10 +191,10 @@ static int pcmcia_report_error(client_handle_t handle, error_info_t *err)
193 191
194/*======================================================================*/ 192/*======================================================================*/
195 193
196void cs_error(client_handle_t handle, int func, int ret) 194void cs_error(struct pcmcia_device *p_dev, int func, int ret)
197{ 195{
198 error_info_t err = { func, ret }; 196 error_info_t err = { func, ret };
199 pcmcia_report_error(handle, &err); 197 pcmcia_report_error(p_dev, &err);
200} 198}
201EXPORT_SYMBOL(cs_error); 199EXPORT_SYMBOL(cs_error);
202 200
@@ -207,6 +205,10 @@ static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
207 unsigned int i; 205 unsigned int i;
208 u32 hash; 206 u32 hash;
209 207
208 if (!p_drv->attach || !p_drv->event || !p_drv->detach)
209 printk(KERN_DEBUG "pcmcia: %s does misses a callback function",
210 p_drv->drv.name);
211
210 while (did && did->match_flags) { 212 while (did && did->match_flags) {
211 for (i=0; i<4; i++) { 213 for (i=0; i<4; i++) {
212 if (!did->prod_id[i]) 214 if (!did->prod_id[i])
@@ -376,7 +378,7 @@ static int pcmcia_device_probe(struct device * dev)
376 378
377 if (p_drv->attach) { 379 if (p_drv->attach) {
378 p_dev->instance = p_drv->attach(); 380 p_dev->instance = p_drv->attach();
379 if ((!p_dev->instance) || (p_dev->client.state & CLIENT_UNBOUND)) { 381 if ((!p_dev->instance) || (p_dev->state & CLIENT_UNBOUND)) {
380 printk(KERN_NOTICE "ds: unable to create instance " 382 printk(KERN_NOTICE "ds: unable to create instance "
381 "of '%s'!\n", p_drv->drv.name); 383 "of '%s'!\n", p_drv->drv.name);
382 ret = -EINVAL; 384 ret = -EINVAL;
@@ -516,10 +518,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
516 sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no); 518 sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no);
517 519
518 /* compat */ 520 /* compat */
519 p_dev->client.client_magic = CLIENT_MAGIC; 521 p_dev->state = CLIENT_UNBOUND;
520 p_dev->client.Socket = s;
521 p_dev->client.Function = function;
522 p_dev->client.state = CLIENT_UNBOUND;
523 522
524 /* Add to the list in pcmcia_bus_socket */ 523 /* Add to the list in pcmcia_bus_socket */
525 spin_lock_irqsave(&pcmcia_dev_list_lock, flags); 524 spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
@@ -573,8 +572,6 @@ static int pcmcia_card_add(struct pcmcia_socket *s)
573 else 572 else
574 no_funcs = 1; 573 no_funcs = 1;
575 574
576 /* this doesn't handle multifunction devices on one pcmcia function
577 * yet. */
578 for (i=0; i < no_funcs; i++) 575 for (i=0; i < no_funcs; i++)
579 pcmcia_device_add(s, i); 576 pcmcia_device_add(s, i);
580 577
@@ -914,6 +911,7 @@ struct send_event_data {
914static int send_event_callback(struct device *dev, void * _data) 911static int send_event_callback(struct device *dev, void * _data)
915{ 912{
916 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); 913 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
914 struct pcmcia_driver *p_drv;
917 struct send_event_data *data = _data; 915 struct send_event_data *data = _data;
918 916
919 /* we get called for all sockets, but may only pass the event 917 /* we get called for all sockets, but may only pass the event
@@ -921,11 +919,16 @@ static int send_event_callback(struct device *dev, void * _data)
921 if (p_dev->socket != data->skt) 919 if (p_dev->socket != data->skt)
922 return 0; 920 return 0;
923 921
924 if (p_dev->client.state & (CLIENT_UNBOUND|CLIENT_STALE)) 922 p_drv = to_pcmcia_drv(p_dev->dev.driver);
923 if (!p_drv)
925 return 0; 924 return 0;
926 925
927 if (p_dev->client.EventMask & data->event) 926 if (p_dev->state & (CLIENT_UNBOUND|CLIENT_STALE))
928 return EVENT(&p_dev->client, data->event, data->priority); 927 return 0;
928
929 if (p_drv->event)
930 return p_drv->event(data->event, data->priority,
931 &p_dev->event_callback_args);
929 932
930 return 0; 933 return 0;
931} 934}
@@ -987,11 +990,11 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
987 990
988 991
989 992
990int pcmcia_register_client(client_handle_t *handle, client_reg_t *req) 993int pcmcia_register_client(struct pcmcia_device **handle, client_reg_t *req)
991{ 994{
992 client_t *client = NULL;
993 struct pcmcia_socket *s = NULL; 995 struct pcmcia_socket *s = NULL;
994 struct pcmcia_device *p_dev = NULL; 996 struct pcmcia_device *p_dev = NULL;
997 struct pcmcia_driver *p_drv = NULL;
995 998
996 /* Look for unbound client with matching dev_info */ 999 /* Look for unbound client with matching dev_info */
997 down_read(&pcmcia_socket_list_rwsem); 1000 down_read(&pcmcia_socket_list_rwsem);
@@ -1006,18 +1009,16 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
1006 continue; 1009 continue;
1007 spin_lock_irqsave(&pcmcia_dev_list_lock, flags); 1010 spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
1008 list_for_each_entry(p_dev, &s->devices_list, socket_device_list) { 1011 list_for_each_entry(p_dev, &s->devices_list, socket_device_list) {
1009 struct pcmcia_driver *p_drv;
1010 p_dev = pcmcia_get_dev(p_dev); 1012 p_dev = pcmcia_get_dev(p_dev);
1011 if (!p_dev) 1013 if (!p_dev)
1012 continue; 1014 continue;
1013 if (!(p_dev->client.state & CLIENT_UNBOUND) || 1015 if (!(p_dev->state & CLIENT_UNBOUND) ||
1014 (!p_dev->dev.driver)) { 1016 (!p_dev->dev.driver)) {
1015 pcmcia_put_dev(p_dev); 1017 pcmcia_put_dev(p_dev);
1016 continue; 1018 continue;
1017 } 1019 }
1018 p_drv = to_pcmcia_drv(p_dev->dev.driver); 1020 p_drv = to_pcmcia_drv(p_dev->dev.driver);
1019 if (!strncmp(p_drv->drv.name, (char *)req->dev_info, DEV_NAME_LEN)) { 1021 if (!strncmp(p_drv->drv.name, (char *)req->dev_info, DEV_NAME_LEN)) {
1020 client = &p_dev->client;
1021 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); 1022 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
1022 goto found; 1023 goto found;
1023 } 1024 }
@@ -1028,26 +1029,20 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
1028 } 1029 }
1029 found: 1030 found:
1030 up_read(&pcmcia_socket_list_rwsem); 1031 up_read(&pcmcia_socket_list_rwsem);
1031 if (!p_dev || !client) 1032 if (!p_dev)
1032 return -ENODEV; 1033 return -ENODEV;
1033 1034
1034 pcmcia_put_socket(s); /* safe, as we already hold a reference from bind_device */ 1035 pcmcia_put_socket(s); /* safe, as we already hold a reference from bind_device */
1035 1036
1036 *handle = client; 1037 *handle = p_dev;
1037 client->state &= ~CLIENT_UNBOUND; 1038 p_dev->state &= ~CLIENT_UNBOUND;
1038 client->Socket = s; 1039 p_dev->event_callback_args = req->event_callback_args;
1039 client->EventMask = req->EventMask; 1040 p_dev->event_callback_args.client_handle = p_dev;
1040 client->event_handler = req->event_handler;
1041 client->event_callback_args = req->event_callback_args;
1042 client->event_callback_args.client_handle = client;
1043 1041
1044 if (s->state & SOCKET_CARDBUS)
1045 client->state |= CLIENT_CARDBUS;
1046 1042
1047 if ((!(s->state & SOCKET_CARDBUS)) && (s->functions == 0) && 1043 if (!s->functions) {
1048 (client->Function != BIND_FN_ALL)) {
1049 cistpl_longlink_mfc_t mfc; 1044 cistpl_longlink_mfc_t mfc;
1050 if (pccard_read_tuple(s, client->Function, CISTPL_LONGLINK_MFC, &mfc) 1045 if (pccard_read_tuple(s, p_dev->func, CISTPL_LONGLINK_MFC, &mfc)
1051 == CS_SUCCESS) 1046 == CS_SUCCESS)
1052 s->functions = mfc.nfn; 1047 s->functions = mfc.nfn;
1053 else 1048 else
@@ -1060,13 +1055,13 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
1060 } 1055 }
1061 1056
1062 ds_dbg(1, "register_client(): client 0x%p, dev %s\n", 1057 ds_dbg(1, "register_client(): client 0x%p, dev %s\n",
1063 client, p_dev->dev.bus_id); 1058 p_dev, p_dev->dev.bus_id);
1064 if (client->EventMask & CS_EVENT_REGISTRATION_COMPLETE)
1065 EVENT(client, CS_EVENT_REGISTRATION_COMPLETE, CS_EVENT_PRI_LOW);
1066 1059
1067 if ((s->state & (SOCKET_PRESENT|SOCKET_CARDBUS)) == SOCKET_PRESENT) { 1060 if ((s->state & (SOCKET_PRESENT|SOCKET_CARDBUS)) == SOCKET_PRESENT) {
1068 if (client->EventMask & CS_EVENT_CARD_INSERTION) 1061 if (p_drv->event)
1069 EVENT(client, CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW); 1062 p_drv->event(CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW,
1063 &p_dev->event_callback_args);
1064
1070 } 1065 }
1071 1066
1072 return CS_SUCCESS; 1067 return CS_SUCCESS;
@@ -1099,7 +1094,7 @@ static int unbind_request(struct pcmcia_socket *s)
1099 } 1094 }
1100 p_dev = list_entry((&s->devices_list)->next, struct pcmcia_device, socket_device_list); 1095 p_dev = list_entry((&s->devices_list)->next, struct pcmcia_device, socket_device_list);
1101 list_del(&p_dev->socket_device_list); 1096 list_del(&p_dev->socket_device_list);
1102 p_dev->client.state |= CLIENT_STALE; 1097 p_dev->state |= CLIENT_STALE;
1103 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); 1098 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
1104 1099
1105 device_unregister(&p_dev->dev); 1100 device_unregister(&p_dev->dev);
@@ -1108,31 +1103,25 @@ static int unbind_request(struct pcmcia_socket *s)
1108 return 0; 1103 return 0;
1109} /* unbind_request */ 1104} /* unbind_request */
1110 1105
1111int pcmcia_deregister_client(client_handle_t handle) 1106int pcmcia_deregister_client(struct pcmcia_device *p_dev)
1112{ 1107{
1113 struct pcmcia_socket *s; 1108 struct pcmcia_socket *s;
1114 int i; 1109 int i;
1115 struct pcmcia_device *p_dev = handle_to_pdev(handle);
1116
1117 if (CHECK_HANDLE(handle))
1118 return CS_BAD_HANDLE;
1119 1110
1120 s = SOCKET(handle); 1111 s = p_dev->socket;
1121 ds_dbg(1, "deregister_client(%p)\n", handle); 1112 ds_dbg(1, "deregister_client(%p)\n", p_dev);
1122 1113
1123 if (handle->state & (CLIENT_IRQ_REQ|CLIENT_IO_REQ|CLIENT_CONFIG_LOCKED)) 1114 if (p_dev->state & (CLIENT_IRQ_REQ|CLIENT_IO_REQ|CLIENT_CONFIG_LOCKED))
1124 goto warn_out; 1115 goto warn_out;
1125 for (i = 0; i < MAX_WIN; i++) 1116 for (i = 0; i < MAX_WIN; i++)
1126 if (handle->state & CLIENT_WIN_REQ(i)) 1117 if (p_dev->state & CLIENT_WIN_REQ(i))
1127 goto warn_out; 1118 goto warn_out;
1128 1119
1129 if (handle->state & CLIENT_STALE) { 1120 if (p_dev->state & CLIENT_STALE) {
1130 handle->client_magic = 0; 1121 p_dev->state &= ~CLIENT_STALE;
1131 handle->state &= ~CLIENT_STALE;
1132 pcmcia_put_dev(p_dev); 1122 pcmcia_put_dev(p_dev);
1133 } else { 1123 } else {
1134 handle->state = CLIENT_UNBOUND; 1124 p_dev->state = CLIENT_UNBOUND;
1135 handle->event_handler = NULL;
1136 } 1125 }
1137 1126
1138 return CS_SUCCESS; 1127 return CS_SUCCESS;
diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c
index 5ab55ae0ac36..316f8bcc878b 100644
--- a/drivers/pcmcia/hd64465_ss.c
+++ b/drivers/pcmcia/hd64465_ss.c
@@ -43,7 +43,6 @@
43#include <asm/hd64465/hd64465.h> 43#include <asm/hd64465/hd64465.h>
44#include <asm/hd64465/io.h> 44#include <asm/hd64465/io.h>
45 45
46#include <pcmcia/version.h>
47#include <pcmcia/cs_types.h> 46#include <pcmcia/cs_types.h>
48#include <pcmcia/cs.h> 47#include <pcmcia/cs.h>
49#include <pcmcia/cistpl.h> 48#include <pcmcia/cistpl.h>
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index d72f9a35c8bd..a713015e8228 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -53,7 +53,6 @@
53#include <asm/io.h> 53#include <asm/io.h>
54#include <asm/system.h> 54#include <asm/system.h>
55 55
56#include <pcmcia/version.h>
57#include <pcmcia/cs_types.h> 56#include <pcmcia/cs_types.h>
58#include <pcmcia/ss.h> 57#include <pcmcia/ss.h>
59#include <pcmcia/cs.h> 58#include <pcmcia/cs.h>
@@ -698,14 +697,6 @@ static void __init add_pcic(int ns, int type)
698 struct i82365_socket *t = &socket[sockets-ns]; 697 struct i82365_socket *t = &socket[sockets-ns];
699 698
700 base = sockets-ns; 699 base = sockets-ns;
701 if (t->ioaddr > 0) {
702 if (!request_region(t->ioaddr, 2, "i82365")) {
703 printk(KERN_ERR "i82365: IO region conflict at %#lx, not available\n",
704 t->ioaddr);
705 return;
706 }
707 }
708
709 if (base == 0) printk("\n"); 700 if (base == 0) printk("\n");
710 printk(KERN_INFO " %s", pcic[type].name); 701 printk(KERN_INFO " %s", pcic[type].name);
711 printk(" ISA-to-PCMCIA at port %#lx ofs 0x%02x", 702 printk(" ISA-to-PCMCIA at port %#lx ofs 0x%02x",
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index b1111c6bf062..65f3ee3d4d3c 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -29,7 +29,6 @@
29#include <asm/io.h> 29#include <asm/io.h>
30#include <asm/system.h> 30#include <asm/system.h>
31 31
32#include <pcmcia/version.h>
33#include <pcmcia/cs_types.h> 32#include <pcmcia/cs_types.h>
34#include <pcmcia/ss.h> 33#include <pcmcia/ss.h>
35#include <pcmcia/cs.h> 34#include <pcmcia/cs.h>
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index c0997c4714f0..7b14d7efd68c 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -30,7 +30,6 @@
30#include <asm/system.h> 30#include <asm/system.h>
31#include <asm/addrspace.h> 31#include <asm/addrspace.h>
32 32
33#include <pcmcia/version.h>
34#include <pcmcia/cs_types.h> 33#include <pcmcia/cs_types.h>
35#include <pcmcia/ss.h> 34#include <pcmcia/ss.h>
36#include <pcmcia/cs.h> 35#include <pcmcia/cs.h>
diff --git a/drivers/pcmcia/pcmcia_compat.c b/drivers/pcmcia/pcmcia_compat.c
index 1cc83317e7e3..ebb161c4f819 100644
--- a/drivers/pcmcia/pcmcia_compat.c
+++ b/drivers/pcmcia/pcmcia_compat.c
@@ -18,7 +18,6 @@
18#include <linux/init.h> 18#include <linux/init.h>
19 19
20#define IN_CARD_SERVICES 20#define IN_CARD_SERVICES
21#include <pcmcia/version.h>
22#include <pcmcia/cs_types.h> 21#include <pcmcia/cs_types.h>
23#include <pcmcia/cs.h> 22#include <pcmcia/cs.h>
24#include <pcmcia/bulkmem.h> 23#include <pcmcia/bulkmem.h>
@@ -28,64 +27,39 @@
28 27
29#include "cs_internal.h" 28#include "cs_internal.h"
30 29
31int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple) 30int pcmcia_get_first_tuple(struct pcmcia_device *p_dev, tuple_t *tuple)
32{ 31{
33 struct pcmcia_socket *s; 32 return pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple);
34 if (CHECK_HANDLE(handle))
35 return CS_BAD_HANDLE;
36 s = SOCKET(handle);
37 return pccard_get_first_tuple(s, handle->Function, tuple);
38} 33}
39EXPORT_SYMBOL(pcmcia_get_first_tuple); 34EXPORT_SYMBOL(pcmcia_get_first_tuple);
40 35
41int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple) 36int pcmcia_get_next_tuple(struct pcmcia_device *p_dev, tuple_t *tuple)
42{ 37{
43 struct pcmcia_socket *s; 38 return pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple);
44 if (CHECK_HANDLE(handle))
45 return CS_BAD_HANDLE;
46 s = SOCKET(handle);
47 return pccard_get_next_tuple(s, handle->Function, tuple);
48} 39}
49EXPORT_SYMBOL(pcmcia_get_next_tuple); 40EXPORT_SYMBOL(pcmcia_get_next_tuple);
50 41
51int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple) 42int pcmcia_get_tuple_data(struct pcmcia_device *p_dev, tuple_t *tuple)
52{ 43{
53 struct pcmcia_socket *s; 44 return pccard_get_tuple_data(p_dev->socket, tuple);
54 if (CHECK_HANDLE(handle))
55 return CS_BAD_HANDLE;
56 s = SOCKET(handle);
57 return pccard_get_tuple_data(s, tuple);
58} 45}
59EXPORT_SYMBOL(pcmcia_get_tuple_data); 46EXPORT_SYMBOL(pcmcia_get_tuple_data);
60 47
61int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse) 48int pcmcia_parse_tuple(struct pcmcia_device *p_dev, tuple_t *tuple, cisparse_t *parse)
62{ 49{
63 return pccard_parse_tuple(tuple, parse); 50 return pccard_parse_tuple(tuple, parse);
64} 51}
65EXPORT_SYMBOL(pcmcia_parse_tuple); 52EXPORT_SYMBOL(pcmcia_parse_tuple);
66 53
67int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info) 54int pcmcia_validate_cis(struct pcmcia_device *p_dev, cisinfo_t *info)
68{ 55{
69 struct pcmcia_socket *s; 56 return pccard_validate_cis(p_dev->socket, p_dev->func, info);
70 if (CHECK_HANDLE(handle))
71 return CS_BAD_HANDLE;
72 s = SOCKET(handle);
73 return pccard_validate_cis(s, handle->Function, info);
74} 57}
75EXPORT_SYMBOL(pcmcia_validate_cis); 58EXPORT_SYMBOL(pcmcia_validate_cis);
76 59
77 60
78int pcmcia_reset_card(client_handle_t handle, client_req_t *req) 61int pcmcia_reset_card(struct pcmcia_device *p_dev, client_req_t *req)
79{ 62{
80 struct pcmcia_socket *skt; 63 return pccard_reset_card(p_dev->socket);
81
82 if (CHECK_HANDLE(handle))
83 return CS_BAD_HANDLE;
84 skt = SOCKET(handle);
85 if (!skt)
86 return CS_BAD_HANDLE;
87
88 return pccard_reset_card(skt);
89} 64}
90EXPORT_SYMBOL(pcmcia_reset_card); 65EXPORT_SYMBOL(pcmcia_reset_card);
91
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index b883bc151ed0..39ba6406fd54 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -31,7 +31,6 @@
31#include <linux/workqueue.h> 31#include <linux/workqueue.h>
32 32
33#define IN_CARD_SERVICES 33#define IN_CARD_SERVICES
34#include <pcmcia/version.h>
35#include <pcmcia/cs_types.h> 34#include <pcmcia/cs_types.h>
36#include <pcmcia/cs.h> 35#include <pcmcia/cs.h>
37#include <pcmcia/cistpl.h> 36#include <pcmcia/cistpl.h>
@@ -71,29 +70,6 @@ extern int ds_pc_debug;
71#define ds_dbg(lvl, fmt, arg...) do { } while (0) 70#define ds_dbg(lvl, fmt, arg...) do { } while (0)
72#endif 71#endif
73 72
74static const char *release = "Linux Kernel Card Services";
75
76/** pcmcia_get_card_services_info
77 *
78 * Return information about this version of Card Services
79 */
80static int pcmcia_get_card_services_info(servinfo_t *info)
81{
82 unsigned int socket_count = 0;
83 struct list_head *tmp;
84 info->Signature[0] = 'C';
85 info->Signature[1] = 'S';
86 down_read(&pcmcia_socket_list_rwsem);
87 list_for_each(tmp, &pcmcia_socket_list)
88 socket_count++;
89 up_read(&pcmcia_socket_list_rwsem);
90 info->Count = socket_count;
91 info->Revision = CS_RELEASE_CODE;
92 info->CSLevel = 0x0210;
93 info->VendorString = (char *)release;
94 return CS_SUCCESS;
95} /* get_card_services_info */
96
97 73
98/* backwards-compatible accessing of driver --- by name! */ 74/* backwards-compatible accessing of driver --- by name! */
99 75
@@ -591,9 +567,6 @@ static int ds_ioctl(struct inode * inode, struct file * file,
591 case DS_ADJUST_RESOURCE_INFO: 567 case DS_ADJUST_RESOURCE_INFO:
592 ret = pcmcia_adjust_resource_info(&buf->adjust); 568 ret = pcmcia_adjust_resource_info(&buf->adjust);
593 break; 569 break;
594 case DS_GET_CARD_SERVICES_INFO:
595 ret = pcmcia_get_card_services_info(&buf->servinfo);
596 break;
597 case DS_GET_CONFIGURATION_INFO: 570 case DS_GET_CONFIGURATION_INFO:
598 if (buf->config.Function && 571 if (buf->config.Function &&
599 (buf->config.Function >= s->functions)) 572 (buf->config.Function >= s->functions))
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index c01dc6bf1526..184f4f88b2a0 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -23,7 +23,6 @@
23#include <linux/device.h> 23#include <linux/device.h>
24 24
25#define IN_CARD_SERVICES 25#define IN_CARD_SERVICES
26#include <pcmcia/version.h>
27#include <pcmcia/cs_types.h> 26#include <pcmcia/cs_types.h>
28#include <pcmcia/ss.h> 27#include <pcmcia/ss.h>
29#include <pcmcia/cs.h> 28#include <pcmcia/cs.h>
@@ -202,14 +201,11 @@ int pccard_access_configuration_register(struct pcmcia_socket *s,
202 return CS_SUCCESS; 201 return CS_SUCCESS;
203} /* pccard_access_configuration_register */ 202} /* pccard_access_configuration_register */
204 203
205int pcmcia_access_configuration_register(client_handle_t handle, 204int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
206 conf_reg_t *reg) 205 conf_reg_t *reg)
207{ 206{
208 struct pcmcia_socket *s; 207 return pccard_access_configuration_register(p_dev->socket,
209 if (CHECK_HANDLE(handle)) 208 p_dev->func, reg);
210 return CS_BAD_HANDLE;
211 s = SOCKET(handle);
212 return pccard_access_configuration_register(s, handle->Function, reg);
213} 209}
214EXPORT_SYMBOL(pcmcia_access_configuration_register); 210EXPORT_SYMBOL(pcmcia_access_configuration_register);
215 211
@@ -271,17 +267,11 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
271 return CS_SUCCESS; 267 return CS_SUCCESS;
272} /* pccard_get_configuration_info */ 268} /* pccard_get_configuration_info */
273 269
274int pcmcia_get_configuration_info(client_handle_t handle, 270int pcmcia_get_configuration_info(struct pcmcia_device *p_dev,
275 config_info_t *config) 271 config_info_t *config)
276{ 272{
277 struct pcmcia_socket *s; 273 return pccard_get_configuration_info(p_dev->socket, p_dev->func,
278 274 config);
279 if ((CHECK_HANDLE(handle)) || !config)
280 return CS_BAD_HANDLE;
281 s = SOCKET(handle);
282 if (!s)
283 return CS_BAD_HANDLE;
284 return pccard_get_configuration_info(s, handle->Function, config);
285} 275}
286EXPORT_SYMBOL(pcmcia_get_configuration_info); 276EXPORT_SYMBOL(pcmcia_get_configuration_info);
287 277
@@ -382,10 +372,8 @@ int pccard_get_status(struct pcmcia_socket *s, unsigned int function,
382int pcmcia_get_status(client_handle_t handle, cs_status_t *status) 372int pcmcia_get_status(client_handle_t handle, cs_status_t *status)
383{ 373{
384 struct pcmcia_socket *s; 374 struct pcmcia_socket *s;
385 if (CHECK_HANDLE(handle))
386 return CS_BAD_HANDLE;
387 s = SOCKET(handle); 375 s = SOCKET(handle);
388 return pccard_get_status(s, handle->Function, status); 376 return pccard_get_status(s, handle->func, status);
389} 377}
390EXPORT_SYMBOL(pcmcia_get_status); 378EXPORT_SYMBOL(pcmcia_get_status);
391 379
@@ -426,16 +414,14 @@ EXPORT_SYMBOL(pcmcia_map_mem_page);
426 * 414 *
427 * Modify a locked socket configuration 415 * Modify a locked socket configuration
428 */ 416 */
429int pcmcia_modify_configuration(client_handle_t handle, 417int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
430 modconf_t *mod) 418 modconf_t *mod)
431{ 419{
432 struct pcmcia_socket *s; 420 struct pcmcia_socket *s;
433 config_t *c; 421 config_t *c;
434 422
435 if (CHECK_HANDLE(handle)) 423 s = p_dev->socket;
436 return CS_BAD_HANDLE; 424 c = CONFIG(p_dev);
437 s = SOCKET(handle);
438 c = CONFIG(handle);
439 if (!(s->state & SOCKET_PRESENT)) 425 if (!(s->state & SOCKET_PRESENT))
440 return CS_NO_CARD; 426 return CS_NO_CARD;
441 if (!(c->state & CONFIG_LOCKED)) 427 if (!(c->state & CONFIG_LOCKED))
@@ -472,25 +458,18 @@ int pcmcia_modify_configuration(client_handle_t handle,
472EXPORT_SYMBOL(pcmcia_modify_configuration); 458EXPORT_SYMBOL(pcmcia_modify_configuration);
473 459
474 460
475int pcmcia_release_configuration(client_handle_t handle) 461int pcmcia_release_configuration(struct pcmcia_device *p_dev)
476{ 462{
477 pccard_io_map io = { 0, 0, 0, 0, 1 }; 463 pccard_io_map io = { 0, 0, 0, 0, 1 };
478 struct pcmcia_socket *s; 464 struct pcmcia_socket *s = p_dev->socket;
479 int i; 465 int i;
480 466
481 if (CHECK_HANDLE(handle) || 467 if (!(p_dev->state & CLIENT_CONFIG_LOCKED))
482 !(handle->state & CLIENT_CONFIG_LOCKED))
483 return CS_BAD_HANDLE; 468 return CS_BAD_HANDLE;
484 handle->state &= ~CLIENT_CONFIG_LOCKED; 469 p_dev->state &= ~CLIENT_CONFIG_LOCKED;
485 s = SOCKET(handle);
486
487#ifdef CONFIG_CARDBUS
488 if (handle->state & CLIENT_CARDBUS)
489 return CS_SUCCESS;
490#endif
491 470
492 if (!(handle->state & CLIENT_STALE)) { 471 if (!(p_dev->state & CLIENT_STALE)) {
493 config_t *c = CONFIG(handle); 472 config_t *c = CONFIG(p_dev);
494 if (--(s->lock_count) == 0) { 473 if (--(s->lock_count) == 0) {
495 s->socket.flags = SS_OUTPUT_ENA; /* Is this correct? */ 474 s->socket.flags = SS_OUTPUT_ENA; /* Is this correct? */
496 s->socket.Vpp = 0; 475 s->socket.Vpp = 0;
@@ -523,22 +502,16 @@ EXPORT_SYMBOL(pcmcia_release_configuration);
523 * don't bother checking the port ranges against the current socket 502 * don't bother checking the port ranges against the current socket
524 * values. 503 * values.
525 */ 504 */
526int pcmcia_release_io(client_handle_t handle, io_req_t *req) 505int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req)
527{ 506{
528 struct pcmcia_socket *s; 507 struct pcmcia_socket *s = p_dev->socket;
529 508
530 if (CHECK_HANDLE(handle) || !(handle->state & CLIENT_IO_REQ)) 509 if (!(p_dev->state & CLIENT_IO_REQ))
531 return CS_BAD_HANDLE; 510 return CS_BAD_HANDLE;
532 handle->state &= ~CLIENT_IO_REQ; 511 p_dev->state &= ~CLIENT_IO_REQ;
533 s = SOCKET(handle);
534
535#ifdef CONFIG_CARDBUS
536 if (handle->state & CLIENT_CARDBUS)
537 return CS_SUCCESS;
538#endif
539 512
540 if (!(handle->state & CLIENT_STALE)) { 513 if (!(p_dev->state & CLIENT_STALE)) {
541 config_t *c = CONFIG(handle); 514 config_t *c = CONFIG(p_dev);
542 if (c->state & CONFIG_LOCKED) 515 if (c->state & CONFIG_LOCKED)
543 return CS_CONFIGURATION_LOCKED; 516 return CS_CONFIGURATION_LOCKED;
544 if ((c->io.BasePort1 != req->BasePort1) || 517 if ((c->io.BasePort1 != req->BasePort1) ||
@@ -558,16 +531,15 @@ int pcmcia_release_io(client_handle_t handle, io_req_t *req)
558EXPORT_SYMBOL(pcmcia_release_io); 531EXPORT_SYMBOL(pcmcia_release_io);
559 532
560 533
561int pcmcia_release_irq(client_handle_t handle, irq_req_t *req) 534int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
562{ 535{
563 struct pcmcia_socket *s; 536 struct pcmcia_socket *s = p_dev->socket;
564 if (CHECK_HANDLE(handle) || !(handle->state & CLIENT_IRQ_REQ)) 537 if (!(p_dev->state & CLIENT_IRQ_REQ))
565 return CS_BAD_HANDLE; 538 return CS_BAD_HANDLE;
566 handle->state &= ~CLIENT_IRQ_REQ; 539 p_dev->state &= ~CLIENT_IRQ_REQ;
567 s = SOCKET(handle);
568 540
569 if (!(handle->state & CLIENT_STALE)) { 541 if (!(p_dev->state & CLIENT_STALE)) {
570 config_t *c = CONFIG(handle); 542 config_t *c = CONFIG(p_dev);
571 if (c->state & CONFIG_LOCKED) 543 if (c->state & CONFIG_LOCKED)
572 return CS_CONFIGURATION_LOCKED; 544 return CS_CONFIGURATION_LOCKED;
573 if (c->irq.Attributes != req->Attributes) 545 if (c->irq.Attributes != req->Attributes)
@@ -623,29 +595,21 @@ int pcmcia_release_window(window_handle_t win)
623EXPORT_SYMBOL(pcmcia_release_window); 595EXPORT_SYMBOL(pcmcia_release_window);
624 596
625 597
626int pcmcia_request_configuration(client_handle_t handle, 598int pcmcia_request_configuration(struct pcmcia_device *p_dev,
627 config_req_t *req) 599 config_req_t *req)
628{ 600{
629 int i; 601 int i;
630 u_int base; 602 u_int base;
631 struct pcmcia_socket *s; 603 struct pcmcia_socket *s = p_dev->socket;
632 config_t *c; 604 config_t *c;
633 pccard_io_map iomap; 605 pccard_io_map iomap;
634 606
635 if (CHECK_HANDLE(handle))
636 return CS_BAD_HANDLE;
637 s = SOCKET(handle);
638 if (!(s->state & SOCKET_PRESENT)) 607 if (!(s->state & SOCKET_PRESENT))
639 return CS_NO_CARD; 608 return CS_NO_CARD;
640 609
641#ifdef CONFIG_CARDBUS
642 if (handle->state & CLIENT_CARDBUS)
643 return CS_UNSUPPORTED_MODE;
644#endif
645
646 if (req->IntType & INT_CARDBUS) 610 if (req->IntType & INT_CARDBUS)
647 return CS_UNSUPPORTED_MODE; 611 return CS_UNSUPPORTED_MODE;
648 c = CONFIG(handle); 612 c = CONFIG(p_dev);
649 if (c->state & CONFIG_LOCKED) 613 if (c->state & CONFIG_LOCKED)
650 return CS_CONFIGURATION_LOCKED; 614 return CS_CONFIGURATION_LOCKED;
651 615
@@ -746,7 +710,7 @@ int pcmcia_request_configuration(client_handle_t handle,
746 } 710 }
747 711
748 c->state |= CONFIG_LOCKED; 712 c->state |= CONFIG_LOCKED;
749 handle->state |= CLIENT_CONFIG_LOCKED; 713 p_dev->state |= CLIENT_CONFIG_LOCKED;
750 return CS_SUCCESS; 714 return CS_SUCCESS;
751} /* pcmcia_request_configuration */ 715} /* pcmcia_request_configuration */
752EXPORT_SYMBOL(pcmcia_request_configuration); 716EXPORT_SYMBOL(pcmcia_request_configuration);
@@ -757,29 +721,17 @@ EXPORT_SYMBOL(pcmcia_request_configuration);
757 * Request_io() reserves ranges of port addresses for a socket. 721 * Request_io() reserves ranges of port addresses for a socket.
758 * I have not implemented range sharing or alias addressing. 722 * I have not implemented range sharing or alias addressing.
759 */ 723 */
760int pcmcia_request_io(client_handle_t handle, io_req_t *req) 724int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
761{ 725{
762 struct pcmcia_socket *s; 726 struct pcmcia_socket *s = p_dev->socket;
763 config_t *c; 727 config_t *c;
764 728
765 if (CHECK_HANDLE(handle))
766 return CS_BAD_HANDLE;
767 s = SOCKET(handle);
768 if (!(s->state & SOCKET_PRESENT)) 729 if (!(s->state & SOCKET_PRESENT))
769 return CS_NO_CARD; 730 return CS_NO_CARD;
770 731
771 if (handle->state & CLIENT_CARDBUS) {
772#ifdef CONFIG_CARDBUS
773 handle->state |= CLIENT_IO_REQ;
774 return CS_SUCCESS;
775#else
776 return CS_UNSUPPORTED_FUNCTION;
777#endif
778 }
779
780 if (!req) 732 if (!req)
781 return CS_UNSUPPORTED_MODE; 733 return CS_UNSUPPORTED_MODE;
782 c = CONFIG(handle); 734 c = CONFIG(p_dev);
783 if (c->state & CONFIG_LOCKED) 735 if (c->state & CONFIG_LOCKED)
784 return CS_CONFIGURATION_LOCKED; 736 return CS_CONFIGURATION_LOCKED;
785 if (c->state & CONFIG_IO_REQ) 737 if (c->state & CONFIG_IO_REQ)
@@ -804,7 +756,7 @@ int pcmcia_request_io(client_handle_t handle, io_req_t *req)
804 756
805 c->io = *req; 757 c->io = *req;
806 c->state |= CONFIG_IO_REQ; 758 c->state |= CONFIG_IO_REQ;
807 handle->state |= CLIENT_IO_REQ; 759 p_dev->state |= CLIENT_IO_REQ;
808 return CS_SUCCESS; 760 return CS_SUCCESS;
809} /* pcmcia_request_io */ 761} /* pcmcia_request_io */
810EXPORT_SYMBOL(pcmcia_request_io); 762EXPORT_SYMBOL(pcmcia_request_io);
@@ -827,19 +779,15 @@ static irqreturn_t test_action(int cpl, void *dev_id, struct pt_regs *regs)
827} 779}
828#endif 780#endif
829 781
830int pcmcia_request_irq(client_handle_t handle, irq_req_t *req) 782int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
831{ 783{
832 struct pcmcia_socket *s; 784 struct pcmcia_socket *s = p_dev->socket;
833 config_t *c; 785 config_t *c;
834 int ret = CS_IN_USE, irq = 0; 786 int ret = CS_IN_USE, irq = 0;
835 struct pcmcia_device *p_dev = handle_to_pdev(handle);
836 787
837 if (CHECK_HANDLE(handle))
838 return CS_BAD_HANDLE;
839 s = SOCKET(handle);
840 if (!(s->state & SOCKET_PRESENT)) 788 if (!(s->state & SOCKET_PRESENT))
841 return CS_NO_CARD; 789 return CS_NO_CARD;
842 c = CONFIG(handle); 790 c = CONFIG(p_dev);
843 if (c->state & CONFIG_LOCKED) 791 if (c->state & CONFIG_LOCKED)
844 return CS_CONFIGURATION_LOCKED; 792 return CS_CONFIGURATION_LOCKED;
845 if (c->state & CONFIG_IRQ_REQ) 793 if (c->state & CONFIG_IRQ_REQ)
@@ -903,7 +851,7 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
903 s->irq.Config++; 851 s->irq.Config++;
904 852
905 c->state |= CONFIG_IRQ_REQ; 853 c->state |= CONFIG_IRQ_REQ;
906 handle->state |= CLIENT_IRQ_REQ; 854 p_dev->state |= CLIENT_IRQ_REQ;
907 855
908#ifdef CONFIG_PCMCIA_PROBE 856#ifdef CONFIG_PCMCIA_PROBE
909 pcmcia_used_irq[irq]++; 857 pcmcia_used_irq[irq]++;
@@ -919,16 +867,13 @@ EXPORT_SYMBOL(pcmcia_request_irq);
919 * Request_window() establishes a mapping between card memory space 867 * Request_window() establishes a mapping between card memory space
920 * and system memory space. 868 * and system memory space.
921 */ 869 */
922int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle_t *wh) 870int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh)
923{ 871{
924 struct pcmcia_socket *s; 872 struct pcmcia_socket *s = (*p_dev)->socket;
925 window_t *win; 873 window_t *win;
926 u_long align; 874 u_long align;
927 int w; 875 int w;
928 876
929 if (CHECK_HANDLE(*handle))
930 return CS_BAD_HANDLE;
931 s = (*handle)->Socket;
932 if (!(s->state & SOCKET_PRESENT)) 877 if (!(s->state & SOCKET_PRESENT))
933 return CS_NO_CARD; 878 return CS_NO_CARD;
934 if (req->Attributes & (WIN_PAGED | WIN_SHARED)) 879 if (req->Attributes & (WIN_PAGED | WIN_SHARED))
@@ -957,7 +902,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
957 win = &s->win[w]; 902 win = &s->win[w];
958 win->magic = WINDOW_MAGIC; 903 win->magic = WINDOW_MAGIC;
959 win->index = w; 904 win->index = w;
960 win->handle = *handle; 905 win->handle = *p_dev;
961 win->sock = s; 906 win->sock = s;
962 907
963 if (!(s->features & SS_CAP_STATIC_MAP)) { 908 if (!(s->features & SS_CAP_STATIC_MAP)) {
@@ -966,7 +911,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
966 if (!win->ctl.res) 911 if (!win->ctl.res)
967 return CS_IN_USE; 912 return CS_IN_USE;
968 } 913 }
969 (*handle)->state |= CLIENT_WIN_REQ(w); 914 (*p_dev)->state |= CLIENT_WIN_REQ(w);
970 915
971 /* Configure the socket controller */ 916 /* Configure the socket controller */
972 win->ctl.map = w+1; 917 win->ctl.map = w+1;
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index f1bb79153021..e98bb3d80e7c 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -34,7 +34,6 @@
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/config.h> 35#include <linux/config.h>
36 36
37#include <pcmcia/version.h>
38#include <pcmcia/cs_types.h> 37#include <pcmcia/cs_types.h>
39#include <pcmcia/cs.h> 38#include <pcmcia/cs.h>
40#include <pcmcia/ss.h> 39#include <pcmcia/ss.h>
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h
index 700a155fbc78..6f14126889b3 100644
--- a/drivers/pcmcia/soc_common.h
+++ b/drivers/pcmcia/soc_common.h
@@ -11,7 +11,6 @@
11 11
12/* include the world */ 12/* include the world */
13#include <linux/cpufreq.h> 13#include <linux/cpufreq.h>
14#include <pcmcia/version.h>
15#include <pcmcia/cs_types.h> 14#include <pcmcia/cs_types.h>
16#include <pcmcia/cs.h> 15#include <pcmcia/cs.h>
17#include <pcmcia/ss.h> 16#include <pcmcia/ss.h>
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c
index fcef54c1c2da..1040a6c1a8a4 100644
--- a/drivers/pcmcia/socket_sysfs.c
+++ b/drivers/pcmcia/socket_sysfs.c
@@ -29,7 +29,6 @@
29#include <asm/irq.h> 29#include <asm/irq.h>
30 30
31#define IN_CARD_SERVICES 31#define IN_CARD_SERVICES
32#include <pcmcia/version.h>
33#include <pcmcia/cs_types.h> 32#include <pcmcia/cs_types.h>
34#include <pcmcia/ss.h> 33#include <pcmcia/ss.h>
35#include <pcmcia/cs.h> 34#include <pcmcia/cs.h>
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index aacbbb5f055d..d5a61eae6119 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -50,7 +50,6 @@
50#include <asm/io.h> 50#include <asm/io.h>
51#include <asm/system.h> 51#include <asm/system.h>
52 52
53#include <pcmcia/version.h>
54#include <pcmcia/cs_types.h> 53#include <pcmcia/cs_types.h>
55#include <pcmcia/cs.h> 54#include <pcmcia/cs.h>
56#include <pcmcia/ss.h> 55#include <pcmcia/ss.h>
diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h
index c7ba99871aca..fbe233e19ceb 100644
--- a/drivers/pcmcia/ti113x.h
+++ b/drivers/pcmcia/ti113x.h
@@ -154,8 +154,6 @@
154#define ENE_TEST_C9 0xc9 /* 8bit */ 154#define ENE_TEST_C9 0xc9 /* 8bit */
155#define ENE_TEST_C9_TLTENABLE 0x02 155#define ENE_TEST_C9_TLTENABLE 0x02
156 156
157#ifdef CONFIG_CARDBUS
158
159/* 157/*
160 * Texas Instruments CardBus controller overrides. 158 * Texas Instruments CardBus controller overrides.
161 */ 159 */
@@ -843,7 +841,5 @@ static int ti1250_override(struct yenta_socket *socket)
843 return ti12xx_override(socket); 841 return ti12xx_override(socket);
844} 842}
845 843
846#endif /* CONFIG_CARDBUS */
847
848#endif /* _LINUX_TI113X_H */ 844#endif /* _LINUX_TI113X_H */
849 845
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 02b23abc2df1..0e7aa8176692 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -18,7 +18,6 @@
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/module.h> 19#include <linux/module.h>
20 20
21#include <pcmcia/version.h>
22#include <pcmcia/cs_types.h> 21#include <pcmcia/cs_types.h>
23#include <pcmcia/ss.h> 22#include <pcmcia/ss.h>
24#include <pcmcia/cs.h> 23#include <pcmcia/cs.h>
@@ -869,14 +868,11 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
869 */ 868 */
870static void yenta_get_socket_capabilities(struct yenta_socket *socket, u32 isa_irq_mask) 869static void yenta_get_socket_capabilities(struct yenta_socket *socket, u32 isa_irq_mask)
871{ 870{
872 socket->socket.features |= SS_CAP_PAGE_REGS | SS_CAP_PCCARD | SS_CAP_CARDBUS;
873 socket->socket.map_size = 0x1000;
874 socket->socket.pci_irq = socket->cb_irq; 871 socket->socket.pci_irq = socket->cb_irq;
875 if (isa_probe) 872 if (isa_probe)
876 socket->socket.irq_mask = yenta_probe_irq(socket, isa_irq_mask); 873 socket->socket.irq_mask = yenta_probe_irq(socket, isa_irq_mask);
877 else 874 else
878 socket->socket.irq_mask = 0; 875 socket->socket.irq_mask = 0;
879 socket->socket.cb_dev = socket->dev;
880 876
881 printk(KERN_INFO "Yenta: ISA IRQ mask 0x%04x, PCI irq %d\n", 877 printk(KERN_INFO "Yenta: ISA IRQ mask 0x%04x, PCI irq %d\n",
882 socket->socket.irq_mask, socket->cb_irq); 878 socket->socket.irq_mask, socket->cb_irq);
@@ -942,6 +938,9 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
942 socket->socket.dev.dev = &dev->dev; 938 socket->socket.dev.dev = &dev->dev;
943 socket->socket.driver_data = socket; 939 socket->socket.driver_data = socket;
944 socket->socket.owner = THIS_MODULE; 940 socket->socket.owner = THIS_MODULE;
941 socket->socket.features = SS_CAP_PAGE_REGS | SS_CAP_PCCARD;
942 socket->socket.map_size = 0x1000;
943 socket->socket.cb_dev = dev;
945 944
946 /* prepare struct yenta_socket */ 945 /* prepare struct yenta_socket */
947 socket->dev = dev; 946 socket->dev = dev;
@@ -1012,6 +1011,10 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
1012 socket->poll_timer.data = (unsigned long)socket; 1011 socket->poll_timer.data = (unsigned long)socket;
1013 socket->poll_timer.expires = jiffies + HZ; 1012 socket->poll_timer.expires = jiffies + HZ;
1014 add_timer(&socket->poll_timer); 1013 add_timer(&socket->poll_timer);
1014 printk(KERN_INFO "Yenta: no PCI IRQ, CardBus support disabled for this socket.\n"
1015 KERN_INFO "Yenta: check your BIOS CardBus, BIOS IRQ or ACPI settings.\n");
1016 } else {
1017 socket->socket.features |= SS_CAP_CARDBUS;
1015 } 1018 }
1016 1019
1017 /* Figure out what the dang thing can do for the PCMCIA layer... */ 1020 /* Figure out what the dang thing can do for the PCMCIA layer... */