Index: /trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c	(revision 41686)
+++ /trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c	(revision 41687)
@@ -108,5 +108,5 @@
 
 /*******************************************************************************
-*   Kernel Entry Hook                                                          *
+*   Kernel Entry Hooks                                                         *
 *******************************************************************************/
 int VBoxUSBSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred);
@@ -317,5 +317,6 @@
 LOCAL inline void vboxUSBSolarisDeQueueURB(vboxusb_urb_t *pUrb, int URBStatus);
 LOCAL inline void vboxUSBSolarisNotifyComplete(vboxusb_state_t *pState);
-LOCAL int vboxUSBSolarisProcessIOCtl(int iFunction, void *pvState, int Mode, PVBOXUSBREQ pUSBReq, void *pvBuf, size_t *pcbDataOut);
+LOCAL int vboxUSBSolarisProcessIOCtl(int iFunction, void *pvState, int Mode, PVBOXUSBREQ pUSBReq, void *pvBuf,
+                                     size_t *pcbDataOut);
 LOCAL bool vboxUSBSolarisIsUSBDevice(dev_info_t *pDip);
 
@@ -555,15 +556,14 @@
                                                     char szDevicePath[MAXPATHLEN];
                                                     ddi_pathname(pState->pDip, szDevicePath);
-                                                    RTStrPrintf(pState->ClientInfo.szClientPath, sizeof(pState->ClientInfo.szClientPath),
-                                                                "/devices%s:%s",
-                                                                szDevicePath,
-                                                                DEVICE_NAME);
+                                                    RTStrPrintf(pState->ClientInfo.szClientPath,
+                                                                sizeof(pState->ClientInfo.szClientPath),
+                                                                "/devices%s:%s", szDevicePath,DEVICE_NAME);
                                                     RTPathStripFilename(szDevicePath);
-                                                    RTStrPrintf(pState->ClientInfo.szDeviceIdent, sizeof(pState->ClientInfo.szDeviceIdent),
+                                                    RTStrPrintf(pState->ClientInfo.szDeviceIdent,
+                                                                sizeof(pState->ClientInfo.szDeviceIdent),
                                                                 "%#x:%#x:%d:%s",
                                                                 pState->pDevDesc->dev_descr->idVendor,
                                                                 pState->pDevDesc->dev_descr->idProduct,
-                                                                pState->pDevDesc->dev_descr->bcdDevice,
-                                                                szDevicePath);
+                                                                pState->pDevDesc->dev_descr->bcdDevice, szDevicePath);
                                                     pState->ClientInfo.Instance = instance;
                                                     pState->ClientInfo.pfnSetConsumerCredentials = &vboxUSBSolarisSetConsumerCredentials;
@@ -572,5 +572,6 @@
                                                     {
                                                         LogRel((DEVICE_NAME ": Captured %s %#x:%#x:%d:%s\n",
-                                                                pState->pDevDesc->dev_product ? pState->pDevDesc->dev_product : "<Unnamed USB device>",
+                                                                pState->pDevDesc->dev_product ? pState->pDevDesc->dev_product
+                                                                    : "<Unnamed USB device>",
                                                                 pState->pDevDesc->dev_descr->idVendor,
                                                                 pState->pDevDesc->dev_descr->idProduct,
@@ -582,6 +583,7 @@
                                                     else
                                                     {
-                                                        LogRel((DEVICE_NAME ":VBoxUSBMonSolarisRegisterClient failed! rc=%d path=%s instance=%d\n",
-                                                                rc, pState->ClientInfo.szClientPath, instance));
+                                                        LogRel((DEVICE_NAME ":VBoxUSBMonSolarisRegisterClient failed! rc=%d "
+                                                                "path=%s instance=%d\n", rc, pState->ClientInfo.szClientPath,
+                                                                instance));
                                                     }
 
@@ -589,19 +591,32 @@
                                                 }
                                                 else
-                                                    LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach failed to register hotplug callbacks! rc=%d\n", rc));
+                                                    LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach failed to register hotplug "
+                                                            "callbacks! rc=%d\n", rc));
 
                                                 ddi_remove_minor_node(pState->pDip, NULL);
                                             }
                                             else
