From 8846bbd0ecf804b7f3c297e8713049341cf5c361 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 28 Apr 1999 13:59:11 +0000 Subject: Patch from Emmanuel Raguet : I have made test with the Dec21140 driver and it appears that all works fine even if the cache is enabled for the memory space in which the incoming and outcoming Ethernet frames are stored. I have had #ifdef to "comment" the code. If you want to disable cache, you only have to #define the name. It could be mandatory for some BSPs. --- c/src/lib/libbsp/i386/pc386/dec21140/dec21140.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'c') diff --git a/c/src/lib/libbsp/i386/pc386/dec21140/dec21140.c b/c/src/lib/libbsp/i386/pc386/dec21140/dec21140.c index 13bd268ef4..221cd0da26 100644 --- a/c/src/lib/libbsp/i386/pc386/dec21140/dec21140.c +++ b/c/src/lib/libbsp/i386/pc386/dec21140/dec21140.c @@ -406,12 +406,14 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc) cp = (char *)malloc((NRXBUFS+NTXBUFS)*(sizeof(struct MD)+ RBUF_SIZE) + PG_SIZE); sc->bufferBase = cp; - cp += (PG_SIZE - (int)cp) & MASK_OFFSET ; + cp += (PG_SIZE - (int)cp) & MASK_OFFSET; +#ifdef PCI_BRIDGE_DOES_NOT_ENSURE_CACHE_COHERENCY_FOR_DMA if (_CPU_is_paging_enabled()) _CPU_change_memory_mapping_attribute (NULL, cp, (NRXBUFS+NTXBUFS)*(sizeof(struct MD)+ RBUF_SIZE), PTE_CACHE_DISABLE | PTE_WRITABLE); +#endif rmd = (struct MD*)cp; sc->MDbase = rmd; buffer = cp + ((NRXBUFS+NTXBUFS)*sizeof(struct MD)); -- cgit v1.2.3