--- eepro100-napi-proc.c Wed Jun 12 17:33:51 2002 +++ eepro100-mips.c Wed Jun 12 19:22:29 2002 @@ -45,7 +45,7 @@ /* Set the copy breakpoint for the copy-only-tiny-buffer Rx method. Lower values use more memory, but are faster. */ -#if defined(__alpha__) || defined(__sparc__) || defined(__mips__) || \ +#if defined(__alpha__) || defined(__sparc__) || /*defined(__mips__) ||*/ \ defined(__arm__) static int rx_copybreak = 1518; #else @@ -66,8 +66,8 @@ /* A few values that may be tweaked. */ /* The ring sizes should be a power of two for efficiency. */ -#define TX_RING_SIZE 64 -#define RX_RING_SIZE 64 +#define TX_RING_SIZE 32 +#define RX_RING_SIZE 32 /* How much slots multicast filter setup may take. Do not descrease without changing set_rx_mode() implementaion. */ #define TX_MULTICAST_SIZE 2 @@ -1298,7 +1298,14 @@ if (skb == NULL) break; /* OK. Just initially short of Rx bufs. */ skb->dev = dev; /* Mark as being used by this device. */ +#ifndef __mips__ rxf = (struct RxFD *)skb->tail; +#else + /* use uncached address,use pci_dma_sync_xx seems + * problematic in my mips platform + */ + rxf = (struct RxFD *)(KSEG1ADDR(skb->tail)); +#endif sp->rx_ringp[i] = rxf; sp->rx_ring_dma[i] = pci_map_single(sp->pdev, rxf, @@ -1306,8 +1313,10 @@ skb_reserve(skb, sizeof(struct RxFD)); if (last_rxf) { last_rxf->link = cpu_to_le32(sp->rx_ring_dma[i]); +#ifndef __mips__ pci_dma_sync_single(sp->pdev, last_rxf_dma, sizeof(struct RxFD), PCI_DMA_TODEVICE); +#endif } last_rxf = rxf; last_rxf_dma = sp->rx_ring_dma[i]; @@ -1316,14 +1325,18 @@ /* This field unused by i82557. */ rxf->rx_buf_addr = 0xffffffff; rxf->count = cpu_to_le32(PKT_BUF_SZ << 16); +#ifndef __mips__ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[i], sizeof(struct RxFD), PCI_DMA_TODEVICE); +#endif } sp->dirty_rx = (unsigned int)(i - RX_RING_SIZE); /* Mark the last entry as end-of-list. */ last_rxf->status = cpu_to_le32(0xC0000002); /* '2' is flag value only. */ +#ifndef __mips__ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[RX_RING_SIZE-1], sizeof(struct RxFD), PCI_DMA_TODEVICE); +#endif sp->last_rxf = last_rxf; sp->last_rxf_dma = last_rxf_dma; } @@ -1733,15 +1746,21 @@ #endif return NULL; } +#ifndef __mips__ rxf = sp->rx_ringp[entry] = (struct RxFD *)skb->tail; +#else + rxf = sp->rx_ringp[entry] = (struct RxFD *)(KSEG1ADDR(skb->tail)); +#endif sp->rx_ring_dma[entry] = pci_map_single(sp->pdev, rxf, PKT_BUF_SZ + sizeof(struct RxFD), PCI_DMA_FROMDEVICE); skb->dev = dev; skb_reserve(skb, sizeof(struct RxFD)); rxf->rx_buf_addr = 0xffffffff; +#ifndef __mips__ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[entry], sizeof(struct RxFD), PCI_DMA_TODEVICE); +#endif return rxf; } @@ -1754,8 +1773,10 @@ rxf->count = cpu_to_le32(PKT_BUF_SZ << 16); sp->last_rxf->link = cpu_to_le32(rxf_dma); sp->last_rxf->status &= cpu_to_le32(~0xC0000000); +#ifndef __mips__ pci_dma_sync_single(sp->pdev, sp->last_rxf_dma, sizeof(struct RxFD), PCI_DMA_TODEVICE); +#endif sp->last_rxf = rxf; sp->last_rxf_dma = rxf_dma; } @@ -2274,8 +2295,10 @@ int status; int pkt_len; +#ifndef __mips__ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[entry], sizeof(struct RxFD), PCI_DMA_FROMDEVICE); +#endif status = le32_to_cpu(sp->rx_ringp[entry]->status); pkt_len = le32_to_cpu(sp->rx_ringp[entry]->count) & 0x3fff;