Lines Matching refs:ndev
97 struct net_device *ndev; member
230 struct net_device *ndev = priv->ndev; in w5300_write_macaddr() local
232 ndev->dev_addr[0] << 24 | in w5300_write_macaddr()
233 ndev->dev_addr[1] << 16 | in w5300_write_macaddr()
234 ndev->dev_addr[2] << 8 | in w5300_write_macaddr()
235 ndev->dev_addr[3]); in w5300_write_macaddr()
237 ndev->dev_addr[4] << 8 | in w5300_write_macaddr()
238 ndev->dev_addr[5]); in w5300_write_macaddr()
282 static void w5300_get_drvinfo(struct net_device *ndev, in w5300_get_drvinfo() argument
287 strscpy(info->bus_info, dev_name(ndev->dev.parent), in w5300_get_drvinfo()
291 static u32 w5300_get_link(struct net_device *ndev) in w5300_get_link() argument
293 struct w5300_priv *priv = netdev_priv(ndev); in w5300_get_link()
301 static u32 w5300_get_msglevel(struct net_device *ndev) in w5300_get_msglevel() argument
303 struct w5300_priv *priv = netdev_priv(ndev); in w5300_get_msglevel()
308 static void w5300_set_msglevel(struct net_device *ndev, u32 value) in w5300_set_msglevel() argument
310 struct w5300_priv *priv = netdev_priv(ndev); in w5300_set_msglevel()
315 static int w5300_get_regs_len(struct net_device *ndev) in w5300_get_regs_len() argument
320 static void w5300_get_regs(struct net_device *ndev, in w5300_get_regs() argument
323 struct w5300_priv *priv = netdev_priv(ndev); in w5300_get_regs()
344 static void w5300_tx_timeout(struct net_device *ndev, unsigned int txqueue) in w5300_tx_timeout() argument
346 struct w5300_priv *priv = netdev_priv(ndev); in w5300_tx_timeout()
348 netif_stop_queue(ndev); in w5300_tx_timeout()
351 ndev->stats.tx_errors++; in w5300_tx_timeout()
352 netif_trans_update(ndev); in w5300_tx_timeout()
353 netif_wake_queue(ndev); in w5300_tx_timeout()
356 static netdev_tx_t w5300_start_tx(struct sk_buff *skb, struct net_device *ndev) in w5300_start_tx() argument
358 struct w5300_priv *priv = netdev_priv(ndev); in w5300_start_tx()
360 netif_stop_queue(ndev); in w5300_start_tx()
363 ndev->stats.tx_packets++; in w5300_start_tx()
364 ndev->stats.tx_bytes += skb->len; in w5300_start_tx()
366 netif_dbg(priv, tx_queued, ndev, "tx queued\n"); in w5300_start_tx()
376 struct net_device *ndev = priv->ndev; in w5300_napi_poll() local
388 skb = netdev_alloc_skb_ip_align(ndev, roundup(rx_len, 2)); in w5300_napi_poll()
393 ndev->stats.rx_dropped++; in w5300_napi_poll()
399 skb->protocol = eth_type_trans(skb, ndev); in w5300_napi_poll()
402 ndev->stats.rx_packets++; in w5300_napi_poll()
403 ndev->stats.rx_bytes += rx_len; in w5300_napi_poll()
416 struct net_device *ndev = ndev_instance; in w5300_interrupt() local
417 struct w5300_priv *priv = netdev_priv(ndev); in w5300_interrupt()
425 netif_dbg(priv, tx_done, ndev, "tx done\n"); in w5300_interrupt()
426 netif_wake_queue(ndev); in w5300_interrupt()
441 struct net_device *ndev = ndev_instance; in w5300_detect_link() local
442 struct w5300_priv *priv = netdev_priv(ndev); in w5300_detect_link()
444 if (netif_running(ndev)) { in w5300_detect_link()
446 netif_info(priv, link, ndev, "link is up\n"); in w5300_detect_link()
447 netif_carrier_on(ndev); in w5300_detect_link()
449 netif_info(priv, link, ndev, "link is down\n"); in w5300_detect_link()
450 netif_carrier_off(ndev); in w5300_detect_link()
457 static void w5300_set_rx_mode(struct net_device *ndev) in w5300_set_rx_mode() argument
459 struct w5300_priv *priv = netdev_priv(ndev); in w5300_set_rx_mode()
460 bool set_promisc = (ndev->flags & IFF_PROMISC) != 0; in w5300_set_rx_mode()
468 static int w5300_set_macaddr(struct net_device *ndev, void *addr) in w5300_set_macaddr() argument
470 struct w5300_priv *priv = netdev_priv(ndev); in w5300_set_macaddr()
475 eth_hw_addr_set(ndev, sock_addr->sa_data); in w5300_set_macaddr()
480 static int w5300_open(struct net_device *ndev) in w5300_open() argument
482 struct w5300_priv *priv = netdev_priv(ndev); in w5300_open()
484 netif_info(priv, ifup, ndev, "enabling\n"); in w5300_open()
487 netif_start_queue(ndev); in w5300_open()
490 netif_carrier_on(ndev); in w5300_open()
494 static int w5300_stop(struct net_device *ndev) in w5300_stop() argument
496 struct w5300_priv *priv = netdev_priv(ndev); in w5300_stop()
498 netif_info(priv, ifdown, ndev, "shutting down\n"); in w5300_stop()
500 netif_carrier_off(ndev); in w5300_stop()
501 netif_stop_queue(ndev); in w5300_stop()
528 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_hw_probe() local
529 struct w5300_priv *priv = netdev_priv(ndev); in w5300_hw_probe()
530 const char *name = netdev_name(ndev); in w5300_hw_probe()
537 eth_hw_addr_set(ndev, data->mac_addr); in w5300_hw_probe()
539 eth_hw_addr_random(ndev); in w5300_hw_probe()
567 IRQ_TYPE_LEVEL_LOW, name, ndev); in w5300_hw_probe()
581 link_name, priv->ndev) < 0) in w5300_hw_probe()
585 netdev_info(ndev, "at 0x%llx irq %d\n", (u64)mem->start, irq); in w5300_hw_probe()
592 struct net_device *ndev; in w5300_probe() local
595 ndev = alloc_etherdev(sizeof(*priv)); in w5300_probe()
596 if (!ndev) in w5300_probe()
598 SET_NETDEV_DEV(ndev, &pdev->dev); in w5300_probe()
599 platform_set_drvdata(pdev, ndev); in w5300_probe()
600 priv = netdev_priv(ndev); in w5300_probe()
601 priv->ndev = ndev; in w5300_probe()
603 ndev->netdev_ops = &w5300_netdev_ops; in w5300_probe()
604 ndev->ethtool_ops = &w5300_ethtool_ops; in w5300_probe()
605 ndev->watchdog_timeo = HZ; in w5300_probe()
606 netif_napi_add_weight(ndev, &priv->napi, w5300_napi_poll, 16); in w5300_probe()
611 ndev->features |= NETIF_F_VLAN_CHALLENGED; in w5300_probe()
613 err = register_netdev(ndev); in w5300_probe()
624 unregister_netdev(ndev); in w5300_probe()
626 free_netdev(ndev); in w5300_probe()
632 struct net_device *ndev = platform_get_drvdata(pdev); in w5300_remove() local
633 struct w5300_priv *priv = netdev_priv(ndev); in w5300_remove()
636 free_irq(priv->irq, ndev); in w5300_remove()
638 free_irq(priv->link_irq, ndev); in w5300_remove()
640 unregister_netdev(ndev); in w5300_remove()
641 free_netdev(ndev); in w5300_remove()
648 struct net_device *ndev = dev_get_drvdata(dev); in w5300_suspend() local
649 struct w5300_priv *priv = netdev_priv(ndev); in w5300_suspend()
651 if (netif_running(ndev)) { in w5300_suspend()
652 netif_carrier_off(ndev); in w5300_suspend()
653 netif_device_detach(ndev); in w5300_suspend()
662 struct net_device *ndev = dev_get_drvdata(dev); in w5300_resume() local
663 struct w5300_priv *priv = netdev_priv(ndev); in w5300_resume()
665 if (!netif_running(ndev)) { in w5300_resume()
669 netif_device_attach(ndev); in w5300_resume()
672 netif_carrier_on(ndev); in w5300_resume()