Index: c/src/lib/libbsp/m68k/mvme167/include/bsp.h
===================================================================
--- c/src/lib/libbsp/m68k/mvme167/include/bsp.h	(revision b1446092bd72944e7cbbeafd5a933f7fa97887c4)
+++ c/src/lib/libbsp/m68k/mvme167/include/bsp.h	(revision db9ae7078d4fe001139d1fbb7816ef71a3d2f2ae)
@@ -47,5 +47,5 @@
  
 struct rtems_bsdnet_ifconfig;
-extern int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig );
+int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig, int attaching );
 #define RTEMS_BSP_NETWORK_DRIVER_NAME   "uti1"
 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH uti596_attach
Index: c/src/lib/libbsp/m68k/mvme167/network/network.c
===================================================================
--- c/src/lib/libbsp/m68k/mvme167/network/network.c	(revision b1446092bd72944e7cbbeafd5a933f7fa97887c4)
+++ c/src/lib/libbsp/m68k/mvme167/network/network.c	(revision db9ae7078d4fe001139d1fbb7816ef71a3d2f2ae)
@@ -53,4 +53,6 @@
 #include <bsp.h>
 #include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
 
 #include <rtems/error.h>
@@ -124,5 +126,5 @@
 static unsigned long word_swap ( unsigned long );
 static void * malloc_16byte_aligned ( void **, void ** adjusted_pointer, size_t );
-RTEMS_INLINE_ROUTINE void uti596_writePortFunction ( void *, unsigned long );
+RTEMS_INLINE_ROUTINE void uti596_writePortFunction ( volatile void *, unsigned long );
 RTEMS_INLINE_ROUTINE void uti596_portReset( void );
 static unsigned long uti596_portSelfTest( i596_selftest * );
@@ -286,5 +288,5 @@
  */
 RTEMS_INLINE_ROUTINE void uti596_writePortFunction(
-  void * addr,
+  volatile void * addr,
   unsigned long cmd
 )
@@ -746,5 +748,5 @@
   diagnose.command = CmdDiagnose;
   diagnose.status = 0;
-  uti596_softc.pCurrent_command_status = &diagnose.status;
+  uti596_softc.pCurrent_command_status = (unsigned short *)&diagnose.status;
   uti596_addPolledCmd(&diagnose);
   return (uti596_wait ( &uti596_softc, UTI596_WAIT_FOR_STAT_C ));
@@ -775,9 +777,9 @@
 {
   sc->set_conf.cmd.command = CmdConfigure;
-  memcpy (sc->set_conf.data, uti596initSetup, 14);
+  memcpy ( (void *)sc->set_conf.data, uti596initSetup, 14);
   uti596_addPolledCmd( (i596_cmd *) &sc->set_conf);
 
   /* Poll for successful command completion */
-  sc->pCurrent_command_status = &(sc->set_conf.cmd.status);
+  sc->pCurrent_command_status = (unsigned short *)&(sc->set_conf.cmd.status);
   return ( uti596_wait ( sc, UTI596_WAIT_FOR_STAT_C ) );
 }
@@ -812,5 +814,5 @@
 
   /* Poll for successful command completion */
-  sc->pCurrent_command_status = &(sc->set_add.cmd.status);
+  sc->pCurrent_command_status = (unsigned short *)&(sc->set_add.cmd.status);
   return ( uti596_wait ( sc, UTI596_WAIT_FOR_STAT_C ) );
 }
