Index: /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 71755)
+++ /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 71756)
@@ -582,41 +582,41 @@
 *********************************************************************************************************************************/
 #ifdef IN_RING3
-static int                ichac97StreamCreate(PAC97STATE pThis, PAC97STREAM pStream, uint8_t u8Strm);
-static void               ichac97StreamDestroy(PAC97STATE pThis, PAC97STREAM pStream);
-static int                ichac97StreamOpen(PAC97STATE pThis, PAC97STREAM pStream);
-static int                ichac97StreamReOpen(PAC97STATE pThis, PAC97STREAM pStream);
-static int                ichac97StreamClose(PAC97STATE pThis, PAC97STREAM pStream);
-static void               ichac97StreamReset(PAC97STATE pThis, PAC97STREAM pStream);
-static void               ichac97StreamLock(PAC97STREAM pStream);
-static void               ichac97StreamUnlock(PAC97STREAM pStream);
-static uint32_t           ichac97StreamGetUsed(PAC97STREAM pStream);
-static uint32_t           ichac97StreamGetFree(PAC97STREAM pStream);
-static int                ichac97StreamTransfer(PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax);
-static void               ichac97StreamUpdate(PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer);
-
-static DECLCALLBACK(void) ichac97Reset(PPDMDEVINS pDevIns);
+static int                ichac97R3StreamCreate(PAC97STATE pThis, PAC97STREAM pStream, uint8_t u8Strm);
+static void               ichac97R3StreamDestroy(PAC97STATE pThis, PAC97STREAM pStream);
+static int                ichac97R3StreamOpen(PAC97STATE pThis, PAC97STREAM pStream);
+static int                ichac97R3StreamReOpen(PAC97STATE pThis, PAC97STREAM pStream);
+static int                ichac97R3StreamClose(PAC97STATE pThis, PAC97STREAM pStream);
+static void               ichac97R3StreamReset(PAC97STATE pThis, PAC97STREAM pStream);
+static void               ichac97R3StreamLock(PAC97STREAM pStream);
+static void               ichac97R3StreamUnlock(PAC97STREAM pStream);
+static uint32_t           ichac97R3StreamGetUsed(PAC97STREAM pStream);
+static uint32_t           ichac97R3StreamGetFree(PAC97STREAM pStream);
+static int                ichac97R3StreamTransfer(PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax);
+static void               ichac97R3StreamUpdate(PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer);
+
+static DECLCALLBACK(void) ichac97R3Reset(PPDMDEVINS pDevIns);
 # ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
-static int                ichac97TimerStart(PAC97STATE pThis);
-static int                ichac97TimerMaybeStart(PAC97STATE pThis);
-static int                ichac97TimerStop(PAC97STATE pThis);
-static int                ichac97TimerMaybeStop(PAC97STATE pThis);
-static void               ichac97TimerMain(PAC97STATE pThis);
-static DECLCALLBACK(void) ichac97Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser);
+static int                ichac97R3TimerStart(PAC97STATE pThis);
+static int                ichac97R3TimerMaybeStart(PAC97STATE pThis);
+static int                ichac97R3TimerStop(PAC97STATE pThis);
+static int                ichac97R3TimerMaybeStop(PAC97STATE pThis);
+static void               ichac97R3TimerMain(PAC97STATE pThis);
+static DECLCALLBACK(void) ichac97R3Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser);
 # endif
-static void               ichac97DoTransfers(PAC97STATE pThis);
-
-static int                ichac97MixerAddDrvStream(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PAC97DRIVER pDrv);
-static int                ichac97MixerAddDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg);
-static void               ichac97MixerRemoveDrvStream(PAC97STATE pThis, PAUDMIXSINK pMixSink, PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc, PAC97DRIVER pDrv);
-static void               ichac97MixerRemoveDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc);
+static void               ichac97R3DoTransfers(PAC97STATE pThis);
+
+static int                ichac97R3MixerAddDrvStream(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PAC97DRIVER pDrv);
+static int                ichac97R3MixerAddDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg);
+static void               ichac97R3MixerRemoveDrvStream(PAC97STATE pThis, PAUDMIXSINK pMixSink, PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc, PAC97DRIVER pDrv);
+static void               ichac97R3MixerRemoveDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc);
 
 # ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
-static DECLCALLBACK(int)  ichac97StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser);
-static int                ichac97StreamAsyncIOCreate(PAC97STATE pThis, PAC97STREAM pStream);
-static int                ichac97StreamAsyncIODestroy(PAC97STATE pThis, PAC97STREAM pStream);
-static int                ichac97StreamAsyncIONotify(PAC97STATE pThis, PAC97STREAM pStream);
-static void               ichac97StreamAsyncIOLock(PAC97STREAM pStream);
-static void               ichac97StreamAsyncIOUnlock(PAC97STREAM pStream);
-static void               ichac97StreamAsyncIOEnable(PAC97STREAM pStream, bool fEnable);
+static DECLCALLBACK(int)  ichac97R3StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser);
+static int                ichac97R3StreamAsyncIOCreate(PAC97STATE pThis, PAC97STREAM pStream);
+static int                ichac97R3StreamAsyncIODestroy(PAC97STATE pThis, PAC97STREAM pStream);
+static int                ichac97R3StreamAsyncIONotify(PAC97STATE pThis, PAC97STREAM pStream);
+static void               ichac97R3StreamAsyncIOLock(PAC97STREAM pStream);
+static void               ichac97R3StreamAsyncIOUnlock(PAC97STREAM pStream);
+static void               ichac97R3StreamAsyncIOEnable(PAC97STREAM pStream, bool fEnable);
 # endif
 #endif /* IN_RING3 */
@@ -642,5 +642,5 @@
  * @param   uIndex              Stream index to get audio mixer sink for.
  */
