~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/net/stmmac/dwmac_lib.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
#undef DWMAC_DMA_DEBUG
28
28
#ifdef DWMAC_DMA_DEBUG
29
 
#define DBG(fmt, args...)  printk(fmt, ## args)
 
29
#define DWMAC_LIB_DBG(fmt, args...)  printk(fmt, ## args)
30
30
#else
31
 
#define DBG(fmt, args...)  do { } while (0)
 
31
#define DWMAC_LIB_DBG(fmt, args...)  do { } while (0)
32
32
#endif
33
33
 
34
34
/* CSR1 enables the transmit DMA to check for new descriptor */
152
152
        /* read the status register (CSR5) */
153
153
        u32 intr_status = readl(ioaddr + DMA_STATUS);
154
154
 
155
 
        DBG(INFO, "%s: [CSR5: 0x%08x]\n", __func__, intr_status);
 
155
        DWMAC_LIB_DBG(KERN_INFO "%s: [CSR5: 0x%08x]\n", __func__, intr_status);
156
156
#ifdef DWMAC_DMA_DEBUG
157
157
        /* It displays the DMA process states (CSR5 register) */
158
158
        show_tx_process_state(intr_status);
160
160
#endif
161
161
        /* ABNORMAL interrupts */
162
162
        if (unlikely(intr_status & DMA_STATUS_AIS)) {
163
 
                DBG(INFO, "CSR5[15] DMA ABNORMAL IRQ: ");
 
163
                DWMAC_LIB_DBG(KERN_INFO "CSR5[15] DMA ABNORMAL IRQ: ");
164
164
                if (unlikely(intr_status & DMA_STATUS_UNF)) {
165
 
                        DBG(INFO, "transmit underflow\n");
 
165
                        DWMAC_LIB_DBG(KERN_INFO "transmit underflow\n");
166
166
                        ret = tx_hard_error_bump_tc;
167
167
                        x->tx_undeflow_irq++;
168
168
                }
169
169
                if (unlikely(intr_status & DMA_STATUS_TJT)) {
170
 
                        DBG(INFO, "transmit jabber\n");
 
170
                        DWMAC_LIB_DBG(KERN_INFO "transmit jabber\n");
171
171
                        x->tx_jabber_irq++;
172
172
                }
173
173
                if (unlikely(intr_status & DMA_STATUS_OVF)) {
174
 
                        DBG(INFO, "recv overflow\n");
 
174
                        DWMAC_LIB_DBG(KERN_INFO "recv overflow\n");
175
175
                        x->rx_overflow_irq++;
176
176
                }
177
177
                if (unlikely(intr_status & DMA_STATUS_RU)) {
178
 
                        DBG(INFO, "receive buffer unavailable\n");
 
178
                        DWMAC_LIB_DBG(KERN_INFO "receive buffer unavailable\n");
179
179
                        x->rx_buf_unav_irq++;
180
180
                }
181
181
                if (unlikely(intr_status & DMA_STATUS_RPS)) {
182
 
                        DBG(INFO, "receive process stopped\n");
 
182
                        DWMAC_LIB_DBG(KERN_INFO "receive process stopped\n");
183
183
                        x->rx_process_stopped_irq++;
184
184
                }
185
185
                if (unlikely(intr_status & DMA_STATUS_RWT)) {
186
 
                        DBG(INFO, "receive watchdog\n");
 
186
                        DWMAC_LIB_DBG(KERN_INFO "receive watchdog\n");
187
187
                        x->rx_watchdog_irq++;
188
188
                }
189
189
                if (unlikely(intr_status & DMA_STATUS_ETI)) {
190
 
                        DBG(INFO, "transmit early interrupt\n");
 
190
                        DWMAC_LIB_DBG(KERN_INFO "transmit early interrupt\n");
191
191
                        x->tx_early_irq++;
192
192
                }
193
193
                if (unlikely(intr_status & DMA_STATUS_TPS)) {
194
 
                        DBG(INFO, "transmit process stopped\n");
 
194
                        DWMAC_LIB_DBG(KERN_INFO "transmit process stopped\n");
195
195
                        x->tx_process_stopped_irq++;
196
196
                        ret = tx_hard_error;
197
197
                }
198
198
                if (unlikely(intr_status & DMA_STATUS_FBI)) {
199
 
                        DBG(INFO, "fatal bus error\n");
 
199
                        DWMAC_LIB_DBG(KERN_INFO "fatal bus error\n");
200
200
                        x->fatal_bus_error_irq++;
201
201
                        ret = tx_hard_error;
202
202
                }
215
215
        /* Clear the interrupt by writing a logic 1 to the CSR5[15-0] */
216
216
        writel((intr_status & 0x1ffff), ioaddr + DMA_STATUS);
217
217
 
218
 
        DBG(INFO, "\n\n");
 
218
        DWMAC_LIB_DBG(KERN_INFO "\n\n");
219
219
        return ret;
220
220
}
221
221