-                                                LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach ddi_create_minor_node failed! rc=%d\n", rc));
+                                            {
+                                                LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach ddi_create_minor_node failed! rc=%d\n",
+                                                        rc));
+                                            }
                                         }
                                         else
-                                            LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach failed to initialize power management! rc=%d\n", rc));
+                                        {
+                                            LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach failed to initialize power management! "
+                                                    "rc=%d\n", rc));
+                                        }
                                     }
                                     else
-                                        LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach vboxUSBSolarisInitAllEndPoints failed! rc=%d\n"));
+                                    {
+                                        LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach vboxUSBSolarisInitAllEndPoints failed! "
+                                                "rc=%d\n"));
+                                    }
                                 }
                                 else
-                                    LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach usb_pipe_get_max_bulk_transfer_size failed! rc=%d\n", rc));
+                                {
+                                    LogRel((DEVICE_NAME ":VBoxUSBSolarisAttach usb_pipe_get_max_bulk_transfer_size failed! "
+                                            "rc=%d\n", rc));
+                                }
 
                                 usb_fini_serialization(pState->StateMulti);
@@ -618,5 +633,8 @@
                     }
                     else
-                        Log((DEVICE_NAME ":VBoxUSBSolarisAttach not a USB device.\n")); /* This would appear on every boot if it were Rel */
+                    {
+                        /* This would appear on every boot if it were LogRel() */
+                        Log((DEVICE_NAME ":VBoxUSBSolarisAttach not a USB device.\n"));
+                    }
                 }
                 else
@@ -850,5 +868,6 @@
     else
     {
-        LogRel((DEVICE_NAME ":vboxUSBSolarisSetConsumerCredentials failed! Process %u already has client open.\n", pState->Process));
+        LogRel((DEVICE_NAME ":vboxUSBSolarisSetConsumerCredentials failed! Process %u already has client open.\n",
+                pState->Process));
         rc = VERR_RESOURCE_BUSY;
     }
@@ -891,5 +910,5 @@
             LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen No prior information about authorized process.\n"));
         else
-            LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen Process %d is already using this device instance.\n", pState->Process));
+            LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen Process %u is already using this device instance.\n", pState->Process));
 
         mutex_exit(&pState->Mtx);
@@ -1091,5 +1110,6 @@
     if (IOCPARM_LEN(Cmd) != sizeof(ReqWrap))
     {
-        LogRel((DEVICE_NAME ": VBoxUSBSolarisIOCtl: bad request %#x size=%d expected=%d\n", Cmd, IOCPARM_LEN(Cmd), sizeof(ReqWrap)));
+        LogRel((DEVICE_NAME ": VBoxUSBSolarisIOCtl: bad request %#x size=%d expected=%d\n", Cmd, IOCPARM_LEN(Cmd),
+                sizeof(ReqWrap)));
         return ENOTTY;
     }
@@ -1149,5 +1169,6 @@
     if (RT_UNLIKELY(cbDataOut > ReqWrap.cbData))
     {
-        LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: too much output data %d expected %d Truncating!\n", cbDataOut, ReqWrap.cbData));
+        LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: too much output data %d expected %d Truncating!\n", cbDataOut,
+                ReqWrap.cbData));
         cbDataOut = ReqWrap.cbData;
     }
@@ -1169,5 +1190,6 @@
             if (RT_UNLIKELY(rc))
             {
-                LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout failed; pvBuf=%p pArg=%p Cmd=%d. rc=%d\n", pvBuf, pArg, Cmd, rc));
+                LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout failed; pvBuf=%p pArg=%p Cmd=%d. rc=%d\n", pvBuf, pArg,
+                        Cmd, rc));
                 rc = EFAULT;
             }
@@ -1176,5 +1198,6 @@
     else
     {
-        LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout(1)failed; pReqWrap=%p pArg=%p Cmd=%d. rc=%d\n", &ReqWrap, pArg, Cmd, rc));
+        LogRel((DEVICE_NAME ":VBoxUSBSolarisIOCtl: ddi_copyout(1)failed; pReqWrap=%p pArg=%p Cmd=%d. rc=%d\n", &ReqWrap, pArg,
+                Cmd, rc));
         rc = EFAULT;
     }
