From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KtIof-0004RP-KH for qemu-devel@nongnu.org; Fri, 24 Oct 2008 05:18:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KtIoe-0004R3-Mr for qemu-devel@nongnu.org; Fri, 24 Oct 2008 05:18:45 -0400 Received: from [199.232.76.173] (port=58935 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtIoe-0004Qo-7o for qemu-devel@nongnu.org; Fri, 24 Oct 2008 05:18:44 -0400 Received: from savannah.gnu.org ([199.232.41.3]:53650 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KtIoe-0002uO-Ce for qemu-devel@nongnu.org; Fri, 24 Oct 2008 05:18:44 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KtIoa-0007J0-Ot for qemu-devel@nongnu.org; Fri, 24 Oct 2008 09:18:41 +0000 Received: from edgar_igl by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KtIoa-0007Iv-BQ for qemu-devel@nongnu.org; Fri, 24 Oct 2008 09:18:40 +0000 MIME-Version: 1.0 Errors-To: edgar_igl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: "Edgar E. Iglesias" Message-Id: Date: Fri, 24 Oct 2008 09:18:40 +0000 Subject: [Qemu-devel] [5520] ETRAX-FS: Drop DMA polling for ethernet. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5520 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5520 Author: edgar_igl Date: 2008-10-24 09:18:39 +0000 (Fri, 24 Oct 2008) Log Message: ----------- ETRAX-FS: Drop DMA polling for ethernet. * Drop DMA poll mode. Instead immediately push rx frames straight into the DMA without waiting for DMA_run to poll them of the fifo. Signed-off-by: Edgar E. Iglesias Modified Paths: -------------- trunk/hw/etraxfs_eth.c Modified: trunk/hw/etraxfs_eth.c =================================================================== --- trunk/hw/etraxfs_eth.c 2008-10-23 13:52:00 UTC (rev 5519) +++ trunk/hw/etraxfs_eth.c 2008-10-24 09:18:39 UTC (rev 5520) @@ -322,10 +322,6 @@ uint8_t macaddr[2][6]; uint32_t regs[FS_ETH_MAX_REGS]; - unsigned char rx_fifo[1536]; - int rx_fifo_len; - int rx_fifo_pos; - struct etraxfs_dma_client *dma_out; struct etraxfs_dma_client *dma_in; @@ -523,15 +519,7 @@ static int eth_can_receive(void *opaque) { - struct fs_eth *eth = opaque; - int r; - - r = eth->rx_fifo_len == 0; - if (!r) { - /* TODO: signal fifo overrun. */ - printf("PACKET LOSS!\n"); - } - return r; + return 1; } static void eth_receive(void *opaque, const uint8_t *buf, int size) @@ -556,40 +544,10 @@ && !eth_match_groupaddr(eth, buf)) return; - if (size > sizeof(eth->rx_fifo)) { - /* TODO: signal error. */ - } else if (eth->rx_fifo_len) { - /* FIFO overrun. */ - } else { - memcpy(eth->rx_fifo, buf, size); - /* +4, HW passes the CRC to sw. */ - eth->rx_fifo_len = size + 4; - eth->rx_fifo_pos = 0; - } + /* FIXME: Find another way to pass on the fake csum. */ + etraxfs_dmac_input(eth->dma_in, (void *)buf, size + 4, 1); } -static void eth_rx_pull(void *opaque) -{ - struct fs_eth *eth = opaque; - int len; - if (eth->rx_fifo_len) { - D(printf("%s %d\n", __func__, eth->rx_fifo_len)); -#if 0 - { - int i; - for (i = 0; i < 32; i++) - printf("%2.2x", eth->rx_fifo[i]); - printf("\n"); - } -#endif - len = etraxfs_dmac_input(eth->dma_in, - eth->rx_fifo + eth->rx_fifo_pos, - eth->rx_fifo_len, 1); - eth->rx_fifo_len -= len; - eth->rx_fifo_pos += len; - } -} - static int eth_tx_push(void *opaque, unsigned char *buf, int len) { struct fs_eth *eth = opaque; @@ -628,7 +586,7 @@ dma[0].client.push = eth_tx_push; dma[0].client.opaque = eth; dma[1].client.opaque = eth; - dma[1].client.pull = eth_rx_pull; + dma[1].client.pull = NULL; eth->env = env; eth->base = base;