From: John Frisk <frisk@cs.uiowa.edu>
Subject: L68K: netatalk and 2.0.29
To: linux-m68k@phil.uni-sb.de (M68k/Linux List)
Date: Mon, 18 Aug 1997 14:36:53 -0500 (CDT)
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: linux-m68k@phil.uni-sb.de

Below is the patch to get the netatalk (appletalk) package working with
M68K/linux.

First you must patch the kernel include/linux/atalk.h.  This is already
fixed in 2.0.30 so Jes, please make sure this is included with 2.0.30.
/usr/src/linux/include/linux/atalk.h
--- atalk.h.dist        Mon Aug 18 13:11:19 1997
+++ atalk.h     Mon Aug 18 13:15:11 1997
@@ -72,11 +72,15 @@

 #ifdef __KERNEL__

+#include <asm/byteorder.h>
+
 struct ddpehdr
 {
-       /* FIXME for bigendians */
-       /*__u16 deh_pad:2,deh_hops:4,deh_len:10;*/
-       __u16   deh_len:10,deh_hops:4,deh_pad:2;
+#ifdef __LITTLE_ENDIAN_BITFIELD
+       __u16   deh_len:10, deh_hops:4, deh_pad:2;
+#else
+       __u16   deh_pad:2, deh_hops:4, deh_len:10;
+#endif
        __u16   deh_sum;
        __u16   deh_dnet;
        __u16   deh_snet;
@@ -93,8 +97,11 @@

 struct ddpshdr
 {
-       /* FIXME for bigendians */
+#ifdef __LITTLE_ENDIAN_BITFIELD
        __u16   dsh_len:10, dsh_pad:6;
+#else
+       __u16   dsh_pad:6, dsh_len:10;
+#endif
        __u8    dsh_dport;
        __u8    dsh_sport;
        /* And netatalk apps expect to stick the type in themselves */

--------

Second, you must patch the netatalk package. (I borrowed this patch from
the netatalk homepage for SparcLinux patches.

+++ netatalk-1.4b2/sys/netatalk/endian.h	Wed Mar 26 23:09:31 1997
@@ -32,6 +32,12 @@
 #include <bytesex.h>
 #define BYTE_ORDER	__BYTE_ORDER
 #include <asm/byteorder.h>
+#ifndef BIG_ENDIAN
+#define BIG_ENDIAN __BIG_ENDIAN
+#endif
+#ifndef LITTLE_ENDIAN
+#define LITTLE_ENDIAN __LITTLE_ENDIAN
+#endif
 #endif linux
 
 # ifndef BYTE_ORDER
----------

Then recompile the appletalk module and then recompile the netatalk
package, and everything should work.

Thanks to Jes and Geert for helping me find the information to make this
work.
John