-DECLINLINE(PAUDMIXSINK) ichac97IndexToSink(PAC97STATE pThis, uint8_t uIndex)
+DECLINLINE(PAUDMIXSINK) ichac97R3IndexToSink(PAC97STATE pThis, uint8_t uIndex)
 {
     AssertPtrReturn(pThis, NULL);
@@ -667,5 +667,5 @@
  * @remark  Uses CIV as BDLE index.
  */
-static void ichac97StreamFetchBDLE(PAC97STATE pThis, PAC97STREAM pStream)
+static void ichac97R3StreamFetchBDLE(PAC97STATE pThis, PAC97STREAM pStream)
 {
     PPDMDEVINS  pDevIns = ICHAC97STATE_2_DEVINS(pThis);
@@ -676,10 +676,10 @@
     PDMDevHlpPhysRead(pDevIns, pRegs->bdbar + pRegs->civ * 8, &u32[0], sizeof(u32));
     pRegs->bd_valid   = 1;
-#ifndef RT_LITTLE_ENDIAN
-# error "Please adapt the code (audio buffers are little endian)!"
-#else
+# ifndef RT_LITTLE_ENDIAN
+#  error "Please adapt the code (audio buffers are little endian)!"
+# else
     pRegs->bd.addr    = RT_H2LE_U32(u32[0] & ~3);
     pRegs->bd.ctl_len = RT_H2LE_U32(u32[1]);
-#endif
+# endif
     pRegs->picb       = pRegs->bd.ctl_len & AC97_BD_LEN_MASK;
     LogFlowFunc(("bd %2d addr=%#x ctl=%#06x len=%#x(%d bytes)\n",
@@ -756,10 +756,10 @@
  * @param   pStream             Stream to return status for.
  */
-static bool ichac97StreamIsEnabled(PAC97STATE pThis, PAC97STREAM pStream)
+static bool ichac97R3StreamIsEnabled(PAC97STATE pThis, PAC97STREAM pStream)
 {
     AssertPtrReturn(pThis,   false);
     AssertPtrReturn(pStream, false);
 
-    PAUDMIXSINK pSink = ichac97IndexToSink(pThis, pStream->u8SD);
+    PAUDMIXSINK pSink = ichac97R3IndexToSink(pThis, pStream->u8SD);
     bool fIsEnabled = RT_BOOL(AudioMixerSinkGetStatus(pSink) & AUDMIXSINK_STS_RUNNING);
 
@@ -777,22 +777,22 @@
  *
  */
-static int ichac97StreamEnable(PAC97STATE pThis, PAC97STREAM pStream, bool fEnable)
+static int ichac97R3StreamEnable(PAC97STATE pThis, PAC97STREAM pStream, bool fEnable)
 {
     AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
     AssertPtrReturn(pStream, VERR_INVALID_POINTER);
 
-    ichac97StreamLock(pStream);
+    ichac97R3StreamLock(pStream);
 
     int rc = VINF_SUCCESS;
 
-#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
+# ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
     if (fEnable)
-        rc = ichac97StreamAsyncIOCreate(pThis, pStream);
+        rc = ichac97R3StreamAsyncIOCreate(pThis, pStream);
     if (RT_SUCCESS(rc))
     {
-        ichac97StreamAsyncIOLock(pStream);
-        ichac97StreamAsyncIOEnable(pStream, fEnable);
-    }
-#endif
+        ichac97R3StreamAsyncIOLock(pStream);
+        ichac97R3StreamAsyncIOEnable(pStream, fEnable);
+    }
+# endif
 
     if (fEnable)
@@ -801,30 +801,30 @@
             RTCircBufReset(pStream->State.pCircBuf);
 
-        rc = ichac97StreamOpen(pThis, pStream);
+        rc = ichac97R3StreamOpen(pThis, pStream);
     }
     else
-        rc = ichac97StreamClose(pThis, pStream);
+        rc = ichac97R3StreamClose(pThis, pStream);
 
     if (RT_SUCCESS(rc))
     {
         /* First, enable or disable the stream and the stream's sink, if any. */
-        rc = AudioMixerSinkCtl(ichac97IndexToSink(pThis, pStream->u8SD),
+        rc = AudioMixerSinkCtl(ichac97R3IndexToSink(pThis, pStream->u8SD),
                                fEnable ? AUDMIXSINKCMD_ENABLE : AUDMIXSINKCMD_DISABLE);
     }
 
-#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
-    ichac97StreamAsyncIOUnlock(pStream);
-#endif
+# ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
+    ichac97R3StreamAsyncIOUnlock(pStream);
+# endif
 
     /* Make sure to leave the lock before (eventually) starting the timer. */
-    ichac97StreamUnlock(pStream);
-
-#ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
+    ichac97R3StreamUnlock(pStream);
+
+# ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
     /* Second, see if we need to start or stop the timer. */
     if (!fEnable)
-        ichac97TimerMaybeStop(pThis);
+        ichac97R3TimerMaybeStop(pThis);
     else
-        ichac97TimerMaybeStart(pThis);
-#endif
+        ichac97R3TimerMaybeStart(pThis);
+# endif
 
     LogFunc(("[SD%RU8] cStreamsActive=%RU8, fEnable=%RTbool, rc=%Rrc\n", pStream->u8SD, pThis->cStreamsActive, fEnable, rc));
@@ -839,10 +839,10 @@
  *
  */
-static void ichac97StreamReset(PAC97STATE pThis, PAC97STREAM pStream)
+static void ichac97R3StreamReset(PAC97STATE pThis, PAC97STREAM pStream)
 {
     AssertPtrReturnVoid(pThis);
     AssertPtrReturnVoid(pStream);
 
-    ichac97StreamLock(pStream);
+    ichac97R3StreamLock(pStream);
 
     LogFunc(("[SD%RU8]\n", pStream->u8SD));
@@ -864,5 +864,5 @@
     RT_ZERO(pThis->silence);
 
-    ichac97StreamUnlock(pStream);
+    ichac97R3StreamUnlock(pStream);
 }
 
@@ -875,5 +875,5 @@
  * @param   u8Strm              Stream ID to assign AC'97 stream to.
  */
-static int ichac97StreamCreate(PAC97STATE pThis, PAC97STREAM pStream, uint8_t u8Strm)
+static int ichac97R3StreamCreate(PAC97STATE pThis, PAC97STREAM pStream, uint8_t u8Strm)
 {
     RT_NOREF(pThis);
@@ -900,5 +900,5 @@
  * @param   pStream             AC'97 stream to destroy.
  */
-static void ichac97StreamDestroy(PAC97STATE pThis, PAC97STREAM pStream)
+static void ichac97R3StreamDestroy(PAC97STATE pThis, PAC97STREAM pStream)
 {
     LogFlowFunc(("[SD%RU8]\n", pStream->u8SD));
@@ -913,10 +913,10 @@
     }
 
-#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
-    rc2 = ichac97StreamAsyncIODestroy(pThis, pStream);
+# ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
+    rc2 = ichac97R3StreamAsyncIODestroy(pThis, pStream);
     AssertRC(rc2);
-#else
+# else
     RT_NOREF(pThis);
-#endif
+# endif
 
     LogFlowFuncLeave();
@@ -928,5 +928,5 @@
  * @param   pThis               AC'97 state.
  */
-static void ichac97StreamsDestroy(PAC97STATE pThis)
+static void ichac97R3StreamsDestroy(PAC97STATE pThis)
 {
     LogFlowFuncEnter();
@@ -936,7 +936,7 @@
      */
 
-    ichac97StreamDestroy(pThis, &pThis->StreamLineIn);
-    ichac97StreamDestroy(pThis, &pThis->StreamMicIn);
-    ichac97StreamDestroy(pThis, &pThis->StreamOut);
+    ichac97R3StreamDestroy(pThis, &pThis->StreamLineIn);
+    ichac97R3StreamDestroy(pThis, &pThis->StreamMicIn);
+    ichac97R3StreamDestroy(pThis, &pThis->StreamOut);
 
     /*
@@ -948,5 +948,5 @@
     {
         dstSrc.Source = PDMAUDIORECSOURCE_LINE;
-        ichac97MixerRemoveDrvStreams(pThis, pThis->pSinkLineIn, PDMAUDIODIR_IN, dstSrc);
+        ichac97R3MixerRemoveDrvStreams(pThis, pThis->pSinkLineIn, PDMAUDIODIR_IN, dstSrc);
 
         AudioMixerSinkDestroy(pThis->pSinkLineIn);
@@ -957,5 +957,5 @@
     {
         dstSrc.Source = PDMAUDIORECSOURCE_MIC;
-        ichac97MixerRemoveDrvStreams(pThis, pThis->pSinkMicIn, PDMAUDIODIR_IN, dstSrc);
+        ichac97R3MixerRemoveDrvStreams(pThis, pThis->pSinkMicIn, PDMAUDIODIR_IN, dstSrc);
 
         AudioMixerSinkDestroy(pThis->pSinkMicIn);
@@ -966,5 +966,5 @@
     {
         dstSrc.Dest = PDMAUDIOPLAYBACKDEST_FRONT;
-        ichac97MixerRemoveDrvStreams(pThis, pThis->pSinkOut, PDMAUDIODIR_OUT, dstSrc);
+        ichac97R3MixerRemoveDrvStreams(pThis, pThis->pSinkOut, PDMAUDIODIR_OUT, dstSrc);
 
         AudioMixerSinkDestroy(pThis->pSinkOut);
@@ -983,6 +983,6 @@
  * @param   pcbWritten          Number of bytes written. Optional.
  */
-static int ichac97StreamWrite(PAC97STATE pThis, PAC97STREAM pDstStream, PAUDMIXSINK pSrcMixSink, uint32_t cbToWrite,
-                              uint32_t *pcbWritten)
+static int ichac97R3StreamWrite(PAC97STATE pThis, PAC97STREAM pDstStream, PAUDMIXSINK pSrcMixSink, uint32_t cbToWrite,
+                                uint32_t *pcbWritten)
 {
     RT_NOREF(pThis);
@@ -1007,5 +1007,5 @@
         AssertRC(rc2);
 
-#ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
+# ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
         RTFILE fh;
         RTFileOpen(&fh, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "ichac97StreamWrite.pcm",
@@ -1013,5 +1013,5 @@
         RTFileWrite(fh, pvDst, cbRead, NULL);
         RTFileClose(fh);
-#endif
+# endif
     }
 
@@ -1034,6 +1034,6 @@
  * @param   pcbRead             Number of bytes read. Optional.
  */
-static int ichac97StreamRead(PAC97STATE pThis, PAC97STREAM pSrcStream, PAUDMIXSINK pDstMixSink, uint32_t cbToRead,
-                             uint32_t *pcbRead)
+static int ichac97R3StreamRead(PAC97STATE pThis, PAC97STREAM pSrcStream, PAUDMIXSINK pDstMixSink, uint32_t cbToRead,
+                               uint32_t *pcbRead)
 {
     RT_NOREF(pThis);
@@ -1061,5 +1061,5 @@
         if (cbSrc)
         {
-#ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
+# ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
             RTFILE fh;
             RTFileOpen(&fh, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "ac97StreamRead.pcm",
@@ -1067,5 +1067,5 @@
             RTFileWrite(fh, pvSrc, cbSrc, NULL);
             RTFileClose(fh);
-#endif
+# endif
             rc = AudioMixerSinkWrite(pDstMixSink, AUDMIXOP_COPY, pvSrc, (uint32_t)cbSrc, &cbWritten);
             if (RT_SUCCESS(rc))
@@ -1096,5 +1096,5 @@
 }
 
-#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
+# ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
 
 /**
@@ -1106,5 +1106,5 @@
  * @param   pvUser              User argument. Must be of type PAC97STREAMTHREADCTX.
  */
-static DECLCALLBACK(int) ichac97StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser)
+static DECLCALLBACK(int) ichac97R3StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser)
 {
     PAC97STREAMTHREADCTX pCtx = (PAC97STREAMTHREADCTX)pvUser;
@@ -1122,5 +1122,5 @@
     AssertPtr(pCircBuf);
 
-    PAUDMIXSINK pMixSink = ichac97IndexToSink(pThis, pStream->u8SD);
+    PAUDMIXSINK pMixSink = ichac97R3IndexToSink(pThis, pStream->u8SD);
     AssertPtr(pMixSink);
 
@@ -1151,5 +1151,5 @@
             }
 
-            ichac97StreamUpdate(pThis, pStream, false /* fInTimer */);
+            ichac97R3StreamUpdate(pThis, pStream, false /* fInTimer */);
 
             int rc3 = RTCritSectLeave(&pAIO->CritSect);
@@ -1174,5 +1174,5 @@
  * @param   pStream             AC'97 audio stream to create the async I/O thread for.
  */
-static int ichac97StreamAsyncIOCreate(PAC97STATE pThis, PAC97STREAM pStream)
+static int ichac97R3StreamAsyncIOCreate(PAC97STATE pThis, PAC97STREAM pStream)
 {
     PAC97STREAMSTATEAIO pAIO = &pStream->State.AIO;
@@ -1216,5 +1216,5 @@
  * @param   pStream             AC'97 audio stream to destroy the async I/O thread for.
  */
-static int ichac97StreamAsyncIODestroy(PAC97STATE pThis, PAC97STREAM pStream)
+static int ichac97R3StreamAsyncIODestroy(PAC97STATE pThis, PAC97STREAM pStream)
 {
     PAC97STREAMSTATEAIO pAIO = &pStream->State.AIO;
@@ -1225,5 +1225,5 @@
     ASMAtomicWriteBool(&pAIO->fShutdown, true);
 
-    int rc = ichac97StreamAsyncIONotify(pThis, pStream);
+    int rc = ichac97R3StreamAsyncIONotify(pThis, pStream);
     AssertRC(rc);
 
@@ -1256,5 +1256,5 @@
  * @param   pStream             AC'97 stream to notify async I/O thread for.
  */
-static int ichac97StreamAsyncIONotify(PAC97STATE pThis, PAC97STREAM pStream)
+static int ichac97R3StreamAsyncIONotify(PAC97STATE pThis, PAC97STREAM pStream)
 {
     RT_NOREF(pThis);
@@ -1269,5 +1269,5 @@
  * @param   pStream             AC'97 stream to lock async I/O thread for.
  */
-static void ichac97StreamAsyncIOLock(PAC97STREAM pStream)
+static void ichac97R3StreamAsyncIOLock(PAC97STREAM pStream)
 {
     PAC97STREAMSTATEAIO pAIO = &pStream->State.AIO;
@@ -1285,5 +1285,5 @@
  * @param   pStream             AC'97 stream to unlock async I/O thread for.
  */
-static void ichac97StreamAsyncIOUnlock(PAC97STREAM pStream)
+static void ichac97R3StreamAsyncIOUnlock(PAC97STREAM pStream)
 {
     PAC97STREAMSTATEAIO pAIO = &pStream->State.AIO;
@@ -1304,5 +1304,5 @@
  * @remarks Does not do locking.
  */
-static void ichac97StreamAsyncIOEnable(PAC97STREAM pStream, bool fEnable)
+static void ichac97R3StreamAsyncIOEnable(PAC97STREAM pStream, bool fEnable)
 {
     PAC97STREAMSTATEAIO pAIO = &pStream->State.AIO;
@@ -1310,5 +1310,5 @@
 }
 
-#endif /* VBOX_WITH_AUDIO_AC97_ASYNC_IO */
+# endif /* VBOX_WITH_AUDIO_AC97_ASYNC_IO */
 
 /**
@@ -1323,7 +1323,7 @@
  *                              context or an asynchronous I/O stream thread (if supported).
  */
-static void ichac97StreamUpdate(PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer)
-{
-    PAUDMIXSINK pSink = ichac97IndexToSink(pThis, pStream->u8SD);
+static void ichac97R3StreamUpdate(PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer)
+{
+    PAUDMIXSINK pSink = ichac97R3IndexToSink(pThis, pStream->u8SD);
     AssertPtr(pSink);
 
@@ -1336,5 +1336,5 @@
     {
         /* Is the AC'97 stream ready to be written (guest output data) to? If so, by how much? */
-        const uint32_t cbFree = ichac97StreamGetFree(pStream);
+        const uint32_t cbFree = ichac97R3StreamGetFree(pStream);
 
         if (   fInTimer
@@ -1344,20 +1344,20 @@
 
             /* Do the DMA transfer. */
-            rc2 = ichac97StreamTransfer(pThis, pStream, cbFree);
+            rc2 = ichac97R3StreamTransfer(pThis, pStream, cbFree);
             AssertRC(rc2);
         }
 
         /* How much (guest output) data is available at the moment for the AC'97 stream? */
-        uint32_t cbUsed = ichac97StreamGetUsed(pStream);
-
-#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
+        uint32_t cbUsed = ichac97R3StreamGetUsed(pStream);
+
+# ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
         if (   fInTimer
             && cbUsed)
         {
-            rc2 = ichac97StreamAsyncIONotify(pThis, pStream);
+            rc2 = ichac97R3StreamAsyncIONotify(pThis, pStream);
             AssertRC(rc2);
         }
         else
-#endif
+# endif
         {
             const uint32_t cbSinkWritable = AudioMixerSinkGetWritable(pSink);
@@ -1372,5 +1372,5 @@
                 /* Read (guest output) data and write it to the stream's sink. */
                 uint32_t cbRead;
-                rc2 = ichac97StreamRead(pThis, pStream, pSink, cbUsed, &cbRead);
+                rc2 = ichac97R3StreamRead(pThis, pStream, pSink, cbUsed, &cbRead);
                 AssertRC(rc2);
 
@@ -1388,12 +1388,12 @@
     else /* Input (SDI). */
     {
-#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
+# ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
         if (fInTimer)
         {
-            rc2 = ichac97StreamAsyncIONotify(pThis, pStream);
+            rc2 = ichac97R3StreamAsyncIONotify(pThis, pStream);
             AssertRC(rc2);
         }
         else
-#endif
+# endif
         {
             rc2 = AudioMixerSinkUpdate(pSink);
@@ -1404,5 +1404,5 @@
 
             /* How much (guest input) data is free at the moment? */
-            uint32_t cbFree = ichac97StreamGetFree(pStream);
+            uint32_t cbFree = ichac97R3StreamGetFree(pStream);
 
             Log3Func(("[SD%RU8] cbReadable=%RU32, cbFree=%RU32\n", pStream->u8SD, cbReadable, cbFree));
@@ -1416,19 +1416,19 @@
             {
                 /* Write (guest input) data to the stream which was read from stream's sink before. */
-                rc2 = ichac97StreamWrite(pThis, pStream, pSink, cbFree, NULL /* pcbWritten */);
+                rc2 = ichac97R3StreamWrite(pThis, pStream, pSink, cbFree, NULL /* pcbWritten */);
                 AssertRC(rc2);
             }
         }
 
-#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
+# ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
         if (fInTimer)
-#endif
-        {
-            const uint32_t cbToTransfer = ichac97StreamGetUsed(pStream);
+# endif
+        {
+            const uint32_t cbToTransfer = ichac97R3StreamGetUsed(pStream);
             if (cbToTransfer)
             {
                 /* When running synchronously, do the DMA data transfers here.
                  * Otherwise this will be done in the stream's async I/O thread. */
-                rc2 = ichac97StreamTransfer(pThis, pStream, cbToTransfer);
+                rc2 = ichac97R3StreamTransfer(pThis, pStream, cbToTransfer);
                 AssertRC(rc2);
             }
@@ -1481,6 +1481,6 @@
  * @param   dstSrc              Stream destination / source to retrieve.
  */
-static PAC97DRIVERSTREAM ichac97MixerGetDrvStream(PAC97STATE pThis, PAC97DRIVER pDrv,
-                                                  PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc)
+static PAC97DRIVERSTREAM ichac97R3MixerGetDrvStream(PAC97STATE pThis, PAC97DRIVER pDrv,
+                                                    PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc)
 {
     RT_NOREF(pThis);
@@ -1534,5 +1534,5 @@
  * @param   pDrv                Driver stream to add.
  */
-static int ichac97MixerAddDrvStream(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PAC97DRIVER pDrv)
+static int ichac97R3MixerAddDrvStream(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PAC97DRIVER pDrv)
 {
     AssertPtrReturn(pThis,    VERR_INVALID_POINTER);
@@ -1554,5 +1554,5 @@
     int rc;
 
-    PAC97DRIVERSTREAM pDrvStream = ichac97MixerGetDrvStream(pThis, pDrv, pStreamCfg->enmDir, pStreamCfg->DestSource);
+    PAC97DRIVERSTREAM pDrvStream = ichac97R3MixerGetDrvStream(pThis, pDrv, pStreamCfg->enmDir, pStreamCfg->DestSource);
     if (pDrvStream)
     {
@@ -1591,5 +1591,5 @@
  * @param   pCfg                Stream configuration to use.
  */
-static int ichac97MixerAddDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg)
+static int ichac97R3MixerAddDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pThis,    VERR_INVALID_POINTER);
@@ -1607,5 +1607,5 @@
     RTListForEach(&pThis->lstDrv, pDrv, AC97DRIVER, Node)
     {
-        int rc2 = ichac97MixerAddDrvStream(pThis, pMixSink, pCfg, pDrv);
+        int rc2 = ichac97R3MixerAddDrvStream(pThis, pMixSink, pCfg, pDrv);
         if (RT_FAILURE(rc2))
             LogFunc(("Attaching stream failed with %Rrc\n", rc2));
@@ -1628,11 +1628,11 @@
  * @param   pDrv                Driver stream to remove.
  */
-static void ichac97MixerRemoveDrvStream(PAC97STATE pThis, PAUDMIXSINK pMixSink,
-                                        PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc, PAC97DRIVER pDrv)
+static void ichac97R3MixerRemoveDrvStream(PAC97STATE pThis, PAUDMIXSINK pMixSink,
+                                          PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc, PAC97DRIVER pDrv)
 {
     AssertPtrReturnVoid(pThis);
     AssertPtrReturnVoid(pMixSink);
 
-    PAC97DRIVERSTREAM pDrvStream = ichac97MixerGetDrvStream(pThis, pDrv, enmDir, dstSrc);
+    PAC97DRIVERSTREAM pDrvStream = ichac97R3MixerGetDrvStream(pThis, pDrv, enmDir, dstSrc);
     if (pDrvStream)
     {
@@ -1655,6 +1655,6 @@
  * @param   dstSrc              Stream destination / source to remove.
  */
-static void ichac97MixerRemoveDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink,
-                                         PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc)
+static void ichac97R3MixerRemoveDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink,
+                                           PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc)
 {
     AssertPtrReturnVoid(pThis);
@@ -1663,5 +1663,7 @@
     PAC97DRIVER pDrv;
     RTListForEach(&pThis->lstDrv, pDrv, AC97DRIVER, Node)
-        ichac97MixerRemoveDrvStream(pThis, pMixSink, enmDir, dstSrc, pDrv);
+    {
+        ichac97R3MixerRemoveDrvStream(pThis, pMixSink, enmDir, dstSrc, pDrv);
+    }
 }
 
@@ -1676,5 +1678,5 @@
  * @param   pStream             AC'97 Stream to open.
  */
-static int ichac97StreamOpen(PAC97STATE pThis, PAC97STREAM pStream)
+static int ichac97R3StreamOpen(PAC97STATE pThis, PAC97STREAM pStream)
 {
     int rc = VINF_SUCCESS;
@@ -1733,5 +1735,5 @@
     if (RT_SUCCESS(rc))
     {
-        ichac97MixerRemoveDrvStreams(pThis, pMixSink, pCfg->enmDir, pCfg->DestSource);
+        ichac97R3MixerRemoveDrvStreams(pThis, pMixSink, pCfg->enmDir, pCfg->DestSource);
 
         if (pCfg->Props.uHz)
@@ -1744,5 +1746,5 @@
             pCfg->Props.cShift    = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels);
 
-            rc = ichac97MixerAddDrvStreams(pThis, pMixSink, pCfg);
+            rc = ichac97R3MixerAddDrvStreams(pThis, pMixSink, pCfg);
         }
     }
@@ -1759,5 +1761,5 @@
  * @param   pStream             AC'97 stream to close.
  */
-static int ichac97StreamClose(PAC97STATE pThis, PAC97STREAM pStream)
+static int ichac97R3StreamClose(PAC97STATE pThis, PAC97STREAM pStream)
 {
     RT_NOREF(pThis);
@@ -1777,11 +1779,11 @@
  * @param   pStream             AC'97 stream to re-open.
  */
-static int ichac97StreamReOpen(PAC97STATE pThis, PAC97STREAM pStream)
+static int ichac97R3StreamReOpen(PAC97STATE pThis, PAC97STREAM pStream)
 {
     LogFlowFunc(("[SD%RU8]\n", pStream->u8SD));
 
-    int rc = ichac97StreamClose(pThis, pStream);
+    int rc = ichac97R3StreamClose(pThis, pStream);
     if (RT_SUCCESS(rc))
-        rc = ichac97StreamOpen(pThis, pStream);
+        rc = ichac97R3StreamOpen(pThis, pStream);
 
     return rc;
@@ -1794,5 +1796,5 @@
  * @param   pStream             AC'97 stream to lock.
  */
-static void ichac97StreamLock(PAC97STREAM pStream)
+static void ichac97R3StreamLock(PAC97STREAM pStream)
 {
     AssertPtrReturnVoid(pStream);
@@ -1807,5 +1809,5 @@
  * @param   pStream             AC'97 stream to unlock.
  */
-static void ichac97StreamUnlock(PAC97STREAM pStream)
+static void ichac97R3StreamUnlock(PAC97STREAM pStream)
 {
     AssertPtrReturnVoid(pStream);
@@ -1820,5 +1822,5 @@
  * @param   pStream             AC'97 stream to retrieve size for.
  */
-static uint32_t ichac97StreamGetUsed(PAC97STREAM pStream)
+static uint32_t ichac97R3StreamGetUsed(PAC97STREAM pStream)
 {
     AssertPtrReturn(pStream, 0);
@@ -1836,5 +1838,5 @@
  * @param   pStream             AC'97 stream to retrieve size for.
  */
-static uint32_t ichac97StreamGetFree(PAC97STREAM pStream)
+static uint32_t ichac97R3StreamGetFree(PAC97STREAM pStream)
 {
     AssertPtrReturn(pStream, 0);
@@ -1857,5 +1859,5 @@
  * @param   uVal                Volume value to set.
  */
-static int ichac97MixerSetVolume(PAC97STATE pThis, int index, PDMAUDIOMIXERCTL enmMixerCtl, uint32_t uVal)
+static int ichac97R3MixerSetVolume(PAC97STATE pThis, int index, PDMAUDIOMIXERCTL enmMixerCtl, uint32_t uVal)
 {
     /*
@@ -1883,9 +1885,9 @@
     if (index != AC97_Master_Volume_Mute && index != AC97_Headphone_Volume_Mute)
     {
-#ifndef VBOX_WITH_AC97_GAIN_SUPPORT
+# ifndef VBOX_WITH_AC97_GAIN_SUPPORT
         /* NB: Currently there is no gain support, only attenuation. */
         uCtlAttLeft  = uCtlAttLeft  < 8 ? 0 : uCtlAttLeft  - 8;
         uCtlAttRight = uCtlAttRight < 8 ? 0 : uCtlAttRight - 8;
-#endif
+# endif
     }
     Assert(uCtlAttLeft  <= 255 / AC97_DB_FACTOR);
@@ -1954,5 +1956,5 @@
  * @param   uIdx                AC'97 index to convert.
  */
-static PDMAUDIORECSOURCE ichac97IdxToRecSource(uint8_t uIdx)
+static PDMAUDIORECSOURCE ichac97R3IdxToRecSource(uint8_t uIdx)
 {
     switch (uIdx)
@@ -1978,5 +1980,5 @@
  * @param   enmRecSrc           PDM audio recording source to convert.
  */
-static uint8_t ichac97RecSourceToIdx(PDMAUDIORECSOURCE enmRecSrc)
+static uint8_t ichac97R3RecSourceToIdx(PDMAUDIORECSOURCE enmRecSrc)
 {
     switch (enmRecSrc)
@@ -2026,12 +2028,12 @@
  * @param   val                 AC'97 recording source index to set.
  */
-static void ichac97MixerRecordSelect(PAC97STATE pThis, uint32_t val)
+static void ichac97R3MixerRecordSelect(PAC97STATE pThis, uint32_t val)
 {
     uint8_t rs = val & AC97_REC_MASK;
     uint8_t ls = (val >> 8) & AC97_REC_MASK;
-    PDMAUDIORECSOURCE ars = ichac97IdxToRecSource(rs);
-    PDMAUDIORECSOURCE als = ichac97IdxToRecSource(ls);
-    rs = ichac97RecSourceToIdx(ars);
-    ls = ichac97RecSourceToIdx(als);
+    PDMAUDIORECSOURCE ars = ichac97R3IdxToRecSource(rs);
+    PDMAUDIORECSOURCE als = ichac97R3IdxToRecSource(ls);
+    rs = ichac97R3RecSourceToIdx(ars);
+    ls = ichac97R3RecSourceToIdx(als);
     ichac97MixerSet(pThis, AC97_Record_Select, rs | (ls << 8));
 }
@@ -2043,5 +2045,5 @@
  * @param   pThis               AC'97 state.
  */
-static int ichac97MixerReset(PAC97STATE pThis)
+static int ichac97R3MixerReset(PAC97STATE pThis)
 {
     AssertPtrReturn(pThis, VERR_INVALID_PARAMETER);
@@ -2094,20 +2096,19 @@
         ichac97MixerSet(pThis, AC97_Vendor_ID2              , 0x7600); /* 7608 */
     }
-    ichac97MixerRecordSelect(pThis, 0);
+    ichac97R3MixerRecordSelect(pThis, 0);
 
     /* The default value is 8000h, which corresponds to 0 dB attenuation with mute on. */
-    ichac97MixerSetVolume(pThis, AC97_Master_Volume_Mute,  PDMAUDIOMIXERCTL_VOLUME_MASTER, 0x8000);
+    ichac97R3MixerSetVolume(pThis, AC97_Master_Volume_Mute,  PDMAUDIOMIXERCTL_VOLUME_MASTER, 0x8000);
 
     /* The default value for stereo registers is 8808h, which corresponds to 0 dB gain with mute on.*/
-    ichac97MixerSetVolume(pThis, AC97_PCM_Out_Volume_Mute, PDMAUDIOMIXERCTL_FRONT,         0x8808);
-    ichac97MixerSetVolume(pThis, AC97_Line_In_Volume_Mute, PDMAUDIOMIXERCTL_LINE_IN,       0x8808);
-    ichac97MixerSetVolume(pThis, AC97_Mic_Volume_Mute,     PDMAUDIOMIXERCTL_MIC_IN,        0x8808);
+    ichac97R3MixerSetVolume(pThis, AC97_PCM_Out_Volume_Mute, PDMAUDIOMIXERCTL_FRONT,         0x8808);
+    ichac97R3MixerSetVolume(pThis, AC97_Line_In_Volume_Mute, PDMAUDIOMIXERCTL_LINE_IN,       0x8808);
+    ichac97R3MixerSetVolume(pThis, AC97_Mic_Volume_Mute,     PDMAUDIOMIXERCTL_MIC_IN,        0x8808);
 
     return VINF_SUCCESS;
 }
 
-/* Unused */
-#if 0
-static void ichac97WriteBUP(PAC97STATE pThis, uint32_t cbElapsed)
+# if 0 /* Unused */
+static void ichac97R3WriteBUP(PAC97STATE pThis, uint32_t cbElapsed)
 {
     LogFlowFunc(("cbElapsed=%RU32\n", cbElapsed));
@@ -2147,7 +2148,7 @@
     }
 }
-#endif /* Unused */
-
-#ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
+# endif /* Unused */
+
+# ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
 
 /**
@@ -2157,5 +2158,5 @@
  * @param   pThis               AC'97 state.
  */
-static int  ichac97TimerStart(PAC97STATE pThis)
+static int  ichac97R3TimerStart(PAC97STATE pThis)
 {
     LogFlowFuncEnter();
@@ -2172,5 +2173,5 @@
 
         /* Start transfers. */
-        ichac97TimerMain(pThis);
+        ichac97R3TimerMain(pThis);
     }
 
@@ -2186,5 +2187,5 @@
  * @param   pThis               AC'97 state.
  */
-static int ichac97TimerMaybeStart(PAC97STATE pThis)
+static int ichac97R3TimerMaybeStart(PAC97STATE pThis)
 {
     LogFlowFuncEnter();
@@ -2197,5 +2198,5 @@
     /* Only start the timer at the first active stream. */
     if (pThis->cStreamsActive == 1)
-        return ichac97TimerStart(pThis);
+        return ichac97R3TimerStart(pThis);
 
     return VINF_SUCCESS;
@@ -2208,5 +2209,5 @@
  * @param   pThis               AC'97 state.
  */
-static int ichac97TimerStop(PAC97STATE pThis)
+static int ichac97R3TimerStop(PAC97STATE pThis)
 {
     LogFlowFuncEnter();
@@ -2241,5 +2242,5 @@
  * @param   pThis               AC'97 state.
  */
-static int ichac97TimerMaybeStop(PAC97STATE pThis)
+static int ichac97R3TimerMaybeStop(PAC97STATE pThis)
 {
     LogFlowFuncEnter();
@@ -2253,5 +2254,5 @@
 
         if (pThis->cStreamsActive == 0)
-            return ichac97TimerStop(pThis);
+            return ichac97R3TimerStop(pThis);
     }
 
@@ -2264,5 +2265,5 @@
  * @param   pThis               AC'97 state.
  */
-static void ichac97TimerMain(PAC97STATE pThis)
+static void ichac97R3TimerMain(PAC97STATE pThis)
 {
     STAM_PROFILE_START(&pThis->StatTimer, a);
@@ -2278,10 +2279,10 @@
     bool fArmTimer = false;
 
-    ichac97DoTransfers(pThis);
+    ichac97R3DoTransfers(pThis);
 
     /* Do we need to arm the timer again? */
-    if (   AudioMixerSinkIsActive(ichac97IndexToSink(pThis, pThis->StreamLineIn.u8SD))
-        || AudioMixerSinkIsActive(ichac97IndexToSink(pThis, pThis->StreamMicIn.u8SD))
-        || AudioMixerSinkIsActive(ichac97IndexToSink(pThis, pThis->StreamOut.u8SD)))
+    if (   AudioMixerSinkIsActive(ichac97R3IndexToSink(pThis, pThis->StreamLineIn.u8SD))
+        || AudioMixerSinkIsActive(ichac97R3IndexToSink(pThis, pThis->StreamMicIn.u8SD))
+        || AudioMixerSinkIsActive(ichac97R3IndexToSink(pThis, pThis->StreamOut.u8SD)))
     {
         fArmTimer = true;
@@ -2317,5 +2318,5 @@
  * @param   pvUser              User argument as PAC97STATE.
  */
-static DECLCALLBACK(void) ichac97Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
+static DECLCALLBACK(void) ichac97R3Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
 {
     RT_NOREF(pDevIns, pTimer);
@@ -2325,8 +2326,8 @@
     AssertPtr(pThis);
 
-    ichac97TimerMain(pThis);
-}
-
-#endif /* !VBOX_WITH_AUDIO_AC97_CALLBACKS */
+    ichac97R3TimerMain(pThis);
+}
+
+# endif /* !VBOX_WITH_AUDIO_AC97_CALLBACKS */
 
 /**
@@ -2336,11 +2337,11 @@
  * @param   pThis               AC'97 state.
  */
-static void ichac97DoTransfers(PAC97STATE pThis)
+static void ichac97R3DoTransfers(PAC97STATE pThis)
 {
     AssertPtrReturnVoid(pThis);
 
-    ichac97StreamUpdate(pThis, &pThis->StreamLineIn, true /* fInTimer */);
-    ichac97StreamUpdate(pThis, &pThis->StreamMicIn,  true /* fInTimer */);
-    ichac97StreamUpdate(pThis, &pThis->StreamOut,    true /* fInTimer */);
+    ichac97R3StreamUpdate(pThis, &pThis->StreamLineIn, true /* fInTimer */);
+    ichac97R3StreamUpdate(pThis, &pThis->StreamMicIn,  true /* fInTimer */);
+    ichac97R3StreamUpdate(pThis, &pThis->StreamOut,    true /* fInTimer */);
 }
 
@@ -2359,5 +2360,5 @@
  * @param   cbToProcessMax      Maximum of data (in bytes) to process.
  */
-static int ichac97StreamTransfer(PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax)
+static int ichac97R3StreamTransfer(PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax)
 {
     AssertPtrReturn(pThis,       VERR_INVALID_POINTER);
@@ -2365,5 +2366,5 @@
     AssertReturn(cbToProcessMax, VERR_INVALID_PARAMETER);
 
-    ichac97StreamLock(pStream);
+    ichac97R3StreamLock(pStream);
 
     PAC97BMREGS pRegs = &pStream->Regs;
@@ -2376,5 +2377,5 @@
             {
                 case AC97SOUNDSOURCE_PO_INDEX:
-                    /*ichac97WriteBUP(pThis, cbToProcess);*/
+                    /*ichac97R3WriteBUP(pThis, cbToProcess);*/
                     break;
 
@@ -2384,5 +2385,5 @@
         }
 
-        ichac97StreamUnlock(pStream);
+        ichac97R3StreamUnlock(pStream);
         return VINF_SUCCESS;
     }
@@ -2393,5 +2394,5 @@
         Log3Func(("[SD%RU8] BCIS set\n", pStream->u8SD));
 
-        ichac97StreamUnlock(pStream);
+        ichac97R3StreamUnlock(pStream);
         return VINF_SUCCESS;
     }
@@ -2412,5 +2413,5 @@
         {
             Log3Func(("Invalid buffer descriptor, fetching next one ...\n"));
-            ichac97StreamFetchBDLE(pThis, pStream);
+            ichac97R3StreamFetchBDLE(pThis, pStream);
         }
 
@@ -2432,5 +2433,5 @@
             pRegs->piv = (pRegs->piv + 1) % AC97_MAX_BDLE;
 
-            ichac97StreamFetchBDLE(pThis, pStream);
+            ichac97R3StreamFetchBDLE(pThis, pStream);
             continue;
         }
@@ -2453,5 +2454,5 @@
                     AssertRC(rc2);
 
-#ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
+# ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
                     RTFILE fh;
                     RTFileOpen(&fh,  VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "ac97DMARead.pcm",
@@ -2459,5 +2460,5 @@
                     RTFileWrite(fh, pvDst, cbDst, NULL);
                     RTFileClose(fh);
-#endif
+# endif
                 }
 
@@ -2483,5 +2484,5 @@
                     AssertRC(rc2);
 
-#ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
+# ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
                     RTFILE fh;
                     RTFileOpen(&fh,  VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "ac97DMAWrite.pcm",
@@ -2489,5 +2490,5 @@
                     RTFileWrite(fh, pvSrc, cbSrc, NULL);
                     RTFileClose(fh);
-#endif
+# endif
                 }
 
@@ -2545,5 +2546,5 @@
                 pRegs->civ = pRegs->piv;
                 pRegs->piv = (pRegs->piv + 1) % AC97_MAX_BDLE;
-                ichac97StreamFetchBDLE(pThis, pStream);
+                ichac97R3StreamFetchBDLE(pThis, pStream);
             }
 
@@ -2560,5 +2561,5 @@
     }
 
-    ichac97StreamUnlock(pStream);
+    ichac97R3StreamUnlock(pStream);
 
     LogFlowFuncLeaveRC(rc);
@@ -2791,5 +2792,5 @@
                         pRegs->piv = (pRegs->piv + 1) % AC97_MAX_BDLE;
 
-                        ichac97StreamFetchBDLE(pThis, pStream);
+                        ichac97R3StreamFetchBDLE(pThis, pStream);
 #else
                         rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -2817,6 +2818,6 @@
                         Assert((pRegs->cr & AC97_CR_RPBM) == 0);
 
-                        ichac97StreamEnable(pThis, pStream, false /* fEnable */);
-                        ichac97StreamReset(pThis, pStream);
+                        ichac97R3StreamEnable(pThis, pStream, false /* fEnable */);
+                        ichac97R3StreamReset(pThis, pStream);
 
                         ichac97StreamUpdateSR(pThis, pStream, AC97_SR_DCH); /** @todo Do we need to do that? */
@@ -2830,5 +2831,5 @@
                             Log3Func(("[SD%RU8] Disable\n", pStream->u8SD));
 
-                            ichac97StreamEnable(pThis, pStream, false /* fEnable */);
+                            ichac97R3StreamEnable(pThis, pStream, false /* fEnable */);
 
                             pRegs->sr |= AC97_SR_DCH;
@@ -2844,7 +2845,7 @@
 
                             /* Fetch the initial BDLE descriptor. */
-                            ichac97StreamFetchBDLE(pThis, pStream);
-
-                            ichac97StreamEnable(pThis, pStream, true /* fEnable */);
+                            ichac97R3StreamFetchBDLE(pThis, pStream);
+
+                            ichac97R3StreamEnable(pThis, pStream, true /* fEnable */);
                         }
                     }
@@ -3037,5 +3038,5 @@
                 case AC97_Reset:
 #ifdef IN_RING3
-                    ichac97Reset(pThis->CTX_SUFF(pDevIns));
+                    ichac97R3Reset(pThis->CTX_SUFF(pDevIns));
 #else
                     rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3054,5 +3055,5 @@
                     }
 #ifdef IN_RING3
-                    ichac97MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_VOLUME_MASTER, u32Val);
+                    ichac97R3MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_VOLUME_MASTER, u32Val);
 #else
                     rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3066,5 +3067,5 @@
                             /* Register controls PCM (front) outputs. */
 #ifdef IN_RING3
-                            ichac97MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_VOLUME_MASTER, u32Val);
+                            ichac97R3MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_VOLUME_MASTER, u32Val);
 #else
                             rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3075,5 +3076,5 @@
                 case AC97_PCM_Out_Volume_Mute:
 #ifdef IN_RING3
-                    ichac97MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_FRONT, u32Val);
+                    ichac97R3MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_FRONT, u32Val);
 #else
                     rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3082,5 +3083,5 @@
                 case AC97_Line_In_Volume_Mute:
 #ifdef IN_RING3
-                    ichac97MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_LINE_IN, u32Val);
+                    ichac97R3MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_LINE_IN, u32Val);
 #else
                     rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3089,5 +3090,5 @@
                 case AC97_Record_Select:
 #ifdef IN_RING3
-                    ichac97MixerRecordSelect(pThis, u32Val);
+                    ichac97R3MixerRecordSelect(pThis, u32Val);
 #else
                     rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3098,5 +3099,5 @@
                     /* Newer Ubuntu guests rely on that when controlling gain and muting
                      * the recording (capturing) levels. */
-                    ichac97MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_LINE_IN, u32Val);
+                    ichac97R3MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_LINE_IN, u32Val);
 #else
                     rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3106,5 +3107,5 @@
 #ifdef IN_RING3
                     /* Ditto; see note above. */
-                    ichac97MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_MIC_IN,  u32Val);
+                    ichac97R3MixerSetVolume(pThis, uPortIdx, PDMAUDIOMIXERCTL_MIC_IN,  u32Val);
 #else
                     rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3123,8 +3124,8 @@
                     {
                         ichac97MixerSet(pThis, AC97_PCM_Front_DAC_Rate, 48000);
-                        ichac97StreamReOpen(pThis, &pThis->StreamOut);
+                        ichac97R3StreamReOpen(pThis, &pThis->StreamOut);
 
                         ichac97MixerSet(pThis, AC97_PCM_LR_ADC_Rate,    48000);
-                        ichac97StreamReOpen(pThis, &pThis->StreamLineIn);
+                        ichac97R3StreamReOpen(pThis, &pThis->StreamLineIn);
                     }
                     else
@@ -3134,5 +3135,5 @@
                     {
                         ichac97MixerSet(pThis, AC97_MIC_ADC_Rate,       48000);
-                        ichac97StreamReOpen(pThis, &pThis->StreamMicIn);
+                        ichac97R3StreamReOpen(pThis, &pThis->StreamMicIn);
                     }
                     else
@@ -3151,5 +3152,5 @@
                         ichac97MixerSet(pThis, uPortIdx, u32Val);
                         LogFunc(("Set front DAC rate to %RU32\n", u32Val));
-                        ichac97StreamReOpen(pThis, &pThis->StreamOut);
+                        ichac97R3StreamReOpen(pThis, &pThis->StreamOut);
 #else
                         rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3165,5 +3166,5 @@
                         ichac97MixerSet(pThis, uPortIdx, u32Val);
                         LogFunc(("Set MIC ADC rate to %RU32\n", u32Val));
-                        ichac97StreamReOpen(pThis, &pThis->StreamMicIn);
+                        ichac97R3StreamReOpen(pThis, &pThis->StreamMicIn);
 #else
                         rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3179,5 +3180,5 @@
                         ichac97MixerSet(pThis, uPortIdx, u32Val);
                         LogFunc(("Set front LR ADC rate to %RU32\n", u32Val));
-                        ichac97StreamReOpen(pThis, &pThis->StreamLineIn);
+                        ichac97R3StreamReOpen(pThis, &pThis->StreamLineIn);
 #else
                         rc = VINF_IOM_R3_IOPORT_WRITE;
@@ -3217,6 +3218,6 @@
  * @callback_method_impl{FNPCIIOREGIONMAP}
  */
-static DECLCALLBACK(int) ichac97IOPortMap(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
-                                          RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
+static DECLCALLBACK(int) ichac97R3IOPortMap(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
+                                            RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
 {
     RT_NOREF(cb, enmType);
@@ -3277,5 +3278,5 @@
  * @param   pStream             AC'97 stream to save.
  */
-static int ichac97SaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PAC97STREAM pStream)
+static int ichac97R3SaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PAC97STREAM pStream)
 {
     RT_NOREF(pDevIns);
@@ -3299,5 +3300,5 @@
  * @callback_method_impl{FNSSMDEVSAVEEXEC}
  */
-static DECLCALLBACK(int) ichac97SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
+static DECLCALLBACK(int) ichac97R3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
 {
     PAC97STATE pThis = PDMINS_2_DATA(pDevIns, PAC97STATE);
@@ -3311,9 +3312,9 @@
     /** @todo r=andy For the next saved state version, add unique stream identifiers and a stream count. */
     /* Note: The order the streams are saved here is critical, so don't touch. */
-    int rc2 = ichac97SaveStream(pDevIns, pSSM, &pThis->StreamLineIn);
+    int rc2 = ichac97R3SaveStream(pDevIns, pSSM, &pThis->StreamLineIn);
     AssertRC(rc2);
-    rc2 = ichac97SaveStream(pDevIns, pSSM, &pThis->StreamOut);
+    rc2 = ichac97R3SaveStream(pDevIns, pSSM, &pThis->StreamOut);
     AssertRC(rc2);
-    rc2 = ichac97SaveStream(pDevIns, pSSM, &pThis->StreamMicIn);
+    rc2 = ichac97R3SaveStream(pDevIns, pSSM, &pThis->StreamMicIn);
     AssertRC(rc2);
 
@@ -3322,7 +3323,7 @@
     uint8_t active[AC97SOUNDSOURCE_END_INDEX];
 
-    active[AC97SOUNDSOURCE_PI_INDEX] = ichac97StreamIsEnabled(pThis, &pThis->StreamLineIn) ? 1 : 0;
-    active[AC97SOUNDSOURCE_PO_INDEX] = ichac97StreamIsEnabled(pThis, &pThis->StreamOut)    ? 1 : 0;
-    active[AC97SOUNDSOURCE_MC_INDEX] = ichac97StreamIsEnabled(pThis, &pThis->StreamMicIn)  ? 1 : 0;
+    active[AC97SOUNDSOURCE_PI_INDEX] = ichac97R3StreamIsEnabled(pThis, &pThis->StreamLineIn) ? 1 : 0;
+    active[AC97SOUNDSOURCE_PO_INDEX] = ichac97R3StreamIsEnabled(pThis, &pThis->StreamOut)    ? 1 : 0;
+    active[AC97SOUNDSOURCE_MC_INDEX] = ichac97R3StreamIsEnabled(pThis, &pThis->StreamMicIn)  ? 1 : 0;
 
     SSMR3PutMem(pSSM, active, sizeof(active));
@@ -3336,11 +3337,9 @@
  *
  * @returns IPRT status code.
- * @param   pDevIns             Device instance.
  * @param   pSSM                Saved state manager (SSM) handle to use.
  * @param   pStream             AC'97 stream to load.
  */
-static int ichac97LoadStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PAC97STREAM pStream)
-{
-    RT_NOREF(pDevIns);
+static int ichac97R3LoadStream(PSSMHANDLE pSSM, PAC97STREAM pStream)
+{
     PAC97BMREGS pRegs = &pStream->Regs;
 
@@ -3354,7 +3353,5 @@
     SSMR3GetS32(pSSM, &pRegs->bd_valid);
     SSMR3GetU32(pSSM, &pRegs->bd.addr);
-    SSMR3GetU32(pSSM, &pRegs->bd.ctl_len);
-
-    return VINF_SUCCESS;
+    return SSMR3GetU32(pSSM, &pRegs->bd.ctl_len);
 }
 
@@ -3362,5 +3359,5 @@
  * @callback_method_impl{FNSSMDEVLOADEXEC}
  */
-static DECLCALLBACK(int) ichac97LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
+static DECLCALLBACK(int) ichac97R3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
 {
     PAC97STATE pThis = PDMINS_2_DATA(pDevIns, PAC97STATE);
@@ -3377,10 +3374,10 @@
     /** @todo r=andy For the next saved state version, add unique stream identifiers and a stream count. */
     /* Note: The order the streams are loaded here is critical, so don't touch. */
-    int rc2 = ichac97LoadStream(pDevIns, pSSM, &pThis->StreamLineIn);
-    AssertRC(rc2);
-    rc2 = ichac97LoadStream(pDevIns, pSSM, &pThis->StreamOut);
-    AssertRC(rc2);
-    rc2 = ichac97LoadStream(pDevIns, pSSM, &pThis->StreamMicIn);
-    AssertRC(rc2);
+    int rc2 = ichac97R3LoadStream(pSSM, &pThis->StreamLineIn);
+    AssertRCReturn(rc2, rc2);
+    rc2 = ichac97R3LoadStream(pSSM, &pThis->StreamOut);
+    AssertRCReturn(rc2, rc2);
+    rc2 = ichac97R3LoadStream(pSSM, &pThis->StreamMicIn);
+    AssertRCReturn(rc2, rc2);
 
     SSMR3GetMem(pSSM, pThis->mixer_data, sizeof(pThis->mixer_data));
@@ -3388,8 +3385,9 @@
     /** @todo r=andy Stream IDs are hardcoded to certain streams. */
     uint8_t uaStrmsActive[AC97SOUNDSOURCE_END_INDEX];
-    SSMR3GetMem(pSSM, uaStrmsActive, sizeof(uaStrmsActive));
-
-    ichac97MixerRecordSelect(pThis, ichac97MixerGet(pThis, AC97_Record_Select));
-# define V_(a, b) ichac97MixerSetVolume(pThis, a, b, ichac97MixerGet(pThis, a))
+    rc2 = SSMR3GetMem(pSSM, uaStrmsActive, sizeof(uaStrmsActive));
+    AssertRCReturn(rc2, rc2);
+
+    ichac97R3MixerRecordSelect(pThis, ichac97MixerGet(pThis, AC97_Record_Select));
+# define V_(a, b) ichac97R3MixerSetVolume(pThis, a, b, ichac97MixerGet(pThis, a))
     V_(AC97_Master_Volume_Mute,  PDMAUDIOMIXERCTL_VOLUME_MASTER);
     V_(AC97_PCM_Out_Volume_Mute, PDMAUDIOMIXERCTL_FRONT);
@@ -3399,13 +3397,13 @@
     if (pThis->uCodecModel == AC97_CODEC_AD1980)
         if (ichac97MixerGet(pThis, AC97_AD_Misc) & AC97_AD_MISC_HPSEL)
-            ichac97MixerSetVolume(pThis, AC97_Headphone_Volume_Mute, PDMAUDIOMIXERCTL_VOLUME_MASTER,
-                             ichac97MixerGet(pThis, AC97_Headphone_Volume_Mute));
+            ichac97R3MixerSetVolume(pThis, AC97_Headphone_Volume_Mute, PDMAUDIOMIXERCTL_VOLUME_MASTER,
+                                    ichac97MixerGet(pThis, AC97_Headphone_Volume_Mute));
 
     /** @todo r=andy Stream IDs are hardcoded to certain streams. */
-    rc2 = ichac97StreamEnable(pThis, &pThis->StreamLineIn,    RT_BOOL(uaStrmsActive[AC97SOUNDSOURCE_PI_INDEX]));
+    rc2 = ichac97R3StreamEnable(pThis, &pThis->StreamLineIn,    RT_BOOL(uaStrmsActive[AC97SOUNDSOURCE_PI_INDEX]));
     if (RT_SUCCESS(rc2))
-        rc2 = ichac97StreamEnable(pThis, &pThis->StreamMicIn, RT_BOOL(uaStrmsActive[AC97SOUNDSOURCE_MC_INDEX]));
+        rc2 = ichac97R3StreamEnable(pThis, &pThis->StreamMicIn, RT_BOOL(uaStrmsActive[AC97SOUNDSOURCE_MC_INDEX]));
     if (RT_SUCCESS(rc2))
-        rc2 = ichac97StreamEnable(pThis, &pThis->StreamOut,   RT_BOOL(uaStrmsActive[AC97SOUNDSOURCE_PO_INDEX]));
+        rc2 = ichac97R3StreamEnable(pThis, &pThis->StreamOut,   RT_BOOL(uaStrmsActive[AC97SOUNDSOURCE_PO_INDEX]));
 
     pThis->bup_flag  = 0;
@@ -3419,5 +3417,5 @@
  * @interface_method_impl{PDMIBASE,pfnQueryInterface}
  */
-static DECLCALLBACK(void *) ichac97QueryInterface(struct PDMIBASE *pInterface, const char *pszIID)
+static DECLCALLBACK(void *) ichac97R3QueryInterface(struct PDMIBASE *pInterface, const char *pszIID)
 {
     PAC97STATE pThis = RT_FROM_MEMBER(pInterface, AC97STATE, IBase);
@@ -3434,5 +3432,5 @@
  * @param   pDevIns             Device instance to power off.
  */
-static DECLCALLBACK(void) ichac97PowerOff(PPDMDEVINS pDevIns)
+static DECLCALLBACK(void) ichac97R3PowerOff(PPDMDEVINS pDevIns)
 {
     PAC97STATE pThis = PDMINS_2_DATA(pDevIns, PAC97STATE);
@@ -3441,9 +3439,9 @@
 
     /* Note: Involves mixer stream / sink destruction, so also do this here
-     *       instead of in ichac97Destruct(). */
-    ichac97StreamsDestroy(pThis);
+     *       instead of in ichac97R3Destruct(). */
+    ichac97R3StreamsDestroy(pThis);
 
     /**
-     * Note: Destroy the mixer while powering off and *not* in ichac97Destruct,
+     * Note: Destroy the mixer while powering off and *not* in ichac97R3Destruct,
      *       giving the mixer the chance to release any references held to
      *       PDM audio streams it maintains.
@@ -3463,5 +3461,5 @@
  *          make sense to me so we'll do it.
  */
-static DECLCALLBACK(void) ichac97Reset(PPDMDEVINS pDevIns)
+static DECLCALLBACK(void) ichac97R3Reset(PPDMDEVINS pDevIns)
 {
     PAC97STATE pThis = PDMINS_2_DATA(pDevIns, PAC97STATE);
@@ -3474,22 +3472,22 @@
      * the codec manually.
      */
-    ichac97MixerReset(pThis);
+    ichac97R3MixerReset(pThis);
 
     /*
      * Reset all streams.
      */
-    ichac97StreamEnable(pThis, &pThis->StreamLineIn, false /* fEnable */);
-    ichac97StreamReset(pThis, &pThis->StreamLineIn);
-
-    ichac97StreamEnable(pThis, &pThis->StreamMicIn, false /* fEnable */);
-    ichac97StreamReset(pThis, &pThis->StreamMicIn);
-
-    ichac97StreamEnable(pThis, &pThis->StreamOut, false /* fEnable */);
-    ichac97StreamReset(pThis, &pThis->StreamOut);
+    ichac97R3StreamEnable(pThis, &pThis->StreamLineIn, false /* fEnable */);
+    ichac97R3StreamReset(pThis, &pThis->StreamLineIn);
+
+    ichac97R3StreamEnable(pThis, &pThis->StreamMicIn, false /* fEnable */);
+    ichac97R3StreamReset(pThis, &pThis->StreamMicIn);
+
+    ichac97R3StreamEnable(pThis, &pThis->StreamOut, false /* fEnable */);
+    ichac97R3StreamReset(pThis, &pThis->StreamOut);
 
     /*
      * Reset mixer sinks.
      *
-     * Do the reset here instead of in ichac97StreamReset();
+     * Do the reset here instead of in ichac97R3StreamReset();
      * the mixer sink(s) might still have data to be processed when an audio stream gets reset.
      */
@@ -3502,5 +3500,5 @@
      * Stop the timer, if any.
      */
-    ichac97TimerStop(pThis);
+    ichac97R3TimerStop(pThis);
 
     pThis->cStreamsActive = 0;
@@ -3522,5 +3520,5 @@
  * @param   ppDrv       Attached driver instance on success. Optional.
  */
-static int ichac97AttachInternal(PAC97STATE pThis, unsigned uLUN, uint32_t fFlags, PAC97DRIVER *ppDrv)
+static int ichac97R3AttachInternal(PAC97STATE pThis, unsigned uLUN, uint32_t fFlags, PAC97DRIVER *ppDrv)
 {
     RT_NOREF(fFlags);
@@ -3594,5 +3592,5 @@
  * @param   fFlags      Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
  */
-static int ichac97DetachInternal(PAC97STATE pThis, PAC97DRIVER pDrv, uint32_t fFlags)
+static int ichac97R3DetachInternal(PAC97STATE pThis, PAC97DRIVER pDrv, uint32_t fFlags)
 {
     RT_NOREF(fFlags);
@@ -3619,5 +3617,5 @@
  * @interface_method_impl{PDMDEVREG,pfnAttach}
  */
-static DECLCALLBACK(int) ichac97Attach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
+static DECLCALLBACK(int) ichac97R3Attach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
 {
     PAC97STATE pThis = PDMINS_2_DATA(pDevIns, PAC97STATE);
@@ -3628,15 +3626,15 @@
 
     PAC97DRIVER pDrv;
-    int rc2 = ichac97AttachInternal(pThis, uLUN, fFlags, &pDrv);
+    int rc2 = ichac97R3AttachInternal(pThis, uLUN, fFlags, &pDrv);
     if (RT_SUCCESS(rc2))
     {
         if (DrvAudioHlpStreamCfgIsValid(&pThis->StreamLineIn.State.Cfg))
-            ichac97MixerAddDrvStream(pThis, pThis->pSinkLineIn, &pThis->StreamLineIn.State.Cfg, pDrv);
+            ichac97R3MixerAddDrvStream(pThis, pThis->pSinkLineIn, &pThis->StreamLineIn.State.Cfg, pDrv);
 
         if (DrvAudioHlpStreamCfgIsValid(&pThis->StreamMicIn.State.Cfg))
-            ichac97MixerAddDrvStream(pThis, pThis->pSinkMicIn,  &pThis->StreamMicIn.State.Cfg, pDrv);
+            ichac97R3MixerAddDrvStream(pThis, pThis->pSinkMicIn,  &pThis->StreamMicIn.State.Cfg, pDrv);
 
         if (DrvAudioHlpStreamCfgIsValid(&pThis->StreamOut.State.Cfg))
-            ichac97MixerAddDrvStream(pThis, pThis->pSinkOut,    &pThis->StreamOut.State.Cfg, pDrv);
+            ichac97R3MixerAddDrvStream(pThis, pThis->pSinkOut,    &pThis->StreamOut.State.Cfg, pDrv);
     }
 
@@ -3649,5 +3647,5 @@
  * @interface_method_impl{PDMDEVREG,pfnDetach}
  */
-static DECLCALLBACK(void) ichac97Detach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
+static DECLCALLBACK(void) ichac97R3Detach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
 {
     PAC97STATE pThis = PDMINS_2_DATA(pDevIns, PAC97STATE);
@@ -3662,5 +3660,5 @@
         if (pDrv->uLUN == uLUN)
         {
-            int rc2 = ichac97DetachInternal(pThis, pDrv, fFlags);
+            int rc2 = ichac97R3DetachInternal(pThis, pDrv, fFlags);
             if (RT_SUCCESS(rc2))
             {
@@ -3687,5 +3685,5 @@
  * @param   pszDriver   New driver name to attach.
  */
-static int ichac97ReattachInternal(PAC97STATE pThis, PAC97DRIVER pDrv, uint8_t uLUN, const char *pszDriver)
+static int ichac97R3ReattachInternal(PAC97STATE pThis, PAC97DRIVER pDrv, uint8_t uLUN, const char *pszDriver)
 {
     AssertPtrReturn(pThis,     VERR_INVALID_POINTER);
@@ -3696,5 +3694,5 @@
     if (pDrv)
     {
-        rc = ichac97DetachInternal(pThis, pDrv, 0 /* fFlags */);
+        rc = ichac97R3DetachInternal(pThis, pDrv, 0 /* fFlags */);
         if (RT_SUCCESS(rc))
             rc = PDMDevHlpDriverDetach(pThis->pDevInsR3, PDMIBASE_2_PDMDRV(pDrv->pDrvBase), 0 /* fFlags */);
@@ -3713,5 +3711,5 @@
     CFGMR3RemoveNode(CFGMR3GetChildF(pDev0, "LUN#%u/", uLUN));
 
-#define RC_CHECK() if (RT_FAILURE(rc)) { AssertReleaseRC(rc); break; }
+# define RC_CHECK() if (RT_FAILURE(rc)) { AssertReleaseRC(rc); break; }
 
     do
@@ -3732,9 +3730,9 @@
 
     if (RT_SUCCESS(rc))
-        rc = ichac97AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
+        rc = ichac97R3AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
 
     LogFunc(("pThis=%p, uLUN=%u, pszDriver=%s, rc=%Rrc\n", pThis, uLUN, pszDriver, rc));
 
-#undef RC_CHECK
+# undef RC_CHECK
 
     return rc;
@@ -3744,12 +3742,12 @@
  * @interface_method_impl{PDMDEVREG,pfnRelocate}
  */
-static DECLCALLBACK(void) ichac97Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
+static DECLCALLBACK(void) ichac97R3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
 {
     NOREF(offDelta);
     PAC97STATE pThis = PDMINS_2_DATA(pDevIns, PAC97STATE);
     pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
-#ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
+# ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
     pThis->pTimerRC = TMTimerRCPtr(pThis->pTimerR3);
-#endif
+# endif
 }
 
@@ -3757,5 +3755,5 @@
  * @interface_method_impl{PDMDEVREG,pfnDestruct}
  */
-static DECLCALLBACK(int) ichac97Destruct(PPDMDEVINS pDevIns)
+static DECLCALLBACK(int) ichac97R3Destruct(PPDMDEVINS pDevIns)
 {
     PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns); /* this shall come first */
@@ -3780,5 +3778,5 @@
  * @interface_method_impl{PDMDEVREG,pfnConstruct}
  */
-static DECLCALLBACK(int) ichac97Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
+static DECLCALLBACK(int) ichac97R3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
 {
     PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); /* this shall come first */
@@ -3792,5 +3790,5 @@
     pThis->pDevInsR0                = PDMDEVINS_2_R0PTR(pDevIns);
     pThis->pDevInsRC                = PDMDEVINS_2_RCPTR(pDevIns);
-    pThis->IBase.pfnQueryInterface  = ichac97QueryInterface;
+    pThis->IBase.pfnQueryInterface  = ichac97R3QueryInterface;
     RTListInit(&pThis->lstDrv);
 
@@ -3819,5 +3817,5 @@
                                 N_("AC'97 configuration error: Querying \"Codec\" as string failed"));
 
-#ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
+# ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
     uint16_t uTimerHz;
     rc = CFGMR3QueryU16Def(pCfg, "TimerHz", &uTimerHz, AC97_TIMER_HZ /* Default value, if not set. */);
@@ -3825,5 +3823,5 @@
         return PDMDEV_SET_ERROR(pDevIns, rc,
                                 N_("AC'97 configuration error: failed to read Hertz (Hz) rate as unsigned integer"));
-#endif
+# endif
 
     /*
@@ -3897,19 +3895,19 @@
         return rc;
 
-    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 256, PCI_ADDRESS_SPACE_IO, ichac97IOPortMap);
+    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 256, PCI_ADDRESS_SPACE_IO, ichac97R3IOPortMap);
     if (RT_FAILURE(rc))
         return rc;
 
-    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 1, 64, PCI_ADDRESS_SPACE_IO, ichac97IOPortMap);
+    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 1, 64, PCI_ADDRESS_SPACE_IO, ichac97R3IOPortMap);
     if (RT_FAILURE(rc))
         return rc;
 
-    rc = PDMDevHlpSSMRegister(pDevIns, AC97_SSM_VERSION, sizeof(*pThis), ichac97SaveExec, ichac97LoadExec);
+    rc = PDMDevHlpSSMRegister(pDevIns, AC97_SSM_VERSION, sizeof(*pThis), ichac97R3SaveExec, ichac97R3LoadExec);
     if (RT_FAILURE(rc))
         return rc;
 
-#ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
+# ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO
     LogRel(("AC97: Asynchronous I/O enabled\n"));
-#endif
+# endif
 
     /*
@@ -3920,5 +3918,5 @@
     {
         LogFunc(("Trying to attach driver for LUN #%RU8 ...\n", uLUN));
-        rc = ichac97AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
+        rc = ichac97R3AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
         if (RT_FAILURE(rc))
         {
@@ -3927,5 +3925,5 @@
             else if (rc == VERR_AUDIO_BACKEND_INIT_FAILED)
             {
-                ichac97ReattachInternal(pThis, NULL /* pDrv */, uLUN, "NullAudio");
+                ichac97R3ReattachInternal(pThis, NULL /* pDrv */, uLUN, "NullAudio");
                 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
                         N_("Host audio backend initialization has failed. Selecting the NULL audio backend "
@@ -3959,13 +3957,13 @@
          * Create all hardware streams.
          */
-        rc = ichac97StreamCreate(pThis, &pThis->StreamLineIn, AC97SOUNDSOURCE_PI_INDEX);
+        rc = ichac97R3StreamCreate(pThis, &pThis->StreamLineIn, AC97SOUNDSOURCE_PI_INDEX);
         if (RT_SUCCESS(rc))
         {
-            rc = ichac97StreamCreate(pThis, &pThis->StreamMicIn, AC97SOUNDSOURCE_MC_INDEX);
+            rc = ichac97R3StreamCreate(pThis, &pThis->StreamMicIn, AC97SOUNDSOURCE_MC_INDEX);
             if (RT_SUCCESS(rc))
-                rc = ichac97StreamCreate(pThis, &pThis->StreamOut, AC97SOUNDSOURCE_PO_INDEX);
-        }
-
-#ifdef VBOX_WITH_AUDIO_AC97_ONETIME_INIT
+                rc = ichac97R3StreamCreate(pThis, &pThis->StreamOut, AC97SOUNDSOURCE_PO_INDEX);
+        }
+
+# ifdef VBOX_WITH_AUDIO_AC97_ONETIME_INIT
         PAC97DRIVER pDrv;
         RTListForEach(&pThis->lstDrv, pDrv, AC97DRIVER, Node)
@@ -3991,6 +3989,6 @@
                 LogRel(("AC97: Falling back to NULL backend (no sound audible)\n"));
 
-                ichac97Reset(pDevIns);
-                ichac97ReattachInternal(pThis, pDrv, pDrv->uLUN, "NullAudio");
+                ichac97R3Reset(pDevIns);
+                ichac97R3ReattachInternal(pThis, pDrv, pDrv->uLUN, "NullAudio");
 
                 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
@@ -4062,11 +4060,11 @@
             }
         }
-#endif /* VBOX_WITH_AUDIO_AC97_ONETIME_INIT */
+# endif /* VBOX_WITH_AUDIO_AC97_ONETIME_INIT */
     }
 
     if (RT_SUCCESS(rc))
-        ichac97Reset(pDevIns);
-
-#ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
+        ichac97R3Reset(pDevIns);
+
+# ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
     if (RT_SUCCESS(rc))
     {
@@ -4077,5 +4075,5 @@
          *        instead of the LPIB registers.
          */
-        rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, ichac97Timer, pThis,
+        rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, ichac97R3Timer, pThis,
                                     TMTIMER_FLAGS_NO_CRIT_SECT, "AC'97 Timer", &pThis->pTimerR3);
         AssertRCReturn(rc, rc);
@@ -4092,5 +4090,5 @@
         LogFunc(("Timer ticks=%RU64 (%RU16 Hz)\n", pThis->cTimerTicks, uTimerHz));
     }
-#else /* !VBOX_WITH_AUDIO_AC97_CALLBACKS */
+# else /* !VBOX_WITH_AUDIO_AC97_CALLBACKS */
     if (RT_SUCCESS(rc))
     {
@@ -4122,7 +4120,7 @@
         }
     }
-#endif /* VBOX_WITH_AUDIO_AC97_CALLBACKS */
-
-#ifdef VBOX_WITH_STATISTICS
+# endif /* VBOX_WITH_AUDIO_AC97_CALLBACKS */
+
+# ifdef VBOX_WITH_STATISTICS
     if (RT_SUCCESS(rc))
     {
@@ -4136,12 +4134,12 @@
         PDMDevHlpSTAMRegister(pDevIns, &pThis->StatBytesWritten, STAMTYPE_COUNTER, "/Devices/AC97/BytesWritten", STAMUNIT_BYTES,          "Bytes written to AC97 emulation.");
     }
-#endif
-
-#ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
+# endif
+
+# ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA
     RTFileDelete(VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "ac97DMARead.pcm");
     RTFileDelete(VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "ac97DMAWrite.pcm");
     RTFileDelete(VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "ac97StreamRead.pcm");
     RTFileDelete(VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "ac97StreamWrite.pcm");
-#endif
+# endif
 
     LogFlowFuncLeaveRC(rc);
@@ -4173,9 +4171,9 @@
     sizeof(AC97STATE),
     /* pfnConstruct */
-    ichac97Construct,
+    ichac97R3Construct,
     /* pfnDestruct */
-    ichac97Destruct,
+    ichac97R3Destruct,
     /* pfnRelocate */
-    ichac97Relocate,
+    ichac97R3Relocate,
     /* pfnMemSetup */
     NULL,
@@ -4183,5 +4181,5 @@
     NULL,
     /* pfnReset */
-    ichac97Reset,
+    ichac97R3Reset,
     /* pfnSuspend */
     NULL,
@@ -4189,7 +4187,7 @@
     NULL,
     /* pfnAttach */
-    ichac97Attach,
+    ichac97R3Attach,
     /* pfnDetach */
-    ichac97Detach,
+    ichac97R3Detach,
     /* pfnQueryInterface. */
     NULL,
@@ -4197,5 +4195,5 @@
     NULL,
     /* pfnPowerOff */
-    ichac97PowerOff,
+    ichac97R3PowerOff,
     /* pfnSoftReset */
     NULL,
