Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215212
b: refs/heads/master
c: d3cd156
h: refs/heads/master
v: v3
  • Loading branch information
Marc Kleine-Budde committed Oct 18, 2010
1 parent 061959d commit 9b9031f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e15de3a73899903f33975b1ce57cf59c616d1d9
refs/heads/master: d3cd15657516141adce387810be8cb377baf020e
15 changes: 13 additions & 2 deletions trunk/drivers/net/can/mcp251x.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
# define CANINTF_TX0IF 0x04
# define CANINTF_RX1IF 0x02
# define CANINTF_RX0IF 0x01
# define CANINTF_ERR_TX \
(CANINTF_ERRIF | CANINTF_TX2IF | CANINTF_TX1IF | CANINTF_TX0IF)
#define EFLG 0x2d
# define EFLG_EWARN 0x01
# define EFLG_RXWAR 0x02
Expand Down Expand Up @@ -769,21 +771,30 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
while (!priv->force_quit) {
enum can_state new_state;
u8 intf, eflag;
u8 clear_intf = 0;
int can_id = 0, data1 = 0;

mcp251x_read_2regs(spi, CANINTF, &intf, &eflag);

/* receive buffer 0 */
if (intf & CANINTF_RX0IF) {
mcp251x_hw_rx(spi, 0);
/* Free one buffer ASAP */
mcp251x_write_bits(spi, CANINTF, intf & CANINTF_RX0IF,
0x00);
}

if (intf & CANINTF_RX1IF)
/* receive buffer 1 */
if (intf & CANINTF_RX1IF) {
mcp251x_hw_rx(spi, 1);
clear_intf |= CANINTF_RX1IF;
}

mcp251x_write_bits(spi, CANINTF, intf, 0x00);
/* any error or tx interrupt we need to clear? */
if (intf & CANINTF_ERR_TX)
clear_intf |= intf & CANINTF_ERR_TX;
if (clear_intf)
mcp251x_write_bits(spi, CANINTF, clear_intf, 0x00);

if (eflag)
mcp251x_write_bits(spi, EFLG, eflag, 0x00);
Expand Down

0 comments on commit 9b9031f

Please sign in to comment.