for(i = 0; i < 64; i++) { e1000_create_lbtest_frame(txdr->buffer_info[i].skb, 1024); pci_dma_sync_single_for_device(pdev, txdr->buffer_info[i].dma, txdr->buffer_info[i].length, PCI_DMA_TODEVICE); } E1000_WRITE_REG(&adapter->hw, TDT, i); 
/* Calculate the loop count based on the largest descriptor ring * The idea is to wrap the largest ring a number of times using 64 * send/receive pairs during each loop */ 
e1000_run_loopback_test(struct e1000_adapter *adapter){	struct e1000_desc_ring *txdr = &adapter->test_tx_ring;	struct e1000_desc_ring *rxdr = &adapter->test_rx_ring;	struct pci_dev *pdev = adapter->pdev;	int i, ret_val;	E1000_WRITE_REG(&adapter->hw, RDT, rxdr->count - 1);	for(i = 0; i < 64; i++) {		e1000_create_lbtest_frame(txdr->buffer_info[i].skb, 1024);		pci_dma_sync_single_for_device(pdev, txdr->buffer_info[i].dma,					    txdr->buffer_info[i].length,					    PCI_DMA_TODEVICE);	}	E1000_WRITE_REG(&adapter->hw, TDT, i);	msec_delay(200);	i = 0;	do {		pci_dma_sync_single_for_cpu(pdev, rxdr->buffer_info[i].dma,					    rxdr->buffer_info[i].length,					    PCI_DMA_FROMDEVICE);		ret_val = e1000_check_lbtest_frame(rxdr->buffer_info[i].skb,						   1024);		i++;	} while (ret_val != 0 && i < 64);	return ret_val;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e4eff7291c977308989b24fdfc7215a501302e6a/e1000_ethtool.c/buggy/drivers/net/e1000/e1000_ethtool.c