diff options
Diffstat (limited to 'drivers/net/pcmcia/fmvj18x_cs.c')
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 7c27c50211a5..98fffb03ecd7 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_types.h> | ||
53 | #include <pcmcia/cs.h> | 52 | #include <pcmcia/cs.h> |
54 | #include <pcmcia/cistpl.h> | 53 | #include <pcmcia/cistpl.h> |
55 | #include <pcmcia/ciscode.h> | 54 | #include <pcmcia/ciscode.h> |
@@ -249,9 +248,8 @@ static int fmvj18x_probe(struct pcmcia_device *link) | |||
249 | lp->base = NULL; | 248 | lp->base = NULL; |
250 | 249 | ||
251 | /* The io structure describes IO port mapping */ | 250 | /* The io structure describes IO port mapping */ |
252 | link->io.NumPorts1 = 32; | 251 | link->resource[0]->end = 32; |
253 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 252 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
254 | link->io.IOAddrLines = 5; | ||
255 | 253 | ||
256 | /* General socket configuration */ | 254 | /* General socket configuration */ |
257 | link->conf.Attributes = CONF_ENABLE_IRQ; | 255 | link->conf.Attributes = CONF_ENABLE_IRQ; |
@@ -289,13 +287,13 @@ static int mfc_try_io_port(struct pcmcia_device *link) | |||
289 | { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 287 | { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
290 | 288 | ||
291 | for (i = 0; i < 5; i++) { | 289 | for (i = 0; i < 5; i++) { |
292 | link->io.BasePort2 = serial_base[i]; | 290 | link->resource[1]->start = serial_base[i]; |
293 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 291 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; |
294 | if (link->io.BasePort2 == 0) { | 292 | if (link->resource[1]->start == 0) { |
295 | link->io.NumPorts2 = 0; | 293 | link->resource[1]->end = 0; |
296 | printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); | 294 | printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); |
297 | } | 295 | } |
298 | ret = pcmcia_request_io(link, &link->io); | 296 | ret = pcmcia_request_io(link); |
299 | if (ret == 0) | 297 | if (ret == 0) |
300 | return ret; | 298 | return ret; |
301 | } | 299 | } |
@@ -311,12 +309,12 @@ static int ungermann_try_io_port(struct pcmcia_device *link) | |||
311 | 0x380,0x3c0 only for ioport. | 309 | 0x380,0x3c0 only for ioport. |
312 | */ | 310 | */ |
313 | for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { | 311 | for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { |
314 | link->io.BasePort1 = ioaddr; | 312 | link->resource[0]->start = ioaddr; |
315 | ret = pcmcia_request_io(link, &link->io); | 313 | ret = pcmcia_request_io(link); |
316 | if (ret == 0) { | 314 | if (ret == 0) { |
317 | /* calculate ConfigIndex value */ | 315 | /* calculate ConfigIndex value */ |
318 | link->conf.ConfigIndex = | 316 | link->conf.ConfigIndex = |
319 | ((link->io.BasePort1 & 0x0f0) >> 3) | 0x22; | 317 | ((link->resource[0]->start & 0x0f0) >> 3) | 0x22; |
320 | return ret; | 318 | return ret; |
321 | } | 319 | } |
322 | } | 320 | } |
@@ -346,6 +344,8 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
346 | 344 | ||
347 | dev_dbg(&link->dev, "fmvj18x_config\n"); | 345 | dev_dbg(&link->dev, "fmvj18x_config\n"); |
348 | 346 | ||
347 | link->io_lines = 5; | ||
348 | |||
349 | len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); | 349 | len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); |
350 | kfree(buf); | 350 | kfree(buf); |
351 | 351 | ||
@@ -364,20 +364,20 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
364 | /* MultiFunction Card */ | 364 | /* MultiFunction Card */ |
365 | link->conf.ConfigBase = 0x800; | 365 | link->conf.ConfigBase = 0x800; |
366 | link->conf.ConfigIndex = 0x47; | 366 | link->conf.ConfigIndex = 0x47; |
367 | link->io.NumPorts2 = 8; | 367 | link->resource[1]->end = 8; |
368 | } | 368 | } |
369 | break; | 369 | break; |
370 | case MANFID_NEC: | 370 | case MANFID_NEC: |
371 | cardtype = NEC; /* MultiFunction Card */ | 371 | cardtype = NEC; /* MultiFunction Card */ |
372 | link->conf.ConfigBase = 0x800; | 372 | link->conf.ConfigBase = 0x800; |
373 | link->conf.ConfigIndex = 0x47; | 373 | link->conf.ConfigIndex = 0x47; |
374 | link->io.NumPorts2 = 8; | 374 | link->resource[1]->end = 8; |
375 | break; | 375 | break; |
376 | case MANFID_KME: | 376 | case MANFID_KME: |
377 | cardtype = KME; /* MultiFunction Card */ | 377 | cardtype = KME; /* MultiFunction Card */ |
378 | link->conf.ConfigBase = 0x800; | 378 | link->conf.ConfigBase = 0x800; |
379 | link->conf.ConfigIndex = 0x47; | 379 | link->conf.ConfigIndex = 0x47; |
380 | link->io.NumPorts2 = 8; | 380 | link->resource[1]->end = 8; |
381 | break; | 381 | break; |
382 | case MANFID_CONTEC: | 382 | case MANFID_CONTEC: |
383 | cardtype = CONTEC; | 383 | cardtype = CONTEC; |
@@ -418,14 +418,14 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
418 | } | 418 | } |
419 | } | 419 | } |
420 | 420 | ||
421 | if (link->io.NumPorts2 != 0) { | 421 | if (link->resource[1]->end != 0) { |
422 | ret = mfc_try_io_port(link); | 422 | ret = mfc_try_io_port(link); |
423 | if (ret != 0) goto failed; | 423 | if (ret != 0) goto failed; |
424 | } else if (cardtype == UNGERMANN) { | 424 | } else if (cardtype == UNGERMANN) { |
425 | ret = ungermann_try_io_port(link); | 425 | ret = ungermann_try_io_port(link); |
426 | if (ret != 0) goto failed; | 426 | if (ret != 0) goto failed; |
427 | } else { | 427 | } else { |
428 | ret = pcmcia_request_io(link, &link->io); | 428 | ret = pcmcia_request_io(link); |
429 | if (ret) | 429 | if (ret) |
430 | goto failed; | 430 | goto failed; |
431 | } | 431 | } |
@@ -437,9 +437,9 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
437 | goto failed; | 437 | goto failed; |
438 | 438 | ||
439 | dev->irq = link->irq; | 439 | dev->irq = link->irq; |
440 | dev->base_addr = link->io.BasePort1; | 440 | dev->base_addr = link->resource[0]->start; |
441 | 441 | ||
442 | if (link->io.BasePort2 != 0) { | 442 | if (resource_size(link->resource[1]) != 0) { |
443 | ret = fmvj18x_setup_mfc(link); | 443 | ret = fmvj18x_setup_mfc(link); |
444 | if (ret != 0) goto failed; | 444 | if (ret != 0) goto failed; |
445 | } | 445 | } |
@@ -545,7 +545,6 @@ failed: | |||
545 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | 545 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) |
546 | { | 546 | { |
547 | win_req_t req; | 547 | win_req_t req; |
548 | memreq_t mem; | ||
549 | u_char __iomem *base; | 548 | u_char __iomem *base; |
550 | int i, j; | 549 | int i, j; |
551 | 550 | ||
@@ -558,9 +557,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
558 | return -1; | 557 | return -1; |
559 | 558 | ||
560 | base = ioremap(req.Base, req.Size); | 559 | base = ioremap(req.Base, req.Size); |
561 | mem.Page = 0; | 560 | pcmcia_map_mem_page(link, link->win, 0); |
562 | mem.CardOffset = 0; | ||
563 | pcmcia_map_mem_page(link, link->win, &mem); | ||
564 | 561 | ||
565 | /* | 562 | /* |
566 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format | 563 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format |
@@ -594,7 +591,6 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
594 | static int fmvj18x_setup_mfc(struct pcmcia_device *link) | 591 | static int fmvj18x_setup_mfc(struct pcmcia_device *link) |
595 | { | 592 | { |
596 | win_req_t req; | 593 | win_req_t req; |
597 | memreq_t mem; | ||
598 | int i; | 594 | int i; |
599 | struct net_device *dev = link->priv; | 595 | struct net_device *dev = link->priv; |
600 | unsigned int ioaddr; | 596 | unsigned int ioaddr; |
@@ -614,9 +610,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) | |||
614 | return -1; | 610 | return -1; |
615 | } | 611 | } |
616 | 612 | ||
617 | mem.Page = 0; | 613 | i = pcmcia_map_mem_page(link, link->win, 0); |
618 | mem.CardOffset = 0; | ||
619 | i = pcmcia_map_mem_page(link, link->win, &mem); | ||
620 | if (i != 0) { | 614 | if (i != 0) { |
621 | iounmap(lp->base); | 615 | iounmap(lp->base); |
622 | lp->base = NULL; | 616 | lp->base = NULL; |