2000-11-16 01:15:13

by Adam J. Richter

[permalink] [raw]
Subject: 2.4.0-test11-pre5/drivers/net/sunhme.c compile failure on x86

linux-2.4.0-test11-pre5/drivers/net/sunhme.c fails to compile
on x86 because it uses the undefined symbols DMA_BURST{BITS,8,16,32,64},
which are not defined anywhere in include/asm-i386/*.h. For sparc,
these symbols are defined in include/asm-sparc/dma.h, so I copied them
in sunhme.c and bracketted them if #ifndef DMA_BURSTBITS...#endif, which
made the code compile. However, that is probably not exactly the cleanest
change (it should give correct behavior, however, since the PCI bus
behavior is just to set the mask in question to all ones, so that the
tests for different DMA types all succeed, if I understand correctly).

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
[email protected] \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."


2000-11-16 01:21:03

by David Miller

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre5/drivers/net/sunhme.c compile failure on x86


This is a better fix:

--- drivers/net/sunhme.c.~1~ Sun Nov 12 02:23:30 2000
+++ drivers/net/sunhme.c Wed Nov 15 16:34:44 2000
@@ -1600,6 +1600,10 @@
HMD(("happy_meal_init: old[%08x] bursts<",
hme_read32(hp, gregs + GREG_CFG)));

+#ifndef __sparc__
+ /* It is always PCI and can handle 64byte bursts. */
+ hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST64);
+#else
if ((hp->happy_bursts & DMA_BURST64) &&
((hp->happy_flags & HFLAG_PCI) != 0
#ifdef CONFIG_SBUS
@@ -1633,6 +1637,7 @@
HMD(("XXX>"));
hme_write32(hp, gregs + GREG_CFG, 0);
}
+#endif /* __sparc__ */

/* Turn off interrupts we do not want to hear. */
HMD((", enable global interrupts, "));
@@ -2887,8 +2892,10 @@
/* And of course, indicate this is PCI. */
hp->happy_flags |= HFLAG_PCI;

+#ifdef __sparc__
/* Assume PCI happy meals can handle all burst sizes. */
hp->happy_bursts = DMA_BURSTBITS;
+#endif

hp->happy_block = (struct hmeal_init_block *)
pci_alloc_consistent(pdev, PAGE_SIZE, &hp->hblock_dvma);

2000-11-16 01:46:57

by willy tarreau

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre5/drivers/net/sunhme.c compile failure on x86

Hello !

(thanks Dave for the quick patch)

I also had to move the #include <asm/uaccess.h>
out of the #ifdef __sparc__/#endif because
copy_{from|to}_user were left undefined (see
simple patch below).

Regards,
Willy


--- drivers/net/sunhme.c-orig Wed Nov 15 12:56:33
2000
+++ drivers/net/sunhme.c Wed Nov 15 12:59:35
2000
@@ -48,8 +48,8 @@
#ifndef __sparc_v9__
#include <asm/io-unit.h>
#endif
-#include <asm/uaccess.h>
#endif
+#include <asm/uaccess.h>

#include <asm/pgtable.h>
#include <asm/irq.h>


___________________________________________________________
Do You Yahoo!? -- Pour dialoguer en direct avec vos amis,
Yahoo! Messenger : http://fr.messenger.yahoo.com

2000-11-16 04:54:05

by David Miller

[permalink] [raw]
Subject: Re: 2.4.0-test11-pre5/drivers/net/sunhme.c compile failure on x86

Date: Thu, 16 Nov 2000 02:16:32 +0100 (CET)
From: willy tarreau <[email protected]>

I also had to move the #include <asm/uaccess.h>
out of the #ifdef __sparc__/#endif because
copy_{from|to}_user were left undefined (see
simple patch below).

Applied, thanks.

Later,
David S. Miller
[email protected]