diff options
-rw-r--r-- | drivers/net/can/c_can/c_can.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c index 6170e644426d..2aae073a1dc1 100644 --- a/drivers/net/can/c_can/c_can.c +++ b/drivers/net/can/c_can/c_can.c | |||
@@ -108,6 +108,7 @@ | |||
108 | #define IF_COMM_CONTROL BIT(4) | 108 | #define IF_COMM_CONTROL BIT(4) |
109 | #define IF_COMM_CLR_INT_PND BIT(3) | 109 | #define IF_COMM_CLR_INT_PND BIT(3) |
110 | #define IF_COMM_TXRQST BIT(2) | 110 | #define IF_COMM_TXRQST BIT(2) |
111 | #define IF_COMM_CLR_NEWDAT IF_COMM_TXRQST | ||
111 | #define IF_COMM_DATAA BIT(1) | 112 | #define IF_COMM_DATAA BIT(1) |
112 | #define IF_COMM_DATAB BIT(0) | 113 | #define IF_COMM_DATAB BIT(0) |
113 | #define IF_COMM_ALL (IF_COMM_MASK | IF_COMM_ARB | \ | 114 | #define IF_COMM_ALL (IF_COMM_MASK | IF_COMM_ARB | \ |
@@ -120,7 +121,7 @@ | |||
120 | IF_COMM_DATAA | IF_COMM_DATAB) | 121 | IF_COMM_DATAA | IF_COMM_DATAB) |
121 | 122 | ||
122 | /* For the high buffers we clear the interrupt bit and newdat */ | 123 | /* For the high buffers we clear the interrupt bit and newdat */ |
123 | #define IF_COMM_RCV_HIGH (IF_COMM_RCV_LOW | IF_COMM_TXRQST) | 124 | #define IF_COMM_RCV_HIGH (IF_COMM_RCV_LOW | IF_COMM_CLR_NEWDAT) |
124 | 125 | ||
125 | /* IFx arbitration */ | 126 | /* IFx arbitration */ |
126 | #define IF_ARB_MSGVAL BIT(15) | 127 | #define IF_ARB_MSGVAL BIT(15) |
@@ -353,17 +354,12 @@ static void c_can_write_msg_object(struct net_device *dev, | |||
353 | } | 354 | } |
354 | 355 | ||
355 | static inline void c_can_activate_all_lower_rx_msg_obj(struct net_device *dev, | 356 | static inline void c_can_activate_all_lower_rx_msg_obj(struct net_device *dev, |
356 | int iface, | 357 | int iface) |
357 | int ctrl_mask) | ||
358 | { | 358 | { |
359 | int i; | 359 | int i; |
360 | struct c_can_priv *priv = netdev_priv(dev); | ||
361 | 360 | ||
362 | for (i = C_CAN_MSG_OBJ_RX_FIRST; i <= C_CAN_MSG_RX_LOW_LAST; i++) { | 361 | for (i = C_CAN_MSG_OBJ_RX_FIRST; i <= C_CAN_MSG_RX_LOW_LAST; i++) |
363 | priv->write_reg(priv, C_CAN_IFACE(MSGCTRL_REG, iface), | 362 | c_can_object_get(dev, iface, i, IF_COMM_CLR_NEWDAT); |
364 | ctrl_mask & ~IF_MCONT_NEWDAT); | ||
365 | c_can_object_put(dev, iface, i, IF_COMM_CONTROL); | ||
366 | } | ||
367 | } | 363 | } |
368 | 364 | ||
369 | static int c_can_handle_lost_msg_obj(struct net_device *dev, | 365 | static int c_can_handle_lost_msg_obj(struct net_device *dev, |
@@ -829,7 +825,7 @@ static int c_can_read_objects(struct net_device *dev, struct c_can_priv *priv, | |||
829 | 825 | ||
830 | if (obj == C_CAN_MSG_RX_LOW_LAST) | 826 | if (obj == C_CAN_MSG_RX_LOW_LAST) |
831 | /* activate all lower message objects */ | 827 | /* activate all lower message objects */ |
832 | c_can_activate_all_lower_rx_msg_obj(dev, IF_RX, ctrl); | 828 | c_can_activate_all_lower_rx_msg_obj(dev, IF_RX); |
833 | 829 | ||
834 | pkts++; | 830 | pkts++; |
835 | quota--; | 831 | quota--; |