Lines Matching refs:ndev
55 struct net_device *ndev; in xgene_enet_refill_bufpool() local
63 ndev = buf_pool->ndev; in xgene_enet_refill_bufpool()
64 dev = ndev_to_dev(buf_pool->ndev); in xgene_enet_refill_bufpool()
65 pdata = netdev_priv(ndev); in xgene_enet_refill_bufpool()
72 skb = netdev_alloc_skb_ip_align(ndev, len); in xgene_enet_refill_bufpool()
79 netdev_err(ndev, "DMA mapping error\n"); in xgene_enet_refill_bufpool()
98 struct xgene_enet_pdata *pdata = netdev_priv(ring->ndev); in xgene_enet_dst_ring_num()
112 struct xgene_enet_pdata *pdata = netdev_priv(buf_pool->ndev); in xgene_enet_delete_bufpool()
160 dev = ndev_to_dev(cp_ring->ndev); in xgene_enet_tx_completion()
174 xgene_enet_parse_error(cp_ring, netdev_priv(cp_ring->ndev), in xgene_enet_tx_completion()
182 netdev_err(cp_ring->ndev, "completion skb is NULL\n"); in xgene_enet_tx_completion()
191 struct net_device *ndev = skb->dev; in xgene_enet_work_msg() local
192 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_work_msg()
217 if (ndev->features & NETIF_F_TSO) { in xgene_enet_work_msg()
291 struct device *dev = ndev_to_dev(tx_ring->ndev); in xgene_enet_setup_tx_desc()
292 struct xgene_enet_pdata *pdata = netdev_priv(tx_ring->ndev); in xgene_enet_setup_tx_desc()
320 netdev_err(tx_ring->ndev, "DMA mapping error\n"); in xgene_enet_setup_tx_desc()
430 struct net_device *ndev) in xgene_enet_start_xmit() argument
432 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_start_xmit()
441 netif_stop_queue(ndev); in xgene_enet_start_xmit()
476 struct net_device *ndev; in xgene_enet_rx_frame() local
485 ndev = rx_ring->ndev; in xgene_enet_rx_frame()
486 pdata = netdev_priv(ndev); in xgene_enet_rx_frame()
487 dev = ndev_to_dev(rx_ring->ndev); in xgene_enet_rx_frame()
499 xgene_enet_parse_error(rx_ring, netdev_priv(rx_ring->ndev), in xgene_enet_rx_frame()
513 skb->protocol = eth_type_trans(skb, ndev); in xgene_enet_rx_frame()
514 if (likely((ndev->features & NETIF_F_IP_CSUM) && in xgene_enet_rx_frame()
539 struct xgene_enet_pdata *pdata = netdev_priv(ring->ndev); in xgene_enet_process_ring()
593 if (netif_queue_stopped(ring->ndev)) in xgene_enet_process_ring()
594 netif_start_queue(ring->ndev); in xgene_enet_process_ring()
616 static void xgene_enet_timeout(struct net_device *ndev) in xgene_enet_timeout() argument
618 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_timeout()
623 static int xgene_enet_register_irq(struct net_device *ndev) in xgene_enet_register_irq() argument
625 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_register_irq()
626 struct device *dev = ndev_to_dev(ndev); in xgene_enet_register_irq()
634 netdev_err(ndev, "Failed to request irq %s\n", ring->irq_name); in xgene_enet_register_irq()
641 netdev_err(ndev, "Failed to request irq %s\n", in xgene_enet_register_irq()
649 static void xgene_enet_free_irq(struct net_device *ndev) in xgene_enet_free_irq() argument
654 pdata = netdev_priv(ndev); in xgene_enet_free_irq()
655 dev = ndev_to_dev(ndev); in xgene_enet_free_irq()
690 static int xgene_enet_open(struct net_device *ndev) in xgene_enet_open() argument
692 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_open()
700 ret = xgene_enet_register_irq(ndev); in xgene_enet_open()
709 netif_start_queue(ndev); in xgene_enet_open()
714 static int xgene_enet_close(struct net_device *ndev) in xgene_enet_close() argument
716 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_close()
719 netif_stop_queue(ndev); in xgene_enet_close()
729 xgene_enet_free_irq(ndev); in xgene_enet_close()
741 pdata = netdev_priv(ring->ndev); in xgene_enet_delete_ring()
742 dev = ndev_to_dev(ring->ndev); in xgene_enet_delete_ring()
803 dev = ndev_to_dev(ring->ndev); in xgene_enet_free_desc_ring()
804 pdata = netdev_priv(ring->ndev); in xgene_enet_free_desc_ring()
858 struct net_device *ndev, u32 ring_num, in xgene_enet_create_desc_ring() argument
862 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_create_desc_ring()
863 struct device *dev = ndev_to_dev(ndev); in xgene_enet_create_desc_ring()
875 ring->ndev = ndev; in xgene_enet_create_desc_ring()
902 netdev_dbg(ndev, "ring info: num=%d size=%d id=%d slots=%d\n", in xgene_enet_create_desc_ring()
934 static int xgene_enet_create_desc_rings(struct net_device *ndev) in xgene_enet_create_desc_rings() argument
936 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_create_desc_rings()
937 struct device *dev = ndev_to_dev(ndev); in xgene_enet_create_desc_rings()
952 rx_ring = xgene_enet_create_desc_ring(ndev, ring_num++, in xgene_enet_create_desc_rings()
962 buf_pool = xgene_enet_create_desc_ring(ndev, ring_num++, in xgene_enet_create_desc_rings()
974 ndev->name); in xgene_enet_create_desc_rings()
976 snprintf(rx_ring->irq_name, IRQ_ID_SIZE, "%s-rx", ndev->name); in xgene_enet_create_desc_rings()
992 tx_ring = xgene_enet_create_desc_ring(ndev, ring_num++, in xgene_enet_create_desc_rings()
1014 cp_ring = xgene_enet_create_desc_ring(ndev, ring_num++, in xgene_enet_create_desc_rings()
1022 snprintf(cp_ring->irq_name, IRQ_ID_SIZE, "%s-txc", ndev->name); in xgene_enet_create_desc_rings()
1054 struct net_device *ndev, in xgene_enet_get_stats64() argument
1057 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_get_stats64()
1069 static int xgene_enet_set_mac_address(struct net_device *ndev, void *addr) in xgene_enet_set_mac_address() argument
1071 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_set_mac_address()
1074 ret = eth_mac_addr(ndev, addr); in xgene_enet_set_mac_address()
1171 struct net_device *ndev; in xgene_enet_get_resources() local
1180 ndev = pdata->ndev; in xgene_enet_get_resources()
1226 if (!device_get_mac_address(dev, ndev->dev_addr, ETH_ALEN)) in xgene_enet_get_resources()
1227 eth_hw_addr_random(ndev); in xgene_enet_get_resources()
1229 memcpy(ndev->perm_addr, ndev->dev_addr, ndev->addr_len); in xgene_enet_get_resources()
1302 struct net_device *ndev = pdata->ndev; in xgene_enet_init_hw() local
1311 ret = xgene_enet_create_desc_rings(ndev); in xgene_enet_init_hw()
1313 netdev_err(ndev, "Error in ring configuration\n"); in xgene_enet_init_hw()
1405 netif_napi_add(pdata->ndev, napi, xgene_enet_napi, NAPI_POLL_WEIGHT); in xgene_enet_napi_add()
1409 netif_napi_add(pdata->ndev, napi, xgene_enet_napi, in xgene_enet_napi_add()
1429 struct net_device *ndev; in xgene_enet_probe() local
1436 ndev = alloc_etherdev(sizeof(struct xgene_enet_pdata)); in xgene_enet_probe()
1437 if (!ndev) in xgene_enet_probe()
1440 pdata = netdev_priv(ndev); in xgene_enet_probe()
1443 pdata->ndev = ndev; in xgene_enet_probe()
1444 SET_NETDEV_DEV(ndev, dev); in xgene_enet_probe()
1446 ndev->netdev_ops = &xgene_ndev_ops; in xgene_enet_probe()
1447 xgene_enet_set_ethtool_ops(ndev); in xgene_enet_probe()
1448 ndev->features |= NETIF_F_IP_CSUM | in xgene_enet_probe()
1467 free_netdev(ndev); in xgene_enet_probe()
1478 ndev->features |= NETIF_F_TSO; in xgene_enet_probe()
1481 ndev->hw_features = ndev->features; in xgene_enet_probe()
1485 netdev_err(ndev, "No usable DMA configuration\n"); in xgene_enet_probe()
1489 ret = register_netdev(ndev); in xgene_enet_probe()
1491 netdev_err(ndev, "Failed to register netdev\n"); in xgene_enet_probe()
1511 unregister_netdev(ndev); in xgene_enet_probe()
1512 free_netdev(ndev); in xgene_enet_probe()
1520 struct net_device *ndev; in xgene_enet_remove() local
1524 ndev = pdata->ndev; in xgene_enet_remove()
1532 unregister_netdev(ndev); in xgene_enet_remove()
1535 free_netdev(ndev); in xgene_enet_remove()