/* work-around for errata 10 and it applies * to all controllers in PCI-X mode * The fix is to make sure that the first descriptor of a * packet is smaller than 2048 - 16 - 16 (or 2016) bytes */ if(unlikely((adapter->hw.bus_type == e1000_bus_type_pcix) && (size > 2015) && count == 0)) size = 2015;  
e1000_tx_map(struct e1000_adapter *adapter, struct sk_buff *skb,	unsigned int first, unsigned int max_per_txd,	unsigned int nr_frags, unsigned int mss){	struct e1000_desc_ring *tx_ring = &adapter->tx_ring;	struct e1000_buffer *buffer_info;	unsigned int len = skb->len;	unsigned int offset = 0, size, count = 0, i;	unsigned int f;	len -= skb->data_len;	i = tx_ring->next_to_use;	while(len) {		buffer_info = &tx_ring->buffer_info[i];		size = min(len, max_per_txd);#ifdef NETIF_F_TSO		/* Workaround for premature desc write-backs		 * in TSO mode.  Append 4-byte sentinel desc */		if(unlikely(mss && !nr_frags && size == len && size > 8))			size -= 4;#endif		/* Workaround for potential 82544 hang in PCI-X.  Avoid		 * terminating buffers within evenly-aligned dwords. */		if(unlikely(adapter->pcix_82544 &&		   !((unsigned long)(skb->data + offset + size - 1) & 4) &&		   size > 4))			size -= 4;		buffer_info->length = size;		buffer_info->dma =			pci_map_single(adapter->pdev,				skb->data + offset,				size,				PCI_DMA_TODEVICE);		buffer_info->time_stamp = jiffies;		len -= size;		offset += size;		count++;		if(unlikely(++i == tx_ring->count)) i = 0;	}	for(f = 0; f < nr_frags; f++) {		struct skb_frag_struct *frag;		frag = &skb_shinfo(skb)->frags[f];		len = frag->size;		offset = frag->page_offset;		while(len) {			buffer_info = &tx_ring->buffer_info[i];			size = min(len, max_per_txd);#ifdef NETIF_F_TSO			/* Workaround for premature desc write-backs			 * in TSO mode.  Append 4-byte sentinel desc */			if(unlikely(mss && f == (nr_frags-1) && size == len && size > 8))				size -= 4;#endif			/* Workaround for potential 82544 hang in PCI-X.			 * Avoid terminating buffers within evenly-aligned			 * dwords. */			if(unlikely(adapter->pcix_82544 &&			   !((unsigned long)(frag->page+offset+size-1) & 4) &&			   size > 4))				size -= 4;			buffer_info->length = size;			buffer_info->dma =				pci_map_page(adapter->pdev,					frag->page,					offset,					size,					PCI_DMA_TODEVICE);			buffer_info->time_stamp = jiffies;			len -= size;			offset += size;			count++;			if(unlikely(++i == tx_ring->count)) i = 0;		}	}	i = (i == 0) ? tx_ring->count - 1 : i - 1;	tx_ring->buffer_info[i].skb = skb;	tx_ring->buffer_info[first].next_to_watch = i;	return count;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/97338bde27d97347bc83203d6ac5e93be1ebcd03/e1000_main.c/buggy/drivers/net/e1000/e1000_main.c