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);  
k = l = 0; for(j = 0; j <= lc; j++) { /* loop count loop */ for(i = 0; i < 64; i++) { /* send the packets */ e1000_create_lbtest_frame(txdr->buffer_info[i].skb, 1024); pci_dma_sync_single_for_device(pdev, txdr->buffer_info[k].dma, txdr->buffer_info[k].length, PCI_DMA_TODEVICE); if(unlikely(++k == txdr->count)) k = 0; } E1000_WRITE_REG(&adapter->hw, TDT, k); msec_delay(200); time = jiffies; /* set the start time for the receive */ good_cnt = 0; do { /* receive the sent packets */ pci_dma_sync_single_for_cpu(pdev, rxdr->buffer_info[l].dma, rxdr->buffer_info[l].length, PCI_DMA_FROMDEVICE);  ret_val = e1000_check_lbtest_frame( rxdr->buffer_info[l].skb, 1024); if(!ret_val) good_cnt++; if(unlikely(++l == rxdr->count)) l = 0; /* time + 20 msecs (200 msecs on 2.4) is more than * enough time to complete the receives, if it's * exceeded, break and error off */ } while (good_cnt < 64 && jiffies < (time + 20)); if(good_cnt != 64) { ret_val = 13; /* ret_val is the same as mis-compare */ break; } if(jiffies >= (time + 2)) { ret_val = 14; /* error code for time out error */ break; } } /* end loop count 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