Lines Matching refs:ndev
98 struct net_device *ndev; member
235 struct net_device *ndev = priv->ndev; in w5300_write_macaddr() local
237 ndev->dev_addr[0] << 24 | in w5300_write_macaddr()
238 ndev->dev_addr[1] << 16 | in w5300_write_macaddr()
239 ndev->dev_addr[2] << 8 | in w5300_write_macaddr()
240 ndev->dev_addr[3]); in w5300_write_macaddr()
242 ndev->dev_addr[4] << 8 | in w5300_write_macaddr()
243 ndev->dev_addr[5]); in w5300_write_macaddr()
294 static void w5300_get_drvinfo(struct net_device *ndev, in w5300_get_drvinfo() argument
299 strlcpy(info->bus_info, dev_name(ndev->dev.parent), in w5300_get_drvinfo()
303 static u32 w5300_get_link(struct net_device *ndev) in w5300_get_link() argument
305 struct w5300_priv *priv = netdev_priv(ndev); in w5300_get_link()
313 static u32 w5300_get_msglevel(struct net_device *ndev) in w5300_get_msglevel() argument
315 struct w5300_priv *priv = netdev_priv(ndev); in w5300_get_msglevel()
320 static void w5300_set_msglevel(struct net_device *ndev, u32 value) in w5300_set_msglevel() argument
322 struct w5300_priv *priv = netdev_priv(ndev); in w5300_set_msglevel()
327 static int w5300_get_regs_len(struct net_device *ndev) in w5300_get_regs_len() argument
332 static void w5300_get_regs(struct net_device *ndev, in w5300_get_regs() argument
335 struct w5300_priv *priv = netdev_priv(ndev); in w5300_get_regs()
356 static void w5300_tx_timeout(struct net_device *ndev) in w5300_tx_timeout() argument
358 struct w5300_priv *priv = netdev_priv(ndev); in w5300_tx_timeout()
360 netif_stop_queue(ndev); in w5300_tx_timeout()
363 ndev->stats.tx_errors++; in w5300_tx_timeout()
364 netif_trans_update(ndev); in w5300_tx_timeout()
365 netif_wake_queue(ndev); in w5300_tx_timeout()
368 static int w5300_start_tx(struct sk_buff *skb, struct net_device *ndev) in w5300_start_tx() argument
370 struct w5300_priv *priv = netdev_priv(ndev); in w5300_start_tx()
372 netif_stop_queue(ndev); in w5300_start_tx()
376 ndev->stats.tx_packets++; in w5300_start_tx()
377 ndev->stats.tx_bytes += skb->len; in w5300_start_tx()
379 netif_dbg(priv, tx_queued, ndev, "tx queued\n"); in w5300_start_tx()
389 struct net_device *ndev = priv->ndev; in w5300_napi_poll() local
401 skb = netdev_alloc_skb_ip_align(ndev, roundup(rx_len, 2)); in w5300_napi_poll()
406 ndev->stats.rx_dropped++; in w5300_napi_poll()
412 skb->protocol = eth_type_trans(skb, ndev); in w5300_napi_poll()
415 ndev->stats.rx_packets++; in w5300_napi_poll()
416 ndev->stats.rx_bytes += rx_len; in w5300_napi_poll()
430 struct net_device *ndev = ndev_instance; in w5300_interrupt() local
431 struct w5300_priv *priv = netdev_priv(ndev); in w5300_interrupt()
440 netif_dbg(priv, tx_done, ndev, "tx done\n"); in w5300_interrupt()
441 netif_wake_queue(ndev); in w5300_interrupt()
457 struct net_device *ndev = ndev_instance; in w5300_detect_link() local
458 struct w5300_priv *priv = netdev_priv(ndev); in w5300_detect_link()
460 if (netif_running(ndev)) { in w5300_detect_link()
462 netif_info(priv, link, ndev, "link is up\n"); in w5300_detect_link()
463 netif_carrier_on(ndev); in w5300_detect_link()
465 netif_info(priv, link, ndev, "link is down\n"); in w5300_detect_link()
466 netif_carrier_off(ndev); in w5300_detect_link()
473 static void w5300_set_rx_mode(struct net_device *ndev) in w5300_set_rx_mode() argument
475 struct w5300_priv *priv = netdev_priv(ndev); in w5300_set_rx_mode()
476 bool set_promisc = (ndev->flags & IFF_PROMISC) != 0; in w5300_set_rx_mode()
484 static int w5300_set_macaddr(struct net_device *ndev, void *addr) in w5300_set_macaddr() argument
486 struct w5300_priv *priv = netdev_priv(ndev); in w5300_set_macaddr()
491 memcpy(ndev->dev_addr, sock_addr->sa_data, ETH_ALEN); in w5300_set_macaddr()
496 static int w5300_open(struct net_device *ndev) in w5300_open() argument
498 struct w5300_priv *priv = netdev_priv(ndev); in w5300_open()
500 netif_info(priv, ifup, ndev, "enabling\n"); in w5300_open()
503 netif_start_queue(ndev); in w5300_open()
506 netif_carrier_on(ndev); in w5300_open()
510 static int w5300_stop(struct net_device *ndev) in w5300_stop() argument
512 struct w5300_priv *priv = netdev_priv(ndev); in w5300_stop()
514 netif_info(priv, ifdown, ndev, "shutting down\n"); in w5300_stop()
516 netif_carrier_off(ndev); in w5300_stop()
517 netif_stop_queue(ndev); in w5300_stop()
544 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_hw_probe() local
545 struct w5300_priv *priv = netdev_priv(ndev); in w5300_hw_probe()
546 const char *name = netdev_name(ndev); in w5300_hw_probe()
553 memcpy(ndev->dev_addr, data->mac_addr, ETH_ALEN); in w5300_hw_probe()
555 eth_hw_addr_random(ndev); in w5300_hw_probe()
583 IRQ_TYPE_LEVEL_LOW, name, ndev); in w5300_hw_probe()
597 link_name, priv->ndev) < 0) in w5300_hw_probe()
601 netdev_info(ndev, "at 0x%llx irq %d\n", (u64)mem->start, irq); in w5300_hw_probe()
608 struct net_device *ndev; in w5300_probe() local
611 ndev = alloc_etherdev(sizeof(*priv)); in w5300_probe()
612 if (!ndev) in w5300_probe()
614 SET_NETDEV_DEV(ndev, &pdev->dev); in w5300_probe()
615 platform_set_drvdata(pdev, ndev); in w5300_probe()
616 priv = netdev_priv(ndev); in w5300_probe()
617 priv->ndev = ndev; in w5300_probe()
619 ndev->netdev_ops = &w5300_netdev_ops; in w5300_probe()
620 ndev->ethtool_ops = &w5300_ethtool_ops; in w5300_probe()
621 ndev->watchdog_timeo = HZ; in w5300_probe()
622 netif_napi_add(ndev, &priv->napi, w5300_napi_poll, 16); in w5300_probe()
627 ndev->features |= NETIF_F_VLAN_CHALLENGED; in w5300_probe()
629 err = register_netdev(ndev); in w5300_probe()
640 unregister_netdev(ndev); in w5300_probe()
642 free_netdev(ndev); in w5300_probe()
648 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_remove() local
649 struct w5300_priv *priv = netdev_priv(ndev); in w5300_remove()
652 free_irq(priv->irq, ndev); in w5300_remove()
654 free_irq(priv->link_irq, ndev); in w5300_remove()
656 unregister_netdev(ndev); in w5300_remove()
657 free_netdev(ndev); in w5300_remove()
665 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_suspend() local
666 struct w5300_priv *priv = netdev_priv(ndev); in w5300_suspend()
668 if (netif_running(ndev)) { in w5300_suspend()
669 netif_carrier_off(ndev); in w5300_suspend()
670 netif_device_detach(ndev); in w5300_suspend()
680 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_resume() local
681 struct w5300_priv *priv = netdev_priv(ndev); in w5300_resume()
683 if (!netif_running(ndev)) { in w5300_resume()
687 netif_device_attach(ndev); in w5300_resume()
690 netif_carrier_on(ndev); in w5300_resume()