Index: /trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-netbsd.c
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-netbsd.c	(revision 70042)
+++ /trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-netbsd.c	(revision 70043)
@@ -245,5 +245,5 @@
     int rc = VINF_SUCCESS;
     int iResId = 0;
-    vboxguest_softc *vboxguest;
+    vboxguest_softc *sc;
     struct pci_attach_args *pa = aux;
     bus_space_tag_t iot, memt;
@@ -258,6 +258,6 @@
     aprint_normal(": VirtualBox Guest\n");
 
-    vboxguest = device_private(self);
-    vboxguest->sc_dev = self;
+    sc = device_private(self);
+    sc->sc_dev = self;
 
     /*
@@ -268,9 +268,9 @@
     {
         LogFunc(("RTR0Init failed.\n"));
-        aprint_error_dev(vboxguest->sc_dev, "RTR0Init failed\n");
+        aprint_error_dev(sc->sc_dev, "RTR0Init failed\n");
         return;
     }
 
-    vboxguest->pc = pa->pa_pc;
+    sc->pc = pa->pa_pc;
 
     /*
@@ -278,6 +278,6 @@
      */
     ioh_valid = (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_IO, 0,
-                                &vboxguest->io_tag, &vboxguest->io_handle,
-                                &vboxguest->uIOPortBase, &vboxguest->io_regsize) == 0);
+                                &sc->io_tag, &sc->io_handle,
+                                &sc->uIOPortBase, &sc->io_regsize) == 0);
 
     if (ioh_valid)
