Пример #1
0
static void cpmac_end_xmit(int queue)
{
//	struct cpmac_desc *desc;
	//struct cpmac_priv *priv = netdev_priv(dev);

//	desc = desc_ring[queue];
	cpmac_write(CPMAC_TX_ACK(queue), (u32)desc_ring[queue].mapping);
	if (likely(desc_ring[queue].skb)) {
		unlock_s(synthlock_0);
		spin_lock(cplock);
		netdev.stats.tx_packets++;
		lock_s(synthlock_0);
		netdev.stats.tx_bytes += desc_ring[queue].skb->len;
		spin_unlock(cplock);
		dma_unmap_single(desc_ring[queue].data_mapping, desc_ring[queue].skb->len,
				 DMA_TO_DEVICE);

//		if (unlikely(netif_msg_tx_done(priv)))
//			netdev_dbg(dev, "sent 0x%p, len=%d\n",
//				   desc_ring[queue].skb, desc_ring[queue].skb->len);

		dev_kfree_skb_irq(desc_ring[queue].skb);
		desc_ring[queue].skb = NULL;
		//if (__netif_subqueue_stopped(dev, queue))
			unlock_s(synthlock_0);
			netif_wake_subqueue();
	} else {
//		if (netif_msg_tx_err(priv) && net_ratelimit())
//			netdev_warn(dev, "end_xmit: spurious interrupt\n");
		//if (__netif_subqueue_stopped(dev, queue))
			unlock_s(synthlock_0);
			netif_wake_subqueue();
	}
lock_s(synthlock_0);
}
Пример #2
0
static void cpmac_end_xmit(struct net_device *dev, int queue)
{
	struct cpmac_desc *desc;
	struct cpmac_priv *priv = netdev_priv(dev);

	desc = &priv->desc_ring[queue];
	cpmac_write(priv->regs, CPMAC_TX_ACK(queue), (u32)desc->mapping);
	if (likely(desc->skb)) {
		spin_lock(&priv->lock);
		dev->stats.tx_packets++;
		dev->stats.tx_bytes += desc->skb->len;
		spin_unlock(&priv->lock);
		dma_unmap_single(&dev->dev, desc->data_mapping, desc->skb->len,
				 DMA_TO_DEVICE);

		if (unlikely(netif_msg_tx_done(priv)))
			printk(KERN_DEBUG "%s: sent 0x%p, len=%d\n", dev->name,
			       desc->skb, desc->skb->len);

		dev_kfree_skb_irq(desc->skb);
		desc->skb = NULL;
		if (netif_subqueue_stopped(dev, queue))
			netif_wake_subqueue(dev, queue);
	} else {
		if (netif_msg_tx_err(priv) && net_ratelimit())
			printk(KERN_WARNING
			       "%s: end_xmit: spurious interrupt\n", dev->name);
		if (netif_subqueue_stopped(dev, queue))
			netif_wake_subqueue(dev, queue);
	}
}