diff -ur linux-pmac-devel/include/net/x25.h pmac-devel-x25loop/include/net/x25.h
--- linux-pmac-devel/include/net/x25.h	Sat Nov 11 01:11:05 2000
+++ pmac-devel-x25loop/include/net/x25.h	Sat Nov 11 12:04:04 2000
@@ -156,7 +156,7 @@
 
 /* x25_dev.c */
 extern void x25_send_frame(struct sk_buff *, struct x25_neigh *);
-extern int  x25_lapb_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *);
+extern int  x25_netdev_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *);
 extern int  x25_llc_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *);
 extern void x25_establish_link(struct x25_neigh *);
 extern void x25_terminate_link(struct x25_neigh *);
diff -ur linux-pmac-devel/net/x25/af_x25.c pmac-devel-x25loop/net/x25/af_x25.c
--- linux-pmac-devel/net/x25/af_x25.c	Sat Nov 11 01:11:05 2000
+++ pmac-devel-x25loop/net/x25/af_x25.c	Sat Nov 11 12:06:58 2000
@@ -20,6 +20,7 @@
  *	2000-03-22	Daniela Squassoni Allowed disabling/enabling of 
  *					  facilities negotiation and increased 
  *					  the throughput upper limit.
+ *	2000-02-24	Henner Eisen	Loopback device support.
  *	2000-08-27	Arnaldo C. Melo s/suser/capable/ + micro cleanups
  *	2000-09-04	Henner Eisen	Set sock->state in x25_accept(). 
  *					Fixed x25_output() related skb leakage.
@@ -198,6 +199,7 @@
 #if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
 	 || dev->type == ARPHRD_ETHER
 #endif
+	 || dev->type == ARPHRD_LOOPBACK
 	 ) {
 		switch (event) {
 			case NETDEV_UP:
@@ -1284,7 +1286,7 @@
 {
 	0,		/* MUTTER ntohs(ETH_P_X25),*/
 	0,		/* copy */
-	x25_lapb_receive_frame,
+	x25_netdev_receive_frame,
 	NULL,
 	NULL,
 };
@@ -1337,6 +1339,7 @@
 #if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
 					   || dev->type == ARPHRD_ETHER
 #endif
+					   || dev->type == ARPHRD_LOOPBACK
 			))
 			x25_link_device_up(dev);
 	}
diff -ur linux-pmac-devel/net/x25/x25_dev.c pmac-devel-x25loop/net/x25/x25_dev.c
--- linux-pmac-devel/net/x25/x25_dev.c	Sat Nov 11 01:11:05 2000
+++ pmac-devel-x25loop/net/x25/x25_dev.c	Sat Nov 11 12:13:31 2000
@@ -15,6 +15,7 @@
  *	History
  *	X.25 001	Jonathan Naylor	Started coding.
  *      2000-09-04	Henner Eisen	Prevent freeing a dangling skb.
+ *	2000-02-24	Henner Eisen	loopback device support.
  */
 
 #include <linux/config.h>
@@ -64,6 +65,8 @@
 		return 0;
 	}
 
+	if(skb->dev->type == ARPHRD_LOOPBACK) lci = 0xfff-lci;
+
 	/*
 	 *	Find an existing socket.
 	 */
@@ -99,7 +102,11 @@
 	return 0;
 }
 
-int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype)
+/*
+ * Receive X.25 packets directly from a network device. This was formerly
+ * named x25_lapb_receive_frame before loopback device support was added.
+ */
+int x25_netdev_receive_frame(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype)
 {
 	struct x25_neigh *neigh;
 	int queued;
@@ -115,6 +122,11 @@
 		return 0;
 	}
 
+	if(skb->dev->type == ARPHRD_LOOPBACK){
+		if(! x25_receive_data(skb, neigh)) kfree_skb(skb);
+		return 0;
+	}
+
 	switch (skb->data[0]) {
 		case 0x00:
 			skb_pull(skb, 1);
@@ -141,6 +153,7 @@
 			return 0;
 
 		default:
+		  printk(KERN_DEBUG "unknown first byte: %d\n",(int)skb->data[0]); 
 			kfree_skb(skb);
 			return 0;
 	}
@@ -178,7 +191,9 @@
 			ptr  = skb_put(skb, 1);
 			*ptr = 0x01;
 			break;
-
+		case ARPHRD_LOOPBACK:
+			x25_link_established(neigh);
+			return;
 #if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
 		case ARPHRD_ETHER:
 			return;
@@ -207,7 +222,9 @@
 			ptr  = skb_put(skb, 1);
 			*ptr = 0x02;
 			break;
-
+		case ARPHRD_LOOPBACK:
+			x25_link_terminated(neigh);
+			return;
 #if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
 		case ARPHRD_ETHER:
 			return;
@@ -233,7 +250,9 @@
 			dptr  = skb_push(skb, 1);
 			*dptr = 0x00;
 			break;
-
+		case ARPHRD_LOOPBACK:
+			neigh->dev->hard_header(skb,neigh->dev,ETH_P_X25,NULL,NULL,skb->len);
+			break;
 #if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
 		case ARPHRD_ETHER:
 			kfree_skb(skb);
@@ -251,6 +270,3 @@
 }
 
 #endif
-
-
-
diff -ur linux-pmac-devel/net/x25/x25_route.c pmac-devel-x25loop/net/x25/x25_route.c
--- linux-pmac-devel/net/x25/x25_route.c	Fri Nov 19 20:33:29 1999
+++ pmac-devel-x25loop/net/x25/x25_route.c	Sat Nov 11 12:04:04 2000
@@ -148,6 +148,7 @@
 #if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
 	   || dev->type == ARPHRD_ETHER
 #endif
+	   || dev->type == ARPHRD_LOOPBACK
 	   ))
 		return dev;
 
