long ioaddr = dev->base_addr; 
void __iomem *ioaddr = vp->ioaddr; 
boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev){	struct vortex_private *vp = netdev_priv(dev);	long ioaddr = dev->base_addr;	/* Calculate the next Tx descriptor entry. */	int entry = vp->cur_tx % TX_RING_SIZE;	struct boom_tx_desc *prev_entry = &vp->tx_ring[(vp->cur_tx-1) % TX_RING_SIZE];	unsigned long flags;	if (vortex_debug > 6) {		printk(KERN_DEBUG "boomerang_start_xmit()\n");		printk(KERN_DEBUG "%s: Trying to send a packet, Tx index %d.\n",			   dev->name, vp->cur_tx);	}	if (vp->cur_tx - vp->dirty_tx >= TX_RING_SIZE) {		if (vortex_debug > 0)			printk(KERN_WARNING "%s: BUG! Tx Ring full, refusing to send buffer.\n",				   dev->name);		netif_stop_queue(dev);		return 1;	}	vp->tx_skbuff[entry] = skb;	vp->tx_ring[entry].next = 0;#if DO_ZEROCOPY	if (skb->ip_summed != CHECKSUM_HW)			vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded);	else			vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded | AddTCPChksum | AddUDPChksum);	if (!skb_shinfo(skb)->nr_frags) {		vp->tx_ring[entry].frag[0].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data,										skb->len, PCI_DMA_TODEVICE));		vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb->len | LAST_FRAG);	} else {		int i;		vp->tx_ring[entry].frag[0].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data,										skb->len-skb->data_len, PCI_DMA_TODEVICE));		vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb->len-skb->data_len);		for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {			skb_frag_t *frag = &skb_shinfo(skb)->frags[i];			vp->tx_ring[entry].frag[i+1].addr =					cpu_to_le32(pci_map_single(VORTEX_PCI(vp),											   (void*)page_address(frag->page) + frag->page_offset,											   frag->size, PCI_DMA_TODEVICE));			if (i == skb_shinfo(skb)->nr_frags-1)					vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(frag->size|LAST_FRAG);			else					vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(frag->size);		}	}#else	vp->tx_ring[entry].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, skb->len, PCI_DMA_TODEVICE));	vp->tx_ring[entry].length = cpu_to_le32(skb->len | LAST_FRAG);	vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded);#endif	spin_lock_irqsave(&vp->lock, flags);	/* Wait for the stall to complete. */	issue_and_wait(dev, DownStall);	prev_entry->next = cpu_to_le32(vp->tx_ring_dma + entry * sizeof(struct boom_tx_desc));	if (inl(ioaddr + DownListPtr) == 0) {		outl(vp->tx_ring_dma + entry * sizeof(struct boom_tx_desc), ioaddr + DownListPtr);		vp->queued_packet++;	}	vp->cur_tx++;	if (vp->cur_tx - vp->dirty_tx > TX_RING_SIZE - 1) {		netif_stop_queue (dev);	} else {					/* Clear previous interrupt enable. */#if defined(tx_interrupt_mitigation)		/* Dubious. If in boomeang_interrupt "faster" cyclone ifdef		 * were selected, this would corrupt DN_COMPLETE. No?		 */		prev_entry->status &= cpu_to_le32(~TxIntrUploaded);#endif	}	outw(DownUnstall, ioaddr + EL3_CMD);	spin_unlock_irqrestore(&vp->lock, flags);	dev->trans_start = jiffies;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/62afe595de7aaac6c140103a34dc8c208afa34e7/3c59x.c/buggy/drivers/net/3c59x.c