*** Makefile.ORIG	Wed Aug 21 11:37:49 1996
--- Makefile	Thu Aug 22 21:00:45 1996
***************
*** 17,28 ****
  # the following lines. You have to recompile your kernel
  # and say 'y' when 'make config' asks you for IPX and ncpfs.
  #
! SUBDIRS += kernel-1.2/src
! INCLUDES = -I$(TOPDIR)/kernel-1.2
  
  # If you are using kerneld to autoload ncp support,
  # uncomment this (kerneld is in linux since about 1.3.57):
! #KERNELD = -DHAVE_KERNELD
  
  export INCLUDES BINDIR INTERM_BINDIR SBINDIR KERNELD VERSION
  
--- 17,28 ----
  # the following lines. You have to recompile your kernel
  # and say 'y' when 'make config' asks you for IPX and ncpfs.
  #
! #SUBDIRS += kernel-1.2/src
! #INCLUDES = -I$(TOPDIR)/kernel-1.2
  
  # If you are using kerneld to autoload ncp support,
  # uncomment this (kerneld is in linux since about 1.3.57):
! KERNELD = -DHAVE_KERNELD
  
  export INCLUDES BINDIR INTERM_BINDIR SBINDIR KERNELD VERSION
  
*** util/ncplib.c.ORIG	Sat Mar  9 13:48:15 1996
--- util/ncplib.c	Thu Aug 22 23:19:02 1996
***************
*** 2,7 ****
--- 2,8 ----
   *  ncplib.c
   *
   *  Copyright (C) 1995, 1996 by Volker Lendecke
+  *  Modified for sparc by J.F. Chadima
   *
   */
  
***************
*** 531,538 ****
--- 532,544 ----
  
  	if (conn->has_subfunction != 0)
  	{
+ #ifdef __sparc__
+   		__u16 tmp = conn->current_size - sizeof(struct ncp_request_header)- 2;
+ 		memcpy (&(h->data[0]), &tmp, 2);
+ #else
  		*(__u16 *)&(h->data[0]) = conn->current_size
  			- sizeof(struct ncp_request_header)- 2;
+ #endif
  	}
  
  	request.function   = function;
***************
*** 569,576 ****
--- 575,587 ----
  
  	if (conn->has_subfunction != 0)
  	{
+ #ifdef __sparc__
+ 		__u16 tmp = conn->current_size - sizeof(struct ncp_request_header) - 2;
+ 		memcpy (&(h->data[0]), &tmp, 2);
+ #else
  		*(__u16 *)&(h->data[0]) = conn->current_size
  			- sizeof(struct ncp_request_header) - 2;
+ #endif
  	}
  
  	h->type = NCP_REQUEST;
***************
*** 636,642 ****
  	addr.sipx_family  = AF_IPX;
  	addr.sipx_port    = htons(0x0);
  	addr.sipx_type    = NCP_PTYPE;
! 	addr.sipx_network = IPX_THIS_NET;
  	ipx_assign_node(addr.sipx_node, IPX_THIS_NODE);
  
  	addrlen = sizeof(addr);
--- 647,653 ----
  	addr.sipx_family  = AF_IPX;
  	addr.sipx_port    = htons(0x0);
  	addr.sipx_type    = NCP_PTYPE;
! 	addr.sipx_network = htonl(IPX_THIS_NET);
  	ipx_assign_node(addr.sipx_node, IPX_THIS_NODE);
  
  	addrlen = sizeof(addr);
***************
*** 1451,1457 ****
--- 1462,1472 ----
  ncp_add_byte(struct ncp_conn *conn, byte x)
  {
  	assert_conn_locked(conn);
+ #ifdef __sparc__
+ 	memcpy (&(conn->packet[conn->current_size]), &x, 1);
+ #else
  	*(byte *)(&(conn->packet[conn->current_size])) = x;
+ #endif
  	conn->current_size += 1;
  	return;
  }
***************
*** 1460,1466 ****
--- 1475,1485 ----
  ncp_add_word(struct ncp_conn *conn, word x)
  {
  	assert_conn_locked(conn);
+ #ifdef __sparc__
+ 	memcpy (&(conn->packet[conn->current_size]), &x, 2);
+ #else
  	*(word *)(&(conn->packet[conn->current_size])) = x;
+ #endif
  	conn->current_size += 2;
  	return;
  }
***************
*** 1469,1475 ****
--- 1488,1498 ----
  ncp_add_dword(struct ncp_conn *conn, dword x)
  {
  	assert_conn_locked(conn);
+ #ifdef __sparc__
+ 	memcpy (&(conn->packet[conn->current_size]), &x, 4);
+ #else
  	*(dword *)(&(conn->packet[conn->current_size])) = x;
+ #endif
  	conn->current_size += 4;
  	return;
  }
***************
*** 2334,2342 ****
--- 2357,2370 ----
  static inline void
  ConvertToNWfromDWORD ( __u32 sfd , __u8 ret[6] )
  {
+ #ifdef __sparc__
+     memcpy (ret + 2, &sfd, 4);
+     ret[1] = (ret[3] + ((ret[0] = (ret[2] + 1) & 0xFF) == 0) ? 1 : 0) & 0xFF;
+ #else
      __u16 *dest = (__u16 *) ret;
      memcpy(&(dest[1]), &sfd, 4);
      dest[0] = dest[1] + 1;
+ #endif
      return;
  }
  
