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