Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215439
b: refs/heads/master
c: 5601b2d
h: refs/heads/master
i:
  215437: 7962573
  215435: 1707693
  215431: 583d1b0
  215423: a7546c3
v: v3
  • Loading branch information
Marc Kleine-Budde authored and David S. Miller committed Oct 21, 2010
1 parent 53dbb37 commit 22efd73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 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: 1e55659ce6ddb5247cee0b1f720d77a799902b85
refs/heads/master: 5601b2dfae86198667dd6e075a074fbef0c83423
14 changes: 9 additions & 5 deletions trunk/drivers/net/can/mcp251x.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@
# 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 CANINTF_RX (CANINTF_RX0IF | CANINTF_RX1IF)
# define CANINTF_TX (CANINTF_TX2IF | CANINTF_TX1IF | CANINTF_TX0IF)
# define CANINTF_ERR (CANINTF_ERRIF)
#define EFLG 0x2d
# define EFLG_EWARN 0x01
# define EFLG_RXWAR 0x02
Expand Down Expand Up @@ -790,6 +791,9 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)

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

/* mask out flags we don't care about */
intf &= CANINTF_RX | CANINTF_TX | CANINTF_ERR;

/* receive buffer 0 */
if (intf & CANINTF_RX0IF) {
mcp251x_hw_rx(spi, 0);
Expand All @@ -810,8 +814,8 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
}

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

Expand Down Expand Up @@ -887,7 +891,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
if (intf == 0)
break;

if (intf & (CANINTF_TX2IF | CANINTF_TX1IF | CANINTF_TX0IF)) {
if (intf & CANINTF_TX) {
net->stats.tx_packets++;
net->stats.tx_bytes += priv->tx_len - 1;
if (priv->tx_len) {
Expand Down

0 comments on commit 22efd73

Please sign in to comment.