From: Kars de J. <jo...@li...> - 2003-02-18 21:31:49
|
On Wed, 2002-12-25 at 11:11, Kars de Jong wrote: > On Mon, 2002-12-23 at 10:32, Geert Uytterhoeven wrote: > > On Mon, 23 Dec 2002, [iso-8859-2] Krystian Bac=B3awski wrote: > > > As far as I know apne driver in current version of kernel makes oops. > > >=20 > > > I found out that apne driver in 2.4.20 kernel was modified by someone= who > > > knew nothing about amiga (he/she cut out a lot of code with GAYLE sym= bols > > > and replaced readb/writeb with inb/outb). I replaced apne.c from curr= ent > > > cvs tree with old one from 2.4.18-cvs. As for me it works. > >=20 > > PCMCIA is some sort of ISA, so inb() and friends should be OK. > > Most probably the ISA changes in the m68k-specific part of the tree wer= en't > > ported to APUS. >=20 > I agree. Richard Zidlicky cleaned up the ISA support some time ago, > making it possible to just use inb() etc. in drivers for PCMCIA > hardware. It makes a lot of the things done in the apne driver no longer > needed. Have a look at include/asm-m68k/io.h if you want to know how it > was done. > =20 > > DISCLAIMER: since I don't have a PCMCIA Ethernet card I cannot guarante= e that > > it works in the m68k tree neither. >=20 > It does. Or at least did :p > Haven't tried for a while since my Amiga is still sitting in its box > after I moved. Update: I finally unpacked and connected my Amiga again (it still works, phew!), compiled the latest 2.4 CVS kernel, and found out it didn't work :-P Included is the patch I needed to get it working again. This is m68k-specific, the APUS people may need to check their include/asm-ppc/io.h or equivalent. The first patch is cosmetic (I don't think APNE would be used on a little endian box) but it makes the code more like the other 8390 drivers. Kars. Index: drivers/net/apne.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/linux-m68k/cvsroot/linux/drivers/net/apne.c,v retrieving revision 1.2.2.1 diff -u -r1.2.2.1 apne.c --- drivers/net/apne.c 1 Mar 2002 16:45:46 -0000 1.2.2.1 +++ drivers/net/apne.c 18 Feb 2003 20:30:00 -0000 @@ -113,9 +113,6 @@ #define MANUAL_HWADDR5 0x9a */ =20 -#define WORDSWAP(a) ( (((a)>>8)&0xff) | ((a)<<8) ) - - static const char version[] =3D "apne.c:v1.1 7/10/98 Alain Malek (Ala...@cr...)\n"; =20 @@ -403,10 +400,9 @@ } =20 outb(ENISR_RDC, nic_base + NE_EN0_ISR); /* Ack intr. */ - - hdr->count =3D WORDSWAP(hdr->count); - ei_status.dmaing &=3D ~0x01; + + le16_to_cpus(&hdr->count); } =20 /* Block input and output, similar to the Crynwr packet driver. If you Index: include/asm-m68k/io.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/linux-m68k/cvsroot/linux/include/asm-m68k/io.h,v retrieving revision 1.2.2.3 diff -u -r1.2.2.3 io.h --- include/asm-m68k/io.h 5 Feb 2003 11:08:02 -0000 1.2.2.3 +++ include/asm-m68k/io.h 18 Feb 2003 20:30:19 -0000 @@ -162,7 +162,9 @@ #ifdef CONFIG_GG2 case GG2_ISA: return GG2_ISA_MEM_B(addr); #endif - /* FIXME: any ISA mem mapping for PCMCIA? */ +#ifdef CONFIG_AMIGA_PCMCIA + case AG_ISA: return addr; +#endif default: return 0; /* avoid warnings, just in case */ } } @@ -176,6 +178,9 @@ #ifdef CONFIG_GG2 case GG2_ISA: return GG2_ISA_MEM_W(addr); #endif +#ifdef CONFIG_AMIGA_PCMCIA + case AG_ISA: return addr; +#endif default: return 0; /* avoid warnings, just in case */ } } @@ -187,9 +192,9 @@ #define isa_outw(val,port) (ISA_SEX ? out_be16(isa_itw(port),(val)) : out_= le16(isa_itw(port),(val))) =20 #define isa_readb(p) in_8(isa_mtb(p)) -#define isa_readw(p) in_le16(isa_mtw(p)) +#define isa_readw(p) (ISA_SEX ? in_be16(isa_mtw(p)) : in_le16(isa_mt= w(p))) #define isa_writeb(val,p) out_8(isa_mtb(p),(val)) -#define isa_writew(val,p) out_le16(isa_mtw(p),(val)) +#define isa_writew(val,p) (ISA_SEX ? out_be16(isa_mtw(p),(val)) : out_le1= 6(isa_mtw(p),(val))) =20 static inline void isa_delay(void) { |