aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/fmvj18x_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia/fmvj18x_cs.c')
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index bba6369a028e..699304480aed 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -248,9 +248,8 @@ static int fmvj18x_probe(struct pcmcia_device *link)
248 lp->base = NULL; 248 lp->base = NULL;
249 249
250 /* The io structure describes IO port mapping */ 250 /* The io structure describes IO port mapping */
251 link->io.NumPorts1 = 32; 251 link->resource[0]->end = 32;
252 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 252 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
253 link->io.IOAddrLines = 5;
254 253
255 /* General socket configuration */ 254 /* General socket configuration */
256 link->conf.Attributes = CONF_ENABLE_IRQ; 255 link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -288,13 +287,13 @@ static int mfc_try_io_port(struct pcmcia_device *link)
288 { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 287 { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
289 288
290 for (i = 0; i < 5; i++) { 289 for (i = 0; i < 5; i++) {
291 link->io.BasePort2 = serial_base[i]; 290 link->resource[1]->start = serial_base[i];
292 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 291 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
293 if (link->io.BasePort2 == 0) { 292 if (link->resource[1]->start == 0) {
294 link->io.NumPorts2 = 0; 293 link->resource[1]->end = 0;
295 printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); 294 printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n");
296 } 295 }
297 ret = pcmcia_request_io(link, &link->io); 296 ret = pcmcia_request_io(link);
298 if (ret == 0) 297 if (ret == 0)
299 return ret; 298 return ret;
300 } 299 }
@@ -310,8 +309,8 @@ static int ungermann_try_io_port(struct pcmcia_device *link)
310 0x380,0x3c0 only for ioport. 309 0x380,0x3c0 only for ioport.
311 */ 310 */
312 for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { 311 for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) {
313 link->io.BasePort1 = ioaddr; 312 link->resource[0]->start = ioaddr;
314 ret = pcmcia_request_io(link, &link->io); 313 ret = pcmcia_request_io(link);
315 if (ret == 0) { 314 if (ret == 0) {
316 /* calculate ConfigIndex value */ 315 /* calculate ConfigIndex value */
317 link->conf.ConfigIndex = 316 link->conf.ConfigIndex =
@@ -345,6 +344,8 @@ static int fmvj18x_config(struct pcmcia_device *link)
345 344
346 dev_dbg(&link->dev, "fmvj18x_config\n"); 345 dev_dbg(&link->dev, "fmvj18x_config\n");
347 346
347 link->io_lines = 5;
348
348 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); 349 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf);
349 kfree(buf); 350 kfree(buf);
350 351
@@ -363,20 +364,20 @@ static int fmvj18x_config(struct pcmcia_device *link)
363 /* MultiFunction Card */ 364 /* MultiFunction Card */
364 link->conf.ConfigBase = 0x800; 365 link->conf.ConfigBase = 0x800;
365 link->conf.ConfigIndex = 0x47; 366 link->conf.ConfigIndex = 0x47;
366 link->io.NumPorts2 = 8; 367 link->resource[1]->end = 8;
367 } 368 }
368 break; 369 break;
369 case MANFID_NEC: 370 case MANFID_NEC:
370 cardtype = NEC; /* MultiFunction Card */ 371 cardtype = NEC; /* MultiFunction Card */
371 link->conf.ConfigBase = 0x800; 372 link->conf.ConfigBase = 0x800;
372 link->conf.ConfigIndex = 0x47; 373 link->conf.ConfigIndex = 0x47;
373 link->io.NumPorts2 = 8; 374 link->resource[1]->end = 8;
374 break; 375 break;
375 case MANFID_KME: 376 case MANFID_KME:
376 cardtype = KME; /* MultiFunction Card */ 377 cardtype = KME; /* MultiFunction Card */
377 link->conf.ConfigBase = 0x800; 378 link->conf.ConfigBase = 0x800;
378 link->conf.ConfigIndex = 0x47; 379 link->conf.ConfigIndex = 0x47;
379 link->io.NumPorts2 = 8; 380 link->resource[1]->end = 8;
380 break; 381 break;
381 case MANFID_CONTEC: 382 case MANFID_CONTEC:
382 cardtype = CONTEC; 383 cardtype = CONTEC;
@@ -417,14 +418,14 @@ static int fmvj18x_config(struct pcmcia_device *link)
417 } 418 }
418 } 419 }
419 420
420 if (link->io.NumPorts2 != 0) { 421 if (link->resource[1]->end != 0) {
421 ret = mfc_try_io_port(link); 422 ret = mfc_try_io_port(link);
422 if (ret != 0) goto failed; 423 if (ret != 0) goto failed;
423 } else if (cardtype == UNGERMANN) { 424 } else if (cardtype == UNGERMANN) {
424 ret = ungermann_try_io_port(link); 425 ret = ungermann_try_io_port(link);
425 if (ret != 0) goto failed; 426 if (ret != 0) goto failed;
426 } else { 427 } else {
427 ret = pcmcia_request_io(link, &link->io); 428 ret = pcmcia_request_io(link);
428 if (ret) 429 if (ret)
429 goto failed; 430 goto failed;
430 } 431 }