hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/can/usb/esd_usb2.c
....@@ -1,20 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * CAN driver for esd CAN-USB/2 and CAN-USB/Micro
34 *
45 * Copyright (C) 2010-2012 Matthias Fuchs <matthias.fuchs@esd.eu>, esd gmbh
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License as published
8
- * by the Free Software Foundation; version 2 of the License.
9
- *
10
- * This program is distributed in the hope that it will be useful, but
11
- * WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License along
16
- * with this program; if not, write to the Free Software Foundation, Inc.,
17
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
186 */
197 #include <linux/signal.h>
208 #include <linux/slab.h>
....@@ -239,6 +227,10 @@
239227 u8 rxerr = msg->msg.rx.data[2];
240228 u8 txerr = msg->msg.rx.data[3];
241229
230
+ netdev_dbg(priv->netdev,
231
+ "CAN_ERR_EV_EXT: dlc=%#02x state=%02x ecc=%02x rec=%02x tec=%02x\n",
232
+ msg->msg.rx.dlc, state, ecc, rxerr, txerr);
233
+
242234 skb = alloc_can_err_skb(priv->netdev, &cf);
243235 if (skb == NULL) {
244236 stats->rx_dropped++;
....@@ -265,6 +257,8 @@
265257 break;
266258 default:
267259 priv->can.state = CAN_STATE_ERROR_ACTIVE;
260
+ txerr = 0;
261
+ rxerr = 0;
268262 break;
269263 }
270264 } else {