Esempio n. 1
0
static void z8530_tx_done(struct z8530_channel *c)
{
	struct sk_buff *skb;

	/* Actually this can happen.*/
	if (c->tx_skb == NULL)
		return;

	skb = c->tx_skb;
	c->tx_skb = NULL;
	z8530_tx_begin(c);
	c->netdevice->stats.tx_packets++;
	c->netdevice->stats.tx_bytes += skb->len;
	dev_kfree_skb_irq(skb);
}
Esempio n. 2
0
File: z85230.c Progetto: 274914765/C
int z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb)
{
    unsigned long flags;
    
    netif_stop_queue(c->netdevice);
    if(c->tx_next_skb)
    {
        return 1;
    }
    
    /* PC SPECIFIC - DMA limits */
    
    /*
     *    If we will DMA the transmit and its gone over the ISA bus
     *    limit, then copy to the flip buffer
     */
     
    if(c->dma_tx && ((unsigned long)(virt_to_bus(skb->data+skb->len))>=16*1024*1024 || spans_boundary(skb)))
    {
        /* 
         *    Send the flip buffer, and flip the flippy bit.
         *    We don't care which is used when just so long as
         *    we never use the same buffer twice in a row. Since
         *    only one buffer can be going out at a time the other
         *    has to be safe.
         */
        c->tx_next_ptr=c->tx_dma_buf[c->tx_dma_used];
        c->tx_dma_used^=1;    /* Flip temp buffer */
        skb_copy_from_linear_data(skb, c->tx_next_ptr, skb->len);
    }
    else
        c->tx_next_ptr=skb->data;    
    RT_LOCK;
    c->tx_next_skb=skb;
    RT_UNLOCK;
    
    spin_lock_irqsave(c->lock, flags);
    z8530_tx_begin(c);
    spin_unlock_irqrestore(c->lock, flags);
    
    return 0;
}