@@ -1434,5 +1436,5 @@
      if (uti596_softc.pLastUnkRFD != I596_NULL ) {
 
-       uti596_append(&uti596_softc.pSavedRfdQueue, pRfd); /* Only here! saved Q */
+       uti596_append((i596_rfd **)&uti596_softc.pSavedRfdQueue, pRfd); /* Only here! saved Q */
        uti596_softc.pEndSavedQueue = pRfd;
        uti596_softc.savedCount++;
@@ -1481,5 +1483,5 @@
     * in either case, EL bit has been read, and RNR condition will occur
     */
-   uti596_append( &uti596_softc.pSavedRfdQueue, pRfd); /* save it for RNR */
+   uti596_append( (i596_rfd **)&uti596_softc.pSavedRfdQueue, pRfd); /* save it for RNR */
 
    uti596_softc.pEndSavedQueue = pRfd;  /* reset end of saved queue */
@@ -1650,17 +1652,18 @@
 
 int uti596_attach(
-  struct rtems_bsdnet_ifconfig * pConfig
+  struct rtems_bsdnet_ifconfig * pConfig,
+  int attaching
 )
 {
   uti596_softc_ *sc = &uti596_softc;				/* device dependent data structure */
-  struct ifnet * ifp = &sc->arpcom.ac_if;   /* ifnet structure */
-	int unitNumber;
-	char *unitName;
-	char *pAddr;
-	int addr;
-
-	#ifdef DBG_ATTACH
+  struct ifnet * ifp = (struct ifnet *)&sc->arpcom.ac_if;       /* ifnet structure */
+  int unitNumber;
+  char *unitName;
+  char *pAddr;
+  int addr;
+
+  #ifdef DBG_ATTACH
   printk(("uti596_attach: begins\n"))
-	#endif
+  #endif
 
   /* The NIC is not started yet */
@@ -1668,10 +1671,10 @@
 
   /* Indicate to ULCS that this is initialized */
-  ifp->if_softc = sc;
+  ifp->if_softc = (void *)sc;
   sc->pScp = NULL;
 
-        /* Parse driver name */
-        if ((unitNumber = rtems_bsdnet_parse_driver_name (pConfig, &unitName)) < 0)
-                return 0;
+  /* Parse driver name */
+  if ((unitNumber = rtems_bsdnet_parse_driver_name (pConfig, &unitName)) < 0)
+    return 0;
 
   ifp->if_name = unitName;
@@ -1693,15 +1696,15 @@
    * structure values is unrecoverable and would be lost here.
    */
-  if ( addr = nvram->ipaddr ) {
-  	if ( pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT ) )
-			pConfig->ip_address = inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );
-		else
-			rtems_panic("Can't allocate ip_address buffer!\n");
-  }
-  if ( addr = nvram->netmask ) {
-  	if ( pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT ) )
-			pConfig->ip_netmask = inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );
-		else
-			rtems_panic("Can't allocate ip_netmask buffer!\n");
+  if ( (addr = nvram->ipaddr) ) {
+    if ( (pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT )) )
+      pConfig->ip_address = (char *)inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );
+    else
+      rtems_panic("Can't allocate ip_address buffer!\n");
+  }
+  if ( (addr = nvram->netmask) ) {
+    if ( (pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT )) )
+      pConfig->ip_netmask = (char *)inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );
+    else
+      rtems_panic("Can't allocate ip_netmask buffer!\n");
   }
 
@@ -1711,11 +1714,11 @@
    */
   if ( nvram->enaddr ) {
-  	memcpy (sc->arpcom.ac_enaddr, &nvram->enaddr, ETHER_ADDR_LEN);
+  	memcpy ((void *)sc->arpcom.ac_enaddr, &nvram->enaddr, ETHER_ADDR_LEN);
   }
   else if ( pConfig->hardware_address) {
-    memcpy (sc->arpcom.ac_enaddr, pConfig->hardware_address, ETHER_ADDR_LEN);
+    memcpy ((void *)sc->arpcom.ac_enaddr, pConfig->hardware_address, ETHER_ADDR_LEN);
   }
   else {
-    memcpy (sc->arpcom.ac_enaddr, (char *)0xFFFC1F2C, ETHER_ADDR_LEN);
+    memcpy ((void *)sc->arpcom.ac_enaddr, (char *)0xFFFC1F2C, ETHER_ADDR_LEN);
   }
 
