hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c
....@@ -371,7 +371,7 @@
371371 .brp_inc = 1,
372372 };
373373
374
-static const struct can_bittiming_const kvaser_usb_hydra_flexc_bittiming_c = {
374
+const struct can_bittiming_const kvaser_usb_flexc_bittiming_const = {
375375 .name = "kvaser_usb_flex",
376376 .tseg1_min = 4,
377377 .tseg1_max = 16,
....@@ -890,8 +890,10 @@
890890 new_state < CAN_STATE_BUS_OFF)
891891 priv->can.can_stats.restarts++;
892892
893
- cf->data[6] = bec->txerr;
894
- cf->data[7] = bec->rxerr;
893
+ if (new_state != CAN_STATE_BUS_OFF) {
894
+ cf->data[6] = bec->txerr;
895
+ cf->data[7] = bec->rxerr;
896
+ }
895897
896898 stats = &netdev->stats;
897899 stats->rx_packets++;
....@@ -1045,8 +1047,10 @@
10451047 shhwtstamps->hwtstamp = hwtstamp;
10461048
10471049 cf->can_id |= CAN_ERR_BUSERROR;
1048
- cf->data[6] = bec.txerr;
1049
- cf->data[7] = bec.rxerr;
1050
+ if (new_state != CAN_STATE_BUS_OFF) {
1051
+ cf->data[6] = bec.txerr;
1052
+ cf->data[7] = bec.rxerr;
1053
+ }
10501054
10511055 stats->rx_packets++;
10521056 stats->rx_bytes += cf->can_dlc;
....@@ -1841,7 +1845,7 @@
18411845 {
18421846 int err;
18431847
1844
- init_completion(&priv->start_comp);
1848
+ reinit_completion(&priv->start_comp);
18451849
18461850 err = kvaser_usb_hydra_send_simple_cmd(priv->dev, CMD_START_CHIP_REQ,
18471851 priv->channel);
....@@ -1859,7 +1863,7 @@
18591863 {
18601864 int err;
18611865
1862
- init_completion(&priv->stop_comp);
1866
+ reinit_completion(&priv->stop_comp);
18631867
18641868 /* Make sure we do not report invalid BUS_OFF from CMD_CHIP_STATE_EVENT
18651869 * see comment in kvaser_usb_hydra_update_state()
....@@ -1882,7 +1886,7 @@
18821886 {
18831887 int err;
18841888
1885
- init_completion(&priv->flush_comp);
1889
+ reinit_completion(&priv->flush_comp);
18861890
18871891 err = kvaser_usb_hydra_send_simple_cmd(priv->dev, CMD_FLUSH_QUEUE,
18881892 priv->channel);
....@@ -2024,5 +2028,5 @@
20242028 .freq = 24000000,
20252029 },
20262030 .timestamp_freq = 1,
2027
- .bittiming_const = &kvaser_usb_hydra_flexc_bittiming_c,
2031
+ .bittiming_const = &kvaser_usb_flexc_bittiming_const,
20282032 };