Project : madwifi
Revision : 2198
Author : proski (Pavel Roskin)
Date : 2007-03-16 21:57:24 +0100 (Fri, 16 Mar 2007)
Log Message :
Fix memory corruption on PowerPC and possibly other platforms
The size of the memory window for consistent DMA must be a power of 2.
Otherwise, it's supposed to be rounded up. Due to a bug in Linux kernel
headers, it is rounded down for constant values. The bug was fixed days
ago and the fix will appear in Linux 2.6.21.
Put barrier() to ensure that sc->sc_desc_len is not treated as a
constant.
Affected Files:
* branches/madwifi-old-openhal/ath/if_ath.c updated
Modified: branches/madwifi-old-openhal/ath/if_ath.c
===================================================================
--- branches/madwifi-old-openhal/ath/if_ath.c 2007-03-12 08:51:21 UTC (rev
2197)
+++ branches/madwifi-old-openhal/ath/if_ath.c 2007-03-16 20:57:24 UTC (rev
2198)
@@ -3008,6 +3008,7 @@
/* allocate descriptors */
sc->sc_desc_len = sizeof(struct ath_desc) *
(ATH_TXBUF * ATH_TXDESC + ATH_RXBUF + ATH_BCBUF
+ 1);
+ barrier(); /* get_order() rounds down constants before Linux
2.6.21 */
sc->sc_desc = bus_alloc_consistent(sc->sc_bdev,
sc->sc_desc_len, &sc->sc_desc_daddr);
if (sc->sc_desc == NULL) {
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|