@@ -1560,5 +1583,6 @@
             if (!strncmp(ppszCompatible[cCompatible], "usb", 3))
             {
-                Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice verified device as USB. pszCompatible=%s\n", ppszCompatible[cCompatible]));
+                Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice verified device as USB. pszCompatible=%s\n",
+                     ppszCompatible[cCompatible]));
                 ddi_prop_free(ppszCompatible);
                 return true;
@@ -1578,10 +1602,12 @@
     if (pParentDip)
     {
-        rc = ddi_prop_lookup_string_array(DDI_DEV_T_ANY, pParentDip, DDI_PROP_DONTPASS, "compatible", &ppszCompatible, &cCompatible);
+        rc = ddi_prop_lookup_string_array(DDI_DEV_T_ANY, pParentDip, DDI_PROP_DONTPASS, "compatible", &ppszCompatible,
+                                          &cCompatible);
         if (RT_LIKELY(rc == DDI_PROP_SUCCESS))
         {
             while (cCompatible--)
             {
-                Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice parent compatible[%d]=%s\n", cCompatible, ppszCompatible[cCompatible]));
+                Log((DEVICE_NAME ":vboxUSBSolarisIsUSBDevice parent compatible[%d]=%s\n", cCompatible,
+                     ppszCompatible[cCompatible]));
                 if (!strncmp(ppszCompatible[cCompatible], "usb", 3))
                 {
@@ -1610,5 +1636,5 @@
  *
  * @param   pState          The USB device instance.
- * @param   pUrb            Pointer to the VBox USB URB.
+ * @param   pUrbReq         Pointer to the VBox USB URB.
  * @param   Mode            The IOCtl mode.
  *
@@ -1673,6 +1699,7 @@
             mutex_exit(&pState->Mtx);
             freemsg(pMsg);
-            LogRel((DEVICE_NAME ":vboxUSBSolarisSendUrb OpenPipe failed. pState=%p pUrbReq=%p bEndpoint=%#x enmDir=%#x enmType=%#x cbData=%d pvData=%p rc=%d\n",
-                    pState, pUrbReq, pUrbReq->bEndpoint, pUrbReq->enmDir, pUrbReq->enmType, pUrbReq->cbData, pUrbReq->pvData, rc));
+            LogRel((DEVICE_NAME ":vboxUSBSolarisSendUrb OpenPipe failed. pState=%p pUrbReq=%p bEndpoint=%#x enmDir=%#x "
+                    "enmType=%#x cbData=%d pvData=%p rc=%d\n", pState, pUrbReq, pUrbReq->bEndpoint, pUrbReq->enmDir,
+                    pUrbReq->enmType, pUrbReq->cbData, pUrbReq->pvData, rc));
             return VERR_BAD_PIPE;
         }
@@ -1724,4 +1751,8 @@
             if (RT_FAILURE(rc))
             {
+                /** @todo We share the state mutex for protecting concurrent accesses to both
+                 *        the inflight URB list as well as pUrb->pMsg (data). Probably make this
+                 *        more fine grained later by having a different mutex for the URB if
+                 *        it's really worth the trouble. */
                 mutex_enter(&pState->Mtx);
                 if (pUrb->pMsg)
@@ -1796,4 +1827,9 @@
     {
         vboxusb_urb_t *pUrb = list_remove_head(&pState->hLandedUrbs);
+
+        /*
+         * It is safe to access pUrb->pMsg outside the state mutex because this is from the landed URB list
+         * and not the inflight URB list.
+         */
         mutex_exit(&pState->Mtx);
         if (pUrb)
@@ -1856,5 +1892,6 @@
                     }
 
-                    Log((DEVICE_NAME ":vboxUSBSolarisReapUrb pvUrbR3=%p pvDataR3=%p cbData=%d\n", pUrbReq->pvUrbR3, pUrbReq->pvData, pUrbReq->cbData));
+                    Log((DEVICE_NAME ":vboxUSBSolarisReapUrb pvUrbR3=%p pvDataR3=%p cbData=%d\n", pUrbReq->pvUrbR3,
+                         pUrbReq->pvData, pUrbReq->cbData));
                 }
                 else
@@ -1993,5 +2030,6 @@
             else
             {
-                Log((DEVICE_NAME ":vboxUSBSolarisClearEndPoint not opened to be cleared. Faking success. bEndpoint=%#x.\n", bEndpoint));
+                Log((DEVICE_NAME ":vboxUSBSolarisClearEndPoint not opened to be cleared. Faking success. bEndpoint=%#x.\n",
+                     bEndpoint));
                 rc = VINF_SUCCESS;
             }
@@ -1999,5 +2037,6 @@
         else
         {
-            LogRel((DEVICE_NAME ":vboxUSBSolarisClearEndPoint Endpoint missing!! bEndpoint=%#x EndPtIndex=%d.\n", bEndpoint, EndPtIndex));
+            LogRel((DEVICE_NAME ":vboxUSBSolarisClearEndPoint Endpoint missing!! bEndpoint=%#x EndPtIndex=%d.\n", bEndpoint,
+                    EndPtIndex));
             rc = VERR_GENERAL_FAILURE;
         }
@@ -2390,5 +2429,6 @@
             if (RT_FAILURE(rc))
             {
-                LogRel((DEVICE_NAME ":vboxUSBSolarisInitAllEndPoints: vboxUSBSolarisInitEndPoints uCfgIndex=%d failed. rc=%d\n", uCfgIndex, rc));
+                LogRel((DEVICE_NAME ":vboxUSBSolarisInitAllEndPoints: vboxUSBSolarisInitEndPoints uCfgIndex=%d failed. rc=%d\n",
+                        uCfgIndex, rc));
                 return rc;
             }
@@ -2431,6 +2471,6 @@
                 if (RT_FAILURE(rc))
                 {
-                    LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForConfig: vboxUSBSolarisInitEndPoint failed! pEp=%p uCfgValue=%u uCfgIndex=%u uInterface=%u, uAlt=%u\n",
-                                uCfgValue, uCfgIndex, uInterface, uAlt));
+                    LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForConfig: vboxUSBSolarisInitEndPoint failed! pEp=%p "
+                            "uCfgValue=%u uCfgIndex=%u uInterface=%u, uAlt=%u\n", uCfgValue, uCfgIndex, uInterface, uAlt));
                     return rc;
                 }
