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 /arch/arm/mach-ixp4xx/include | |
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 'arch/arm/mach-ixp4xx/include')
-rw-r--r-- | arch/arm/mach-ixp4xx/include/mach/qmgr.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/arch/arm/mach-ixp4xx/include/mach/qmgr.h b/arch/arm/mach-ixp4xx/include/mach/qmgr.h index 1e52b95cede5..0cbe6ceb67c5 100644 --- a/arch/arm/mach-ixp4xx/include/mach/qmgr.h +++ b/arch/arm/mach-ixp4xx/include/mach/qmgr.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/io.h> | 12 | #include <linux/io.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | 14 | ||
15 | #define DEBUG_QMGR 0 | ||
16 | |||
15 | #define HALF_QUEUES 32 | 17 | #define HALF_QUEUES 32 |
16 | #define QUEUES 64 /* only 32 lower queues currently supported */ | 18 | #define QUEUES 64 /* only 32 lower queues currently supported */ |
17 | #define MAX_QUEUE_LENGTH 4 /* in dwords */ | 19 | #define MAX_QUEUE_LENGTH 4 /* in dwords */ |
@@ -61,22 +63,51 @@ void qmgr_enable_irq(unsigned int queue); | |||
61 | void qmgr_disable_irq(unsigned int queue); | 63 | void qmgr_disable_irq(unsigned int queue); |
62 | 64 | ||
63 | /* request_ and release_queue() must be called from non-IRQ context */ | 65 | /* request_ and release_queue() must be called from non-IRQ context */ |
66 | |||
67 | #if DEBUG_QMGR | ||
68 | extern char qmgr_queue_descs[QUEUES][32]; | ||
69 | |||
64 | int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */, | 70 | int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */, |
65 | unsigned int nearly_empty_watermark, | 71 | unsigned int nearly_empty_watermark, |
66 | unsigned int nearly_full_watermark); | 72 | unsigned int nearly_full_watermark, |
73 | const char *desc_format, const char* name); | ||
74 | #else | ||
75 | int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */, | ||
76 | unsigned int nearly_empty_watermark, | ||
77 | unsigned int nearly_full_watermark); | ||
78 | #define qmgr_request_queue(queue, len, nearly_empty_watermark, \ | ||
79 | nearly_full_watermark, desc_format, name) \ | ||
80 | __qmgr_request_queue(queue, len, nearly_empty_watermark, \ | ||
81 | nearly_full_watermark) | ||
82 | #endif | ||
83 | |||
67 | void qmgr_release_queue(unsigned int queue); | 84 | void qmgr_release_queue(unsigned int queue); |
68 | 85 | ||
69 | 86 | ||
70 | static inline void qmgr_put_entry(unsigned int queue, u32 val) | 87 | static inline void qmgr_put_entry(unsigned int queue, u32 val) |
71 | { | 88 | { |
72 | extern struct qmgr_regs __iomem *qmgr_regs; | 89 | extern struct qmgr_regs __iomem *qmgr_regs; |
90 | #if DEBUG_QMGR | ||
91 | BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */ | ||
92 | |||
93 | printk(KERN_DEBUG "Queue %s(%i) put %X\n", | ||
94 | qmgr_queue_descs[queue], queue, val); | ||
95 | #endif | ||
73 | __raw_writel(val, &qmgr_regs->acc[queue][0]); | 96 | __raw_writel(val, &qmgr_regs->acc[queue][0]); |
74 | } | 97 | } |
75 | 98 | ||
76 | static inline u32 qmgr_get_entry(unsigned int queue) | 99 | static inline u32 qmgr_get_entry(unsigned int queue) |
77 | { | 100 | { |
101 | u32 val; | ||
78 | extern struct qmgr_regs __iomem *qmgr_regs; | 102 | extern struct qmgr_regs __iomem *qmgr_regs; |
79 | return __raw_readl(&qmgr_regs->acc[queue][0]); | 103 | val = __raw_readl(&qmgr_regs->acc[queue][0]); |
104 | #if DEBUG_QMGR | ||
105 | BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */ | ||
106 | |||
107 | printk(KERN_DEBUG "Queue %s(%i) get %X\n", | ||
108 | qmgr_queue_descs[queue], queue, val); | ||
109 | #endif | ||
110 | return val; | ||
80 | } | 111 | } |
81 | 112 | ||
82 | static inline int qmgr_get_stat1(unsigned int queue) | 113 | static inline int qmgr_get_stat1(unsigned int queue) |