#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
+#include <linux/can/led.h>
/* driver constants */
#define MAX_RX_URBS 20
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+
+ can_led_event(priv->netdev, CAN_LED_EVENT_RX);
} else {
netdev_warn(priv->netdev, "frame type %d unknown",
msg->type);
can_get_echo_skb(netdev, context->echo_index);
+ can_led_event(netdev, CAN_LED_EVENT_TX);
+
/* Release context */
context->echo_index = MAX_TX_URBS;
if (err)
return err;
+ can_led_event(netdev, CAN_LED_EVENT_OPEN);
+
/* finally start device */
err = usb_8dev_start(priv);
if (err) {
close_candev(netdev);
+ can_led_event(netdev, CAN_LED_EVENT_STOP);
+
return err;
}
(version>>8) & 0xff, version & 0xff);
}
+ devm_can_led_init(netdev);
+
return 0;
cleanup_cmd_msg_buffer: