diff options
author | Krzysztof Hałasa <khc@pm.waw.pl> | 2008-12-21 18:26:38 -0500 |
---|---|---|
committer | Krzysztof Hałasa <khc@pm.waw.pl> | 2008-12-21 18:48:00 -0500 |
commit | e6da96ace859dad966fe85cc9552b89f48bbc930 (patch) | |
tree | c022b49ee22b355eec92d627fd45160f89406cf0 /drivers/net/arm/ixp4xx_eth.c | |
parent | 9251ce959cab704eb0e4910860b06b18e7083474 (diff) |
IXP4xx: move common debugging from network drivers to QMGR module.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Diffstat (limited to 'drivers/net/arm/ixp4xx_eth.c')
-rw-r--r-- | drivers/net/arm/ixp4xx_eth.c | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index 3f72eb66e7f1..64adf6cc1221 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <mach/npe.h> | 35 | #include <mach/npe.h> |
36 | #include <mach/qmgr.h> | 36 | #include <mach/qmgr.h> |
37 | 37 | ||
38 | #define DEBUG_QUEUES 0 | ||
39 | #define DEBUG_DESC 0 | 38 | #define DEBUG_DESC 0 |
40 | #define DEBUG_RX 0 | 39 | #define DEBUG_RX 0 |
41 | #define DEBUG_TX 0 | 40 | #define DEBUG_TX 0 |
@@ -423,47 +422,13 @@ static inline void debug_desc(u32 phys, struct desc *desc) | |||
423 | #endif | 422 | #endif |
424 | } | 423 | } |
425 | 424 | ||
426 | static inline void debug_queue(unsigned int queue, int is_get, u32 phys) | ||
427 | { | ||
428 | #if DEBUG_QUEUES | ||
429 | static struct { | ||
430 | int queue; | ||
431 | char *name; | ||
432 | } names[] = { | ||
433 | { TX_QUEUE(0x10), "TX#0 " }, | ||
434 | { TX_QUEUE(0x20), "TX#1 " }, | ||
435 | { TX_QUEUE(0x00), "TX#2 " }, | ||
436 | { RXFREE_QUEUE(0x10), "RX-free#0 " }, | ||
437 | { RXFREE_QUEUE(0x20), "RX-free#1 " }, | ||
438 | { RXFREE_QUEUE(0x00), "RX-free#2 " }, | ||
439 | { TXDONE_QUEUE, "TX-done " }, | ||
440 | }; | ||
441 | int i; | ||
442 | |||
443 | for (i = 0; i < ARRAY_SIZE(names); i++) | ||
444 | if (names[i].queue == queue) | ||
445 | break; | ||
446 | |||
447 | printk(KERN_DEBUG "Queue %i %s%s %X\n", queue, | ||
448 | i < ARRAY_SIZE(names) ? names[i].name : "", | ||
449 | is_get ? "->" : "<-", phys); | ||
450 | #endif | ||
451 | } | ||
452 | |||
453 | static inline u32 queue_get_entry(unsigned int queue) | ||
454 | { | ||
455 | u32 phys = qmgr_get_entry(queue); | ||
456 | debug_queue(queue, 1, phys); | ||
457 | return phys; | ||
458 | } | ||
459 | |||
460 | static inline int queue_get_desc(unsigned int queue, struct port *port, | 425 | static inline int queue_get_desc(unsigned int queue, struct port *port, |
461 | int is_tx) | 426 | int is_tx) |
462 | { | 427 | { |
463 | u32 phys, tab_phys, n_desc; | 428 | u32 phys, tab_phys, n_desc; |
464 | struct desc *tab; | 429 | struct desc *tab; |
465 | 430 | ||
466 | if (!(phys = queue_get_entry(queue))) | 431 | if (!(phys = qmgr_get_entry(queue))) |
467 | return -1; | 432 | return -1; |
468 | 433 | ||
469 | phys &= ~0x1F; /* mask out non-address bits */ | 434 | phys &= ~0x1F; /* mask out non-address bits */ |
@@ -479,7 +444,6 @@ static inline int queue_get_desc(unsigned int queue, struct port *port, | |||
479 | static inline void queue_put_desc(unsigned int queue, u32 phys, | 444 | static inline void queue_put_desc(unsigned int queue, u32 phys, |
480 | struct desc *desc) | 445 | struct desc *desc) |
481 | { | 446 | { |
482 | debug_queue(queue, 0, phys); | ||
483 | debug_desc(phys, desc); | 447 | debug_desc(phys, desc); |
484 | BUG_ON(phys & 0x1F); | 448 | BUG_ON(phys & 0x1F); |
485 | qmgr_put_entry(queue, phys); | 449 | qmgr_put_entry(queue, phys); |
@@ -628,7 +592,7 @@ static void eth_txdone_irq(void *unused) | |||
628 | #if DEBUG_TX | 592 | #if DEBUG_TX |
629 | printk(KERN_DEBUG DRV_NAME ": eth_txdone_irq\n"); | 593 | printk(KERN_DEBUG DRV_NAME ": eth_txdone_irq\n"); |
630 | #endif | 594 | #endif |
631 | while ((phys = queue_get_entry(TXDONE_QUEUE)) != 0) { | 595 | while ((phys = qmgr_get_entry(TXDONE_QUEUE)) != 0) { |
632 | u32 npe_id, n_desc; | 596 | u32 npe_id, n_desc; |
633 | struct port *port; | 597 | struct port *port; |
634 | struct desc *desc; | 598 | struct desc *desc; |
@@ -840,25 +804,30 @@ static int request_queues(struct port *port) | |||
840 | { | 804 | { |
841 | int err; | 805 | int err; |
842 | 806 | ||
843 | err = qmgr_request_queue(RXFREE_QUEUE(port->id), RX_DESCS, 0, 0); | 807 | err = qmgr_request_queue(RXFREE_QUEUE(port->id), RX_DESCS, 0, 0, |
808 | "%s:RX-free", port->netdev->name); | ||
844 | if (err) | 809 | if (err) |
845 | return err; | 810 | return err; |
846 | 811 | ||
847 | err = qmgr_request_queue(port->plat->rxq, RX_DESCS, 0, 0); | 812 | err = qmgr_request_queue(port->plat->rxq, RX_DESCS, 0, 0, |
813 | "%s:RX", port->netdev->name); | ||
848 | if (err) | 814 | if (err) |
849 | goto rel_rxfree; | 815 | goto rel_rxfree; |
850 | 816 | ||
851 | err = qmgr_request_queue(TX_QUEUE(port->id), TX_DESCS, 0, 0); | 817 | err = qmgr_request_queue(TX_QUEUE(port->id), TX_DESCS, 0, 0, |
818 | "%s:TX", port->netdev->name); | ||
852 | if (err) | 819 | if (err) |
853 | goto rel_rx; | 820 | goto rel_rx; |
854 | 821 | ||
855 | err = qmgr_request_queue(port->plat->txreadyq, TX_DESCS, 0, 0); | 822 | err = qmgr_request_queue(port->plat->txreadyq, TX_DESCS, 0, 0, |
823 | "%s:TX-ready", port->netdev->name); | ||
856 | if (err) | 824 | if (err) |
857 | goto rel_tx; | 825 | goto rel_tx; |
858 | 826 | ||
859 | /* TX-done queue handles skbs sent out by the NPEs */ | 827 | /* TX-done queue handles skbs sent out by the NPEs */ |
860 | if (!ports_open) { | 828 | if (!ports_open) { |
861 | err = qmgr_request_queue(TXDONE_QUEUE, TXDONE_QUEUE_LEN, 0, 0); | 829 | err = qmgr_request_queue(TXDONE_QUEUE, TXDONE_QUEUE_LEN, 0, 0, |
830 | "%s:TX-done", DRV_NAME); | ||
862 | if (err) | 831 | if (err) |
863 | goto rel_txready; | 832 | goto rel_txready; |
864 | } | 833 | } |