Lines Matching refs:ndev

214 	struct net_device *ndev;  member
300 netdev_warn(priv->ndev, "WARN: Triple" in ti_hecc_set_btc()
309 netdev_info(priv->ndev, "setting CANBTC=%#x\n", can_btc); in ti_hecc_set_btc()
321 static void ti_hecc_reset(struct net_device *ndev) in ti_hecc_reset() argument
324 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_reset()
326 netdev_dbg(ndev, "resetting hecc ...\n"); in ti_hecc_reset()
384 static void ti_hecc_start(struct net_device *ndev) in ti_hecc_start() argument
386 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_start()
390 ti_hecc_reset(ndev); in ti_hecc_start()
424 static void ti_hecc_stop(struct net_device *ndev) in ti_hecc_stop() argument
426 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_stop()
435 static int ti_hecc_do_set_mode(struct net_device *ndev, enum can_mode mode) in ti_hecc_do_set_mode() argument
441 ti_hecc_start(ndev); in ti_hecc_do_set_mode()
442 netif_wake_queue(ndev); in ti_hecc_do_set_mode()
452 static int ti_hecc_get_berr_counter(const struct net_device *ndev, in ti_hecc_get_berr_counter() argument
455 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_get_berr_counter()
485 static netdev_tx_t ti_hecc_xmit(struct sk_buff *skb, struct net_device *ndev) in ti_hecc_xmit() argument
487 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_xmit()
492 if (can_dropped_invalid_skb(ndev, skb)) in ti_hecc_xmit()
500 netif_stop_queue(ndev); in ti_hecc_xmit()
501 netdev_err(priv->ndev, in ti_hecc_xmit()
526 can_put_echo_skb(skb, ndev, mbxno); in ti_hecc_xmit()
532 netif_stop_queue(ndev); in ti_hecc_xmit()
546 struct net_device_stats *stats = &priv->ndev->stats; in ti_hecc_rx_pkt()
552 skb = alloc_can_skb(priv->ndev, &cf); in ti_hecc_rx_pkt()
555 netdev_err(priv->ndev, in ti_hecc_rx_pkt()
585 can_led_event(priv->ndev, CAN_LED_EVENT_RX); in ti_hecc_rx_pkt()
615 struct net_device *ndev = napi->dev; in ti_hecc_rx_poll() local
616 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_rx_poll()
621 if (!netif_running(ndev)) in ti_hecc_rx_poll()
660 static int ti_hecc_error(struct net_device *ndev, int int_status, in ti_hecc_error() argument
663 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_error()
664 struct net_device_stats *stats = &ndev->stats; in ti_hecc_error()
669 skb = alloc_can_err_skb(ndev, &cf); in ti_hecc_error()
672 netdev_err(priv->ndev, in ti_hecc_error()
688 netdev_dbg(priv->ndev, "Error Warning interrupt\n"); in ti_hecc_error()
703 netdev_dbg(priv->ndev, "Error passive interrupt\n"); in ti_hecc_error()
719 can_bus_off(ndev); in ti_hecc_error()
756 struct net_device *ndev = (struct net_device *)dev_id; in ti_hecc_interrupt() local
757 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_interrupt()
758 struct net_device_stats *stats = &ndev->stats; in ti_hecc_interrupt()
771 ti_hecc_error(ndev, int_status, err_status); in ti_hecc_interrupt()
787 can_led_event(ndev, CAN_LED_EVENT_TX); in ti_hecc_interrupt()
788 can_get_echo_skb(ndev, mbxno); in ti_hecc_interrupt()
797 netif_wake_queue(ndev); in ti_hecc_interrupt()
820 static int ti_hecc_open(struct net_device *ndev) in ti_hecc_open() argument
822 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_open()
825 err = request_irq(ndev->irq, ti_hecc_interrupt, IRQF_SHARED, in ti_hecc_open()
826 ndev->name, ndev); in ti_hecc_open()
828 netdev_err(ndev, "error requesting interrupt\n"); in ti_hecc_open()
835 err = open_candev(ndev); in ti_hecc_open()
837 netdev_err(ndev, "open_candev() failed %d\n", err); in ti_hecc_open()
839 free_irq(ndev->irq, ndev); in ti_hecc_open()
843 can_led_event(ndev, CAN_LED_EVENT_OPEN); in ti_hecc_open()
845 ti_hecc_start(ndev); in ti_hecc_open()
847 netif_start_queue(ndev); in ti_hecc_open()
852 static int ti_hecc_close(struct net_device *ndev) in ti_hecc_close() argument
854 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_close()
856 netif_stop_queue(ndev); in ti_hecc_close()
858 ti_hecc_stop(ndev); in ti_hecc_close()
859 free_irq(ndev->irq, ndev); in ti_hecc_close()
860 close_candev(ndev); in ti_hecc_close()
863 can_led_event(ndev, CAN_LED_EVENT_STOP); in ti_hecc_close()
877 struct net_device *ndev = (struct net_device *)0; in ti_hecc_probe() local
912 ndev = alloc_candev(sizeof(struct ti_hecc_priv), HECC_MAX_TX_MBOX); in ti_hecc_probe()
913 if (!ndev) { in ti_hecc_probe()
919 priv = netdev_priv(ndev); in ti_hecc_probe()
920 priv->ndev = ndev; in ti_hecc_probe()
934 ndev->irq = irq->start; in ti_hecc_probe()
935 ndev->flags |= IFF_ECHO; in ti_hecc_probe()
936 platform_set_drvdata(pdev, ndev); in ti_hecc_probe()
937 SET_NETDEV_DEV(ndev, &pdev->dev); in ti_hecc_probe()
938 ndev->netdev_ops = &ti_hecc_netdev_ops; in ti_hecc_probe()
948 netif_napi_add(ndev, &priv->napi, ti_hecc_rx_poll, in ti_hecc_probe()
952 err = register_candev(ndev); in ti_hecc_probe()
958 devm_can_led_init(ndev); in ti_hecc_probe()
961 priv->base, (u32) ndev->irq); in ti_hecc_probe()
968 free_candev(ndev); in ti_hecc_probe()
980 struct net_device *ndev = platform_get_drvdata(pdev); in ti_hecc_remove() local
981 struct ti_hecc_priv *priv = netdev_priv(ndev); in ti_hecc_remove()
983 unregister_candev(ndev); in ti_hecc_remove()
989 free_candev(ndev); in ti_hecc_remove()