Lines Matching defs:ndev
33 struct net_device *ndev;
47 static int mhi_ndo_open(struct net_device *ndev)
49 struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
55 netif_carrier_on(ndev);
57 netif_start_queue(ndev);
62 static int mhi_ndo_stop(struct net_device *ndev)
64 struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
66 netif_stop_queue(ndev);
67 netif_carrier_off(ndev);
73 static netdev_tx_t mhi_ndo_xmit(struct sk_buff *skb, struct net_device *ndev)
75 struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
82 ndev->name, err);
88 netif_stop_queue(ndev);
100 static void mhi_ndo_get_stats64(struct net_device *ndev,
103 struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
129 static void mhi_net_setup(struct net_device *ndev)
131 ndev->header_ops = NULL; /* No header */
132 ndev->type = ARPHRD_RAWIP;
133 ndev->hard_header_len = 0;
134 ndev->addr_len = 0;
135 ndev->flags = IFF_POINTOPOINT | IFF_NOARP;
136 ndev->netdev_ops = &mhi_netdev_ops;
137 ndev->mtu = MHI_NET_DEFAULT_MTU;
138 ndev->min_mtu = MHI_NET_MIN_MTU;
139 ndev->max_mtu = MHI_NET_MAX_MTU;
140 ndev->tx_queue_len = 1000;
187 netdev_warn_once(mhi_netdev->ndev,
240 struct net_device *ndev = mhi_netdev->ndev;
264 if (netif_queue_stopped(ndev) && !mhi_queue_is_full(mdev, DMA_TO_DEVICE))
265 netif_wake_queue(ndev);
272 struct net_device *ndev = mhi_netdev->ndev;
278 size = mhi_netdev->mru ? mhi_netdev->mru : READ_ONCE(ndev->mtu);
281 skb = netdev_alloc_skb(ndev, size);
288 ndev->name, err);
304 static int mhi_net_newlink(struct mhi_device *mhi_dev, struct net_device *ndev)
309 mhi_netdev = netdev_priv(ndev);
312 mhi_netdev->ndev = ndev;
329 err = register_netdev(ndev);
336 static void mhi_net_dellink(struct mhi_device *mhi_dev, struct net_device *ndev)
338 struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
340 unregister_netdev(ndev);
346 free_netdev(ndev);
355 struct net_device *ndev;
358 ndev = alloc_netdev(sizeof(struct mhi_net_dev), info->netname,
360 if (!ndev)
363 SET_NETDEV_DEV(ndev, &mhi_dev->dev);
365 err = mhi_net_newlink(mhi_dev, ndev);
367 free_netdev(ndev);
378 mhi_net_dellink(mhi_dev, mhi_netdev->ndev);