@@ -1801,5 +1804,5 @@
 {
   uti596_softc_ *sc = arg;
-  struct ifnet *ifp = &sc->arpcom.ac_if;
+  struct ifnet *ifp = (struct ifnet *)&sc->arpcom.ac_if;
 
   if (sc->txDaemonTid == 0) {
@@ -1808,7 +1811,7 @@
      * Initialize the 82596
      */
-		#ifdef DBG_INIT
+    #ifdef DBG_INIT
     printk(("uti596_init: begins\nuti596_init: initializing the 82596...\n"))
-		#endif
+    #endif
     uti596_initialize_hardware(sc);
 
@@ -1816,14 +1819,14 @@
      * Start driver tasks
      */
-		#ifdef DBG_INIT
+    #ifdef DBG_INIT
     printk(("uti596_init: starting driver tasks...\n"))
-		#endif
-    sc->txDaemonTid = rtems_bsdnet_newproc ("UTtx", 2*4096, uti596_txDaemon, sc);
-    sc->rxDaemonTid = rtems_bsdnet_newproc ("UTrx", 2*4096, uti596_rxDaemon, sc);
-    sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096, uti596_resetDaemon, sc);
-
-		#ifdef DBG_INIT
+    #endif
+    sc->txDaemonTid = rtems_bsdnet_newproc ("UTtx", 2*4096, uti596_txDaemon, (void *)sc);
+    sc->rxDaemonTid = rtems_bsdnet_newproc ("UTrx", 2*4096, uti596_rxDaemon, (void *)sc);
+    sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096, uti596_resetDaemon, (void *)sc);
+
+    #ifdef DBG_INIT
     printk(("uti596_init: After attach, status of board = 0x%x\n", sc->scb.status ))
-		#endif
+    #endif
   }
 
@@ -1831,7 +1834,7 @@
    * Enable receiver
    */
-		#ifdef DBG_INIT
-    printk(("uti596_init: enabling the reciever...\n" ))
-		#endif
+  #ifdef DBG_INIT
+  printk(("uti596_init: enabling the reciever...\n" ))
+  #endif
   sc->scb.command = RX_START;
   uti596_issueCA ( sc, UTI596_WAIT_FOR_CU_ACCEPT );
@@ -1841,7 +1844,7 @@
    */
   ifp->if_flags |= IFF_RUNNING;
-		#ifdef DBG_INIT
-    printk(("uti596_init: completed.\n"))
-		#endif  
+  #ifdef DBG_INIT
+  printk(("uti596_init: completed.\n"))
+  #endif  
 }
 
