Lines Matching full:netdev

42 	struct net_device *netdev;  member
57 static int liteeth_rx(struct net_device *netdev) in liteeth_rx() argument
59 struct liteeth *priv = netdev_priv(netdev); in liteeth_rx()
71 skb = netdev_alloc_skb_ip_align(netdev, len); in liteeth_rx()
73 netdev_err(netdev, "couldn't get memory\n"); in liteeth_rx()
79 skb->protocol = eth_type_trans(skb, netdev); in liteeth_rx()
81 netdev->stats.rx_packets++; in liteeth_rx()
82 netdev->stats.rx_bytes += len; in liteeth_rx()
87 netdev->stats.rx_dropped++; in liteeth_rx()
88 netdev->stats.rx_errors++; in liteeth_rx()
95 struct net_device *netdev = dev_id; in liteeth_interrupt() local
96 struct liteeth *priv = netdev_priv(netdev); in liteeth_interrupt()
101 if (netif_queue_stopped(netdev)) in liteeth_interrupt()
102 netif_wake_queue(netdev); in liteeth_interrupt()
108 liteeth_rx(netdev); in liteeth_interrupt()
115 static int liteeth_open(struct net_device *netdev) in liteeth_open() argument
117 struct liteeth *priv = netdev_priv(netdev); in liteeth_open()
124 err = request_irq(netdev->irq, liteeth_interrupt, 0, netdev->name, netdev); in liteeth_open()
126 netdev_err(netdev, "failed to request irq %d\n", netdev->irq); in liteeth_open()
134 netif_carrier_on(netdev); in liteeth_open()
135 netif_start_queue(netdev); in liteeth_open()
140 static int liteeth_stop(struct net_device *netdev) in liteeth_stop() argument
142 struct liteeth *priv = netdev_priv(netdev); in liteeth_stop()
144 netif_stop_queue(netdev); in liteeth_stop()
145 netif_carrier_off(netdev); in liteeth_stop()
150 free_irq(netdev->irq, netdev); in liteeth_stop()
156 struct net_device *netdev) in liteeth_start_xmit() argument
158 struct liteeth *priv = netdev_priv(netdev); in liteeth_start_xmit()
163 netdev_err(netdev, "LITEETH_READER_READY not ready\n"); in liteeth_start_xmit()
165 netif_stop_queue(netdev); in liteeth_start_xmit()
173 netdev_err(netdev, "tx packet too big\n"); in liteeth_start_xmit()
176 netdev->stats.tx_dropped++; in liteeth_start_xmit()
177 netdev->stats.tx_errors++; in liteeth_start_xmit()
188 netdev->stats.tx_bytes += skb->len; in liteeth_start_xmit()
189 netdev->stats.tx_packets++; in liteeth_start_xmit()
229 struct net_device *netdev; in liteeth_probe() local
234 netdev = devm_alloc_etherdev(&pdev->dev, sizeof(*priv)); in liteeth_probe()
235 if (!netdev) in liteeth_probe()
238 SET_NETDEV_DEV(netdev, &pdev->dev); in liteeth_probe()
239 platform_set_drvdata(pdev, netdev); in liteeth_probe()
241 priv = netdev_priv(netdev); in liteeth_probe()
242 priv->netdev = netdev; in liteeth_probe()
248 netdev->irq = irq; in liteeth_probe()
268 err = of_get_ethdev_address(pdev->dev.of_node, netdev); in liteeth_probe()
270 eth_hw_addr_random(netdev); in liteeth_probe()
272 netdev->netdev_ops = &liteeth_netdev_ops; in liteeth_probe()
274 err = register_netdev(netdev); in liteeth_probe()
276 dev_err(&pdev->dev, "Failed to register netdev %d\n", err); in liteeth_probe()
280 netdev_info(netdev, "irq %d slots: tx %d rx %d size %d\n", in liteeth_probe()
281 netdev->irq, priv->num_tx_slots, priv->num_rx_slots, priv->slot_size); in liteeth_probe()
288 struct net_device *netdev = platform_get_drvdata(pdev); in liteeth_remove() local
290 unregister_netdev(netdev); in liteeth_remove()