blob: 12bfb1c01f2e86a75f93a6780a920591121b4e15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
From f62c047af910c9c9696db7b47472a3728b8100e8 Mon Sep 17 00:00:00 2001
From: Daniel Hellstrom <daniel@gaisler.com>
Date: Wed, 1 Dec 2010 11:56:22 +0100
Subject: [PATCH] GRETH: handle frame error interrupts
Not handling frame error interrupts are unlikly but may lead to dead
lock if 128 error frames are recieved in a row.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
---
drivers/net/greth.c | 5 +++--
drivers/net/greth.h | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -595,11 +595,12 @@ static irqreturn_t greth_interrupt(int i
status = GRETH_REGLOAD(greth->regs->status);
/* Handle rx and tx interrupts through poll */
- if (status & (GRETH_INT_RX | GRETH_INT_TX)) {
+ if (status & (GRETH_INT_RE | GRETH_INT_RX | GRETH_INT_TE | GRETH_INT_TX)) {
/* Clear interrupt status */
GRETH_REGSAVE(greth->regs->status,
- status & (GRETH_INT_RX | GRETH_INT_TX));
+ status & (GRETH_INT_RE | GRETH_INT_RX |
+ GRETH_INT_TE | GRETH_INT_TX));
retval = IRQ_HANDLED;
--- a/drivers/net/greth.h
+++ b/drivers/net/greth.h
@@ -23,6 +23,7 @@
#define GRETH_BD_LEN 0x7FF
#define GRETH_TXEN 0x1
+#define GRETH_INT_TE 0x2
#define GRETH_INT_TX 0x8
#define GRETH_TXI 0x4
#define GRETH_TXBD_STATUS 0x0001C000
@@ -35,6 +36,7 @@
#define GRETH_TXBD_ERR_UE 0x4000
#define GRETH_TXBD_ERR_AL 0x8000
+#define GRETH_INT_RE 0x1
#define GRETH_INT_RX 0x4
#define GRETH_RXEN 0x2
#define GRETH_RXI 0x8
|