diff options
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r-- | drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 4 | ||||
-rw-r--r-- | drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 10 | ||||
-rw-r--r-- | drivers/net/can/usb/ucan.c | 7 |
3 files changed, 7 insertions, 14 deletions
diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c index b939a4c10b84..c89c7d4900d7 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | |||
@@ -528,7 +528,6 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, | |||
528 | context = &priv->tx_contexts[i]; | 528 | context = &priv->tx_contexts[i]; |
529 | 529 | ||
530 | context->echo_index = i; | 530 | context->echo_index = i; |
531 | can_put_echo_skb(skb, netdev, context->echo_index); | ||
532 | ++priv->active_tx_contexts; | 531 | ++priv->active_tx_contexts; |
533 | if (priv->active_tx_contexts >= (int)dev->max_tx_urbs) | 532 | if (priv->active_tx_contexts >= (int)dev->max_tx_urbs) |
534 | netif_stop_queue(netdev); | 533 | netif_stop_queue(netdev); |
@@ -553,7 +552,6 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, | |||
553 | dev_kfree_skb(skb); | 552 | dev_kfree_skb(skb); |
554 | spin_lock_irqsave(&priv->tx_contexts_lock, flags); | 553 | spin_lock_irqsave(&priv->tx_contexts_lock, flags); |
555 | 554 | ||
556 | can_free_echo_skb(netdev, context->echo_index); | ||
557 | context->echo_index = dev->max_tx_urbs; | 555 | context->echo_index = dev->max_tx_urbs; |
558 | --priv->active_tx_contexts; | 556 | --priv->active_tx_contexts; |
559 | netif_wake_queue(netdev); | 557 | netif_wake_queue(netdev); |
@@ -564,6 +562,8 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, | |||
564 | 562 | ||
565 | context->priv = priv; | 563 | context->priv = priv; |
566 | 564 | ||
565 | can_put_echo_skb(skb, netdev, context->echo_index); | ||
566 | |||
567 | usb_fill_bulk_urb(urb, dev->udev, | 567 | usb_fill_bulk_urb(urb, dev->udev, |
568 | usb_sndbulkpipe(dev->udev, | 568 | usb_sndbulkpipe(dev->udev, |
569 | dev->bulk_out->bEndpointAddress), | 569 | dev->bulk_out->bEndpointAddress), |
diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c index c084bae5ec0a..5fc0be564274 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | |||
@@ -1019,6 +1019,11 @@ kvaser_usb_hydra_error_frame(struct kvaser_usb_net_priv *priv, | |||
1019 | new_state : CAN_STATE_ERROR_ACTIVE; | 1019 | new_state : CAN_STATE_ERROR_ACTIVE; |
1020 | 1020 | ||
1021 | can_change_state(netdev, cf, tx_state, rx_state); | 1021 | can_change_state(netdev, cf, tx_state, rx_state); |
1022 | |||
1023 | if (priv->can.restart_ms && | ||
1024 | old_state >= CAN_STATE_BUS_OFF && | ||
1025 | new_state < CAN_STATE_BUS_OFF) | ||
1026 | cf->can_id |= CAN_ERR_RESTARTED; | ||
1022 | } | 1027 | } |
1023 | 1028 | ||
1024 | if (new_state == CAN_STATE_BUS_OFF) { | 1029 | if (new_state == CAN_STATE_BUS_OFF) { |
@@ -1028,11 +1033,6 @@ kvaser_usb_hydra_error_frame(struct kvaser_usb_net_priv *priv, | |||
1028 | 1033 | ||
1029 | can_bus_off(netdev); | 1034 | can_bus_off(netdev); |
1030 | } | 1035 | } |
1031 | |||
1032 | if (priv->can.restart_ms && | ||
1033 | old_state >= CAN_STATE_BUS_OFF && | ||
1034 | new_state < CAN_STATE_BUS_OFF) | ||
1035 | cf->can_id |= CAN_ERR_RESTARTED; | ||
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | if (!skb) { | 1038 | if (!skb) { |
diff --git a/drivers/net/can/usb/ucan.c b/drivers/net/can/usb/ucan.c index 0678a38b1af4..f3d5bda012a1 100644 --- a/drivers/net/can/usb/ucan.c +++ b/drivers/net/can/usb/ucan.c | |||
@@ -35,10 +35,6 @@ | |||
35 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
36 | #include <linux/usb.h> | 36 | #include <linux/usb.h> |
37 | 37 | ||
38 | #include <linux/can.h> | ||
39 | #include <linux/can/dev.h> | ||
40 | #include <linux/can/error.h> | ||
41 | |||
42 | #define UCAN_DRIVER_NAME "ucan" | 38 | #define UCAN_DRIVER_NAME "ucan" |
43 | #define UCAN_MAX_RX_URBS 8 | 39 | #define UCAN_MAX_RX_URBS 8 |
44 | /* the CAN controller needs a while to enable/disable the bus */ | 40 | /* the CAN controller needs a while to enable/disable the bus */ |
@@ -1575,11 +1571,8 @@ err_firmware_needs_update: | |||
1575 | /* disconnect the device */ | 1571 | /* disconnect the device */ |
1576 | static void ucan_disconnect(struct usb_interface *intf) | 1572 | static void ucan_disconnect(struct usb_interface *intf) |
1577 | { | 1573 | { |
1578 | struct usb_device *udev; | ||
1579 | struct ucan_priv *up = usb_get_intfdata(intf); | 1574 | struct ucan_priv *up = usb_get_intfdata(intf); |
1580 | 1575 | ||
1581 | udev = interface_to_usbdev(intf); | ||
1582 | |||
1583 | usb_set_intfdata(intf, NULL); | 1576 | usb_set_intfdata(intf, NULL); |
1584 | 1577 | ||
1585 | if (up) { | 1578 | if (up) { |