Lines Matching refs:ndev
99 struct net_device *ndev; member
236 struct net_device *ndev = priv->ndev; in w5300_write_macaddr() local
238 ndev->dev_addr[0] << 24 | in w5300_write_macaddr()
239 ndev->dev_addr[1] << 16 | in w5300_write_macaddr()
240 ndev->dev_addr[2] << 8 | in w5300_write_macaddr()
241 ndev->dev_addr[3]); in w5300_write_macaddr()
243 ndev->dev_addr[4] << 8 | in w5300_write_macaddr()
244 ndev->dev_addr[5]); in w5300_write_macaddr()
295 static void w5300_get_drvinfo(struct net_device *ndev, in w5300_get_drvinfo() argument
300 strlcpy(info->bus_info, dev_name(ndev->dev.parent), in w5300_get_drvinfo()
304 static u32 w5300_get_link(struct net_device *ndev) in w5300_get_link() argument
306 struct w5300_priv *priv = netdev_priv(ndev); in w5300_get_link()
314 static u32 w5300_get_msglevel(struct net_device *ndev) in w5300_get_msglevel() argument
316 struct w5300_priv *priv = netdev_priv(ndev); in w5300_get_msglevel()
321 static void w5300_set_msglevel(struct net_device *ndev, u32 value) in w5300_set_msglevel() argument
323 struct w5300_priv *priv = netdev_priv(ndev); in w5300_set_msglevel()
328 static int w5300_get_regs_len(struct net_device *ndev) in w5300_get_regs_len() argument
333 static void w5300_get_regs(struct net_device *ndev, in w5300_get_regs() argument
336 struct w5300_priv *priv = netdev_priv(ndev); in w5300_get_regs()
357 static void w5300_tx_timeout(struct net_device *ndev) in w5300_tx_timeout() argument
359 struct w5300_priv *priv = netdev_priv(ndev); in w5300_tx_timeout()
361 netif_stop_queue(ndev); in w5300_tx_timeout()
364 ndev->stats.tx_errors++; in w5300_tx_timeout()
365 ndev->trans_start = jiffies; in w5300_tx_timeout()
366 netif_wake_queue(ndev); in w5300_tx_timeout()
369 static int w5300_start_tx(struct sk_buff *skb, struct net_device *ndev) in w5300_start_tx() argument
371 struct w5300_priv *priv = netdev_priv(ndev); in w5300_start_tx()
373 netif_stop_queue(ndev); in w5300_start_tx()
377 ndev->stats.tx_packets++; in w5300_start_tx()
378 ndev->stats.tx_bytes += skb->len; in w5300_start_tx()
380 netif_dbg(priv, tx_queued, ndev, "tx queued\n"); in w5300_start_tx()
390 struct net_device *ndev = priv->ndev; in w5300_napi_poll() local
402 skb = netdev_alloc_skb_ip_align(ndev, roundup(rx_len, 2)); in w5300_napi_poll()
407 ndev->stats.rx_dropped++; in w5300_napi_poll()
413 skb->protocol = eth_type_trans(skb, ndev); in w5300_napi_poll()
416 ndev->stats.rx_packets++; in w5300_napi_poll()
417 ndev->stats.rx_bytes += rx_len; in w5300_napi_poll()
431 struct net_device *ndev = ndev_instance; in w5300_interrupt() local
432 struct w5300_priv *priv = netdev_priv(ndev); in w5300_interrupt()
441 netif_dbg(priv, tx_done, ndev, "tx done\n"); in w5300_interrupt()
442 netif_wake_queue(ndev); in w5300_interrupt()
458 struct net_device *ndev = ndev_instance; in w5300_detect_link() local
459 struct w5300_priv *priv = netdev_priv(ndev); in w5300_detect_link()
461 if (netif_running(ndev)) { in w5300_detect_link()
463 netif_info(priv, link, ndev, "link is up\n"); in w5300_detect_link()
464 netif_carrier_on(ndev); in w5300_detect_link()
466 netif_info(priv, link, ndev, "link is down\n"); in w5300_detect_link()
467 netif_carrier_off(ndev); in w5300_detect_link()
474 static void w5300_set_rx_mode(struct net_device *ndev) in w5300_set_rx_mode() argument
476 struct w5300_priv *priv = netdev_priv(ndev); in w5300_set_rx_mode()
477 bool set_promisc = (ndev->flags & IFF_PROMISC) != 0; in w5300_set_rx_mode()
485 static int w5300_set_macaddr(struct net_device *ndev, void *addr) in w5300_set_macaddr() argument
487 struct w5300_priv *priv = netdev_priv(ndev); in w5300_set_macaddr()
492 memcpy(ndev->dev_addr, sock_addr->sa_data, ETH_ALEN); in w5300_set_macaddr()
497 static int w5300_open(struct net_device *ndev) in w5300_open() argument
499 struct w5300_priv *priv = netdev_priv(ndev); in w5300_open()
501 netif_info(priv, ifup, ndev, "enabling\n"); in w5300_open()
504 netif_start_queue(ndev); in w5300_open()
507 netif_carrier_on(ndev); in w5300_open()
511 static int w5300_stop(struct net_device *ndev) in w5300_stop() argument
513 struct w5300_priv *priv = netdev_priv(ndev); in w5300_stop()
515 netif_info(priv, ifdown, ndev, "shutting down\n"); in w5300_stop()
517 netif_carrier_off(ndev); in w5300_stop()
518 netif_stop_queue(ndev); in w5300_stop()
546 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_hw_probe() local
547 struct w5300_priv *priv = netdev_priv(ndev); in w5300_hw_probe()
548 const char *name = netdev_name(ndev); in w5300_hw_probe()
555 memcpy(ndev->dev_addr, data->mac_addr, ETH_ALEN); in w5300_hw_probe()
557 eth_hw_addr_random(ndev); in w5300_hw_probe()
585 IRQ_TYPE_LEVEL_LOW, name, ndev); in w5300_hw_probe()
599 link_name, priv->ndev) < 0) in w5300_hw_probe()
603 netdev_info(ndev, "at 0x%llx irq %d\n", (u64)mem->start, irq); in w5300_hw_probe()
610 struct net_device *ndev; in w5300_probe() local
613 ndev = alloc_etherdev(sizeof(*priv)); in w5300_probe()
614 if (!ndev) in w5300_probe()
616 SET_NETDEV_DEV(ndev, &pdev->dev); in w5300_probe()
617 platform_set_drvdata(pdev, ndev); in w5300_probe()
618 priv = netdev_priv(ndev); in w5300_probe()
619 priv->ndev = ndev; in w5300_probe()
621 ndev->netdev_ops = &w5300_netdev_ops; in w5300_probe()
622 ndev->ethtool_ops = &w5300_ethtool_ops; in w5300_probe()
623 ndev->watchdog_timeo = HZ; in w5300_probe()
624 netif_napi_add(ndev, &priv->napi, w5300_napi_poll, 16); in w5300_probe()
629 ndev->features |= NETIF_F_VLAN_CHALLENGED; in w5300_probe()
631 err = register_netdev(ndev); in w5300_probe()
642 unregister_netdev(ndev); in w5300_probe()
644 free_netdev(ndev); in w5300_probe()
650 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_remove() local
651 struct w5300_priv *priv = netdev_priv(ndev); in w5300_remove()
654 free_irq(priv->irq, ndev); in w5300_remove()
656 free_irq(priv->link_irq, ndev); in w5300_remove()
658 unregister_netdev(ndev); in w5300_remove()
659 free_netdev(ndev); in w5300_remove()
667 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_suspend() local
668 struct w5300_priv *priv = netdev_priv(ndev); in w5300_suspend()
670 if (netif_running(ndev)) { in w5300_suspend()
671 netif_carrier_off(ndev); in w5300_suspend()
672 netif_device_detach(ndev); in w5300_suspend()
682 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_resume() local
683 struct w5300_priv *priv = netdev_priv(ndev); in w5300_resume()
685 if (!netif_running(ndev)) { in w5300_resume()
689 netif_device_attach(ndev); in w5300_resume()
692 netif_carrier_on(ndev); in w5300_resume()