diff options
Diffstat (limited to 'drivers/net/ethernet/xilinx/ll_temac_main.c')
| -rw-r--r-- | drivers/net/ethernet/xilinx/ll_temac_main.c | 33 | 
1 files changed, 11 insertions, 22 deletions
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index 9fc2ada4c3c..57c2e5ef280 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -245,39 +245,30 @@ static int temac_dma_bd_init(struct net_device *ndev)  	/* returns a virtual address and a physical address. */  	lp->tx_bd_v = dma_alloc_coherent(ndev->dev.parent,  					 sizeof(*lp->tx_bd_v) * TX_BD_NUM, -					 &lp->tx_bd_p, GFP_KERNEL); -	if (!lp->tx_bd_v) { -		dev_err(&ndev->dev, -				"unable to allocate DMA TX buffer descriptors"); +					 &lp->tx_bd_p, GFP_KERNEL | __GFP_ZERO); +	if (!lp->tx_bd_v)  		goto out; -	} +  	lp->rx_bd_v = dma_alloc_coherent(ndev->dev.parent,  					 sizeof(*lp->rx_bd_v) * RX_BD_NUM, -					 &lp->rx_bd_p, GFP_KERNEL); -	if (!lp->rx_bd_v) { -		dev_err(&ndev->dev, -				"unable to allocate DMA RX buffer descriptors"); +					 &lp->rx_bd_p, GFP_KERNEL | __GFP_ZERO); +	if (!lp->rx_bd_v)  		goto out; -	} -	memset(lp->tx_bd_v, 0, sizeof(*lp->tx_bd_v) * TX_BD_NUM);  	for (i = 0; i < TX_BD_NUM; i++) {  		lp->tx_bd_v[i].next = lp->tx_bd_p +  				sizeof(*lp->tx_bd_v) * ((i + 1) % TX_BD_NUM);  	} -	memset(lp->rx_bd_v, 0, sizeof(*lp->rx_bd_v) * RX_BD_NUM);  	for (i = 0; i < RX_BD_NUM; i++) {  		lp->rx_bd_v[i].next = lp->rx_bd_p +  				sizeof(*lp->rx_bd_v) * ((i + 1) % RX_BD_NUM);  		skb = netdev_alloc_skb_ip_align(ndev,  						XTE_MAX_JUMBO_FRAME_SIZE); - -		if (skb == 0) { -			dev_err(&ndev->dev, "alloc_skb error %d\n", i); +		if (!skb)  			goto out; -		} +  		lp->rx_skb[i] = skb;  		/* returns physical address of skb->data */  		lp->rx_bd_v[i].phys = dma_map_single(ndev->dev.parent, @@ -789,9 +780,7 @@ static void ll_temac_recv(struct net_device *ndev)  		new_skb = netdev_alloc_skb_ip_align(ndev,  						XTE_MAX_JUMBO_FRAME_SIZE); - -		if (new_skb == 0) { -			dev_err(&ndev->dev, "no memory for new sk_buff\n"); +		if (!new_skb) {  			spin_unlock_irqrestore(&lp->rx_lock, flags);  			return;  		} @@ -1029,9 +1018,9 @@ static int temac_of_probe(struct platform_device *op)  	ndev->features |= NETIF_F_HW_CSUM; /* Can checksum all the packets. */  	ndev->features |= NETIF_F_IPV6_CSUM; /* Can checksum IPV6 TCP/UDP */  	ndev->features |= NETIF_F_HIGHDMA; /* Can DMA to high memory. */ -	ndev->features |= NETIF_F_HW_VLAN_TX; /* Transmit VLAN hw accel */ -	ndev->features |= NETIF_F_HW_VLAN_RX; /* Receive VLAN hw acceleration */ -	ndev->features |= NETIF_F_HW_VLAN_FILTER; /* Receive VLAN filtering */ +	ndev->features |= NETIF_F_HW_VLAN_CTAG_TX; /* Transmit VLAN hw accel */ +	ndev->features |= NETIF_F_HW_VLAN_CTAG_RX; /* Receive VLAN hw acceleration */ +	ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; /* Receive VLAN filtering */  	ndev->features |= NETIF_F_VLAN_CHALLENGED; /* cannot handle VLAN pkts */  	ndev->features |= NETIF_F_GSO; /* Enable software GSO. */  	ndev->features |= NETIF_F_MULTI_QUEUE; /* Has multiple TX/RX queues */  |