Lines Matching refs:ndev

51 	struct net_device *ndev;  in xgene_enet_refill_bufpool()  local
59 ndev = buf_pool->ndev; in xgene_enet_refill_bufpool()
60 dev = ndev_to_dev(buf_pool->ndev); in xgene_enet_refill_bufpool()
67 skb = netdev_alloc_skb_ip_align(ndev, len); in xgene_enet_refill_bufpool()
74 netdev_err(ndev, "DMA mapping error\n"); in xgene_enet_refill_bufpool()
93 struct xgene_enet_pdata *pdata = netdev_priv(ring->ndev); in xgene_enet_dst_ring_num()
162 dev = ndev_to_dev(cp_ring->ndev); in xgene_enet_tx_completion()
170 xgene_enet_parse_error(cp_ring, netdev_priv(cp_ring->ndev), in xgene_enet_tx_completion()
178 netdev_err(cp_ring->ndev, "completion skb is NULL\n"); in xgene_enet_tx_completion()
230 struct device *dev = ndev_to_dev(tx_ring->ndev); in xgene_enet_setup_tx_desc()
241 netdev_err(tx_ring->ndev, "DMA mapping error\n"); in xgene_enet_setup_tx_desc()
259 struct net_device *ndev) in xgene_enet_start_xmit() argument
261 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_start_xmit()
270 netif_stop_queue(ndev); in xgene_enet_start_xmit()
302 struct net_device *ndev; in xgene_enet_rx_frame() local
311 ndev = rx_ring->ndev; in xgene_enet_rx_frame()
312 pdata = netdev_priv(ndev); in xgene_enet_rx_frame()
313 dev = ndev_to_dev(rx_ring->ndev); in xgene_enet_rx_frame()
325 xgene_enet_parse_error(rx_ring, netdev_priv(rx_ring->ndev), in xgene_enet_rx_frame()
339 skb->protocol = eth_type_trans(skb, ndev); in xgene_enet_rx_frame()
340 if (likely((ndev->features & NETIF_F_IP_CSUM) && in xgene_enet_rx_frame()
365 struct xgene_enet_pdata *pdata = netdev_priv(ring->ndev); in xgene_enet_process_ring()
395 if (netif_queue_stopped(ring->ndev)) { in xgene_enet_process_ring()
397 netif_wake_queue(ring->ndev); in xgene_enet_process_ring()
420 static void xgene_enet_timeout(struct net_device *ndev) in xgene_enet_timeout() argument
422 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_timeout()
427 static int xgene_enet_register_irq(struct net_device *ndev) in xgene_enet_register_irq() argument
429 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_register_irq()
430 struct device *dev = ndev_to_dev(ndev); in xgene_enet_register_irq()
438 netdev_err(ndev, "Failed to request irq %s\n", ring->irq_name); in xgene_enet_register_irq()
445 netdev_err(ndev, "Failed to request irq %s\n", in xgene_enet_register_irq()
453 static void xgene_enet_free_irq(struct net_device *ndev) in xgene_enet_free_irq() argument
458 pdata = netdev_priv(ndev); in xgene_enet_free_irq()
459 dev = ndev_to_dev(ndev); in xgene_enet_free_irq()
494 static int xgene_enet_open(struct net_device *ndev) in xgene_enet_open() argument
496 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_open()
503 ret = xgene_enet_register_irq(ndev); in xgene_enet_open()
513 netif_start_queue(ndev); in xgene_enet_open()
518 static int xgene_enet_close(struct net_device *ndev) in xgene_enet_close() argument
520 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_close()
523 netif_stop_queue(ndev); in xgene_enet_close()
531 xgene_enet_free_irq(ndev); in xgene_enet_close()
545 pdata = netdev_priv(ring->ndev); in xgene_enet_delete_ring()
546 dev = ndev_to_dev(ring->ndev); in xgene_enet_delete_ring()
606 dev = ndev_to_dev(ring->ndev); in xgene_enet_free_desc_ring()
641 struct net_device *ndev, u32 ring_num, in xgene_enet_create_desc_ring() argument
645 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_create_desc_ring()
646 struct device *dev = ndev_to_dev(ndev); in xgene_enet_create_desc_ring()
658 ring->ndev = ndev; in xgene_enet_create_desc_ring()
674 netdev_dbg(ndev, "ring info: num=%d size=%d id=%d slots=%d\n", in xgene_enet_create_desc_ring()
685 static int xgene_enet_create_desc_rings(struct net_device *ndev) in xgene_enet_create_desc_rings() argument
687 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_create_desc_rings()
688 struct device *dev = ndev_to_dev(ndev); in xgene_enet_create_desc_rings()
700 rx_ring = xgene_enet_create_desc_ring(ndev, ring_num++, in xgene_enet_create_desc_rings()
709 buf_pool = xgene_enet_create_desc_ring(ndev, ring_num++, in xgene_enet_create_desc_rings()
721 ndev->name); in xgene_enet_create_desc_rings()
723 snprintf(rx_ring->irq_name, IRQ_ID_SIZE, "%s-rx", ndev->name); in xgene_enet_create_desc_rings()
738 tx_ring = xgene_enet_create_desc_ring(ndev, ring_num++, in xgene_enet_create_desc_rings()
751 cp_ring = xgene_enet_create_desc_ring(ndev, ring_num++, in xgene_enet_create_desc_rings()
759 snprintf(cp_ring->irq_name, IRQ_ID_SIZE, "%s-txc", ndev->name); in xgene_enet_create_desc_rings()
783 struct net_device *ndev, in xgene_enet_get_stats64() argument
786 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_get_stats64()
798 static int xgene_enet_set_mac_address(struct net_device *ndev, void *addr) in xgene_enet_set_mac_address() argument
800 struct xgene_enet_pdata *pdata = netdev_priv(ndev); in xgene_enet_set_mac_address()
803 ret = eth_mac_addr(ndev, addr); in xgene_enet_set_mac_address()
875 struct net_device *ndev; in xgene_enet_get_resources() local
883 ndev = pdata->ndev; in xgene_enet_get_resources()
924 if (xgene_get_mac_address(dev, ndev->dev_addr) != ETH_ALEN) in xgene_enet_get_resources()
925 eth_hw_addr_random(ndev); in xgene_enet_get_resources()
927 memcpy(ndev->perm_addr, ndev->dev_addr, ndev->addr_len); in xgene_enet_get_resources()
984 struct net_device *ndev = pdata->ndev; in xgene_enet_init_hw() local
993 ret = xgene_enet_create_desc_rings(ndev); in xgene_enet_init_hw()
995 netdev_err(ndev, "Error in ring configuration\n"); in xgene_enet_init_hw()
1061 netif_napi_add(pdata->ndev, napi, xgene_enet_napi, NAPI_POLL_WEIGHT); in xgene_enet_napi_add()
1065 netif_napi_add(pdata->ndev, napi, xgene_enet_napi, in xgene_enet_napi_add()
1085 struct net_device *ndev; in xgene_enet_probe() local
1091 ndev = alloc_etherdev(sizeof(struct xgene_enet_pdata)); in xgene_enet_probe()
1092 if (!ndev) in xgene_enet_probe()
1095 pdata = netdev_priv(ndev); in xgene_enet_probe()
1098 pdata->ndev = ndev; in xgene_enet_probe()
1099 SET_NETDEV_DEV(ndev, dev); in xgene_enet_probe()
1101 ndev->netdev_ops = &xgene_ndev_ops; in xgene_enet_probe()
1102 xgene_enet_set_ethtool_ops(ndev); in xgene_enet_probe()
1103 ndev->features |= NETIF_F_IP_CSUM | in xgene_enet_probe()
1113 ret = register_netdev(ndev); in xgene_enet_probe()
1115 netdev_err(ndev, "Failed to register netdev\n"); in xgene_enet_probe()
1121 netdev_err(ndev, "No usable DMA configuration\n"); in xgene_enet_probe()
1138 unregister_netdev(ndev); in xgene_enet_probe()
1139 free_netdev(ndev); in xgene_enet_probe()
1147 struct net_device *ndev; in xgene_enet_remove() local
1151 ndev = pdata->ndev; in xgene_enet_remove()
1159 unregister_netdev(ndev); in xgene_enet_remove()
1161 free_netdev(ndev); in xgene_enet_remove()