@@ -288,6 +288,6 @@
          */
         memh_valid = (pci_mapreg_map(pa, PCI_MAPREG_START+4, PCI_MAPREG_TYPE_MEM, BUS_SPACE_MAP_LINEAR,
-                                     &vboxguest->iVMMDevMemResId, &vboxguest->VMMDevMemHandle,
-                                     &vboxguest->pMMIOBase, &vboxguest->VMMDevMemSize) == 0);
+                                     &sc->iVMMDevMemResId, &sc->VMMDevMemHandle,
+                                     &sc->pMMIOBase, &sc->VMMDevMemSize) == 0);
         if (memh_valid)
         {
@@ -295,8 +295,8 @@
              * Call the common device extension initializer.
              */
-            rc = VGDrvCommonInitDevExt(&g_DevExt, vboxguest->uIOPortBase,
-                                       bus_space_vaddr(vboxguest->iVMMDevMemResId,
-                                                       vboxguest->VMMDevMemHandle),
-                                       vboxguest->VMMDevMemSize,
+            rc = VGDrvCommonInitDevExt(&g_DevExt, sc->uIOPortBase,
+                                       bus_space_vaddr(sc->iVMMDevMemResId,
+                                                       sc->VMMDevMemHandle),
+                                       sc->VMMDevMemSize,
 #if ARCH_BITS == 64
                                        VBOXOSTYPE_NetBSD_x64,
@@ -310,11 +310,11 @@
                  * Add IRQ of VMMDev.
                  */
-                rc = VBoxGuestNetBSDAddIRQ(vboxguest, pa);
+                rc = VBoxGuestNetBSDAddIRQ(sc, pa);
                 if (RT_SUCCESS(rc))
                 {
-                    vboxguest->vboxguest_state |= VBOXGUEST_STATE_INITOK;
-                    VBoxGuestNetBSDWsmAttach(vboxguest);
-
-                    g_SC = vboxguest;
+                    sc->vboxguest_state |= VBOXGUEST_STATE_INITOK;
+                    VBoxGuestNetBSDWsmAttach(sc);
+
+                    g_SC = sc;
                     return;
                 }
@@ -323,17 +323,17 @@
             else
             {
-                aprint_error_dev(vboxguest->sc_dev, "init failed\n");
+                aprint_error_dev(sc->sc_dev, "init failed\n");
             }
-            bus_space_unmap(vboxguest->iVMMDevMemResId, vboxguest->VMMDevMemHandle, vboxguest->VMMDevMemSize);
+            bus_space_unmap(sc->iVMMDevMemResId, sc->VMMDevMemHandle, sc->VMMDevMemSize);
         }
         else
         {
-            aprint_error_dev(vboxguest->sc_dev, "MMIO mapping failed\n");
+            aprint_error_dev(sc->sc_dev, "MMIO mapping failed\n");
         }
-        bus_space_unmap(vboxguest->io_tag, vboxguest->io_handle, vboxguest->io_regsize);
+        bus_space_unmap(sc->io_tag, sc->io_handle, sc->io_regsize);
     }
     else
     {
-        aprint_error_dev(vboxguest->sc_dev, "IO mapping failed\n");
+        aprint_error_dev(sc->sc_dev, "IO mapping failed\n");
     }
 
@@ -350,5 +350,5 @@
  * @param   pa  Pointer to the PCI attach arguments.
  */
-static int VBoxGuestNetBSDAddIRQ(vboxguest_softc *vboxguest, struct pci_attach_args *pa)
+static int VBoxGuestNetBSDAddIRQ(vboxguest_softc *sc, struct pci_attach_args *pa)
 {
     int iResId = 0;
@@ -361,21 +361,21 @@
     LogFlow((DEVICE_NAME ": %s\n", __func__));
 
-    if (pci_intr_map(pa, &vboxguest->ih))
-    {
-        aprint_error_dev(vboxguest->sc_dev, "couldn't map interrupt.\n");
+    if (pci_intr_map(pa, &sc->ih))
+    {
+        aprint_error_dev(sc->sc_dev, "couldn't map interrupt.\n");
         return VERR_DEV_IO_ERROR;
     }
 
-    intrstr = pci_intr_string(vboxguest->pc, vboxguest->ih
+    intrstr = pci_intr_string(sc->pc, sc->ih
 #if __NetBSD_Prereq__(6, 99, 39)
                               , intstrbuf, sizeof(intstrbuf)
 #endif
                               );
-    aprint_normal_dev(vboxguest->sc_dev, "interrupting at %s\n", intrstr);
-
-    vboxguest->pfnIrqHandler = pci_intr_establish(vboxguest->pc, vboxguest->ih, IPL_BIO, VBoxGuestNetBSDISR, vboxguest);
-    if (vboxguest->pfnIrqHandler == NULL)
-    {
-        aprint_error_dev(vboxguest->sc_dev, "couldn't establish interrupt\n");
+    aprint_normal_dev(sc->sc_dev, "interrupting at %s\n", intrstr);
+
+    sc->pfnIrqHandler = pci_intr_establish(sc->pc, sc->ih, IPL_BIO, VBoxGuestNetBSDISR, sc);
+    if (sc->pfnIrqHandler == NULL)
+    {
+        aprint_error_dev(sc->sc_dev, "couldn't establish interrupt\n");
         return VERR_DEV_IO_ERROR;
     }
@@ -427,6 +427,6 @@
 static int VBoxGuestNetBSDDetach(device_t self, int flags)
 {
-    vboxguest_softc *vboxguest;
-    vboxguest = device_private(self);
+    vboxguest_softc *sc;
+    sc = device_private(self);
 
     LogFlow((DEVICE_NAME ": %s\n", __func__));
@@ -435,5 +435,5 @@
         return EBUSY;
 
-    if ((vboxguest->vboxguest_state & VBOXGUEST_STATE_INITOK) == 0)
+    if ((sc->vboxguest_state & VBOXGUEST_STATE_INITOK) == 0)
         return 0;
 
@@ -441,13 +441,13 @@
      * Reverse what we did in VBoxGuestNetBSDAttach.
      */
-    if (vboxguest->sc_vmmmousereq != NULL)
-        VbglR0GRFree((VMMDevRequestHeader *)vboxguest->sc_vmmmousereq);
-
-    VBoxGuestNetBSDRemoveIRQ(vboxguest);
+    if (sc->sc_vmmmousereq != NULL)
+        VbglR0GRFree((VMMDevRequestHeader *)sc->sc_vmmmousereq);
+
+    VBoxGuestNetBSDRemoveIRQ(sc);
 
     VGDrvCommonDeleteDevExt(&g_DevExt);
 
-    bus_space_unmap(vboxguest->iVMMDevMemResId, vboxguest->VMMDevMemHandle, vboxguest->VMMDevMemSize);
-    bus_space_unmap(vboxguest->io_tag, vboxguest->io_handle, vboxguest->io_regsize);
+    bus_space_unmap(sc->iVMMDevMemResId, sc->VMMDevMemHandle, sc->VMMDevMemSize);
+    bus_space_unmap(sc->io_tag, sc->io_handle, sc->io_regsize);
 
     RTR0Term();
@@ -462,11 +462,11 @@
  * @param   vboxguest  Opaque pointer to the state info structure.
  */
-static void VBoxGuestNetBSDRemoveIRQ(vboxguest_softc *vboxguest)
+static void VBoxGuestNetBSDRemoveIRQ(vboxguest_softc *sc)
 {
     LogFlow((DEVICE_NAME ": %s\n", __func__));
 
-    if (vboxguest->pfnIrqHandler)
-    {
-        pci_intr_disestablish(vboxguest->pc, vboxguest->pfnIrqHandler);
+    if (sc->pfnIrqHandler)
+    {
+        pci_intr_disestablish(sc->pc, sc->pfnIrqHandler);
     }
 }
@@ -598,5 +598,5 @@
 {
     int rc;
-    vboxguest_softc *vboxguest;
+    vboxguest_softc *sc;
     struct vboxguest_session *session;
     file_t *fp;
@@ -605,5 +605,5 @@
     LogFlow((DEVICE_NAME ": %s\n", __func__));
 
-    if ((vboxguest = device_lookup_private(&vboxguest_cd, minor(device))) == NULL)
+    if ((sc = device_lookup_private(&vboxguest_cd, minor(device))) == NULL)
     {
         printf("device_lookup_private failed\n");
@@ -611,7 +611,7 @@
     }
 
-    if ((vboxguest->vboxguest_state & VBOXGUEST_STATE_INITOK) == 0)
-    {
-        aprint_error_dev(vboxguest->sc_dev, "device not configured\n");
+    if ((sc->vboxguest_state & VBOXGUEST_STATE_INITOK) == 0)
+    {
+        aprint_error_dev(sc->sc_dev, "device not configured\n");
         return (ENXIO);
     }
@@ -623,5 +623,5 @@
     }
 
-    session->sc = vboxguest;
+    session->sc = sc;
 
     if ((error = fd_allocfile(&fp, &fd)) != 0)
@@ -637,5 +637,5 @@
     if (! RT_SUCCESS(rc))
     {
-        aprint_error_dev(vboxguest->sc_dev, "VBox session creation failed\n");
+        aprint_error_dev(sc->sc_dev, "VBox session creation failed\n");
         closef(fp); /* ??? */
         kmem_free(session, sizeof(*session));
@@ -654,5 +654,5 @@
 {
     struct vboxguest_session *session = fp->f_data;
-    vboxguest_softc *vboxguest = session->sc;
+    vboxguest_softc *sc = session->sc;
 
     LogFlow((DEVICE_NAME ": %s\n", __func__));
@@ -682,5 +682,5 @@
 static int VBoxGuestNetBSDIOCtlSlow(struct vboxguest_session *session, u_long command, void *data)
 {
-    vboxguest_softc *vboxguest = session->sc;
+    vboxguest_softc *sc = session->sc;
     size_t cbReq = IOCPARM_LEN(command);
     PVBGLREQHDR pHdr = NULL;
@@ -797,5 +797,5 @@
 {
     struct vboxguest_session *session = fp->f_data;
-    vboxguest_softc *vboxguest = session->sc;
+    vboxguest_softc *sc = session->sc;
 
     int rc = 0;