@@ -2453,5 +2493,6 @@
 LOCAL int vboxUSBSolarisInitEndPointsForInterfaceAlt(vboxusb_state_t *pState, uint8_t uInterface, uint8_t uAlt)
 {
-    LogFunc((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt pState=%p uInterface=%d uAlt=%d\n", pState, uInterface, uAlt));
+    LogFunc((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt pState=%p uInterface=%d uAlt=%d\n", pState, uInterface,
+             uAlt));
 
     /* Doesn't hurt to be paranoid */
@@ -2479,6 +2520,6 @@
                 if (RT_FAILURE(rc))
                 {
-                    LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt: vboxUSBSolarisInitEndPoint failed! pEp=%p uCfgValue=%u uCfgIndex=%u uInterface=%u, uAlt=%u\n",
-                                uCfgValue, uCfgIndex, uInterface, uAlt));
+                    LogRel((DEVICE_NAME ":vboxUSBSolarisInitEndPointsForInterfaceAlt: vboxUSBSolarisInitEndPoint failed! pEp=%p "
+                            "uCfgValue=%u uCfgIndex=%u uInterface=%u, uAlt=%u\n", uCfgValue, uCfgIndex, uInterface, uAlt));
                     return rc;
                 }
@@ -2506,5 +2547,5 @@
  *
  * @param   pState          The USB device instance.
- * @remarks Requires the state mutex to be held!!
+ * @remarks Requires the state mutex to be held.
  *          Call only from Detach() or similar as callbacks
  */
@@ -2512,4 +2553,6 @@
 {
     LogFunc((DEVICE_NAME ":vboxUSBSolarisDestroyAllEndPoints pState=%p\n", pState));
+
+    Assert(mutex_owned(&pState->Mtx));
     for (unsigned i = 0; i < VBOXUSB_MAX_ENDPOINTS; i++)
     {
@@ -2529,4 +2572,5 @@
  * @param   pState          The USB device instance.
  * @param   pEp             The Endpoint.
+ * @remarks Requires the state mutex to be held.
  */
 LOCAL void vboxUSBSolarisDestroyEndPoint(vboxusb_state_t *pState, vboxusb_ep_t *pEp)
@@ -2534,4 +2578,5 @@
     LogFunc((DEVICE_NAME ":vboxUSBSolarisDestroyEndPoint pState=%p pEp=%p\n", pState, pEp));
 
+    Assert(mutex_owned(&pState->Mtx));
     if (pEp->fInitialized == VBOXUSB_EP_INITIALIZED)
     {
@@ -2602,4 +2647,5 @@
  * @param   pState          The USB device instance.
  * @param   pEp             The Endpoint.
+ * @remarks Requires the device state mutex to be held.
  *
  * @returns VBox status code.
@@ -2608,4 +2654,6 @@
 {
 //    LogFunc((DEVICE_NAME ":vboxUSBSolarisOpenPipe pState=%p pEp=%p\n", pState, pEp));
+
+    Assert(mutex_owned(&pState->Mtx));
 
     /*
@@ -2629,5 +2677,7 @@
      * Open the non-default pipe for the Endpoint.
      */
+    mutex_exit(&pState->Mtx);
     int rc = usb_pipe_open(pState->pDip, &pEp->EpDesc, &pEp->PipePolicy, USB_FLAGS_NOSLEEP, &pEp->pPipe);
+    mutex_enter(&pState->Mtx);
     if (rc == USB_SUCCESS)
     {
@@ -2715,5 +2765,6 @@
              * Non-default pipe: close it.
              */
-            Log((DEVICE_NAME ":vboxUSBSolarisClosePipe pipe bmAttributes=%#x bEndpointAddress=%#x\n", pEp->EpDesc.bmAttributes, pEp->EpDesc.bEndpointAddress));
+            Log((DEVICE_NAME ":vboxUSBSolarisClosePipe pipe bmAttributes=%#x bEndpointAddress=%#x\n", pEp->EpDesc.bmAttributes,
+                 pEp->EpDesc.bEndpointAddress));
             mutex_exit(&pState->Mtx);
             usb_pipe_close(pState->pDip, pEp->pPipe, USB_FLAGS_SLEEP, NULL /* callback */, NULL /* callback arg. */);
@@ -2806,5 +2857,5 @@
  * @param   pMsg            Pointer to the allocated request data.
  *
- * @returns The allocated URB to be used.
+ * @returns The allocated URB to be used, or NULL upon failure.
  */
 LOCAL vboxusb_urb_t *vboxUSBSolarisQueueURB(vboxusb_state_t *pState, PVBOXUSBREQ_URB pUrbReq, mblk_t *pMsg)
@@ -2836,11 +2887,12 @@
             && pUrb->enmState != VBOXUSB_URB_STATE_FREE))
     {
+        mutex_exit(&pState->Mtx);
         pUrb = RTMemAllocZ(sizeof(vboxusb_urb_t));
         if (RT_UNLIKELY(!pUrb))
         {
-            mutex_exit(&pState->Mtx);
             LogRel((DEVICE_NAME ":vboxUSBSolarisQueueURB failed to alloc %d bytes.\n", sizeof(vboxusb_urb_t)));
             return NULL;
         }
+        mutex_enter(&pState->Mtx);
     }
     else
@@ -2850,4 +2902,5 @@
          * up each one free 'head'.
          */
+        Assert(pUrb && pUrb->enmState == VBOXUSB_URB_STATE_FREE);
         list_remove_head(&pState->hUrbs);
     }
@@ -2955,5 +3008,5 @@
  *
  * @param   pState          The USB device instance.
- * @remarks Requires the device state mutex to be held!!
+ * @remarks Requires the device state mutex to be held.
  */
 LOCAL inline void vboxUSBSolarisNotifyComplete(vboxusb_state_t *pState)
@@ -3001,5 +3054,6 @@
 LOCAL int vboxUSBSolarisCtrlXfer(vboxusb_state_t *pState, vboxusb_ep_t *pEp, vboxusb_urb_t *pUrb)
 {
-    LogFunc((DEVICE_NAME ":vboxUSBSolarisCtrlXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb, pUrb->enmDir, pUrb->cbDataR3));
+    LogFunc((DEVICE_NAME ":vboxUSBSolarisCtrlXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb,
+             pUrb->enmDir, pUrb->cbDataR3));
 
     AssertPtrReturn(pUrb->pMsg, VERR_INVALID_PARAMETER);
@@ -3106,4 +3160,8 @@
             pSetupMsg->b_wptr += sizeof(VUSBSETUP);
 
+            /*
+             * Should be safe to update pMsg here without the state mutex, see vboxUSBSolarisSendURB()
+             * and vboxUSBSolarisQueueUURB() as the URB state is (still) not VBOXUSB_URB_STATE_FREE.
+             */
             pUrb->pMsg = pSetupMsg;
             pUrb->pMsg->b_cont = pReq->ctrl_data;
@@ -3115,6 +3173,6 @@
                 && pUrb->pMsg->b_cont == NULL)  /* Concat succeeded */
             {
-                Log((DEVICE_NAME ":vboxUSBSolarisCtrlXferCompleted prepended header rc=%d cbData=%d.\n", pReq->ctrl_completion_reason,
-                        MBLKL(pUrb->pMsg)));
+                Log((DEVICE_NAME ":vboxUSBSolarisCtrlXferCompleted prepended header rc=%d cbData=%d.\n",
+                     pReq->ctrl_completion_reason, MBLKL(pUrb->pMsg)));
                 Log((DEVICE_NAME ":%.*Rhxd\n", MBLKL(pUrb->pMsg), pUrb->pMsg->b_rptr));
             }
@@ -3129,5 +3187,8 @@
         }
         else
-            LogRel((DEVICE_NAME ":vboxUSBSolarisCtrlXferCompleted failed to alloc %d bytes for Setup Header.\n", sizeof(VUSBSETUP)));
+        {
+            LogRel((DEVICE_NAME ":vboxUSBSolarisCtrlXferCompleted failed to alloc %d bytes for Setup Header.\n",
+                    sizeof(VUSBSETUP)));
+        }
     }
     else
@@ -3150,5 +3211,6 @@
 LOCAL int vboxUSBSolarisBulkXfer(vboxusb_state_t *pState, vboxusb_ep_t *pEp, vboxusb_urb_t *pUrb)
 {
-    LogFunc((DEVICE_NAME ":vboxUSBSolarisBulkXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb, pUrb->enmDir, pUrb->cbDataR3));
+    LogFunc((DEVICE_NAME ":vboxUSBSolarisBulkXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb,
+             pUrb->enmDir, pUrb->cbDataR3));
 
     /*
@@ -3156,5 +3218,6 @@
      */
     int rc = VINF_SUCCESS;
-    usb_bulk_req_t *pReq = usb_alloc_bulk_req(pState->pDip, pUrb->enmDir == VUSBDIRECTION_IN ? pUrb->cbDataR3 : 0, USB_FLAGS_NOSLEEP);
+    usb_bulk_req_t *pReq = usb_alloc_bulk_req(pState->pDip, pUrb->enmDir == VUSBDIRECTION_IN ? pUrb->cbDataR3 : 0,
+                                              USB_FLAGS_NOSLEEP);
     if (RT_LIKELY(pReq))
     {
@@ -3188,5 +3251,6 @@
         else
         {
-            LogRel((DEVICE_NAME ":vboxUSBSolarisBulkXfer usb_pipe_bulk_xfer enmDir=%#x Ep=%#x failed! rc=%d\n", pUrb->enmDir, pUrb->bEndpoint, rc));
+            LogRel((DEVICE_NAME ":vboxUSBSolarisBulkXfer usb_pipe_bulk_xfer enmDir=%#x Ep=%#x failed! rc=%d\n", pUrb->enmDir,
+                    pUrb->bEndpoint, rc));
             rc = VERR_PIPE_IO_ERROR;
         }
@@ -3268,5 +3332,6 @@
 LOCAL int vboxUSBSolarisIntrXfer(vboxusb_state_t *pState, vboxusb_ep_t *pEp, vboxusb_urb_t *pUrb)
 {
-    LogFunc((DEVICE_NAME ":vboxUSBSolarisIntrXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb, pUrb->enmDir, pUrb->cbDataR3));
+    LogFunc((DEVICE_NAME ":vboxUSBSolarisIntrXfer pState=%p pEp=%p pUrb=%p enmDir=%d cbData=%d\n", pState, pEp, pUrb,
+             pUrb->enmDir, pUrb->cbDataR3));
 
     int rc = VINF_SUCCESS;
@@ -3347,6 +3412,6 @@
             }
 
-            Log((DEVICE_NAME ":vboxUSBSolarisIntrXferCompleted rc=%d pMsg=%p enmDir=%#x\n", pReq->intr_completion_reason, pUrb->pMsg,
-                    pUrb->enmDir));
+            Log((DEVICE_NAME ":vboxUSBSolarisIntrXferCompleted rc=%d pMsg=%p enmDir=%#x\n", pReq->intr_completion_reason,
+                 pUrb->pMsg, pUrb->enmDir));
 
             /*
@@ -3533,5 +3598,6 @@
             if (RT_LIKELY(pReq->isoc_data))
             {
-                Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferCompleted cIsocInUrbs=%d cbIsocInLandedReqs=%d\n", pEp->cIsocInUrbs, pEp->cbIsocInLandedReqs));
+                Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferCompleted cIsocInUrbs=%d cbIsocInLandedReqs=%d\n", pEp->cIsocInUrbs,
+                     pEp->cbIsocInLandedReqs));
 
                 mutex_enter(&pState->Mtx);
@@ -3548,5 +3614,5 @@
                         --pEp->cIsocInUrbs;
                         mutex_exit(&pState->Mtx);
-#if 0
+
                         for (unsigned i = 0; i < pReq->isoc_pkts_count; i++)
                         {
@@ -3554,7 +3620,5 @@
                             pUrb->aIsocPkts[i].enmStatus = vboxUSBSolarisGetUrbStatus(pReq->isoc_pkt_descr[i].isoc_pkt_status);
                         }
-#else
-                        bcopy(pReq->isoc_pkt_descr, pUrb->aIsocPkts, sizeof(VUSBISOC_PKT_DESC) * pReq->isoc_pkts_count);
-#endif
+
                         pUrb->pMsg = pReq->isoc_data;
                         pReq->isoc_data = NULL;
@@ -3569,5 +3633,6 @@
                     else
                     {
-                        /* Huh!? cIsocInUrbs is wrong then! Should never happen unless we decide to decrement cIsocInUrbs in Reap time */
+                        /* Huh!? cIsocInUrbs is wrong then! Should never happen unless we decide to decrement cIsocInUrbs in
+                           Reap time */
                         pEp->cIsocInUrbs = 0;
                         LogRel((DEVICE_NAME ":vboxUSBSolarisIsocInXferCompleted Extreme error! Isoc. counter b0rked!\n"));
@@ -3725,5 +3790,6 @@
             mutex_exit(&pState->Mtx);
             usb_pipe_isoc_xfer(pPipe, pReq, USB_FLAGS_NOSLEEP);
-            Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferError resubmitted Isoc. IN request due to immediately unavailable resources.\n"));
+            Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferError resubmitted Isoc. IN request due to immediately unavailable "
+                 "resources.\n"));
 
             return;
@@ -3741,5 +3807,6 @@
         default:
         {
-            Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferError stopping Isoc. In. polling due to rc=%d\n", pReq->isoc_completion_reason));
+            Log((DEVICE_NAME ":vboxUSBSolarisIsocInXferError stopping Isoc. In. polling due to rc=%d\n",
+                 pReq->isoc_completion_reason));
             pEp->fIsocPolling = false;
             mutex_exit(&pState->Mtx);
@@ -3793,5 +3860,6 @@
             }
 
-            Log((DEVICE_NAME ":vboxUSBSolarisIsocOutXferCompleted cIsocPkts=%d cbData=%d cbActPkt=%d\n", pUrb->cIsocPkts, pUrb->cbDataR3, cbActPkt));
+            Log((DEVICE_NAME ":vboxUSBSolarisIsocOutXferCompleted cIsocPkts=%d cbData=%d cbActPkt=%d\n", pUrb->cIsocPkts,
+                 pUrb->cbDataR3, cbActPkt));
 
             if (pReq->isoc_completion_reason == USB_CR_OK)