@@ -1865,17 +1868,17 @@
 )
 {
-        struct ifnet *ifp = &sc->arpcom.ac_if;
-
-        ifp->if_flags &= ~IFF_RUNNING;
+  struct ifnet *ifp = (struct ifnet *)&sc->arpcom.ac_if;
+
+  ifp->if_flags &= ~IFF_RUNNING;
   sc->started = 0;
 
-		#ifdef DBG_STOP
-    printk(("uti596stop: %s: Shutting down ethercard, status was %4.4x.\n",
+  #ifdef DBG_STOP
+  printk(("uti596stop: %s: Shutting down ethercard, status was %4.4x.\n",
            uti596_softc.arpcom.ac_if.if_name, uti596_softc.scb.status))
-		#endif
-
-    printk(("Stopping interface\n"))
-    sc->scb.command = CUC_ABORT | RX_ABORT;
-    i82596->chan_attn = 0x00000000;
+  #endif
+
+  printk(("Stopping interface\n"))
+  sc->scb.command = CUC_ABORT | RX_ABORT;
+  i82596->chan_attn = 0x00000000;
 }
 
@@ -1896,5 +1899,5 @@
 {
   uti596_softc_ *sc = (uti596_softc_ *)arg;
-  struct ifnet *ifp = &sc->arpcom.ac_if;
+  struct ifnet *ifp = (struct ifnet *)&sc->arpcom.ac_if;
   struct mbuf *m;
   rtems_event_set events;
@@ -1941,5 +1944,5 @@
 {
   uti596_softc_ *sc = (uti596_softc_ *)arg;
-  struct ifnet *ifp = &sc->arpcom.ac_if;
+  struct ifnet *ifp = (struct ifnet *)&sc->arpcom.ac_if;
   struct mbuf *m;
 
@@ -1979,5 +1982,5 @@
       * a fragment, so it is NOT a complete packet.
       */
-     pRfd = uti596_dequeue( &sc->pInboundFrameQueue);
+     pRfd = uti596_dequeue( (i596_rfd **)&sc->pInboundFrameQueue);
      while ( pRfd &&
              pRfd != I596_NULL &&
@@ -2005,5 +2008,5 @@
          m->m_pkthdr.rcvif = ifp;
          /* move everything into an mbuf */
-         memcpy(m->m_data, pRfd->data, pkt_len);
+         memcpy(m->m_data, (const char *)pRfd->data, pkt_len);
          m->m_len = m->m_pkthdr.len = pkt_len - sizeof(struct ether_header) - 4;
 
@@ -2060,5 +2063,5 @@
        _ISR_Enable(level);
 
-       pRfd = uti596_dequeue( &sc->pInboundFrameQueue); /* grab next frame */
+       pRfd = uti596_dequeue( (i596_rfd **)&sc->pInboundFrameQueue); /* grab next frame */
 
      } /* end while */
@@ -2228,5 +2231,5 @@
         pIsrRfd = (i596_rfd *) word_swap ((unsigned long)uti596_softc.pBeginRFA->next);
         /* the append destroys the link */
-        uti596_append( &uti596_softc.pInboundFrameQueue , uti596_softc.pBeginRFA );
+        uti596_append( (i596_rfd **)&uti596_softc.pInboundFrameQueue , uti596_softc.pBeginRFA );
 
        /*
@@ -2462,5 +2465,5 @@
             uti596_softc.pEndRFA -> next = I596_NULL;   /* added feb 16 */
           }
-          uti596_append( &uti596_softc.pSavedRfdQueue, uti596_softc.pLastUnkRFD );
+          uti596_append( (i596_rfd **)&uti596_softc.pSavedRfdQueue, uti596_softc.pLastUnkRFD );
           uti596_softc.savedCount++;
           uti596_softc.pEndSavedQueue = uti596_softc.pLastUnkRFD;
@@ -2576,5 +2579,6 @@
 static int uti596_ioctl(
   struct ifnet *ifp,
-  int command, caddr_t data
+  int command,
+  caddr_t data
 )
 {
@@ -2603,5 +2607,5 @@
         case IFF_UP:
           printk(("IFF_UP\n"))
-          uti596_init (sc);
+          uti596_init ( (void *)sc);
           break;
 
@@ -2609,5 +2613,5 @@
           printk(("IFF_UP and RUNNING\n"))
           uti596_stop (sc);
-          uti596_init (sc);
+          uti596_init ( (void *)sc);
           break;
 
Index: c/src/lib/libbsp/m68k/mvme167/network/uti596.h
===================================================================
--- c/src/lib/libbsp/m68k/mvme167/network/uti596.h	(revision b1446092bd72944e7cbbeafd5a933f7fa97887c4)
+++ c/src/lib/libbsp/m68k/mvme167/network/uti596.h	(revision db9ae7078d4fe001139d1fbb7816ef71a3d2f2ae)
@@ -209,5 +209,5 @@
   unsigned short status;
   unsigned short command;
-  struct i596_cmd *next;
+  volatile struct i596_cmd *next;
 } i596_cmd;
 
@@ -228,5 +228,5 @@
 typedef volatile struct i596_tx {
   i596_cmd cmd;
-  struct i596_tbd *pTbd;
+  volatile struct i596_tbd *pTbd;
   unsigned short count;
   unsigned short pad;
@@ -251,5 +251,5 @@
 	  unsigned short size;
 	  unsigned short pad;
-	  struct i596_tbd *next;
+	  volatile struct i596_tbd *next;
 	  char *data; 
 } i596_tbd;
@@ -262,5 +262,5 @@
 	  unsigned short count;
 	  unsigned short offset;
-	  struct i596_rbd *next;
+	  volatile struct i596_rbd *next;
 	  char *data; 
 	  unsigned short size;
@@ -274,5 +274,5 @@
 	  unsigned short stat;
 	  unsigned short cmd;
-	  struct i596_rfd *next;
+	  volatile struct i596_rfd *next;
 	  i596_rbd *pRbd; 
 	  unsigned short count;
Index: make/custom/mvme167.cfg
===================================================================
--- make/custom/mvme167.cfg	(revision b1446092bd72944e7cbbeafd5a933f7fa97887c4)
+++ make/custom/mvme167.cfg	(revision db9ae7078d4fe001139d1fbb7816ef71a3d2f2ae)
@@ -22,5 +22,5 @@
 #
 
-CPU_CFLAGS = -m68040 -DRTEMS_BSP=$(RTEMS_BSP)
+CPU_CFLAGS = -m68040 -DRTEMS_BSP=$(RTEMS_BSP) -D$(RTEMS_BSP)
 
 # BSP specific preprocessor flags.
