diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:42:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:42:59 -0500 |
commit | d9b2c4d0b03c721808c0d259e43a27f1e80205bc (patch) | |
tree | f17a4166f62ee14faa1401a6cbd353a4ab8c77cb /drivers/net/pcmcia/fmvj18x_cs.c | |
parent | 27d16d08717faeaa8afd1b736a096dbaab90f08e (diff) | |
parent | 5fa9167a1bf5f5a4b7282f5e7ac56a4a5a1fa044 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (50 commits)
pcmcia: rework the irq_req_t typedef
pcmcia: remove deprecated handle_to_dev() macro
pcmcia: pcmcia_request_window() doesn't need a pointer to a pointer
pcmcia: remove unused "window_t" typedef
pcmcia: move some window-related code to pcmcia_ioctl.c
pcmcia: Change window_handle_t logic to unsigned long
pcmcia: Pass struct pcmcia_socket to pcmcia_get_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_map_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_release_window()
drivers/pcmcia: remove unnecessary kzalloc
pcmcia: correct handling for Zoomed Video registers in topic.h
pcmcia: fix printk formats
pcmcia: autoload module pcmcia
pcmcia/staging: update comedi drivers
PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket
PCMCIA: ss: allow PCI IRQs > 255
PCMCIA: soc_common: remove 'dev' member from soc_pcmcia_socket
PCMCIA: soc_common: constify soc_pcmcia_socket ops member
PCMCIA: sa1111: remove duplicated initializers
PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data
...
Diffstat (limited to 'drivers/net/pcmcia/fmvj18x_cs.c')
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 189 |
1 files changed, 78 insertions, 111 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 7e01fbdb87e0..6e3e1ced6db4 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -72,13 +72,6 @@ MODULE_LICENSE("GPL"); | |||
72 | /* 0:4KB*2 TX buffer else:8KB*2 TX buffer */ | 72 | /* 0:4KB*2 TX buffer else:8KB*2 TX buffer */ |
73 | INT_MODULE_PARM(sram_config, 0); | 73 | INT_MODULE_PARM(sram_config, 0); |
74 | 74 | ||
75 | #ifdef PCMCIA_DEBUG | ||
76 | INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG); | ||
77 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) | ||
78 | static char *version = DRV_NAME ".c " DRV_VERSION " 2002/03/23"; | ||
79 | #else | ||
80 | #define DEBUG(n, args...) | ||
81 | #endif | ||
82 | 75 | ||
83 | /*====================================================================*/ | 76 | /*====================================================================*/ |
84 | /* | 77 | /* |
@@ -245,7 +238,7 @@ static int fmvj18x_probe(struct pcmcia_device *link) | |||
245 | local_info_t *lp; | 238 | local_info_t *lp; |
246 | struct net_device *dev; | 239 | struct net_device *dev; |
247 | 240 | ||
248 | DEBUG(0, "fmvj18x_attach()\n"); | 241 | dev_dbg(&link->dev, "fmvj18x_attach()\n"); |
249 | 242 | ||
250 | /* Make up a FMVJ18x specific data structure */ | 243 | /* Make up a FMVJ18x specific data structure */ |
251 | dev = alloc_etherdev(sizeof(local_info_t)); | 244 | dev = alloc_etherdev(sizeof(local_info_t)); |
@@ -262,10 +255,8 @@ static int fmvj18x_probe(struct pcmcia_device *link) | |||
262 | link->io.IOAddrLines = 5; | 255 | link->io.IOAddrLines = 5; |
263 | 256 | ||
264 | /* Interrupt setup */ | 257 | /* Interrupt setup */ |
265 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT; | 258 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; |
266 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | ||
267 | link->irq.Handler = &fjn_interrupt; | 259 | link->irq.Handler = &fjn_interrupt; |
268 | link->irq.Instance = dev; | ||
269 | 260 | ||
270 | /* General socket configuration */ | 261 | /* General socket configuration */ |
271 | link->conf.Attributes = CONF_ENABLE_IRQ; | 262 | link->conf.Attributes = CONF_ENABLE_IRQ; |
@@ -285,7 +276,7 @@ static void fmvj18x_detach(struct pcmcia_device *link) | |||
285 | { | 276 | { |
286 | struct net_device *dev = link->priv; | 277 | struct net_device *dev = link->priv; |
287 | 278 | ||
288 | DEBUG(0, "fmvj18x_detach(0x%p)\n", link); | 279 | dev_dbg(&link->dev, "fmvj18x_detach\n"); |
289 | 280 | ||
290 | if (link->dev_node) | 281 | if (link->dev_node) |
291 | unregister_netdev(dev); | 282 | unregister_netdev(dev); |
@@ -297,9 +288,6 @@ static void fmvj18x_detach(struct pcmcia_device *link) | |||
297 | 288 | ||
298 | /*====================================================================*/ | 289 | /*====================================================================*/ |
299 | 290 | ||
300 | #define CS_CHECK(fn, ret) \ | ||
301 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
302 | |||
303 | static int mfc_try_io_port(struct pcmcia_device *link) | 291 | static int mfc_try_io_port(struct pcmcia_device *link) |
304 | { | 292 | { |
305 | int i, ret; | 293 | int i, ret; |
@@ -341,33 +329,38 @@ static int ungermann_try_io_port(struct pcmcia_device *link) | |||
341 | return ret; /* RequestIO failed */ | 329 | return ret; /* RequestIO failed */ |
342 | } | 330 | } |
343 | 331 | ||
332 | static int fmvj18x_ioprobe(struct pcmcia_device *p_dev, | ||
333 | cistpl_cftable_entry_t *cfg, | ||
334 | cistpl_cftable_entry_t *dflt, | ||
335 | unsigned int vcc, | ||
336 | void *priv_data) | ||
337 | { | ||
338 | return 0; /* strange, but that's what the code did already before... */ | ||
339 | } | ||
340 | |||
344 | static int fmvj18x_config(struct pcmcia_device *link) | 341 | static int fmvj18x_config(struct pcmcia_device *link) |
345 | { | 342 | { |
346 | struct net_device *dev = link->priv; | 343 | struct net_device *dev = link->priv; |
347 | local_info_t *lp = netdev_priv(dev); | 344 | local_info_t *lp = netdev_priv(dev); |
348 | tuple_t tuple; | 345 | int i, ret; |
349 | cisparse_t parse; | ||
350 | u_short buf[32]; | ||
351 | int i, last_fn = 0, last_ret = 0, ret; | ||
352 | unsigned int ioaddr; | 346 | unsigned int ioaddr; |
353 | cardtype_t cardtype; | 347 | cardtype_t cardtype; |
354 | char *card_name = "unknown"; | 348 | char *card_name = "unknown"; |
355 | u_char *node_id; | 349 | u8 *buf; |
350 | size_t len; | ||
351 | u_char buggybuf[32]; | ||
352 | |||
353 | dev_dbg(&link->dev, "fmvj18x_config\n"); | ||
356 | 354 | ||
357 | DEBUG(0, "fmvj18x_config(0x%p)\n", link); | 355 | len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); |
356 | kfree(buf); | ||
358 | 357 | ||
359 | tuple.TupleData = (u_char *)buf; | 358 | if (len) { |
360 | tuple.TupleDataMax = 64; | ||
361 | tuple.TupleOffset = 0; | ||
362 | tuple.DesiredTuple = CISTPL_FUNCE; | ||
363 | tuple.TupleOffset = 0; | ||
364 | if (pcmcia_get_first_tuple(link, &tuple) == 0) { | ||
365 | /* Yes, I have CISTPL_FUNCE. Let's check CISTPL_MANFID */ | 359 | /* Yes, I have CISTPL_FUNCE. Let's check CISTPL_MANFID */ |
366 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 360 | ret = pcmcia_loop_config(link, fmvj18x_ioprobe, NULL); |
367 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 361 | if (ret != 0) |
368 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | 362 | goto failed; |
369 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(&tuple, &parse)); | 363 | |
370 | link->conf.ConfigIndex = parse.cftable_entry.index; | ||
371 | switch (link->manf_id) { | 364 | switch (link->manf_id) { |
372 | case MANFID_TDK: | 365 | case MANFID_TDK: |
373 | cardtype = TDK; | 366 | cardtype = TDK; |
@@ -433,17 +426,24 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
433 | 426 | ||
434 | if (link->io.NumPorts2 != 0) { | 427 | if (link->io.NumPorts2 != 0) { |
435 | link->irq.Attributes = | 428 | link->irq.Attributes = |
436 | IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED|IRQ_HANDLE_PRESENT; | 429 | IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; |
437 | ret = mfc_try_io_port(link); | 430 | ret = mfc_try_io_port(link); |
438 | if (ret != 0) goto cs_failed; | 431 | if (ret != 0) goto failed; |
439 | } else if (cardtype == UNGERMANN) { | 432 | } else if (cardtype == UNGERMANN) { |
440 | ret = ungermann_try_io_port(link); | 433 | ret = ungermann_try_io_port(link); |
441 | if (ret != 0) goto cs_failed; | 434 | if (ret != 0) goto failed; |
442 | } else { | 435 | } else { |
443 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); | 436 | ret = pcmcia_request_io(link, &link->io); |
437 | if (ret) | ||
438 | goto failed; | ||
444 | } | 439 | } |
445 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 440 | ret = pcmcia_request_irq(link, &link->irq); |
446 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 441 | if (ret) |
442 | goto failed; | ||
443 | ret = pcmcia_request_configuration(link, &link->conf); | ||
444 | if (ret) | ||
445 | goto failed; | ||
446 | |||
447 | dev->irq = link->irq.AssignedIRQ; | 447 | dev->irq = link->irq.AssignedIRQ; |
448 | dev->base_addr = link->io.BasePort1; | 448 | dev->base_addr = link->io.BasePort1; |
449 | 449 | ||
@@ -474,21 +474,21 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
474 | case CONTEC: | 474 | case CONTEC: |
475 | case NEC: | 475 | case NEC: |
476 | case KME: | 476 | case KME: |
477 | tuple.DesiredTuple = CISTPL_FUNCE; | ||
478 | tuple.TupleOffset = 0; | ||
479 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
480 | tuple.TupleOffset = 0; | ||
481 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
482 | if (cardtype == MBH10304) { | 477 | if (cardtype == MBH10304) { |
483 | /* MBH10304's CIS_FUNCE is corrupted */ | ||
484 | node_id = &(tuple.TupleData[5]); | ||
485 | card_name = "FMV-J182"; | 478 | card_name = "FMV-J182"; |
486 | } else { | 479 | |
487 | while (tuple.TupleData[0] != CISTPL_FUNCE_LAN_NODE_ID ) { | 480 | len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); |
488 | CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); | 481 | if (len < 11) { |
489 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | 482 | kfree(buf); |
483 | goto failed; | ||
490 | } | 484 | } |
491 | node_id = &(tuple.TupleData[2]); | 485 | /* Read MACID from CIS */ |
486 | for (i = 5; i < 11; i++) | ||
487 | dev->dev_addr[i] = buf[i]; | ||
488 | kfree(buf); | ||
489 | } else { | ||
490 | if (pcmcia_get_mac_from_cis(link, dev)) | ||
491 | goto failed; | ||
492 | if( cardtype == TDK ) { | 492 | if( cardtype == TDK ) { |
493 | card_name = "TDK LAK-CD021"; | 493 | card_name = "TDK LAK-CD021"; |
494 | } else if( cardtype == LA501 ) { | 494 | } else if( cardtype == LA501 ) { |
@@ -501,9 +501,6 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
501 | card_name = "C-NET(PC)C"; | 501 | card_name = "C-NET(PC)C"; |
502 | } | 502 | } |
503 | } | 503 | } |
504 | /* Read MACID from CIS */ | ||
505 | for (i = 0; i < 6; i++) | ||
506 | dev->dev_addr[i] = node_id[i]; | ||
507 | break; | 504 | break; |
508 | case UNGERMANN: | 505 | case UNGERMANN: |
509 | /* Read MACID from register */ | 506 | /* Read MACID from register */ |
@@ -513,12 +510,12 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
513 | break; | 510 | break; |
514 | case XXX10304: | 511 | case XXX10304: |
515 | /* Read MACID from Buggy CIS */ | 512 | /* Read MACID from Buggy CIS */ |
516 | if (fmvj18x_get_hwinfo(link, tuple.TupleData) == -1) { | 513 | if (fmvj18x_get_hwinfo(link, buggybuf) == -1) { |
517 | printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net address.\n"); | 514 | printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net address.\n"); |
518 | goto failed; | 515 | goto failed; |
519 | } | 516 | } |
520 | for (i = 0 ; i < 6; i++) { | 517 | for (i = 0 ; i < 6; i++) { |
521 | dev->dev_addr[i] = tuple.TupleData[i]; | 518 | dev->dev_addr[i] = buggybuf[i]; |
522 | } | 519 | } |
523 | card_name = "FMV-J182"; | 520 | card_name = "FMV-J182"; |
524 | break; | 521 | break; |
@@ -533,7 +530,7 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
533 | 530 | ||
534 | lp->cardtype = cardtype; | 531 | lp->cardtype = cardtype; |
535 | link->dev_node = &lp->node; | 532 | link->dev_node = &lp->node; |
536 | SET_NETDEV_DEV(dev, &handle_to_dev(link)); | 533 | SET_NETDEV_DEV(dev, &link->dev); |
537 | 534 | ||
538 | if (register_netdev(dev) != 0) { | 535 | if (register_netdev(dev) != 0) { |
539 | printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); | 536 | printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); |
@@ -551,9 +548,6 @@ static int fmvj18x_config(struct pcmcia_device *link) | |||
551 | 548 | ||
552 | return 0; | 549 | return 0; |
553 | 550 | ||
554 | cs_failed: | ||
555 | /* All Card Services errors end up here */ | ||
556 | cs_error(link, last_fn, last_ret); | ||
557 | failed: | 551 | failed: |
558 | fmvj18x_release(link); | 552 | fmvj18x_release(link); |
559 | return -ENODEV; | 553 | return -ENODEV; |
@@ -571,16 +565,14 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
571 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; | 565 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; |
572 | req.Base = 0; req.Size = 0; | 566 | req.Base = 0; req.Size = 0; |
573 | req.AccessSpeed = 0; | 567 | req.AccessSpeed = 0; |
574 | i = pcmcia_request_window(&link, &req, &link->win); | 568 | i = pcmcia_request_window(link, &req, &link->win); |
575 | if (i != 0) { | 569 | if (i != 0) |
576 | cs_error(link, RequestWindow, i); | ||
577 | return -1; | 570 | return -1; |
578 | } | ||
579 | 571 | ||
580 | base = ioremap(req.Base, req.Size); | 572 | base = ioremap(req.Base, req.Size); |
581 | mem.Page = 0; | 573 | mem.Page = 0; |
582 | mem.CardOffset = 0; | 574 | mem.CardOffset = 0; |
583 | pcmcia_map_mem_page(link->win, &mem); | 575 | pcmcia_map_mem_page(link, link->win, &mem); |
584 | 576 | ||
585 | /* | 577 | /* |
586 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format | 578 | * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format |
@@ -605,9 +597,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id) | |||
605 | } | 597 | } |
606 | 598 | ||
607 | iounmap(base); | 599 | iounmap(base); |
608 | j = pcmcia_release_window(link->win); | 600 | j = pcmcia_release_window(link, link->win); |
609 | if (j != 0) | ||
610 | cs_error(link, ReleaseWindow, j); | ||
611 | return (i != 0x200) ? 0 : -1; | 601 | return (i != 0x200) ? 0 : -1; |
612 | 602 | ||
613 | } /* fmvj18x_get_hwinfo */ | 603 | } /* fmvj18x_get_hwinfo */ |
@@ -626,11 +616,9 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) | |||
626 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; | 616 | req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; |
627 | req.Base = 0; req.Size = 0; | 617 | req.Base = 0; req.Size = 0; |
628 | req.AccessSpeed = 0; | 618 | req.AccessSpeed = 0; |
629 | i = pcmcia_request_window(&link, &req, &link->win); | 619 | i = pcmcia_request_window(link, &req, &link->win); |
630 | if (i != 0) { | 620 | if (i != 0) |
631 | cs_error(link, RequestWindow, i); | ||
632 | return -1; | 621 | return -1; |
633 | } | ||
634 | 622 | ||
635 | lp->base = ioremap(req.Base, req.Size); | 623 | lp->base = ioremap(req.Base, req.Size); |
636 | if (lp->base == NULL) { | 624 | if (lp->base == NULL) { |
@@ -640,11 +628,10 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link) | |||
640 | 628 | ||
641 | mem.Page = 0; | 629 | mem.Page = 0; |
642 | mem.CardOffset = 0; | 630 | mem.CardOffset = 0; |
643 | i = pcmcia_map_mem_page(link->win, &mem); | 631 | i = pcmcia_map_mem_page(link, link->win, &mem); |
644 | if (i != 0) { | 632 | if (i != 0) { |
645 | iounmap(lp->base); | 633 | iounmap(lp->base); |
646 | lp->base = NULL; | 634 | lp->base = NULL; |
647 | cs_error(link, MapMemPage, i); | ||
648 | return -1; | 635 | return -1; |
649 | } | 636 | } |
650 | 637 | ||
@@ -671,15 +658,13 @@ static void fmvj18x_release(struct pcmcia_device *link) | |||
671 | u_char __iomem *tmp; | 658 | u_char __iomem *tmp; |
672 | int j; | 659 | int j; |
673 | 660 | ||
674 | DEBUG(0, "fmvj18x_release(0x%p)\n", link); | 661 | dev_dbg(&link->dev, "fmvj18x_release\n"); |
675 | 662 | ||
676 | if (lp->base != NULL) { | 663 | if (lp->base != NULL) { |
677 | tmp = lp->base; | 664 | tmp = lp->base; |
678 | lp->base = NULL; /* set NULL before iounmap */ | 665 | lp->base = NULL; /* set NULL before iounmap */ |
679 | iounmap(tmp); | 666 | iounmap(tmp); |
680 | j = pcmcia_release_window(link->win); | 667 | j = pcmcia_release_window(link, link->win); |
681 | if (j != 0) | ||
682 | cs_error(link, ReleaseWindow, j); | ||
683 | } | 668 | } |
684 | 669 | ||
685 | pcmcia_disable_device(link); | 670 | pcmcia_disable_device(link); |
@@ -788,8 +773,8 @@ static irqreturn_t fjn_interrupt(int dummy, void *dev_id) | |||
788 | outb(tx_stat, ioaddr + TX_STATUS); | 773 | outb(tx_stat, ioaddr + TX_STATUS); |
789 | outb(rx_stat, ioaddr + RX_STATUS); | 774 | outb(rx_stat, ioaddr + RX_STATUS); |
790 | 775 | ||
791 | DEBUG(4, "%s: interrupt, rx_status %02x.\n", dev->name, rx_stat); | 776 | pr_debug("%s: interrupt, rx_status %02x.\n", dev->name, rx_stat); |
792 | DEBUG(4, " tx_status %02x.\n", tx_stat); | 777 | pr_debug(" tx_status %02x.\n", tx_stat); |
793 | 778 | ||
794 | if (rx_stat || (inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) { | 779 | if (rx_stat || (inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) { |
795 | /* there is packet(s) in rx buffer */ | 780 | /* there is packet(s) in rx buffer */ |
@@ -809,8 +794,8 @@ static irqreturn_t fjn_interrupt(int dummy, void *dev_id) | |||
809 | } | 794 | } |
810 | netif_wake_queue(dev); | 795 | netif_wake_queue(dev); |
811 | } | 796 | } |
812 | DEBUG(4, "%s: exiting interrupt,\n", dev->name); | 797 | pr_debug("%s: exiting interrupt,\n", dev->name); |
813 | DEBUG(4, " tx_status %02x, rx_status %02x.\n", tx_stat, rx_stat); | 798 | pr_debug(" tx_status %02x, rx_status %02x.\n", tx_stat, rx_stat); |
814 | 799 | ||
815 | outb(D_TX_INTR, ioaddr + TX_INTR); | 800 | outb(D_TX_INTR, ioaddr + TX_INTR); |
816 | outb(D_RX_INTR, ioaddr + RX_INTR); | 801 | outb(D_RX_INTR, ioaddr + RX_INTR); |
@@ -882,7 +867,7 @@ static netdev_tx_t fjn_start_xmit(struct sk_buff *skb, | |||
882 | return NETDEV_TX_BUSY; | 867 | return NETDEV_TX_BUSY; |
883 | } | 868 | } |
884 | 869 | ||
885 | DEBUG(4, "%s: Transmitting a packet of length %lu.\n", | 870 | pr_debug("%s: Transmitting a packet of length %lu.\n", |
886 | dev->name, (unsigned long)skb->len); | 871 | dev->name, (unsigned long)skb->len); |
887 | dev->stats.tx_bytes += skb->len; | 872 | dev->stats.tx_bytes += skb->len; |
888 | 873 | ||
@@ -937,7 +922,7 @@ static void fjn_reset(struct net_device *dev) | |||
937 | unsigned int ioaddr = dev->base_addr; | 922 | unsigned int ioaddr = dev->base_addr; |
938 | int i; | 923 | int i; |
939 | 924 | ||
940 | DEBUG(4, "fjn_reset(%s) called.\n",dev->name); | 925 | pr_debug("fjn_reset(%s) called.\n",dev->name); |
941 | 926 | ||
942 | /* Reset controller */ | 927 | /* Reset controller */ |
943 | if( sram_config == 0 ) | 928 | if( sram_config == 0 ) |
@@ -1015,13 +1000,13 @@ static void fjn_rx(struct net_device *dev) | |||
1015 | unsigned int ioaddr = dev->base_addr; | 1000 | unsigned int ioaddr = dev->base_addr; |
1016 | int boguscount = 10; /* 5 -> 10: by agy 19940922 */ | 1001 | int boguscount = 10; /* 5 -> 10: by agy 19940922 */ |
1017 | 1002 | ||
1018 | DEBUG(4, "%s: in rx_packet(), rx_status %02x.\n", | 1003 | pr_debug("%s: in rx_packet(), rx_status %02x.\n", |
1019 | dev->name, inb(ioaddr + RX_STATUS)); | 1004 | dev->name, inb(ioaddr + RX_STATUS)); |
1020 | 1005 | ||
1021 | while ((inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) { | 1006 | while ((inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) { |
1022 | u_short status = inw(ioaddr + DATAPORT); | 1007 | u_short status = inw(ioaddr + DATAPORT); |
1023 | 1008 | ||
1024 | DEBUG(4, "%s: Rxing packet mode %02x status %04x.\n", | 1009 | pr_debug("%s: Rxing packet mode %02x status %04x.\n", |
1025 | dev->name, inb(ioaddr + RX_MODE), status); | 1010 | dev->name, inb(ioaddr + RX_MODE), status); |
1026 | #ifndef final_version | 1011 | #ifndef final_version |
1027 | if (status == 0) { | 1012 | if (status == 0) { |
@@ -1061,16 +1046,14 @@ static void fjn_rx(struct net_device *dev) | |||
1061 | (pkt_len + 1) >> 1); | 1046 | (pkt_len + 1) >> 1); |
1062 | skb->protocol = eth_type_trans(skb, dev); | 1047 | skb->protocol = eth_type_trans(skb, dev); |
1063 | 1048 | ||
1064 | #ifdef PCMCIA_DEBUG | 1049 | { |
1065 | if (pc_debug > 5) { | ||
1066 | int i; | 1050 | int i; |
1067 | printk(KERN_DEBUG "%s: Rxed packet of length %d: ", | 1051 | pr_debug("%s: Rxed packet of length %d: ", |
1068 | dev->name, pkt_len); | 1052 | dev->name, pkt_len); |
1069 | for (i = 0; i < 14; i++) | 1053 | for (i = 0; i < 14; i++) |
1070 | printk(" %02x", skb->data[i]); | 1054 | pr_debug(" %02x", skb->data[i]); |
1071 | printk(".\n"); | 1055 | pr_debug(".\n"); |
1072 | } | 1056 | } |
1073 | #endif | ||
1074 | 1057 | ||
1075 | netif_rx(skb); | 1058 | netif_rx(skb); |
1076 | dev->stats.rx_packets++; | 1059 | dev->stats.rx_packets++; |
@@ -1094,7 +1077,7 @@ static void fjn_rx(struct net_device *dev) | |||
1094 | } | 1077 | } |
1095 | 1078 | ||
1096 | if (i > 0) | 1079 | if (i > 0) |
1097 | DEBUG(5, "%s: Exint Rx packet with mode %02x after " | 1080 | pr_debug("%s: Exint Rx packet with mode %02x after " |
1098 | "%d ticks.\n", dev->name, inb(ioaddr + RX_MODE), i); | 1081 | "%d ticks.\n", dev->name, inb(ioaddr + RX_MODE), i); |
1099 | } | 1082 | } |
1100 | */ | 1083 | */ |
@@ -1112,24 +1095,8 @@ static void netdev_get_drvinfo(struct net_device *dev, | |||
1112 | sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr); | 1095 | sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr); |
1113 | } | 1096 | } |
1114 | 1097 | ||
1115 | #ifdef PCMCIA_DEBUG | ||
1116 | static u32 netdev_get_msglevel(struct net_device *dev) | ||
1117 | { | ||
1118 | return pc_debug; | ||
1119 | } | ||
1120 | |||
1121 | static void netdev_set_msglevel(struct net_device *dev, u32 level) | ||
1122 | { | ||
1123 | pc_debug = level; | ||
1124 | } | ||
1125 | #endif /* PCMCIA_DEBUG */ | ||
1126 | |||
1127 | static const struct ethtool_ops netdev_ethtool_ops = { | 1098 | static const struct ethtool_ops netdev_ethtool_ops = { |
1128 | .get_drvinfo = netdev_get_drvinfo, | 1099 | .get_drvinfo = netdev_get_drvinfo, |
1129 | #ifdef PCMCIA_DEBUG | ||
1130 | .get_msglevel = netdev_get_msglevel, | ||
1131 | .set_msglevel = netdev_set_msglevel, | ||
1132 | #endif /* PCMCIA_DEBUG */ | ||
1133 | }; | 1100 | }; |
1134 | 1101 | ||
1135 | static int fjn_config(struct net_device *dev, struct ifmap *map){ | 1102 | static int fjn_config(struct net_device *dev, struct ifmap *map){ |
@@ -1141,7 +1108,7 @@ static int fjn_open(struct net_device *dev) | |||
1141 | struct local_info_t *lp = netdev_priv(dev); | 1108 | struct local_info_t *lp = netdev_priv(dev); |
1142 | struct pcmcia_device *link = lp->p_dev; | 1109 | struct pcmcia_device *link = lp->p_dev; |
1143 | 1110 | ||
1144 | DEBUG(4, "fjn_open('%s').\n", dev->name); | 1111 | pr_debug("fjn_open('%s').\n", dev->name); |
1145 | 1112 | ||
1146 | if (!pcmcia_dev_present(link)) | 1113 | if (!pcmcia_dev_present(link)) |
1147 | return -ENODEV; | 1114 | return -ENODEV; |
@@ -1167,7 +1134,7 @@ static int fjn_close(struct net_device *dev) | |||
1167 | struct pcmcia_device *link = lp->p_dev; | 1134 | struct pcmcia_device *link = lp->p_dev; |
1168 | unsigned int ioaddr = dev->base_addr; | 1135 | unsigned int ioaddr = dev->base_addr; |
1169 | 1136 | ||
1170 | DEBUG(4, "fjn_close('%s').\n", dev->name); | 1137 | pr_debug("fjn_close('%s').\n", dev->name); |
1171 | 1138 | ||
1172 | lp->open_time = 0; | 1139 | lp->open_time = 0; |
1173 | netif_stop_queue(dev); | 1140 | netif_stop_queue(dev); |