Lines Matching refs:netdev
127 struct net_device *netdev; member
202 struct net_device *netdev; in usb_8dev_send_cmd() local
204 netdev = priv->netdev; in usb_8dev_send_cmd()
217 netdev_err(netdev, "sending command message failed\n"); in usb_8dev_send_cmd()
225 netdev_err(netdev, "no command message answer\n"); in usb_8dev_send_cmd()
315 static int usb_8dev_set_mode(struct net_device *netdev, enum can_mode mode) in usb_8dev_set_mode() argument
317 struct usb_8dev_priv *priv = netdev_priv(netdev); in usb_8dev_set_mode()
324 netdev_warn(netdev, "couldn't start device"); in usb_8dev_set_mode()
340 struct net_device_stats *stats = &priv->netdev->stats; in usb_8dev_rx_err_msg()
356 skb = alloc_can_err_skb(priv->netdev, &cf); in usb_8dev_rx_err_msg()
370 can_bus_off(priv->netdev); in usb_8dev_rx_err_msg()
432 netdev_warn(priv->netdev, in usb_8dev_rx_err_msg()
462 struct net_device_stats *stats = &priv->netdev->stats; in usb_8dev_rx_can_msg()
468 skb = alloc_can_skb(priv->netdev, &cf); in usb_8dev_rx_can_msg()
487 can_led_event(priv->netdev, CAN_LED_EVENT_RX); in usb_8dev_rx_can_msg()
489 netdev_warn(priv->netdev, "frame type %d unknown", in usb_8dev_rx_can_msg()
502 struct net_device *netdev; in usb_8dev_read_bulk_callback() local
506 netdev = priv->netdev; in usb_8dev_read_bulk_callback()
508 if (!netif_device_present(netdev)) in usb_8dev_read_bulk_callback()
522 netdev_info(netdev, "Rx URB aborted (%d)\n", in usb_8dev_read_bulk_callback()
531 netdev_err(priv->netdev, "format error\n"); in usb_8dev_read_bulk_callback()
550 netif_device_detach(netdev); in usb_8dev_read_bulk_callback()
552 netdev_err(netdev, in usb_8dev_read_bulk_callback()
565 struct net_device *netdev; in usb_8dev_write_bulk_callback() local
570 netdev = priv->netdev; in usb_8dev_write_bulk_callback()
578 if (!netif_device_present(netdev)) in usb_8dev_write_bulk_callback()
582 netdev_info(netdev, "Tx URB aborted (%d)\n", in usb_8dev_write_bulk_callback()
585 netdev->stats.tx_packets++; in usb_8dev_write_bulk_callback()
586 netdev->stats.tx_bytes += context->dlc; in usb_8dev_write_bulk_callback()
588 can_get_echo_skb(netdev, context->echo_index); in usb_8dev_write_bulk_callback()
590 can_led_event(netdev, CAN_LED_EVENT_TX); in usb_8dev_write_bulk_callback()
595 netif_wake_queue(netdev); in usb_8dev_write_bulk_callback()
600 struct net_device *netdev) in usb_8dev_start_xmit() argument
602 struct usb_8dev_priv *priv = netdev_priv(netdev); in usb_8dev_start_xmit()
603 struct net_device_stats *stats = &netdev->stats; in usb_8dev_start_xmit()
612 if (can_dropped_invalid_skb(netdev, skb)) in usb_8dev_start_xmit()
623 netdev_err(netdev, "No memory left for USB buffer\n"); in usb_8dev_start_xmit()
667 can_put_echo_skb(skb, netdev, context->echo_index); in usb_8dev_start_xmit()
676 netif_stop_queue(netdev); in usb_8dev_start_xmit()
689 netdev_warn(netdev, "couldn't find free context"); in usb_8dev_start_xmit()
694 can_free_echo_skb(netdev, context->echo_index); in usb_8dev_start_xmit()
702 netif_device_detach(netdev); in usb_8dev_start_xmit()
704 netdev_warn(netdev, "failed tx_urb %d\n", err); in usb_8dev_start_xmit()
716 static int usb_8dev_get_berr_counter(const struct net_device *netdev, in usb_8dev_get_berr_counter() argument
719 struct usb_8dev_priv *priv = netdev_priv(netdev); in usb_8dev_get_berr_counter()
730 struct net_device *netdev = priv->netdev; in usb_8dev_start() local
747 netdev_err(netdev, "No memory left for USB buffer\n"); in usb_8dev_start()
776 netdev_warn(netdev, "couldn't setup read URBs\n"); in usb_8dev_start()
782 netdev_warn(netdev, "rx performance may be slow\n"); in usb_8dev_start()
794 netif_device_detach(priv->netdev); in usb_8dev_start()
796 netdev_warn(netdev, "couldn't submit control: %d\n", err); in usb_8dev_start()
802 static int usb_8dev_open(struct net_device *netdev) in usb_8dev_open() argument
804 struct usb_8dev_priv *priv = netdev_priv(netdev); in usb_8dev_open()
808 err = open_candev(netdev); in usb_8dev_open()
812 can_led_event(netdev, CAN_LED_EVENT_OPEN); in usb_8dev_open()
818 netif_device_detach(priv->netdev); in usb_8dev_open()
820 netdev_warn(netdev, "couldn't start device: %d\n", in usb_8dev_open()
823 close_candev(netdev); in usb_8dev_open()
828 netif_start_queue(netdev); in usb_8dev_open()
847 static int usb_8dev_close(struct net_device *netdev) in usb_8dev_close() argument
849 struct usb_8dev_priv *priv = netdev_priv(netdev); in usb_8dev_close()
855 netdev_warn(netdev, "couldn't stop device"); in usb_8dev_close()
859 netif_stop_queue(netdev); in usb_8dev_close()
864 close_candev(netdev); in usb_8dev_close()
866 can_led_event(netdev, CAN_LED_EVENT_STOP); in usb_8dev_close()
899 struct net_device *netdev; in usb_8dev_probe() local
913 netdev = alloc_candev(sizeof(struct usb_8dev_priv), MAX_TX_URBS); in usb_8dev_probe()
914 if (!netdev) { in usb_8dev_probe()
919 priv = netdev_priv(netdev); in usb_8dev_probe()
922 priv->netdev = netdev; in usb_8dev_probe()
933 netdev->netdev_ops = &usb_8dev_netdev_ops; in usb_8dev_probe()
935 netdev->flags |= IFF_ECHO; /* we support local echo */ in usb_8dev_probe()
952 SET_NETDEV_DEV(netdev, &intf->dev); in usb_8dev_probe()
956 err = register_candev(netdev); in usb_8dev_probe()
958 netdev_err(netdev, in usb_8dev_probe()
965 netdev_err(netdev, "can't get firmware version\n"); in usb_8dev_probe()
968 netdev_info(netdev, in usb_8dev_probe()
974 devm_can_led_init(netdev); in usb_8dev_probe()
979 unregister_netdev(priv->netdev); in usb_8dev_probe()
982 free_candev(netdev); in usb_8dev_probe()
996 netdev_info(priv->netdev, "device disconnected\n"); in usb_8dev_disconnect()
998 unregister_netdev(priv->netdev); in usb_8dev_disconnect()
1000 free_candev(priv->netdev); in usb_8dev_disconnect()