aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c35
-rw-r--r--drivers/net/pcmcia/3c589_cs.c47
-rw-r--r--drivers/net/pcmcia/axnet_cs.c87
-rw-r--r--drivers/net/pcmcia/com20020_cs.c43
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c67
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c89
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c42
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c146
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c114
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c161
10 files changed, 212 insertions, 619 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index c683f77c6f42..ff824e11f0b6 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -87,7 +87,6 @@ earlier 3Com products.
87#include <linux/bitops.h> 87#include <linux/bitops.h>
88#include <linux/mii.h> 88#include <linux/mii.h>
89 89
90#include <pcmcia/cs.h>
91#include <pcmcia/cistpl.h> 90#include <pcmcia/cistpl.h>
92#include <pcmcia/cisreg.h> 91#include <pcmcia/cisreg.h>
93#include <pcmcia/ciscode.h> 92#include <pcmcia/ciscode.h>
@@ -280,25 +279,15 @@ static int tc574_probe(struct pcmcia_device *link)
280 spin_lock_init(&lp->window_lock); 279 spin_lock_init(&lp->window_lock);
281 link->resource[0]->end = 32; 280 link->resource[0]->end = 32;
282 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; 281 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
283 link->conf.Attributes = CONF_ENABLE_IRQ; 282 link->config_flags |= CONF_ENABLE_IRQ;
284 link->conf.IntType = INT_MEMORY_AND_IO; 283 link->config_index = 1;
285 link->conf.ConfigIndex = 1;
286 284
287 dev->netdev_ops = &el3_netdev_ops; 285 dev->netdev_ops = &el3_netdev_ops;
288 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); 286 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
289 dev->watchdog_timeo = TX_TIMEOUT; 287 dev->watchdog_timeo = TX_TIMEOUT;
290 288
291 return tc574_config(link); 289 return tc574_config(link);
292} /* tc574_attach */ 290}
293
294/*
295
296 This deletes a driver "instance". The device is de-registered
297 with Card Services. If it has been released, all local data
298 structures are freed. Otherwise, the structures will be freed
299 when the device is released.
300
301*/
302 291
303static void tc574_detach(struct pcmcia_device *link) 292static void tc574_detach(struct pcmcia_device *link)
304{ 293{
@@ -313,12 +302,6 @@ static void tc574_detach(struct pcmcia_device *link)
313 free_netdev(dev); 302 free_netdev(dev);
314} /* tc574_detach */ 303} /* tc574_detach */
315 304
316/*
317 tc574_config() is scheduled to run after a CARD_INSERTION event
318 is received, to configure the PCMCIA socket, and to make the
319 ethernet device available to the system.
320*/
321
322static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; 305static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
323 306
324static int tc574_config(struct pcmcia_device *link) 307static int tc574_config(struct pcmcia_device *link)
@@ -352,7 +335,7 @@ static int tc574_config(struct pcmcia_device *link)
352 if (ret) 335 if (ret)
353 goto failed; 336 goto failed;
354 337
355 ret = pcmcia_request_configuration(link, &link->conf); 338 ret = pcmcia_enable_device(link);
356 if (ret) 339 if (ret)
357 goto failed; 340 goto failed;
358 341
@@ -465,12 +448,6 @@ failed:
465 448
466} /* tc574_config */ 449} /* tc574_config */
467 450
468/*
469 After a card is removed, tc574_release() will unregister the net
470 device, and release the PCMCIA configuration. If the device is
471 still open, this will be postponed until it is closed.
472*/
473
474static void tc574_release(struct pcmcia_device *link) 451static void tc574_release(struct pcmcia_device *link)
475{ 452{
476 pcmcia_disable_device(link); 453 pcmcia_disable_device(link);
@@ -1198,9 +1175,7 @@ MODULE_DEVICE_TABLE(pcmcia, tc574_ids);
1198 1175
1199static struct pcmcia_driver tc574_driver = { 1176static struct pcmcia_driver tc574_driver = {
1200 .owner = THIS_MODULE, 1177 .owner = THIS_MODULE,
1201 .drv = { 1178 .name = "3c574_cs",
1202 .name = "3c574_cs",
1203 },
1204 .probe = tc574_probe, 1179 .probe = tc574_probe,
1205 .remove = tc574_detach, 1180 .remove = tc574_detach,
1206 .id_table = tc574_ids, 1181 .id_table = tc574_ids,
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 61f9cf2100ff..a07e22295330 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -41,7 +41,6 @@
41#include <linux/bitops.h> 41#include <linux/bitops.h>
42#include <linux/jiffies.h> 42#include <linux/jiffies.h>
43 43
44#include <pcmcia/cs.h>
45#include <pcmcia/cistpl.h> 44#include <pcmcia/cistpl.h>
46#include <pcmcia/cisreg.h> 45#include <pcmcia/cisreg.h>
47#include <pcmcia/ciscode.h> 46#include <pcmcia/ciscode.h>
@@ -176,14 +175,6 @@ static const struct ethtool_ops netdev_ethtool_ops;
176 175
177static void tc589_detach(struct pcmcia_device *p_dev); 176static void tc589_detach(struct pcmcia_device *p_dev);
178 177
179/*======================================================================
180
181 tc589_attach() creates an "instance" of the driver, allocating
182 local data structures for one device. The device is registered
183 with Card Services.
184
185======================================================================*/
186
187static const struct net_device_ops el3_netdev_ops = { 178static const struct net_device_ops el3_netdev_ops = {
188 .ndo_open = el3_open, 179 .ndo_open = el3_open,
189 .ndo_stop = el3_close, 180 .ndo_stop = el3_close,
@@ -216,9 +207,8 @@ static int tc589_probe(struct pcmcia_device *link)
216 link->resource[0]->end = 16; 207 link->resource[0]->end = 16;
217 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; 208 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
218 209
219 link->conf.Attributes = CONF_ENABLE_IRQ; 210 link->config_flags |= CONF_ENABLE_IRQ;
220 link->conf.IntType = INT_MEMORY_AND_IO; 211 link->config_index = 1;
221 link->conf.ConfigIndex = 1;
222 212
223 dev->netdev_ops = &el3_netdev_ops; 213 dev->netdev_ops = &el3_netdev_ops;
224 dev->watchdog_timeo = TX_TIMEOUT; 214 dev->watchdog_timeo = TX_TIMEOUT;
@@ -226,16 +216,7 @@ static int tc589_probe(struct pcmcia_device *link)
226 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); 216 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
227 217
228 return tc589_config(link); 218 return tc589_config(link);
229} /* tc589_attach */ 219}
230
231/*======================================================================
232
233 This deletes a driver "instance". The device is de-registered
234 with Card Services. If it has been released, all local data
235 structures are freed. Otherwise, the structures will be freed
236 when the device is released.
237
238======================================================================*/
239 220
240static void tc589_detach(struct pcmcia_device *link) 221static void tc589_detach(struct pcmcia_device *link)
241{ 222{
@@ -250,14 +231,6 @@ static void tc589_detach(struct pcmcia_device *link)
250 free_netdev(dev); 231 free_netdev(dev);
251} /* tc589_detach */ 232} /* tc589_detach */
252 233
253/*======================================================================
254
255 tc589_config() is scheduled to run after a CARD_INSERTION event
256 is received, to configure the PCMCIA socket, and to make the
257 ethernet device available to the system.
258
259======================================================================*/
260
261static int tc589_config(struct pcmcia_device *link) 234static int tc589_config(struct pcmcia_device *link)
262{ 235{
263 struct net_device *dev = link->priv; 236 struct net_device *dev = link->priv;
@@ -294,7 +267,7 @@ static int tc589_config(struct pcmcia_device *link)
294 if (ret) 267 if (ret)
295 goto failed; 268 goto failed;
296 269
297 ret = pcmcia_request_configuration(link, &link->conf); 270 ret = pcmcia_enable_device(link);
298 if (ret) 271 if (ret)
299 goto failed; 272 goto failed;
300 273
@@ -352,14 +325,6 @@ failed:
352 return -ENODEV; 325 return -ENODEV;
353} /* tc589_config */ 326} /* tc589_config */
354 327
355/*======================================================================
356
357 After a card is removed, tc589_release() will unregister the net
358 device, and release the PCMCIA configuration. If the device is
359 still open, this will be postponed until it is closed.
360
361======================================================================*/
362
363static void tc589_release(struct pcmcia_device *link) 328static void tc589_release(struct pcmcia_device *link)
364{ 329{
365 pcmcia_disable_device(link); 330 pcmcia_disable_device(link);
@@ -955,9 +920,7 @@ MODULE_DEVICE_TABLE(pcmcia, tc589_ids);
955 920
956static struct pcmcia_driver tc589_driver = { 921static struct pcmcia_driver tc589_driver = {
957 .owner = THIS_MODULE, 922 .owner = THIS_MODULE,
958 .drv = { 923 .name = "3c589_cs",
959 .name = "3c589_cs",
960 },
961 .probe = tc589_probe, 924 .probe = tc589_probe,
962 .remove = tc589_detach, 925 .remove = tc589_detach,
963 .id_table = tc589_ids, 926 .id_table = tc589_ids,
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 5f05ffb240cc..9e8b28b271ae 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -39,7 +39,6 @@
39#include <linux/mii.h> 39#include <linux/mii.h>
40#include "../8390.h" 40#include "../8390.h"
41 41
42#include <pcmcia/cs.h>
43#include <pcmcia/cistpl.h> 42#include <pcmcia/cistpl.h>
44#include <pcmcia/ciscode.h> 43#include <pcmcia/ciscode.h>
45#include <pcmcia/ds.h> 44#include <pcmcia/ds.h>
@@ -140,14 +139,6 @@ static const struct net_device_ops axnet_netdev_ops = {
140 .ndo_validate_addr = eth_validate_addr, 139 .ndo_validate_addr = eth_validate_addr,
141}; 140};
142 141
143/*======================================================================
144
145 axnet_attach() creates an "instance" of the driver, allocating
146 local data structures for one device. The device is registered
147 with Card Services.
148
149======================================================================*/
150
151static int axnet_probe(struct pcmcia_device *link) 142static int axnet_probe(struct pcmcia_device *link)
152{ 143{
153 axnet_dev_t *info; 144 axnet_dev_t *info;
@@ -166,8 +157,7 @@ static int axnet_probe(struct pcmcia_device *link)
166 info = PRIV(dev); 157 info = PRIV(dev);
167 info->p_dev = link; 158 info->p_dev = link;
168 link->priv = dev; 159 link->priv = dev;
169 link->conf.Attributes = CONF_ENABLE_IRQ; 160 link->config_flags |= CONF_ENABLE_IRQ;
170 link->conf.IntType = INT_MEMORY_AND_IO;
171 161
172 dev->netdev_ops = &axnet_netdev_ops; 162 dev->netdev_ops = &axnet_netdev_ops;
173 163
@@ -177,15 +167,6 @@ static int axnet_probe(struct pcmcia_device *link)
177 return axnet_config(link); 167 return axnet_config(link);
178} /* axnet_attach */ 168} /* axnet_attach */
179 169
180/*======================================================================
181
182 This deletes a driver "instance". The device is de-registered
183 with Card Services. If it has been released, all local data
184 structures are freed. Otherwise, the structures will be freed
185 when the device is released.
186
187======================================================================*/
188
189static void axnet_detach(struct pcmcia_device *link) 170static void axnet_detach(struct pcmcia_device *link)
190{ 171{
191 struct net_device *dev = link->priv; 172 struct net_device *dev = link->priv;
@@ -231,7 +212,7 @@ static int get_prom(struct pcmcia_device *link)
231 }; 212 };
232 213
233 /* Not much of a test, but the alternatives are messy */ 214 /* Not much of a test, but the alternatives are messy */
234 if (link->conf.ConfigBase != 0x03c0) 215 if (link->config_base != 0x03c0)
235 return 0; 216 return 0;
236 217
237 axnet_reset_8390(dev); 218 axnet_reset_8390(dev);
@@ -248,14 +229,6 @@ static int get_prom(struct pcmcia_device *link)
248 return 1; 229 return 1;
249} /* get_prom */ 230} /* get_prom */
250 231
251/*======================================================================
252
253 axnet_config() is scheduled to run after a CARD_INSERTION event
254 is received, to configure the PCMCIA socket, and to make the
255 ethernet device available to the system.
256
257======================================================================*/
258
259static int try_io_port(struct pcmcia_device *link) 232static int try_io_port(struct pcmcia_device *link)
260{ 233{
261 int j, ret; 234 int j, ret;
@@ -286,35 +259,16 @@ static int try_io_port(struct pcmcia_device *link)
286 } 259 }
287} 260}
288 261
289static int axnet_configcheck(struct pcmcia_device *p_dev, 262static int axnet_configcheck(struct pcmcia_device *p_dev, void *priv_data)
290 cistpl_cftable_entry_t *cfg,
291 cistpl_cftable_entry_t *dflt,
292 unsigned int vcc,
293 void *priv_data)
294{ 263{
295 int i; 264 if (p_dev->config_index == 0)
296 cistpl_io_t *io = &cfg->io; 265 return -EINVAL;
297 266
298 if (cfg->index == 0 || cfg->io.nwin == 0) 267 p_dev->config_index = 0x05;
268 if (p_dev->resource[0]->end + p_dev->resource[1]->end < 32)
299 return -ENODEV; 269 return -ENODEV;
300 270
301 p_dev->conf.ConfigIndex = 0x05; 271 return try_io_port(p_dev);
302 /* For multifunction cards, by convention, we configure the
303 network function with window 0, and serial with window 1 */
304 if (io->nwin > 1) {
305 i = (io->win[1].len > io->win[0].len);
306 p_dev->resource[1]->start = io->win[1-i].base;
307 p_dev->resource[1]->end = io->win[1-i].len;
308 } else {
309 i = p_dev->resource[1]->end = 0;
310 }
311 p_dev->resource[0]->start = io->win[i].base;
312 p_dev->resource[0]->end = io->win[i].len;
313 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
314 if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
315 return try_io_port(p_dev);
316
317 return -ENODEV;
318} 272}
319 273
320static int axnet_config(struct pcmcia_device *link) 274static int axnet_config(struct pcmcia_device *link)
@@ -326,20 +280,19 @@ static int axnet_config(struct pcmcia_device *link)
326 dev_dbg(&link->dev, "axnet_config(0x%p)\n", link); 280 dev_dbg(&link->dev, "axnet_config(0x%p)\n", link);
327 281
328 /* don't trust the CIS on this; Linksys got it wrong */ 282 /* don't trust the CIS on this; Linksys got it wrong */
329 link->conf.Present = 0x63; 283 link->config_regs = 0x63;
284 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
330 ret = pcmcia_loop_config(link, axnet_configcheck, NULL); 285 ret = pcmcia_loop_config(link, axnet_configcheck, NULL);
331 if (ret != 0) 286 if (ret != 0)
332 goto failed; 287 goto failed;
333 288
334 if (!link->irq) 289 if (!link->irq)
335 goto failed; 290 goto failed;
291
292 if (resource_size(link->resource[1]) == 8)
293 link->config_flags |= CONF_ENABLE_SPKR;
336 294
337 if (resource_size(link->resource[1]) == 8) { 295 ret = pcmcia_enable_device(link);
338 link->conf.Attributes |= CONF_ENABLE_SPKR;
339 link->conf.Status = CCSR_AUDIO_ENA;
340 }
341
342 ret = pcmcia_request_configuration(link, &link->conf);
343 if (ret) 296 if (ret)
344 goto failed; 297 goto failed;
345 298
@@ -414,14 +367,6 @@ failed:
414 return -ENODEV; 367 return -ENODEV;
415} /* axnet_config */ 368} /* axnet_config */
416 369
417/*======================================================================
418
419 After a card is removed, axnet_release() will unregister the net
420 device, and release the PCMCIA configuration. If the device is
421 still open, this will be postponed until it is closed.
422
423======================================================================*/
424
425static void axnet_release(struct pcmcia_device *link) 370static void axnet_release(struct pcmcia_device *link)
426{ 371{
427 pcmcia_disable_device(link); 372 pcmcia_disable_device(link);
@@ -783,9 +728,7 @@ MODULE_DEVICE_TABLE(pcmcia, axnet_ids);
783 728
784static struct pcmcia_driver axnet_cs_driver = { 729static struct pcmcia_driver axnet_cs_driver = {
785 .owner = THIS_MODULE, 730 .owner = THIS_MODULE,
786 .drv = { 731 .name = "axnet_cs",
787 .name = "axnet_cs",
788 },
789 .probe = axnet_probe, 732 .probe = axnet_probe,
790 .remove = axnet_detach, 733 .remove = axnet_detach,
791 .id_table = axnet_ids, 734 .id_table = axnet_ids,
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 3c400cfa82ae..b706a7249477 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -43,7 +43,6 @@
43#include <linux/arcdevice.h> 43#include <linux/arcdevice.h>
44#include <linux/com20020.h> 44#include <linux/com20020.h>
45 45
46#include <pcmcia/cs.h>
47#include <pcmcia/cistpl.h> 46#include <pcmcia/cistpl.h>
48#include <pcmcia/ds.h> 47#include <pcmcia/ds.h>
49 48
@@ -123,14 +122,6 @@ typedef struct com20020_dev_t {
123 struct net_device *dev; 122 struct net_device *dev;
124} com20020_dev_t; 123} com20020_dev_t;
125 124
126/*======================================================================
127
128 com20020_attach() creates an "instance" of the driver, allocating
129 local data structures for one device. The device is registered
130 with Card Services.
131
132======================================================================*/
133
134static int com20020_probe(struct pcmcia_device *p_dev) 125static int com20020_probe(struct pcmcia_device *p_dev)
135{ 126{
136 com20020_dev_t *info; 127 com20020_dev_t *info;
@@ -160,8 +151,7 @@ static int com20020_probe(struct pcmcia_device *p_dev)
160 151
161 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; 152 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
162 p_dev->resource[0]->end = 16; 153 p_dev->resource[0]->end = 16;
163 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 154 p_dev->config_flags |= CONF_ENABLE_IRQ;
164 p_dev->conf.IntType = INT_MEMORY_AND_IO;
165 155
166 info->dev = dev; 156 info->dev = dev;
167 p_dev->priv = info; 157 p_dev->priv = info;
@@ -174,15 +164,6 @@ fail_alloc_info:
174 return -ENOMEM; 164 return -ENOMEM;
175} /* com20020_attach */ 165} /* com20020_attach */
176 166
177/*======================================================================
178
179 This deletes a driver "instance". The device is de-registered
180 with Card Services. If it has been released, all local data
181 structures are freed. Otherwise, the structures will be freed
182 when the device is released.
183
184======================================================================*/
185
186static void com20020_detach(struct pcmcia_device *link) 167static void com20020_detach(struct pcmcia_device *link)
187{ 168{
188 struct com20020_dev_t *info = link->priv; 169 struct com20020_dev_t *info = link->priv;
@@ -221,14 +202,6 @@ static void com20020_detach(struct pcmcia_device *link)
221 202
222} /* com20020_detach */ 203} /* com20020_detach */
223 204
224/*======================================================================
225
226 com20020_config() is scheduled to run after a CARD_INSERTION event
227 is received, to configure the PCMCIA socket, and to make the
228 device available to the system.
229
230======================================================================*/
231
232static int com20020_config(struct pcmcia_device *link) 205static int com20020_config(struct pcmcia_device *link)
233{ 206{
234 struct arcnet_local *lp; 207 struct arcnet_local *lp;
@@ -282,7 +255,7 @@ static int com20020_config(struct pcmcia_device *link)
282 255
283 dev->irq = link->irq; 256 dev->irq = link->irq;
284 257
285 ret = pcmcia_request_configuration(link, &link->conf); 258 ret = pcmcia_enable_device(link);
286 if (ret) 259 if (ret)
287 goto failed; 260 goto failed;
288 261
@@ -316,14 +289,6 @@ failed:
316 return -ENODEV; 289 return -ENODEV;
317} /* com20020_config */ 290} /* com20020_config */
318 291
319/*======================================================================
320
321 After a card is removed, com20020_release() will unregister the net
322 device, and release the PCMCIA configuration. If the device is
323 still open, this will be postponed until it is closed.
324
325======================================================================*/
326
327static void com20020_release(struct pcmcia_device *link) 292static void com20020_release(struct pcmcia_device *link)
328{ 293{
329 dev_dbg(&link->dev, "com20020_release\n"); 294 dev_dbg(&link->dev, "com20020_release\n");
@@ -366,9 +331,7 @@ MODULE_DEVICE_TABLE(pcmcia, com20020_ids);
366 331
367static struct pcmcia_driver com20020_cs_driver = { 332static struct pcmcia_driver com20020_cs_driver = {
368 .owner = THIS_MODULE, 333 .owner = THIS_MODULE,
369 .drv = { 334 .name = "com20020_cs",
370 .name = "com20020_cs",
371 },
372 .probe = com20020_probe, 335 .probe = com20020_probe,
373 .remove = com20020_detach, 336 .remove = com20020_detach,
374 .id_table = com20020_ids, 337 .id_table = com20020_ids,
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 98fffb03ecd7..1c327598bbe8 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -49,7 +49,6 @@
49#include <linux/ioport.h> 49#include <linux/ioport.h>
50#include <linux/crc32.h> 50#include <linux/crc32.h>
51 51
52#include <pcmcia/cs.h>
53#include <pcmcia/cistpl.h> 52#include <pcmcia/cistpl.h>
54#include <pcmcia/ciscode.h> 53#include <pcmcia/ciscode.h>
55#include <pcmcia/ds.h> 54#include <pcmcia/ds.h>
@@ -252,8 +251,7 @@ static int fmvj18x_probe(struct pcmcia_device *link)
252 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; 251 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
253 252
254 /* General socket configuration */ 253 /* General socket configuration */
255 link->conf.Attributes = CONF_ENABLE_IRQ; 254 link->config_flags |= CONF_ENABLE_IRQ;
256 link->conf.IntType = INT_MEMORY_AND_IO;
257 255
258 dev->netdev_ops = &fjn_netdev_ops; 256 dev->netdev_ops = &fjn_netdev_ops;
259 dev->watchdog_timeo = TX_TIMEOUT; 257 dev->watchdog_timeo = TX_TIMEOUT;
@@ -313,7 +311,7 @@ static int ungermann_try_io_port(struct pcmcia_device *link)
313 ret = pcmcia_request_io(link); 311 ret = pcmcia_request_io(link);
314 if (ret == 0) { 312 if (ret == 0) {
315 /* calculate ConfigIndex value */ 313 /* calculate ConfigIndex value */
316 link->conf.ConfigIndex = 314 link->config_index =
317 ((link->resource[0]->start & 0x0f0) >> 3) | 0x22; 315 ((link->resource[0]->start & 0x0f0) >> 3) | 0x22;
318 return ret; 316 return ret;
319 } 317 }
@@ -321,11 +319,7 @@ static int ungermann_try_io_port(struct pcmcia_device *link)
321 return ret; /* RequestIO failed */ 319 return ret; /* RequestIO failed */
322} 320}
323 321
324static int fmvj18x_ioprobe(struct pcmcia_device *p_dev, 322static int fmvj18x_ioprobe(struct pcmcia_device *p_dev, void *priv_data)
325 cistpl_cftable_entry_t *cfg,
326 cistpl_cftable_entry_t *dflt,
327 unsigned int vcc,
328 void *priv_data)
329{ 323{
330 return 0; /* strange, but that's what the code did already before... */ 324 return 0; /* strange, but that's what the code did already before... */
331} 325}
@@ -362,28 +356,28 @@ static int fmvj18x_config(struct pcmcia_device *link)
362 link->card_id == PRODID_TDK_NP9610 || 356 link->card_id == PRODID_TDK_NP9610 ||
363 link->card_id == PRODID_TDK_MN3200) { 357 link->card_id == PRODID_TDK_MN3200) {
364 /* MultiFunction Card */ 358 /* MultiFunction Card */
365 link->conf.ConfigBase = 0x800; 359 link->config_base = 0x800;
366 link->conf.ConfigIndex = 0x47; 360 link->config_index = 0x47;
367 link->resource[1]->end = 8; 361 link->resource[1]->end = 8;
368 } 362 }
369 break; 363 break;
370 case MANFID_NEC: 364 case MANFID_NEC:
371 cardtype = NEC; /* MultiFunction Card */ 365 cardtype = NEC; /* MultiFunction Card */
372 link->conf.ConfigBase = 0x800; 366 link->config_base = 0x800;
373 link->conf.ConfigIndex = 0x47; 367 link->config_index = 0x47;
374 link->resource[1]->end = 8; 368 link->resource[1]->end = 8;
375 break; 369 break;
376 case MANFID_KME: 370 case MANFID_KME:
377 cardtype = KME; /* MultiFunction Card */ 371 cardtype = KME; /* MultiFunction Card */
378 link->conf.ConfigBase = 0x800; 372 link->config_base = 0x800;
379 link->conf.ConfigIndex = 0x47; 373 link->config_index = 0x47;
380 link->resource[1]->end = 8; 374 link->resource[1]->end = 8;
381 break; 375 break;
382 case MANFID_CONTEC: 376 case MANFID_CONTEC:
383 cardtype = CONTEC; 377 cardtype = CONTEC;
384 break; 378 break;
385 case MANFID_FUJITSU: 379 case MANFID_FUJITSU:
386 if (link->conf.ConfigBase == 0x0fe0) 380 if (link->config_base == 0x0fe0)
387 cardtype = MBH10302; 381 cardtype = MBH10302;
388 else if (link->card_id == PRODID_FUJITSU_MBH10302) 382 else if (link->card_id == PRODID_FUJITSU_MBH10302)
389 /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302), 383 /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302),
@@ -403,10 +397,10 @@ static int fmvj18x_config(struct pcmcia_device *link)
403 case MANFID_FUJITSU: 397 case MANFID_FUJITSU:
404 if (link->card_id == PRODID_FUJITSU_MBH10304) { 398 if (link->card_id == PRODID_FUJITSU_MBH10304) {
405 cardtype = XXX10304; /* MBH10304 with buggy CIS */ 399 cardtype = XXX10304; /* MBH10304 with buggy CIS */
406 link->conf.ConfigIndex = 0x20; 400 link->config_index = 0x20;
407 } else { 401 } else {
408 cardtype = MBH10302; /* NextCom NC5310, etc. */ 402 cardtype = MBH10302; /* NextCom NC5310, etc. */
409 link->conf.ConfigIndex = 1; 403 link->config_index = 1;
410 } 404 }
411 break; 405 break;
412 case MANFID_UNGERMANN: 406 case MANFID_UNGERMANN:
@@ -414,7 +408,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
414 break; 408 break;
415 default: 409 default:
416 cardtype = MBH10302; 410 cardtype = MBH10302;
417 link->conf.ConfigIndex = 1; 411 link->config_index = 1;
418 } 412 }
419 } 413 }
420 414
@@ -432,7 +426,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
432 ret = pcmcia_request_irq(link, fjn_interrupt); 426 ret = pcmcia_request_irq(link, fjn_interrupt);
433 if (ret) 427 if (ret)
434 goto failed; 428 goto failed;
435 ret = pcmcia_request_configuration(link, &link->conf); 429 ret = pcmcia_enable_device(link);
436 if (ret) 430 if (ret)
437 goto failed; 431 goto failed;
438 432
@@ -544,20 +538,18 @@ failed:
544 538
545static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) 539static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
546{ 540{
547 win_req_t req;
548 u_char __iomem *base; 541 u_char __iomem *base;
549 int i, j; 542 int i, j;
550 543
551 /* Allocate a small memory window */ 544 /* Allocate a small memory window */
552 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 545 link->resource[2]->flags |= WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
553 req.Base = 0; req.Size = 0; 546 link->resource[2]->start = 0; link->resource[2]->end = 0;
554 req.AccessSpeed = 0; 547 i = pcmcia_request_window(link, link->resource[2], 0);
555 i = pcmcia_request_window(link, &req, &link->win);
556 if (i != 0) 548 if (i != 0)
557 return -1; 549 return -1;
558 550
559 base = ioremap(req.Base, req.Size); 551 base = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
560 pcmcia_map_mem_page(link, link->win, 0); 552 pcmcia_map_mem_page(link, link->resource[2], 0);
561 553
562 /* 554 /*
563 * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format 555 * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format
@@ -582,7 +574,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
582 } 574 }
583 575
584 iounmap(base); 576 iounmap(base);
585 j = pcmcia_release_window(link, link->win); 577 j = pcmcia_release_window(link, link->resource[2]);
586 return (i != 0x200) ? 0 : -1; 578 return (i != 0x200) ? 0 : -1;
587 579
588} /* fmvj18x_get_hwinfo */ 580} /* fmvj18x_get_hwinfo */
@@ -590,27 +582,26 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
590 582
591static int fmvj18x_setup_mfc(struct pcmcia_device *link) 583static int fmvj18x_setup_mfc(struct pcmcia_device *link)
592{ 584{
593 win_req_t req;
594 int i; 585 int i;
595 struct net_device *dev = link->priv; 586 struct net_device *dev = link->priv;
596 unsigned int ioaddr; 587 unsigned int ioaddr;
597 local_info_t *lp = netdev_priv(dev); 588 local_info_t *lp = netdev_priv(dev);
598 589
599 /* Allocate a small memory window */ 590 /* Allocate a small memory window */
600 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 591 link->resource[3]->flags = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
601 req.Base = 0; req.Size = 0; 592 link->resource[3]->start = link->resource[3]->end = 0;
602 req.AccessSpeed = 0; 593 i = pcmcia_request_window(link, link->resource[3], 0);
603 i = pcmcia_request_window(link, &req, &link->win);
604 if (i != 0) 594 if (i != 0)
605 return -1; 595 return -1;
606 596
607 lp->base = ioremap(req.Base, req.Size); 597 lp->base = ioremap(link->resource[3]->start,
598 resource_size(link->resource[3]));
608 if (lp->base == NULL) { 599 if (lp->base == NULL) {
609 printk(KERN_NOTICE "fmvj18x_cs: ioremap failed\n"); 600 printk(KERN_NOTICE "fmvj18x_cs: ioremap failed\n");
610 return -1; 601 return -1;
611 } 602 }
612 603
613 i = pcmcia_map_mem_page(link, link->win, 0); 604 i = pcmcia_map_mem_page(link, link->resource[3], 0);
614 if (i != 0) { 605 if (i != 0) {
615 iounmap(lp->base); 606 iounmap(lp->base);
616 lp->base = NULL; 607 lp->base = NULL;
@@ -638,7 +629,6 @@ static void fmvj18x_release(struct pcmcia_device *link)
638 struct net_device *dev = link->priv; 629 struct net_device *dev = link->priv;
639 local_info_t *lp = netdev_priv(dev); 630 local_info_t *lp = netdev_priv(dev);
640 u_char __iomem *tmp; 631 u_char __iomem *tmp;
641 int j;
642 632
643 dev_dbg(&link->dev, "fmvj18x_release\n"); 633 dev_dbg(&link->dev, "fmvj18x_release\n");
644 634
@@ -646,7 +636,6 @@ static void fmvj18x_release(struct pcmcia_device *link)
646 tmp = lp->base; 636 tmp = lp->base;
647 lp->base = NULL; /* set NULL before iounmap */ 637 lp->base = NULL; /* set NULL before iounmap */
648 iounmap(tmp); 638 iounmap(tmp);
649 j = pcmcia_release_window(link, link->win);
650 } 639 }
651 640
652 pcmcia_disable_device(link); 641 pcmcia_disable_device(link);
@@ -708,9 +697,7 @@ MODULE_DEVICE_TABLE(pcmcia, fmvj18x_ids);
708 697
709static struct pcmcia_driver fmvj18x_cs_driver = { 698static struct pcmcia_driver fmvj18x_cs_driver = {
710 .owner = THIS_MODULE, 699 .owner = THIS_MODULE,
711 .drv = { 700 .name = "fmvj18x_cs",
712 .name = "fmvj18x_cs",
713 },
714 .probe = fmvj18x_probe, 701 .probe = fmvj18x_probe,
715 .remove = fmvj18x_detach, 702 .remove = fmvj18x_detach,
716 .id_table = fmvj18x_ids, 703 .id_table = fmvj18x_ids,
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index b0d06a3d962f..bf7dff96d881 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -57,7 +57,6 @@
57#include <linux/trdevice.h> 57#include <linux/trdevice.h>
58#include <linux/ibmtr.h> 58#include <linux/ibmtr.h>
59 59
60#include <pcmcia/cs.h>
61#include <pcmcia/cistpl.h> 60#include <pcmcia/cistpl.h>
62#include <pcmcia/ds.h> 61#include <pcmcia/ds.h>
63 62
@@ -102,9 +101,8 @@ static void ibmtr_detach(struct pcmcia_device *p_dev);
102 101
103typedef struct ibmtr_dev_t { 102typedef struct ibmtr_dev_t {
104 struct pcmcia_device *p_dev; 103 struct pcmcia_device *p_dev;
105 struct net_device *dev; 104 struct net_device *dev;
106 window_handle_t sram_win_handle; 105 struct tok_info *ti;
107 struct tok_info *ti;
108} ibmtr_dev_t; 106} ibmtr_dev_t;
109 107
110static void netdev_get_drvinfo(struct net_device *dev, 108static void netdev_get_drvinfo(struct net_device *dev,
@@ -123,14 +121,6 @@ static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) {
123 return tok_interrupt(irq, dev); 121 return tok_interrupt(irq, dev);
124}; 122};
125 123
126/*======================================================================
127
128 ibmtr_attach() creates an "instance" of the driver, allocating
129 local data structures for one device. The device is registered
130 with Card Services.
131
132======================================================================*/
133
134static int __devinit ibmtr_attach(struct pcmcia_device *link) 124static int __devinit ibmtr_attach(struct pcmcia_device *link)
135{ 125{
136 ibmtr_dev_t *info; 126 ibmtr_dev_t *info;
@@ -153,9 +143,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
153 143
154 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; 144 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
155 link->resource[0]->end = 4; 145 link->resource[0]->end = 4;
156 link->conf.Attributes = CONF_ENABLE_IRQ; 146 link->config_flags |= CONF_ENABLE_IRQ;
157 link->conf.IntType = INT_MEMORY_AND_IO; 147 link->config_regs = PRESENT_OPTION;
158 link->conf.Present = PRESENT_OPTION;
159 148
160 info->dev = dev; 149 info->dev = dev;
161 150
@@ -164,15 +153,6 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
164 return ibmtr_config(link); 153 return ibmtr_config(link);
165} /* ibmtr_attach */ 154} /* ibmtr_attach */
166 155
167/*======================================================================
168
169 This deletes a driver "instance". The device is de-registered
170 with Card Services. If it has been released, all local data
171 structures are freed. Otherwise, the structures will be freed
172 when the device is released.
173
174======================================================================*/
175
176static void ibmtr_detach(struct pcmcia_device *link) 156static void ibmtr_detach(struct pcmcia_device *link)
177{ 157{
178 struct ibmtr_dev_t *info = link->priv; 158 struct ibmtr_dev_t *info = link->priv;
@@ -197,26 +177,17 @@ static void ibmtr_detach(struct pcmcia_device *link)
197 kfree(info); 177 kfree(info);
198} /* ibmtr_detach */ 178} /* ibmtr_detach */
199 179
200/*======================================================================
201
202 ibmtr_config() is scheduled to run after a CARD_INSERTION event
203 is received, to configure the PCMCIA socket, and to make the
204 token-ring device available to the system.
205
206======================================================================*/
207
208static int __devinit ibmtr_config(struct pcmcia_device *link) 180static int __devinit ibmtr_config(struct pcmcia_device *link)
209{ 181{
210 ibmtr_dev_t *info = link->priv; 182 ibmtr_dev_t *info = link->priv;
211 struct net_device *dev = info->dev; 183 struct net_device *dev = info->dev;
212 struct tok_info *ti = netdev_priv(dev); 184 struct tok_info *ti = netdev_priv(dev);
213 win_req_t req;
214 int i, ret; 185 int i, ret;
215 186
216 dev_dbg(&link->dev, "ibmtr_config\n"); 187 dev_dbg(&link->dev, "ibmtr_config\n");
217 188
218 link->conf.ConfigIndex = 0x61;
219 link->io_lines = 16; 189 link->io_lines = 16;
190 link->config_index = 0x61;
220 191
221 /* Determine if this is PRIMARY or ALTERNATE. */ 192 /* Determine if this is PRIMARY or ALTERNATE. */
222 193
@@ -240,39 +211,39 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
240 ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq); 211 ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq);
241 212
242 /* Allocate the MMIO memory window */ 213 /* Allocate the MMIO memory window */
243 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; 214 link->resource[2]->flags |= WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
244 req.Attributes |= WIN_USE_WAIT; 215 link->resource[2]->flags |= WIN_USE_WAIT;
245 req.Base = 0; 216 link->resource[2]->start = 0;
246 req.Size = 0x2000; 217 link->resource[2]->end = 0x2000;
247 req.AccessSpeed = 250; 218 ret = pcmcia_request_window(link, link->resource[2], 250);
248 ret = pcmcia_request_window(link, &req, &link->win);
249 if (ret) 219 if (ret)
250 goto failed; 220 goto failed;
251 221
252 ret = pcmcia_map_mem_page(link, link->win, mmiobase); 222 ret = pcmcia_map_mem_page(link, link->resource[2], mmiobase);
253 if (ret) 223 if (ret)
254 goto failed; 224 goto failed;
255 ti->mmio = ioremap(req.Base, req.Size); 225 ti->mmio = ioremap(link->resource[2]->start,
226 resource_size(link->resource[2]));
256 227
257 /* Allocate the SRAM memory window */ 228 /* Allocate the SRAM memory window */
258 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; 229 link->resource[3]->flags = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
259 req.Attributes |= WIN_USE_WAIT; 230 link->resource[3]->flags |= WIN_USE_WAIT;
260 req.Base = 0; 231 link->resource[3]->start = 0;
261 req.Size = sramsize * 1024; 232 link->resource[3]->end = sramsize * 1024;
262 req.AccessSpeed = 250; 233 ret = pcmcia_request_window(link, link->resource[3], 250);
263 ret = pcmcia_request_window(link, &req, &info->sram_win_handle);
264 if (ret) 234 if (ret)
265 goto failed; 235 goto failed;
266 236
267 ret = pcmcia_map_mem_page(link, info->sram_win_handle, srambase); 237 ret = pcmcia_map_mem_page(link, link->resource[3], srambase);
268 if (ret) 238 if (ret)
269 goto failed; 239 goto failed;
270 240
271 ti->sram_base = srambase >> 12; 241 ti->sram_base = srambase >> 12;
272 ti->sram_virt = ioremap(req.Base, req.Size); 242 ti->sram_virt = ioremap(link->resource[3]->start,
273 ti->sram_phys = req.Base; 243 resource_size(link->resource[3]));
244 ti->sram_phys = link->resource[3]->start;
274 245
275 ret = pcmcia_request_configuration(link, &link->conf); 246 ret = pcmcia_enable_device(link);
276 if (ret) 247 if (ret)
277 goto failed; 248 goto failed;
278 249
@@ -301,14 +272,6 @@ failed:
301 return -ENODEV; 272 return -ENODEV;
302} /* ibmtr_config */ 273} /* ibmtr_config */
303 274
304/*======================================================================
305
306 After a card is removed, ibmtr_release() will unregister the net
307 device, and release the PCMCIA configuration. If the device is
308 still open, this will be postponed until it is closed.
309
310======================================================================*/
311
312static void ibmtr_release(struct pcmcia_device *link) 275static void ibmtr_release(struct pcmcia_device *link)
313{ 276{
314 ibmtr_dev_t *info = link->priv; 277 ibmtr_dev_t *info = link->priv;
@@ -316,7 +279,7 @@ static void ibmtr_release(struct pcmcia_device *link)
316 279
317 dev_dbg(&link->dev, "ibmtr_release\n"); 280 dev_dbg(&link->dev, "ibmtr_release\n");
318 281
319 if (link->win) { 282 if (link->resource[2]->end) {
320 struct tok_info *ti = netdev_priv(dev); 283 struct tok_info *ti = netdev_priv(dev);
321 iounmap(ti->mmio); 284 iounmap(ti->mmio);
322 } 285 }
@@ -398,9 +361,7 @@ MODULE_DEVICE_TABLE(pcmcia, ibmtr_ids);
398 361
399static struct pcmcia_driver ibmtr_cs_driver = { 362static struct pcmcia_driver ibmtr_cs_driver = {
400 .owner = THIS_MODULE, 363 .owner = THIS_MODULE,
401 .drv = { 364 .name = "ibmtr_cs",
402 .name = "ibmtr_cs",
403 },
404 .probe = ibmtr_attach, 365 .probe = ibmtr_attach,
405 .remove = ibmtr_detach, 366 .remove = ibmtr_detach,
406 .id_table = ibmtr_ids, 367 .id_table = ibmtr_ids,
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 68f2deeb3ade..1eca4f5a6e78 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -146,7 +146,6 @@ Include Files
146#include <linux/ioport.h> 146#include <linux/ioport.h>
147#include <linux/bitops.h> 147#include <linux/bitops.h>
148 148
149#include <pcmcia/cs.h>
150#include <pcmcia/cisreg.h> 149#include <pcmcia/cisreg.h>
151#include <pcmcia/cistpl.h> 150#include <pcmcia/cistpl.h>
152#include <pcmcia/ds.h> 151#include <pcmcia/ds.h>
@@ -435,13 +434,6 @@ static const struct net_device_ops mace_netdev_ops = {
435 .ndo_validate_addr = eth_validate_addr, 434 .ndo_validate_addr = eth_validate_addr,
436}; 435};
437 436
438/* ----------------------------------------------------------------------------
439nmclan_attach
440 Creates an "instance" of the driver, allocating local data
441 structures for one device. The device is registered with Card
442 Services.
443---------------------------------------------------------------------------- */
444
445static int nmclan_probe(struct pcmcia_device *link) 437static int nmclan_probe(struct pcmcia_device *link)
446{ 438{
447 mace_private *lp; 439 mace_private *lp;
@@ -460,10 +452,9 @@ static int nmclan_probe(struct pcmcia_device *link)
460 spin_lock_init(&lp->bank_lock); 452 spin_lock_init(&lp->bank_lock);
461 link->resource[0]->end = 32; 453 link->resource[0]->end = 32;
462 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; 454 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
463 link->conf.Attributes = CONF_ENABLE_IRQ; 455 link->config_flags |= CONF_ENABLE_IRQ;
464 link->conf.IntType = INT_MEMORY_AND_IO; 456 link->config_index = 1;
465 link->conf.ConfigIndex = 1; 457 link->config_regs = PRESENT_OPTION;
466 link->conf.Present = PRESENT_OPTION;
467 458
468 lp->tx_free_frames=AM2150_MAX_TX_FRAMES; 459 lp->tx_free_frames=AM2150_MAX_TX_FRAMES;
469 460
@@ -474,14 +465,6 @@ static int nmclan_probe(struct pcmcia_device *link)
474 return nmclan_config(link); 465 return nmclan_config(link);
475} /* nmclan_attach */ 466} /* nmclan_attach */
476 467
477/* ----------------------------------------------------------------------------
478nmclan_detach
479 This deletes a driver "instance". The device is de-registered
480 with Card Services. If it has been released, all local data
481 structures are freed. Otherwise, the structures will be freed
482 when the device is released.
483---------------------------------------------------------------------------- */
484
485static void nmclan_detach(struct pcmcia_device *link) 468static void nmclan_detach(struct pcmcia_device *link)
486{ 469{
487 struct net_device *dev = link->priv; 470 struct net_device *dev = link->priv;
@@ -625,13 +608,6 @@ static int mace_init(mace_private *lp, unsigned int ioaddr, char *enet_addr)
625 return 0; 608 return 0;
626} /* mace_init */ 609} /* mace_init */
627 610
628/* ----------------------------------------------------------------------------
629nmclan_config
630 This routine is scheduled to run after a CARD_INSERTION event
631 is received, to configure the PCMCIA socket, and to make the
632 ethernet device available to the system.
633---------------------------------------------------------------------------- */
634
635static int nmclan_config(struct pcmcia_device *link) 611static int nmclan_config(struct pcmcia_device *link)
636{ 612{
637 struct net_device *dev = link->priv; 613 struct net_device *dev = link->priv;
@@ -650,7 +626,7 @@ static int nmclan_config(struct pcmcia_device *link)
650 ret = pcmcia_request_exclusive_irq(link, mace_interrupt); 626 ret = pcmcia_request_exclusive_irq(link, mace_interrupt);
651 if (ret) 627 if (ret)
652 goto failed; 628 goto failed;
653 ret = pcmcia_request_configuration(link, &link->conf); 629 ret = pcmcia_enable_device(link);
654 if (ret) 630 if (ret)
655 goto failed; 631 goto failed;
656 632
@@ -712,12 +688,6 @@ failed:
712 return -ENODEV; 688 return -ENODEV;
713} /* nmclan_config */ 689} /* nmclan_config */
714 690
715/* ----------------------------------------------------------------------------
716nmclan_release
717 After a card is removed, nmclan_release() will unregister the
718 net device, and release the PCMCIA configuration. If the device
719 is still open, this will be postponed until it is closed.
720---------------------------------------------------------------------------- */
721static void nmclan_release(struct pcmcia_device *link) 691static void nmclan_release(struct pcmcia_device *link)
722{ 692{
723 dev_dbg(&link->dev, "nmclan_release\n"); 693 dev_dbg(&link->dev, "nmclan_release\n");
@@ -1535,9 +1505,7 @@ MODULE_DEVICE_TABLE(pcmcia, nmclan_ids);
1535 1505
1536static struct pcmcia_driver nmclan_cs_driver = { 1506static struct pcmcia_driver nmclan_cs_driver = {
1537 .owner = THIS_MODULE, 1507 .owner = THIS_MODULE,
1538 .drv = { 1508 .name = "nmclan_cs",
1539 .name = "nmclan_cs",
1540 },
1541 .probe = nmclan_probe, 1509 .probe = nmclan_probe,
1542 .remove = nmclan_detach, 1510 .remove = nmclan_detach,
1543 .id_table = nmclan_ids, 1511 .id_table = nmclan_ids,
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index f9b509a6b09a..5d7d1d3088ae 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -42,7 +42,6 @@
42#include <linux/mii.h> 42#include <linux/mii.h>
43#include "../8390.h" 43#include "../8390.h"
44 44
45#include <pcmcia/cs.h>
46#include <pcmcia/cistpl.h> 45#include <pcmcia/cistpl.h>
47#include <pcmcia/ciscode.h> 46#include <pcmcia/ciscode.h>
48#include <pcmcia/ds.h> 47#include <pcmcia/ds.h>
@@ -238,14 +237,6 @@ static const struct net_device_ops pcnet_netdev_ops = {
238#endif 237#endif
239}; 238};
240 239
241/*======================================================================
242
243 pcnet_attach() creates an "instance" of the driver, allocating
244 local data structures for one device. The device is registered
245 with Card Services.
246
247======================================================================*/
248
249static int pcnet_probe(struct pcmcia_device *link) 240static int pcnet_probe(struct pcmcia_device *link)
250{ 241{
251 pcnet_dev_t *info; 242 pcnet_dev_t *info;
@@ -260,23 +251,13 @@ static int pcnet_probe(struct pcmcia_device *link)
260 info->p_dev = link; 251 info->p_dev = link;
261 link->priv = dev; 252 link->priv = dev;
262 253
263 link->conf.Attributes = CONF_ENABLE_IRQ; 254 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
264 link->conf.IntType = INT_MEMORY_AND_IO;
265 255
266 dev->netdev_ops = &pcnet_netdev_ops; 256 dev->netdev_ops = &pcnet_netdev_ops;
267 257
268 return pcnet_config(link); 258 return pcnet_config(link);
269} /* pcnet_attach */ 259} /* pcnet_attach */
270 260
271/*======================================================================
272
273 This deletes a driver "instance". The device is de-registered
274 with Card Services. If it has been released, all local data
275 structures are freed. Otherwise, the structures will be freed
276 when the device is released.
277
278======================================================================*/
279
280static void pcnet_detach(struct pcmcia_device *link) 261static void pcnet_detach(struct pcmcia_device *link)
281{ 262{
282 struct net_device *dev = link->priv; 263 struct net_device *dev = link->priv;
@@ -300,22 +281,22 @@ static void pcnet_detach(struct pcmcia_device *link)
300static hw_info_t *get_hwinfo(struct pcmcia_device *link) 281static hw_info_t *get_hwinfo(struct pcmcia_device *link)
301{ 282{
302 struct net_device *dev = link->priv; 283 struct net_device *dev = link->priv;
303 win_req_t req;
304 u_char __iomem *base, *virt; 284 u_char __iomem *base, *virt;
305 int i, j; 285 int i, j;
306 286
307 /* Allocate a small memory window */ 287 /* Allocate a small memory window */
308 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 288 link->resource[2]->flags |= WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
309 req.Base = 0; req.Size = 0; 289 link->resource[2]->start = 0; link->resource[2]->end = 0;
310 req.AccessSpeed = 0; 290 i = pcmcia_request_window(link, link->resource[2], 0);
311 i = pcmcia_request_window(link, &req, &link->win);
312 if (i != 0) 291 if (i != 0)
313 return NULL; 292 return NULL;
314 293
315 virt = ioremap(req.Base, req.Size); 294 virt = ioremap(link->resource[2]->start,
295 resource_size(link->resource[2]));
316 for (i = 0; i < NR_INFO; i++) { 296 for (i = 0; i < NR_INFO; i++) {
317 pcmcia_map_mem_page(link, link->win, hw_info[i].offset & ~(req.Size-1)); 297 pcmcia_map_mem_page(link, link->resource[2],
318 base = &virt[hw_info[i].offset & (req.Size-1)]; 298 hw_info[i].offset & ~(resource_size(link->resource[2])-1));
299 base = &virt[hw_info[i].offset & (resource_size(link->resource[2])-1)];
319 if ((readb(base+0) == hw_info[i].a0) && 300 if ((readb(base+0) == hw_info[i].a0) &&
320 (readb(base+2) == hw_info[i].a1) && 301 (readb(base+2) == hw_info[i].a1) &&
321 (readb(base+4) == hw_info[i].a2)) { 302 (readb(base+4) == hw_info[i].a2)) {
@@ -326,7 +307,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
326 } 307 }
327 308
328 iounmap(virt); 309 iounmap(virt);
329 j = pcmcia_release_window(link, link->win); 310 j = pcmcia_release_window(link, link->resource[2]);
330 return (i < NR_INFO) ? hw_info+i : NULL; 311 return (i < NR_INFO) ? hw_info+i : NULL;
331} /* get_hwinfo */ 312} /* get_hwinfo */
332 313
@@ -421,7 +402,7 @@ static hw_info_t *get_ax88190(struct pcmcia_device *link)
421 int i, j; 402 int i, j;
422 403
423 /* Not much of a test, but the alternatives are messy */ 404 /* Not much of a test, but the alternatives are messy */
424 if (link->conf.ConfigBase != 0x03c0) 405 if (link->config_base != 0x03c0)
425 return NULL; 406 return NULL;
426 407
427 outb_p(0x01, ioaddr + EN0_DCFG); /* Set word-wide access. */ 408 outb_p(0x01, ioaddr + EN0_DCFG); /* Set word-wide access. */
@@ -463,14 +444,6 @@ static hw_info_t *get_hwired(struct pcmcia_device *link)
463 return &default_info; 444 return &default_info;
464} /* get_hwired */ 445} /* get_hwired */
465 446
466/*======================================================================
467
468 pcnet_config() is scheduled to run after a CARD_INSERTION event
469 is received, to configure the PCMCIA socket, and to make the
470 ethernet device available to the system.
471
472======================================================================*/
473
474static int try_io_port(struct pcmcia_device *link) 447static int try_io_port(struct pcmcia_device *link)
475{ 448{
476 int j, ret; 449 int j, ret;
@@ -502,43 +475,22 @@ static int try_io_port(struct pcmcia_device *link)
502 } 475 }
503} 476}
504 477
505static int pcnet_confcheck(struct pcmcia_device *p_dev, 478static int pcnet_confcheck(struct pcmcia_device *p_dev, void *priv_data)
506 cistpl_cftable_entry_t *cfg,
507 cistpl_cftable_entry_t *dflt,
508 unsigned int vcc,
509 void *priv_data)
510{ 479{
511 int *priv = priv_data; 480 int *priv = priv_data;
512 int try = (*priv & 0x1); 481 int try = (*priv & 0x1);
513 int i;
514 cistpl_io_t *io = &cfg->io;
515 482
516 if (cfg->index == 0 || cfg->io.nwin == 0) 483 *priv &= (p_dev->resource[2]->end >= 0x4000) ? 0x10 : ~0x10;
517 return -EINVAL;
518 484
519 /* For multifunction cards, by convention, we configure the 485 if (p_dev->config_index == 0)
520 network function with window 0, and serial with window 1 */ 486 return -EINVAL;
521 if (io->nwin > 1) {
522 i = (io->win[1].len > io->win[0].len);
523 p_dev->resource[1]->start = io->win[1-i].base;
524 p_dev->resource[1]->end = io->win[1-i].len;
525 } else {
526 i = p_dev->resource[1]->end = 0;
527 }
528 487
529 *priv &= ((cfg->mem.nwin == 1) && 488 if (p_dev->resource[0]->end + p_dev->resource[1]->end < 32)
530 (cfg->mem.win[0].len >= 0x4000)) ? 0x10 : ~0x10; 489 return -EINVAL;
531 490
532 p_dev->resource[0]->start = io->win[i].base; 491 if (try)
533 p_dev->resource[0]->end = io->win[i].len;
534 if (!try)
535 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
536 else
537 p_dev->io_lines = 16; 492 p_dev->io_lines = 16;
538 if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32) 493 return try_io_port(p_dev);
539 return try_io_port(p_dev);
540
541 return -EINVAL;
542} 494}
543 495
544static hw_info_t *pcnet_try_config(struct pcmcia_device *link, 496static hw_info_t *pcnet_try_config(struct pcmcia_device *link,
@@ -560,15 +512,14 @@ static hw_info_t *pcnet_try_config(struct pcmcia_device *link,
560 if (!link->irq) 512 if (!link->irq)
561 return NULL; 513 return NULL;
562 514
563 if (resource_size(link->resource[1]) == 8) { 515 if (resource_size(link->resource[1]) == 8)
564 link->conf.Attributes |= CONF_ENABLE_SPKR; 516 link->config_flags |= CONF_ENABLE_SPKR;
565 link->conf.Status = CCSR_AUDIO_ENA; 517
566 }
567 if ((link->manf_id == MANFID_IBM) && 518 if ((link->manf_id == MANFID_IBM) &&
568 (link->card_id == PRODID_IBM_HOME_AND_AWAY)) 519 (link->card_id == PRODID_IBM_HOME_AND_AWAY))
569 link->conf.ConfigIndex |= 0x10; 520 link->config_index |= 0x10;
570 521
571 ret = pcmcia_request_configuration(link, &link->conf); 522 ret = pcmcia_enable_device(link);
572 if (ret) 523 if (ret)
573 return NULL; 524 return NULL;
574 525
@@ -583,7 +534,7 @@ static hw_info_t *pcnet_try_config(struct pcmcia_device *link,
583 } else 534 } else
584 dev->if_port = 0; 535 dev->if_port = 0;
585 536
586 if ((link->conf.ConfigBase == 0x03c0) && 537 if ((link->config_base == 0x03c0) &&
587 (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) { 538 (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) {
588 dev_info(&link->dev, 539 dev_info(&link->dev,
589 "this is an AX88190 card - use axnet_cs instead.\n"); 540 "this is an AX88190 card - use axnet_cs instead.\n");
@@ -689,14 +640,6 @@ failed:
689 return -ENODEV; 640 return -ENODEV;
690} /* pcnet_config */ 641} /* pcnet_config */
691 642
692/*======================================================================
693
694 After a card is removed, pcnet_release() will unregister the net
695 device, and release the PCMCIA configuration. If the device is
696 still open, this will be postponed until it is closed.
697
698======================================================================*/
699
700static void pcnet_release(struct pcmcia_device *link) 643static void pcnet_release(struct pcmcia_device *link)
701{ 644{
702 pcnet_dev_t *info = PRIV(link->priv); 645 pcnet_dev_t *info = PRIV(link->priv);
@@ -709,15 +652,6 @@ static void pcnet_release(struct pcmcia_device *link)
709 pcmcia_disable_device(link); 652 pcmcia_disable_device(link);
710} 653}
711 654
712/*======================================================================
713
714 The card status event handler. Mostly, this schedules other
715 stuff to run after an event is received. A CARD_REMOVAL event
716 also sets some flags to discourage the net drivers from trying
717 to talk to the card any more.
718
719======================================================================*/
720
721static int pcnet_suspend(struct pcmcia_device *link) 655static int pcnet_suspend(struct pcmcia_device *link)
722{ 656{
723 struct net_device *dev = link->priv; 657 struct net_device *dev = link->priv;
@@ -1486,7 +1420,6 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1486{ 1420{
1487 struct net_device *dev = link->priv; 1421 struct net_device *dev = link->priv;
1488 pcnet_dev_t *info = PRIV(dev); 1422 pcnet_dev_t *info = PRIV(dev);
1489 win_req_t req;
1490 int i, window_size, offset, ret; 1423 int i, window_size, offset, ret;
1491 1424
1492 window_size = (stop_pg - start_pg) << 8; 1425 window_size = (stop_pg - start_pg) << 8;
@@ -1497,22 +1430,22 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1497 window_size = roundup_pow_of_two(window_size); 1430 window_size = roundup_pow_of_two(window_size);
1498 1431
1499 /* Allocate a memory window */ 1432 /* Allocate a memory window */
1500 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; 1433 link->resource[3]->flags |= WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
1501 req.Attributes |= WIN_USE_WAIT; 1434 link->resource[3]->flags |= WIN_USE_WAIT;
1502 req.Base = 0; req.Size = window_size; 1435 link->resource[3]->start = 0; link->resource[3]->end = window_size;
1503 req.AccessSpeed = mem_speed; 1436 ret = pcmcia_request_window(link, link->resource[3], mem_speed);
1504 ret = pcmcia_request_window(link, &req, &link->win);
1505 if (ret) 1437 if (ret)
1506 goto failed; 1438 goto failed;
1507 1439
1508 offset = (start_pg << 8) + cm_offset; 1440 offset = (start_pg << 8) + cm_offset;
1509 offset -= offset % window_size; 1441 offset -= offset % window_size;
1510 ret = pcmcia_map_mem_page(link, link->win, offset); 1442 ret = pcmcia_map_mem_page(link, link->resource[3], offset);
1511 if (ret) 1443 if (ret)
1512 goto failed; 1444 goto failed;
1513 1445
1514 /* Try scribbling on the buffer */ 1446 /* Try scribbling on the buffer */
1515 info->base = ioremap(req.Base, window_size); 1447 info->base = ioremap(link->resource[3]->start,
1448 resource_size(link->resource[3]));
1516 for (i = 0; i < (TX_PAGES<<8); i += 2) 1449 for (i = 0; i < (TX_PAGES<<8); i += 2)
1517 __raw_writew((i>>1), info->base+offset+i); 1450 __raw_writew((i>>1), info->base+offset+i);
1518 udelay(100); 1451 udelay(100);
@@ -1521,19 +1454,20 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1521 pcnet_reset_8390(dev); 1454 pcnet_reset_8390(dev);
1522 if (i != (TX_PAGES<<8)) { 1455 if (i != (TX_PAGES<<8)) {
1523 iounmap(info->base); 1456 iounmap(info->base);
1524 pcmcia_release_window(link, link->win); 1457 pcmcia_release_window(link, link->resource[3]);
1525 info->base = NULL; link->win = 0; 1458 info->base = NULL;
1526 goto failed; 1459 goto failed;
1527 } 1460 }
1528 1461
1529 ei_status.mem = info->base + offset; 1462 ei_status.mem = info->base + offset;
1530 ei_status.priv = req.Size; 1463 ei_status.priv = resource_size(link->resource[3]);
1531 dev->mem_start = (u_long)ei_status.mem; 1464 dev->mem_start = (u_long)ei_status.mem;
1532 dev->mem_end = dev->mem_start + req.Size; 1465 dev->mem_end = dev->mem_start + resource_size(link->resource[3]);
1533 1466
1534 ei_status.tx_start_page = start_pg; 1467 ei_status.tx_start_page = start_pg;
1535 ei_status.rx_start_page = start_pg + TX_PAGES; 1468 ei_status.rx_start_page = start_pg + TX_PAGES;
1536 ei_status.stop_page = start_pg + ((req.Size - offset) >> 8); 1469 ei_status.stop_page = start_pg + (
1470 (resource_size(link->resource[3]) - offset) >> 8);
1537 1471
1538 /* set up block i/o functions */ 1472 /* set up block i/o functions */
1539 ei_status.get_8390_hdr = &shmem_get_8390_hdr; 1473 ei_status.get_8390_hdr = &shmem_get_8390_hdr;
@@ -1772,9 +1706,7 @@ MODULE_FIRMWARE("cis/PE-200.cis");
1772MODULE_FIRMWARE("cis/tamarack.cis"); 1706MODULE_FIRMWARE("cis/tamarack.cis");
1773 1707
1774static struct pcmcia_driver pcnet_driver = { 1708static struct pcmcia_driver pcnet_driver = {
1775 .drv = { 1709 .name = "pcnet_cs",
1776 .name = "pcnet_cs",
1777 },
1778 .probe = pcnet_probe, 1710 .probe = pcnet_probe,
1779 .remove = pcnet_detach, 1711 .remove = pcnet_detach,
1780 .owner = THIS_MODULE, 1712 .owner = THIS_MODULE,
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 377367d03b41..0af2fc8ec164 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -44,7 +44,6 @@
44#include <linux/jiffies.h> 44#include <linux/jiffies.h>
45#include <linux/firmware.h> 45#include <linux/firmware.h>
46 46
47#include <pcmcia/cs.h>
48#include <pcmcia/cistpl.h> 47#include <pcmcia/cistpl.h>
49#include <pcmcia/cisreg.h> 48#include <pcmcia/cisreg.h>
50#include <pcmcia/ciscode.h> 49#include <pcmcia/ciscode.h>
@@ -300,14 +299,6 @@ static const struct net_device_ops smc_netdev_ops = {
300 .ndo_validate_addr = eth_validate_addr, 299 .ndo_validate_addr = eth_validate_addr,
301}; 300};
302 301
303/*======================================================================
304
305 smc91c92_attach() creates an "instance" of the driver, allocating
306 local data structures for one device. The device is registered
307 with Card Services.
308
309======================================================================*/
310
311static int smc91c92_probe(struct pcmcia_device *link) 302static int smc91c92_probe(struct pcmcia_device *link)
312{ 303{
313 struct smc_private *smc; 304 struct smc_private *smc;
@@ -324,10 +315,6 @@ static int smc91c92_probe(struct pcmcia_device *link)
324 link->priv = dev; 315 link->priv = dev;
325 316
326 spin_lock_init(&smc->lock); 317 spin_lock_init(&smc->lock);
327 link->resource[0]->end = 16;
328 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
329 link->conf.Attributes = CONF_ENABLE_IRQ;
330 link->conf.IntType = INT_MEMORY_AND_IO;
331 318
332 /* The SMC91c92-specific entries in the device structure. */ 319 /* The SMC91c92-specific entries in the device structure. */
333 dev->netdev_ops = &smc_netdev_ops; 320 dev->netdev_ops = &smc_netdev_ops;
@@ -343,15 +330,6 @@ static int smc91c92_probe(struct pcmcia_device *link)
343 return smc91c92_config(link); 330 return smc91c92_config(link);
344} /* smc91c92_attach */ 331} /* smc91c92_attach */
345 332
346/*======================================================================
347
348 This deletes a driver "instance". The device is de-registered
349 with Card Services. If it has been released, all local data
350 structures are freed. Otherwise, the structures will be freed
351 when the device is released.
352
353======================================================================*/
354
355static void smc91c92_detach(struct pcmcia_device *link) 333static void smc91c92_detach(struct pcmcia_device *link)
356{ 334{
357 struct net_device *dev = link->priv; 335 struct net_device *dev = link->priv;
@@ -412,26 +390,28 @@ static int mhz_3288_power(struct pcmcia_device *link)
412 mdelay(200); 390 mdelay(200);
413 391
414 /* Now read and write the COR... */ 392 /* Now read and write the COR... */
415 tmp = readb(smc->base + link->conf.ConfigBase + CISREG_COR); 393 tmp = readb(smc->base + link->config_base + CISREG_COR);
416 udelay(5); 394 udelay(5);
417 writeb(tmp, smc->base + link->conf.ConfigBase + CISREG_COR); 395 writeb(tmp, smc->base + link->config_base + CISREG_COR);
418 396
419 return 0; 397 return 0;
420} 398}
421 399
422static int mhz_mfc_config_check(struct pcmcia_device *p_dev, 400static int mhz_mfc_config_check(struct pcmcia_device *p_dev, void *priv_data)
423 cistpl_cftable_entry_t *cf,
424 cistpl_cftable_entry_t *dflt,
425 unsigned int vcc,
426 void *priv_data)
427{ 401{
428 int k; 402 int k;
429 p_dev->resource[1]->start = cf->io.win[0].base; 403 p_dev->io_lines = 16;
404 p_dev->resource[1]->start = p_dev->resource[0]->start;
405 p_dev->resource[1]->end = 8;
406 p_dev->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
407 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
408 p_dev->resource[0]->end = 16;
409 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
410 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
430 for (k = 0; k < 0x400; k += 0x10) { 411 for (k = 0; k < 0x400; k += 0x10) {
431 if (k & 0x80) 412 if (k & 0x80)
432 continue; 413 continue;
433 p_dev->resource[0]->start = k ^ 0x300; 414 p_dev->resource[0]->start = k ^ 0x300;
434 p_dev->io_lines = 16;
435 if (!pcmcia_request_io(p_dev)) 415 if (!pcmcia_request_io(p_dev))
436 return 0; 416 return 0;
437 } 417 }
@@ -442,14 +422,11 @@ static int mhz_mfc_config(struct pcmcia_device *link)
442{ 422{
443 struct net_device *dev = link->priv; 423 struct net_device *dev = link->priv;
444 struct smc_private *smc = netdev_priv(dev); 424 struct smc_private *smc = netdev_priv(dev);
445 win_req_t req;
446 unsigned int offset; 425 unsigned int offset;
447 int i; 426 int i;
448 427
449 link->conf.Attributes |= CONF_ENABLE_SPKR; 428 link->config_flags |= CONF_ENABLE_SPKR | CONF_ENABLE_IRQ |
450 link->conf.Status = CCSR_AUDIO_ENA; 429 CONF_AUTO_SET_IO;
451 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
452 link->resource[1]->end = 8;
453 430
454 /* The Megahertz combo cards have modem-like CIS entries, so 431 /* The Megahertz combo cards have modem-like CIS entries, so
455 we have to explicitly try a bunch of port combinations. */ 432 we have to explicitly try a bunch of port combinations. */
@@ -459,16 +436,16 @@ static int mhz_mfc_config(struct pcmcia_device *link)
459 dev->base_addr = link->resource[0]->start; 436 dev->base_addr = link->resource[0]->start;
460 437
461 /* Allocate a memory window, for accessing the ISR */ 438 /* Allocate a memory window, for accessing the ISR */
462 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 439 link->resource[2]->flags = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
463 req.Base = req.Size = 0; 440 link->resource[2]->start = link->resource[2]->end = 0;
464 req.AccessSpeed = 0; 441 i = pcmcia_request_window(link, link->resource[2], 0);
465 i = pcmcia_request_window(link, &req, &link->win);
466 if (i != 0) 442 if (i != 0)
467 return -ENODEV; 443 return -ENODEV;
468 444
469 smc->base = ioremap(req.Base, req.Size); 445 smc->base = ioremap(link->resource[2]->start,
470 offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0; 446 resource_size(link->resource[2]));
471 i = pcmcia_map_mem_page(link, link->win, offset); 447 offset = (smc->manfid == MANFID_MOTOROLA) ? link->config_base : 0;
448 i = pcmcia_map_mem_page(link, link->resource[2], offset);
472 if ((i == 0) && 449 if ((i == 0) &&
473 (smc->manfid == MANFID_MEGAHERTZ) && 450 (smc->manfid == MANFID_MEGAHERTZ) &&
474 (smc->cardid == PRODID_MEGAHERTZ_EM3288)) 451 (smc->cardid == PRODID_MEGAHERTZ_EM3288))
@@ -591,14 +568,12 @@ static int mot_setup(struct pcmcia_device *link)
591 568
592/*====================================================================*/ 569/*====================================================================*/
593 570
594static int smc_configcheck(struct pcmcia_device *p_dev, 571static int smc_configcheck(struct pcmcia_device *p_dev, void *priv_data)
595 cistpl_cftable_entry_t *cf,
596 cistpl_cftable_entry_t *dflt,
597 unsigned int vcc,
598 void *priv_data)
599{ 572{
600 p_dev->resource[0]->start = cf->io.win[0].base; 573 p_dev->resource[0]->end = 16;
601 p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK; 574 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
575 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
576
602 return pcmcia_request_io(p_dev); 577 return pcmcia_request_io(p_dev);
603} 578}
604 579
@@ -607,7 +582,8 @@ static int smc_config(struct pcmcia_device *link)
607 struct net_device *dev = link->priv; 582 struct net_device *dev = link->priv;
608 int i; 583 int i;
609 584
610 link->resource[0]->end = 16; 585 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
586
611 i = pcmcia_loop_config(link, smc_configcheck, NULL); 587 i = pcmcia_loop_config(link, smc_configcheck, NULL);
612 if (!i) 588 if (!i)
613 dev->base_addr = link->resource[0]->start; 589 dev->base_addr = link->resource[0]->start;
@@ -640,15 +616,14 @@ static int osi_config(struct pcmcia_device *link)
640 static const unsigned int com[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; 616 static const unsigned int com[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
641 int i, j; 617 int i, j;
642 618
643 link->conf.Attributes |= CONF_ENABLE_SPKR; 619 link->config_flags |= CONF_ENABLE_SPKR | CONF_ENABLE_IRQ;
644 link->conf.Status = CCSR_AUDIO_ENA;
645 link->resource[0]->end = 64; 620 link->resource[0]->end = 64;
646 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; 621 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
647 link->resource[1]->end = 8; 622 link->resource[1]->end = 8;
648 623
649 /* Enable Hard Decode, LAN, Modem */ 624 /* Enable Hard Decode, LAN, Modem */
650 link->conf.ConfigIndex = 0x23;
651 link->io_lines = 16; 625 link->io_lines = 16;
626 link->config_index = 0x23;
652 627
653 for (i = j = 0; j < 4; j++) { 628 for (i = j = 0; j < 4; j++) {
654 link->resource[1]->start = com[j]; 629 link->resource[1]->start = com[j];
@@ -658,7 +633,7 @@ static int osi_config(struct pcmcia_device *link)
658 } 633 }
659 if (i != 0) { 634 if (i != 0) {
660 /* Fallback: turn off hard decode */ 635 /* Fallback: turn off hard decode */
661 link->conf.ConfigIndex = 0x03; 636 link->config_index = 0x03;
662 link->resource[1]->end = 0; 637 link->resource[1]->end = 0;
663 i = pcmcia_request_io(link); 638 i = pcmcia_request_io(link);
664 } 639 }
@@ -817,27 +792,16 @@ static int check_sig(struct pcmcia_device *link)
817 } 792 }
818 793
819 if (width) { 794 if (width) {
820 modconf_t mod = {
821 .Attributes = CONF_IO_CHANGE_WIDTH,
822 };
823 printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n"); 795 printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n");
824 796
825 smc91c92_suspend(link); 797 smc91c92_suspend(link);
826 pcmcia_modify_configuration(link, &mod); 798 pcmcia_fixup_iowidth(link);
827 smc91c92_resume(link); 799 smc91c92_resume(link);
828 return check_sig(link); 800 return check_sig(link);
829 } 801 }
830 return -ENODEV; 802 return -ENODEV;
831} 803}
832 804
833/*======================================================================
834
835 smc91c92_config() is scheduled to run after a CARD_INSERTION event
836 is received, to configure the PCMCIA socket, and to make the
837 ethernet device available to the system.
838
839======================================================================*/
840
841static int smc91c92_config(struct pcmcia_device *link) 805static int smc91c92_config(struct pcmcia_device *link)
842{ 806{
843 struct net_device *dev = link->priv; 807 struct net_device *dev = link->priv;
@@ -869,7 +833,7 @@ static int smc91c92_config(struct pcmcia_device *link)
869 i = pcmcia_request_irq(link, smc_interrupt); 833 i = pcmcia_request_irq(link, smc_interrupt);
870 if (i) 834 if (i)
871 goto config_failed; 835 goto config_failed;
872 i = pcmcia_request_configuration(link, &link->conf); 836 i = pcmcia_enable_device(link);
873 if (i) 837 if (i)
874 goto config_failed; 838 goto config_failed;
875 839
@@ -988,18 +952,10 @@ config_failed:
988 return -ENODEV; 952 return -ENODEV;
989} /* smc91c92_config */ 953} /* smc91c92_config */
990 954
991/*======================================================================
992
993 After a card is removed, smc91c92_release() will unregister the net
994 device, and release the PCMCIA configuration. If the device is
995 still open, this will be postponed until it is closed.
996
997======================================================================*/
998
999static void smc91c92_release(struct pcmcia_device *link) 955static void smc91c92_release(struct pcmcia_device *link)
1000{ 956{
1001 dev_dbg(&link->dev, "smc91c92_release\n"); 957 dev_dbg(&link->dev, "smc91c92_release\n");
1002 if (link->win) { 958 if (link->resource[2]->end) {
1003 struct net_device *dev = link->priv; 959 struct net_device *dev = link->priv;
1004 struct smc_private *smc = netdev_priv(dev); 960 struct smc_private *smc = netdev_priv(dev);
1005 iounmap(smc->base); 961 iounmap(smc->base);
@@ -2101,9 +2057,7 @@ MODULE_DEVICE_TABLE(pcmcia, smc91c92_ids);
2101 2057
2102static struct pcmcia_driver smc91c92_cs_driver = { 2058static struct pcmcia_driver smc91c92_cs_driver = {
2103 .owner = THIS_MODULE, 2059 .owner = THIS_MODULE,
2104 .drv = { 2060 .name = "smc91c92_cs",
2105 .name = "smc91c92_cs",
2106 },
2107 .probe = smc91c92_probe, 2061 .probe = smc91c92_probe,
2108 .remove = smc91c92_detach, 2062 .remove = smc91c92_detach,
2109 .id_table = smc91c92_ids, 2063 .id_table = smc91c92_ids,
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index f5819526b5ee..1fece617c069 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -82,7 +82,6 @@
82#include <linux/bitops.h> 82#include <linux/bitops.h>
83#include <linux/mii.h> 83#include <linux/mii.h>
84 84
85#include <pcmcia/cs.h>
86#include <pcmcia/cistpl.h> 85#include <pcmcia/cistpl.h>
87#include <pcmcia/cisreg.h> 86#include <pcmcia/cisreg.h>
88#include <pcmcia/ciscode.h> 87#include <pcmcia/ciscode.h>
@@ -267,33 +266,11 @@ static unsigned mii_rd(unsigned int ioaddr, u_char phyaddr, u_char phyreg);
267static void mii_wr(unsigned int ioaddr, u_char phyaddr, u_char phyreg, 266static void mii_wr(unsigned int ioaddr, u_char phyaddr, u_char phyreg,
268 unsigned data, int len); 267 unsigned data, int len);
269 268
270/*
271 * The event() function is this driver's Card Services event handler.
272 * It will be called by Card Services when an appropriate card status
273 * event is received. The config() and release() entry points are
274 * used to configure or release a socket, in response to card insertion
275 * and ejection events. They are invoked from the event handler.
276 */
277
278static int has_ce2_string(struct pcmcia_device * link); 269static int has_ce2_string(struct pcmcia_device * link);
279static int xirc2ps_config(struct pcmcia_device * link); 270static int xirc2ps_config(struct pcmcia_device * link);
280static void xirc2ps_release(struct pcmcia_device * link); 271static void xirc2ps_release(struct pcmcia_device * link);
281
282/****************
283 * The attach() and detach() entry points are used to create and destroy
284 * "instances" of the driver, where each instance represents everything
285 * needed to manage one actual PCMCIA card.
286 */
287
288static void xirc2ps_detach(struct pcmcia_device *p_dev); 272static void xirc2ps_detach(struct pcmcia_device *p_dev);
289 273
290/****************
291 * You'll also need to prototype all the functions that will actually
292 * be used to talk to your device. See 'pcmem_cs' for a good example
293 * of a fully self-sufficient driver; the other drivers rely more or
294 * less on other parts of the kernel.
295 */
296
297static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); 274static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id);
298 275
299typedef struct local_info_t { 276typedef struct local_info_t {
@@ -501,16 +478,6 @@ static const struct net_device_ops netdev_ops = {
501 .ndo_validate_addr = eth_validate_addr, 478 .ndo_validate_addr = eth_validate_addr,
502}; 479};
503 480
504/****************
505 * xirc2ps_attach() creates an "instance" of the driver, allocating
506 * local data structures for one device. The device is registered
507 * with Card Services.
508 *
509 * The dev_link structure is initialized, but we don't actually
510 * configure the card at this point -- we wait until we receive a
511 * card insertion event.
512 */
513
514static int 481static int
515xirc2ps_probe(struct pcmcia_device *link) 482xirc2ps_probe(struct pcmcia_device *link)
516{ 483{
@@ -529,9 +496,7 @@ xirc2ps_probe(struct pcmcia_device *link)
529 link->priv = dev; 496 link->priv = dev;
530 497
531 /* General socket configuration */ 498 /* General socket configuration */
532 link->conf.Attributes = CONF_ENABLE_IRQ; 499 link->config_index = 1;
533 link->conf.IntType = INT_MEMORY_AND_IO;
534 link->conf.ConfigIndex = 1;
535 500
536 /* Fill in card specific entries */ 501 /* Fill in card specific entries */
537 dev->netdev_ops = &netdev_ops; 502 dev->netdev_ops = &netdev_ops;
@@ -542,13 +507,6 @@ xirc2ps_probe(struct pcmcia_device *link)
542 return xirc2ps_config(link); 507 return xirc2ps_config(link);
543} /* xirc2ps_attach */ 508} /* xirc2ps_attach */
544 509
545/****************
546 * This deletes a driver "instance". The device is de-registered
547 * with Card Services. If it has been released, all local data
548 * structures are freed. Otherwise, the structures will be freed
549 * when the device is released.
550 */
551
552static void 510static void
553xirc2ps_detach(struct pcmcia_device *link) 511xirc2ps_detach(struct pcmcia_device *link)
554{ 512{
@@ -667,44 +625,53 @@ has_ce2_string(struct pcmcia_device * p_dev)
667} 625}
668 626
669static int 627static int
670xirc2ps_config_modem(struct pcmcia_device *p_dev, 628xirc2ps_config_modem(struct pcmcia_device *p_dev, void *priv_data)
671 cistpl_cftable_entry_t *cf,
672 cistpl_cftable_entry_t *dflt,
673 unsigned int vcc,
674 void *priv_data)
675{ 629{
676 unsigned int ioaddr; 630 unsigned int ioaddr;
677 631
678 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) { 632 if ((p_dev->resource[0]->start & 0xf) == 8)
679 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 633 return -ENODEV;
680 p_dev->resource[1]->start = cf->io.win[0].base; 634
681 p_dev->resource[0]->start = ioaddr; 635 p_dev->resource[0]->end = 16;
682 if (!pcmcia_request_io(p_dev)) 636 p_dev->resource[1]->end = 8;
683 return 0; 637 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
684 } 638 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
639 p_dev->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
640 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
641 p_dev->io_lines = 10;
642
643 p_dev->resource[1]->start = p_dev->resource[0]->start;
644 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
645 p_dev->resource[0]->start = ioaddr;
646 if (!pcmcia_request_io(p_dev))
647 return 0;
685 } 648 }
686 return -ENODEV; 649 return -ENODEV;
687} 650}
688 651
689static int 652static int
690xirc2ps_config_check(struct pcmcia_device *p_dev, 653xirc2ps_config_check(struct pcmcia_device *p_dev, void *priv_data)
691 cistpl_cftable_entry_t *cf,
692 cistpl_cftable_entry_t *dflt,
693 unsigned int vcc,
694 void *priv_data)
695{ 654{
696 int *pass = priv_data; 655 int *pass = priv_data;
656 resource_size_t tmp = p_dev->resource[1]->start;
697 657
698 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) { 658 tmp += (*pass ? (p_dev->config_index & 0x20 ? -24 : 8)
699 p_dev->resource[1]->start = cf->io.win[0].base; 659 : (p_dev->config_index & 0x20 ? 8 : -24));
700 p_dev->resource[0]->start = p_dev->resource[1]->start 660
701 + (*pass ? (cf->index & 0x20 ? -24:8) 661 if ((p_dev->resource[0]->start & 0xf) == 8)
702 : (cf->index & 0x20 ? 8:-24)); 662 return -ENODEV;
703 if (!pcmcia_request_io(p_dev)) 663
704 return 0; 664 p_dev->resource[0]->end = 18;
705 } 665 p_dev->resource[1]->end = 8;
706 return -ENODEV; 666 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
667 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
668 p_dev->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
669 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
670 p_dev->io_lines = 10;
707 671
672 p_dev->resource[1]->start = p_dev->resource[0]->start;
673 p_dev->resource[0]->start = tmp;
674 return pcmcia_request_io(p_dev);
708} 675}
709 676
710 677
@@ -727,11 +694,6 @@ static int pcmcia_get_mac_ce(struct pcmcia_device *p_dev,
727}; 694};
728 695
729 696
730/****************
731 * xirc2ps_config() is scheduled to run after a CARD_INSERTION event
732 * is received, to configure the PCMCIA socket, and to make the
733 * ethernet device available to the system.
734 */
735static int 697static int
736xirc2ps_config(struct pcmcia_device * link) 698xirc2ps_config(struct pcmcia_device * link)
737{ 699{
@@ -807,32 +769,24 @@ xirc2ps_config(struct pcmcia_device * link)
807 goto failure; 769 goto failure;
808 } 770 }
809 771
810 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
811 link->io_lines = 10;
812 if (local->modem) { 772 if (local->modem) {
813 int pass; 773 int pass;
774 link->config_flags |= CONF_AUTO_SET_IO;
814 775
815 if (do_sound) {
816 link->conf.Attributes |= CONF_ENABLE_SPKR;
817 link->conf.Status |= CCSR_AUDIO_ENA;
818 }
819 link->resource[1]->end = 8;
820 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
821 if (local->dingo) { 776 if (local->dingo) {
822 /* Take the Modem IO port from the CIS and scan for a free 777 /* Take the Modem IO port from the CIS and scan for a free
823 * Ethernet port */ 778 * Ethernet port */
824 link->resource[0]->end = 16; /* no Mako stuff anymore */
825 if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL)) 779 if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL))
826 goto port_found; 780 goto port_found;
827 } else { 781 } else {
828 link->resource[0]->end = 18;
829 /* We do 2 passes here: The first one uses the regular mapping and 782 /* We do 2 passes here: The first one uses the regular mapping and
830 * the second tries again, thereby considering that the 32 ports are 783 * the second tries again, thereby considering that the 32 ports are
831 * mirrored every 32 bytes. Actually we use a mirrored port for 784 * mirrored every 32 bytes. Actually we use a mirrored port for
832 * the Mako if (on the first pass) the COR bit 5 is set. 785 * the Mako if (on the first pass) the COR bit 5 is set.
833 */ 786 */
834 for (pass=0; pass < 2; pass++) 787 for (pass=0; pass < 2; pass++)
835 if (!pcmcia_loop_config(link, xirc2ps_config_check, &pass)) 788 if (!pcmcia_loop_config(link, xirc2ps_config_check,
789 &pass))
836 goto port_found; 790 goto port_found;
837 /* if special option: 791 /* if special option:
838 * try to configure as Ethernet only. 792 * try to configure as Ethernet only.
@@ -840,7 +794,9 @@ xirc2ps_config(struct pcmcia_device * link)
840 } 794 }
841 printk(KNOT_XIRC "no ports available\n"); 795 printk(KNOT_XIRC "no ports available\n");
842 } else { 796 } else {
797 link->io_lines = 10;
843 link->resource[0]->end = 16; 798 link->resource[0]->end = 16;
799 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
844 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 800 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
845 link->resource[0]->start = ioaddr; 801 link->resource[0]->start = ioaddr;
846 if (!(err = pcmcia_request_io(link))) 802 if (!(err = pcmcia_request_io(link)))
@@ -861,16 +817,14 @@ xirc2ps_config(struct pcmcia_device * link)
861 if ((err=pcmcia_request_irq(link, xirc2ps_interrupt))) 817 if ((err=pcmcia_request_irq(link, xirc2ps_interrupt)))
862 goto config_error; 818 goto config_error;
863 819
864 /**************** 820 link->config_flags |= CONF_ENABLE_IRQ;
865 * This actually configures the PCMCIA socket -- setting up 821 if (do_sound)
866 * the I/O windows and the interrupt mapping. 822 link->config_flags |= CONF_ENABLE_SPKR;
867 */ 823
868 if ((err=pcmcia_request_configuration(link, &link->conf))) 824 if ((err = pcmcia_enable_device(link)))
869 goto config_error; 825 goto config_error;
870 826
871 if (local->dingo) { 827 if (local->dingo) {
872 win_req_t req;
873
874 /* Reset the modem's BAR to the correct value 828 /* Reset the modem's BAR to the correct value
875 * This is necessary because in the RequestConfiguration call, 829 * This is necessary because in the RequestConfiguration call,
876 * the base address of the ethernet port (BasePort1) is written 830 * the base address of the ethernet port (BasePort1) is written
@@ -890,14 +844,14 @@ xirc2ps_config(struct pcmcia_device * link)
890 * is at 0x0800. So we allocate a window into the attribute 844 * is at 0x0800. So we allocate a window into the attribute
891 * memory and write direct to the CIS registers 845 * memory and write direct to the CIS registers
892 */ 846 */
893 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 847 link->resource[2]->flags = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_AM |
894 req.Base = req.Size = 0; 848 WIN_ENABLE;
895 req.AccessSpeed = 0; 849 link->resource[2]->start = link->resource[2]->end = 0;
896 if ((err = pcmcia_request_window(link, &req, &link->win))) 850 if ((err = pcmcia_request_window(link, link->resource[2], 0)))
897 goto config_error; 851 goto config_error;
898 852
899 local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; 853 local->dingo_ccr = ioremap(link->resource[2]->start, 0x1000) + 0x0800;
900 if ((err = pcmcia_map_mem_page(link, link->win, 0))) 854 if ((err = pcmcia_map_mem_page(link, link->resource[2], 0)))
901 goto config_error; 855 goto config_error;
902 856
903 /* Setup the CCRs; there are no infos in the CIS about the Ethernet 857 /* Setup the CCRs; there are no infos in the CIS about the Ethernet
@@ -978,17 +932,12 @@ xirc2ps_config(struct pcmcia_device * link)
978 return -ENODEV; 932 return -ENODEV;
979} /* xirc2ps_config */ 933} /* xirc2ps_config */
980 934
981/****************
982 * After a card is removed, xirc2ps_release() will unregister the net
983 * device, and release the PCMCIA configuration. If the device is
984 * still open, this will be postponed until it is closed.
985 */
986static void 935static void
987xirc2ps_release(struct pcmcia_device *link) 936xirc2ps_release(struct pcmcia_device *link)
988{ 937{
989 dev_dbg(&link->dev, "release\n"); 938 dev_dbg(&link->dev, "release\n");
990 939
991 if (link->win) { 940 if (link->resource[2]->end) {
992 struct net_device *dev = link->priv; 941 struct net_device *dev = link->priv;
993 local_info_t *local = netdev_priv(dev); 942 local_info_t *local = netdev_priv(dev);
994 if (local->dingo) 943 if (local->dingo)
@@ -1830,9 +1779,7 @@ MODULE_DEVICE_TABLE(pcmcia, xirc2ps_ids);
1830 1779
1831static struct pcmcia_driver xirc2ps_cs_driver = { 1780static struct pcmcia_driver xirc2ps_cs_driver = {
1832 .owner = THIS_MODULE, 1781 .owner = THIS_MODULE,
1833 .drv = { 1782 .name = "xirc2ps_cs",
1834 .name = "xirc2ps_cs",
1835 },
1836 .probe = xirc2ps_probe, 1783 .probe = xirc2ps_probe,
1837 .remove = xirc2ps_detach, 1784 .remove = xirc2ps_detach,
1838 .id_table = xirc2ps_ids, 1785 .id_table = xirc2ps_ids,