Lines Matching refs:netdev
77 struct net_device *netdev; member
200 netif_stop_queue(priv->netdev); in mcba_usb_get_free_ctx()
216 netif_wake_queue(ctx->priv->netdev); in mcba_usb_free_ctx()
222 struct net_device *netdev; in mcba_usb_write_bulk_callback() local
226 netdev = ctx->priv->netdev; in mcba_usb_write_bulk_callback()
233 if (!netif_device_present(netdev)) in mcba_usb_write_bulk_callback()
236 netdev->stats.tx_packets++; in mcba_usb_write_bulk_callback()
237 netdev->stats.tx_bytes += ctx->dlc; in mcba_usb_write_bulk_callback()
239 can_led_event(netdev, CAN_LED_EVENT_TX); in mcba_usb_write_bulk_callback()
240 can_get_echo_skb(netdev, ctx->ndx); in mcba_usb_write_bulk_callback()
244 netdev_info(netdev, "Tx URB aborted (%d)\n", urb->status); in mcba_usb_write_bulk_callback()
298 netif_device_detach(priv->netdev); in mcba_usb_xmit()
300 netdev_warn(priv->netdev, "failed tx_urb %d\n", err); in mcba_usb_xmit()
310 struct net_device *netdev) in mcba_usb_start_xmit() argument
312 struct mcba_priv *priv = netdev_priv(netdev); in mcba_usb_start_xmit()
315 struct net_device_stats *stats = &priv->netdev->stats; in mcba_usb_start_xmit()
322 if (can_dropped_invalid_skb(netdev, skb)) in mcba_usb_start_xmit()
358 can_put_echo_skb(skb, priv->netdev, ctx->ndx); in mcba_usb_start_xmit()
367 can_free_echo_skb(priv->netdev, ctx->ndx); in mcba_usb_start_xmit()
384 netdev_err(priv->netdev, in mcba_usb_xmit_cmd()
393 netdev_err(priv->netdev, "Failed to send cmd (%d)", in mcba_usb_xmit_cmd()
423 struct net_device_stats *stats = &priv->netdev->stats; in mcba_usb_process_can()
426 skb = alloc_can_skb(priv->netdev, &cf); in mcba_usb_process_can()
461 can_led_event(priv->netdev, CAN_LED_EVENT_RX); in mcba_usb_process_can()
469 netdev_info(priv->netdev, "PIC USB version %hhu.%hhu\n", in mcba_usb_process_ka_usb()
495 netdev_info(priv->netdev, "PIC CAN version %hhu.%hhu\n", in mcba_usb_process_ka_can()
508 priv->netdev, in mcba_usb_process_ka_can()
557 netdev_warn(priv->netdev, "Unsupported msg (0x%hhX)", in mcba_usb_process_rx()
570 struct net_device *netdev; in mcba_usb_read_bulk_callback() local
574 netdev = priv->netdev; in mcba_usb_read_bulk_callback()
576 if (!netif_device_present(netdev)) in mcba_usb_read_bulk_callback()
590 netdev_info(netdev, "Rx URB aborted (%d)\n", urb->status); in mcba_usb_read_bulk_callback()
599 netdev_err(priv->netdev, "format error\n"); in mcba_usb_read_bulk_callback()
619 netif_device_detach(netdev); in mcba_usb_read_bulk_callback()
621 netdev_err(netdev, "failed resubmitting read bulk urb: %d\n", in mcba_usb_read_bulk_callback()
628 struct net_device *netdev = priv->netdev; in mcba_usb_start() local
647 netdev_err(netdev, "No memory left for USB buffer\n"); in mcba_usb_start()
675 netdev_warn(netdev, "couldn't setup read URBs\n"); in mcba_usb_start()
681 netdev_warn(netdev, "rx performance may be slow\n"); in mcba_usb_start()
690 static int mcba_usb_open(struct net_device *netdev) in mcba_usb_open() argument
692 struct mcba_priv *priv = netdev_priv(netdev); in mcba_usb_open()
696 err = open_candev(netdev); in mcba_usb_open()
703 can_led_event(netdev, CAN_LED_EVENT_OPEN); in mcba_usb_open()
704 netif_start_queue(netdev); in mcba_usb_open()
716 static int mcba_usb_close(struct net_device *netdev) in mcba_usb_close() argument
718 struct mcba_priv *priv = netdev_priv(netdev); in mcba_usb_close()
722 netif_stop_queue(netdev); in mcba_usb_close()
727 close_candev(netdev); in mcba_usb_close()
728 can_led_event(netdev, CAN_LED_EVENT_STOP); in mcba_usb_close()
738 static int mcba_net_set_mode(struct net_device *netdev, enum can_mode mode) in mcba_net_set_mode() argument
743 static int mcba_net_get_berr_counter(const struct net_device *netdev, in mcba_net_get_berr_counter() argument
746 struct mcba_priv *priv = netdev_priv(netdev); in mcba_net_get_berr_counter()
764 static int mcba_net_set_bittiming(struct net_device *netdev) in mcba_net_set_bittiming() argument
766 struct mcba_priv *priv = netdev_priv(netdev); in mcba_net_set_bittiming()
774 static int mcba_set_termination(struct net_device *netdev, u16 term) in mcba_set_termination() argument
776 struct mcba_priv *priv = netdev_priv(netdev); in mcba_set_termination()
794 struct net_device *netdev; in mcba_usb_probe() local
799 netdev = alloc_candev(sizeof(struct mcba_priv), MCBA_MAX_TX_URBS); in mcba_usb_probe()
800 if (!netdev) { in mcba_usb_probe()
805 priv = netdev_priv(netdev); in mcba_usb_probe()
808 priv->netdev = netdev; in mcba_usb_probe()
830 netdev->netdev_ops = &mcba_netdev_ops; in mcba_usb_probe()
832 netdev->flags |= IFF_ECHO; /* we support local echo */ in mcba_usb_probe()
834 SET_NETDEV_DEV(netdev, &intf->dev); in mcba_usb_probe()
836 err = register_candev(netdev); in mcba_usb_probe()
838 netdev_err(netdev, "couldn't register CAN device: %d\n", err); in mcba_usb_probe()
843 devm_can_led_init(netdev); in mcba_usb_probe()
849 netif_device_detach(priv->netdev); in mcba_usb_probe()
851 netdev_warn(netdev, "couldn't start device: %d\n", err); in mcba_usb_probe()
861 unregister_candev(priv->netdev); in mcba_usb_probe()
864 free_candev(netdev); in mcba_usb_probe()
876 netdev_info(priv->netdev, "device disconnected\n"); in mcba_usb_disconnect()
878 unregister_candev(priv->netdev); in mcba_usb_disconnect()
880 free_candev(priv->netdev); in mcba_usb_disconnect()