Lines Matching refs:ndev
103 struct net_device *ndev; member
325 struct net_device *ndev = priv->ndev; in w5100_write_macaddr() local
329 w5100_write(priv, W5100_SHAR + i, ndev->dev_addr[i]); in w5100_write_macaddr()
376 static void w5100_get_drvinfo(struct net_device *ndev, in w5100_get_drvinfo() argument
381 strlcpy(info->bus_info, dev_name(ndev->dev.parent), in w5100_get_drvinfo()
385 static u32 w5100_get_link(struct net_device *ndev) in w5100_get_link() argument
387 struct w5100_priv *priv = netdev_priv(ndev); in w5100_get_link()
395 static u32 w5100_get_msglevel(struct net_device *ndev) in w5100_get_msglevel() argument
397 struct w5100_priv *priv = netdev_priv(ndev); in w5100_get_msglevel()
402 static void w5100_set_msglevel(struct net_device *ndev, u32 value) in w5100_set_msglevel() argument
404 struct w5100_priv *priv = netdev_priv(ndev); in w5100_set_msglevel()
409 static int w5100_get_regs_len(struct net_device *ndev) in w5100_get_regs_len() argument
414 static void w5100_get_regs(struct net_device *ndev, in w5100_get_regs() argument
417 struct w5100_priv *priv = netdev_priv(ndev); in w5100_get_regs()
428 static void w5100_tx_timeout(struct net_device *ndev) in w5100_tx_timeout() argument
430 struct w5100_priv *priv = netdev_priv(ndev); in w5100_tx_timeout()
432 netif_stop_queue(ndev); in w5100_tx_timeout()
435 ndev->stats.tx_errors++; in w5100_tx_timeout()
436 ndev->trans_start = jiffies; in w5100_tx_timeout()
437 netif_wake_queue(ndev); in w5100_tx_timeout()
440 static int w5100_start_tx(struct sk_buff *skb, struct net_device *ndev) in w5100_start_tx() argument
442 struct w5100_priv *priv = netdev_priv(ndev); in w5100_start_tx()
445 netif_stop_queue(ndev); in w5100_start_tx()
451 ndev->stats.tx_bytes += skb->len; in w5100_start_tx()
452 ndev->stats.tx_packets++; in w5100_start_tx()
463 struct net_device *ndev = priv->ndev; in w5100_napi_poll() local
479 skb = netdev_alloc_skb_ip_align(ndev, rx_len); in w5100_napi_poll()
484 ndev->stats.rx_dropped++; in w5100_napi_poll()
493 skb->protocol = eth_type_trans(skb, ndev); in w5100_napi_poll()
496 ndev->stats.rx_packets++; in w5100_napi_poll()
497 ndev->stats.rx_bytes += rx_len; in w5100_napi_poll()
511 struct net_device *ndev = ndev_instance; in w5100_interrupt() local
512 struct w5100_priv *priv = netdev_priv(ndev); in w5100_interrupt()
521 netif_dbg(priv, tx_done, ndev, "tx done\n"); in w5100_interrupt()
522 netif_wake_queue(ndev); in w5100_interrupt()
538 struct net_device *ndev = ndev_instance; in w5100_detect_link() local
539 struct w5100_priv *priv = netdev_priv(ndev); in w5100_detect_link()
541 if (netif_running(ndev)) { in w5100_detect_link()
543 netif_info(priv, link, ndev, "link is up\n"); in w5100_detect_link()
544 netif_carrier_on(ndev); in w5100_detect_link()
546 netif_info(priv, link, ndev, "link is down\n"); in w5100_detect_link()
547 netif_carrier_off(ndev); in w5100_detect_link()
554 static void w5100_set_rx_mode(struct net_device *ndev) in w5100_set_rx_mode() argument
556 struct w5100_priv *priv = netdev_priv(ndev); in w5100_set_rx_mode()
557 bool set_promisc = (ndev->flags & IFF_PROMISC) != 0; in w5100_set_rx_mode()
565 static int w5100_set_macaddr(struct net_device *ndev, void *addr) in w5100_set_macaddr() argument
567 struct w5100_priv *priv = netdev_priv(ndev); in w5100_set_macaddr()
572 memcpy(ndev->dev_addr, sock_addr->sa_data, ETH_ALEN); in w5100_set_macaddr()
577 static int w5100_open(struct net_device *ndev) in w5100_open() argument
579 struct w5100_priv *priv = netdev_priv(ndev); in w5100_open()
581 netif_info(priv, ifup, ndev, "enabling\n"); in w5100_open()
584 netif_start_queue(ndev); in w5100_open()
587 netif_carrier_on(ndev); in w5100_open()
591 static int w5100_stop(struct net_device *ndev) in w5100_stop() argument
593 struct w5100_priv *priv = netdev_priv(ndev); in w5100_stop()
595 netif_info(priv, ifdown, ndev, "shutting down\n"); in w5100_stop()
597 netif_carrier_off(ndev); in w5100_stop()
598 netif_stop_queue(ndev); in w5100_stop()
626 struct net_device *ndev = platform_get_drvdata(pdev); in w5100_hw_probe() local
627 struct w5100_priv *priv = netdev_priv(ndev); in w5100_hw_probe()
628 const char *name = netdev_name(ndev); in w5100_hw_probe()
635 memcpy(ndev->dev_addr, data->mac_addr, ETH_ALEN); in w5100_hw_probe()
637 eth_hw_addr_random(ndev); in w5100_hw_probe()
673 IRQ_TYPE_LEVEL_LOW, name, ndev); in w5100_hw_probe()
687 link_name, priv->ndev) < 0) in w5100_hw_probe()
691 netdev_info(ndev, "at 0x%llx irq %d\n", (u64)mem->start, irq); in w5100_hw_probe()
698 struct net_device *ndev; in w5100_probe() local
701 ndev = alloc_etherdev(sizeof(*priv)); in w5100_probe()
702 if (!ndev) in w5100_probe()
704 SET_NETDEV_DEV(ndev, &pdev->dev); in w5100_probe()
705 platform_set_drvdata(pdev, ndev); in w5100_probe()
706 priv = netdev_priv(ndev); in w5100_probe()
707 priv->ndev = ndev; in w5100_probe()
709 ndev->netdev_ops = &w5100_netdev_ops; in w5100_probe()
710 ndev->ethtool_ops = &w5100_ethtool_ops; in w5100_probe()
711 ndev->watchdog_timeo = HZ; in w5100_probe()
712 netif_napi_add(ndev, &priv->napi, w5100_napi_poll, 16); in w5100_probe()
717 ndev->features |= NETIF_F_VLAN_CHALLENGED; in w5100_probe()
719 err = register_netdev(ndev); in w5100_probe()
730 unregister_netdev(ndev); in w5100_probe()
732 free_netdev(ndev); in w5100_probe()
738 struct net_device *ndev = platform_get_drvdata(pdev); in w5100_remove() local
739 struct w5100_priv *priv = netdev_priv(ndev); in w5100_remove()
742 free_irq(priv->irq, ndev); in w5100_remove()
744 free_irq(priv->link_irq, ndev); in w5100_remove()
746 unregister_netdev(ndev); in w5100_remove()
747 free_netdev(ndev); in w5100_remove()
755 struct net_device *ndev = platform_get_drvdata(pdev); in w5100_suspend() local
756 struct w5100_priv *priv = netdev_priv(ndev); in w5100_suspend()
758 if (netif_running(ndev)) { in w5100_suspend()
759 netif_carrier_off(ndev); in w5100_suspend()
760 netif_device_detach(ndev); in w5100_suspend()
770 struct net_device *ndev = platform_get_drvdata(pdev); in w5100_resume() local
771 struct w5100_priv *priv = netdev_priv(ndev); in w5100_resume()
773 if (netif_running(ndev)) { in w5100_resume()
777 netif_device_attach(ndev); in w5100_resume()
780 netif_carrier_on(ndev); in w5100_resume()