Index: trunk/src/VBox/Devices/Audio/DevCodec.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevCodec.cpp	(revision 44637)
+++ trunk/src/VBox/Devices/Audio/DevCodec.cpp	(revision 44639)
@@ -321,5 +321,5 @@
     pState->u8BSKU = 0x76;
     pState->u8AssemblyId = 0x80;
-    pState->pNodes = (PCODECNODE)RTMemAllocZ(sizeof(CODECNODE) * pState->cTotalNodes);
+    pState->paNodes = (PCODECNODE)RTMemAllocZ(sizeof(CODECNODE) * pState->cTotalNodes);
     pState->fInReset = false;
 #define STAC9220WIDGET(type) pState->au8##type##s = g_abStac9220##type##s
@@ -412,5 +412,5 @@
                                                     | CODEC_F00_09_CAP_FMT_OVERRIDE
                                                     | CODEC_F00_09_CAP_LSB;//(4 << 16) | RT_BIT(9)|RT_BIT(4)|0x1;
-            pNode->node.au32F00_param[0xa] = pState->pNodes[1].node.au32F00_param[0xA];
+            pNode->node.au32F00_param[0xa] = pState->paNodes[1].node.au32F00_param[0xA];
             pNode->spdifout.node.au32F00_param[0xB] = CODEC_F00_0B_PCM;
             pNode->spdifout.u32F06_param = 0;
@@ -424,5 +424,5 @@
                                                    | CODEC_F00_09_CAP_FMT_OVERRIDE
                                                    | CODEC_F00_09_CAP_LSB;//(0x1 << 20)|(4 << 16) | RT_BIT(9)| RT_BIT(8)|RT_BIT(4)|0x1;
-            pNode->node.au32F00_param[0xA] = pState->pNodes[1].node.au32F00_param[0xA];
+            pNode->node.au32F00_param[0xA] = pState->paNodes[1].node.au32F00_param[0xA];
             pNode->node.au32F00_param[0xE] = CODEC_MAKE_F00_0E(0, 1);//RT_BIT(0);
             pNode->node.au32F02_param[0] = 0x11;
@@ -771,5 +771,5 @@
     uint8_t u8Index = CODEC_GET_AMP_DIRECTION(cmd) == AMPLIFIER_OUT? 0 : CODEC_GET_AMP_INDEX(cmd);
 
-    PCODECNODE pNode = &pState->pNodes[CODEC_NID(cmd)];
+    PCODECNODE pNode = &pState->paNodes[CODEC_NID(cmd)];
     if (codecIsDacNode(pState, CODEC_NID(cmd)))
         *pResp = AMPLIFIER_REGISTER(pNode->dac.B_params,
@@ -823,5 +823,5 @@
     }
     *pResp = 0;
-    PCODECNODE pNode = &pState->pNodes[CODEC_NID(cmd)];
+    PCODECNODE pNode = &pState->paNodes[CODEC_NID(cmd)];
     if (codecIsDacNode(pState, CODEC_NID(cmd)))
         pAmplifier = &pNode->dac.B_params;
@@ -884,5 +884,5 @@
     }
     *pResp = 0;
-    *pResp = pState->pNodes[CODEC_NID(cmd)].node.au32F00_param[cmd & CODEC_VERB_8BIT_DATA];
+    *pResp = pState->paNodes[CODEC_NID(cmd)].node.au32F00_param[cmd & CODEC_VERB_8BIT_DATA];
     return VINF_SUCCESS;
 }
@@ -900,13 +900,13 @@
     *pResp = 0;
     if (codecIsAdcMuxNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].adcmux.u32F01_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].adcmux.u32F01_param;
     else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digout.u32F01_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digout.u32F01_param;
     else if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].port.u32F01_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].port.u32F01_param;
     else if (codecIsAdcNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].adc.u32F01_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].adc.u32F01_param;
     else if (codecIsAdcVolNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].adcvol.u32F01_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].adcvol.u32F01_param;
     return VINF_SUCCESS;
 }
@@ -924,13 +924,13 @@
     *pResp = 0;
     if (codecIsAdcMuxNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].adcmux.u32F01_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].adcmux.u32F01_param;
     else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digout.u32F01_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digout.u32F01_param;
     else if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].port.u32F01_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].port.u32F01_param;
     else if (codecIsAdcNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].adc.u32F01_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].adc.u32F01_param;
     else if (codecIsAdcVolNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].adcvol.u32F01_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].adcvol.u32F01_param;
     Assert((pu32Reg));
     if (pu32Reg)
@@ -951,15 +951,15 @@
     *pResp = 0;
     if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].port.u32F07_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].port.u32F07_param;
     else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digout.u32F07_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digout.u32F07_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F07_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digin.u32F07_param;
     else if (codecIsCdNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].cdnode.u32F07_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].cdnode.u32F07_param;
     else if (codecIsPcbeepNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].pcbeep.u32F07_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].pcbeep.u32F07_param;
     else if (codecIsReservedNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].reserved.u32F07_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].reserved.u32F07_param;
     else
         AssertMsgFailed(("Unsupported"));
@@ -980,16 +980,16 @@
     uint32_t *pu32Reg = NULL;
     if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].port.u32F07_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].port.u32F07_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digin.u32F07_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digin.u32F07_param;
     else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digout.u32F07_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digout.u32F07_param;
     else if (codecIsCdNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].cdnode.u32F07_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].cdnode.u32F07_param;
     else if (codecIsPcbeepNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].pcbeep.u32F07_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].pcbeep.u32F07_param;
     else if (   codecIsReservedNode(pState, CODEC_NID(cmd))
              && CODEC_NID(cmd) == 0x1b)
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].reserved.u32F07_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].reserved.u32F07_param;
     Assert((pu32Reg));
     if (pu32Reg)
@@ -1010,15 +1010,15 @@
     *pResp = 0;
     if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].port.u32F08_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].port.u32F08_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F08_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digin.u32F08_param;
     else if ((cmd) == 1 /* AFG */)
-        *pResp = pState->pNodes[CODEC_NID(cmd)].afg.u32F08_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].afg.u32F08_param;
     else if (codecIsVolKnobNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].volumeKnob.u32F08_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].volumeKnob.u32F08_param;
     else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digout.u32F08_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digout.u32F08_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F08_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digin.u32F08_param;
     else
         AssertMsgFailed(("unsupported operation %x on node: %x\n", CODEC_VERB_CMD8(cmd), CODEC_NID(cmd)));
@@ -1039,15 +1039,15 @@
     uint32_t *pu32Reg = NULL;
     if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].port.u32F08_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].port.u32F08_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digin.u32F08_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digin.u32F08_param;
     else if (CODEC_NID(cmd) == 1 /* AFG */)
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].afg.u32F08_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].afg.u32F08_param;
     else if (codecIsVolKnobNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].volumeKnob.u32F08_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].volumeKnob.u32F08_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digin.u32F08_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digin.u32F08_param;
     else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digout.u32F08_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digout.u32F08_param;
     else
         AssertMsgFailed(("unsupported operation %x on node: %x\n", CODEC_VERB_CMD8(cmd), CODEC_NID(cmd)));
@@ -1070,7 +1070,7 @@
     *pResp = 0;
     if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].port.u32F09_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].port.u32F09_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F09_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digin.u32F09_param;
     else
         AssertMsgFailed(("unsupported operation %x on node: %x\n", CODEC_VERB_CMD8(cmd), CODEC_NID(cmd)));
@@ -1091,7 +1091,7 @@
     uint32_t *pu32Reg = NULL;
     if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].port.u32F09_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].port.u32F09_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digin.u32F09_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digin.u32F09_param;
     Assert(pu32Reg);
     if(pu32Reg)
@@ -1116,5 +1116,5 @@
         return VINF_SUCCESS;
     }
-    *pResp = pState->pNodes[CODEC_NID(cmd)].node.au32F02_param[cmd & CODEC_VERB_8BIT_DATA];
+    *pResp = pState->paNodes[CODEC_NID(cmd)].node.au32F02_param[cmd & CODEC_VERB_8BIT_DATA];
     return VINF_SUCCESS;
 }
@@ -1131,5 +1131,5 @@
     *pResp = 0;
     if (codecIsAdcNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].adc.u32F03_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].adc.u32F03_param;
     return VINF_SUCCESS;
 }
@@ -1148,5 +1148,5 @@
     if (codecIsAdcNode(pState, CODEC_NID(cmd)))
     {
-        codecSetRegisterU8(&pState->pNodes[CODEC_NID(cmd)].adc.u32F03_param, cmd, 0);
+        codecSetRegisterU8(&pState->paNodes[CODEC_NID(cmd)].adc.u32F03_param, cmd, 0);
     }
     return VINF_SUCCESS;
@@ -1165,7 +1165,7 @@
     *pResp = 0;
     if (codecIsSpdifOutNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].spdifout.u32F0d_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].spdifout.u32F0d_param;
     else if (codecIsSpdifInNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].spdifin.u32F0d_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].spdifin.u32F0d_param;
     return VINF_SUCCESS;
 }
@@ -1182,7 +1182,7 @@
     *pResp = 0;
     if (codecIsSpdifOutNode(pState, CODEC_NID(cmd)))
-        codecSetRegisterU8(&pState->pNodes[CODEC_NID(cmd)].spdifout.u32F0d_param, cmd, u8Offset);
+        codecSetRegisterU8(&pState->paNodes[CODEC_NID(cmd)].spdifout.u32F0d_param, cmd, u8Offset);
     else if (codecIsSpdifInNode(pState, CODEC_NID(cmd)))
-        codecSetRegisterU8(&pState->pNodes[CODEC_NID(cmd)].spdifin.u32F0d_param, cmd, u8Offset);
+        codecSetRegisterU8(&pState->paNodes[CODEC_NID(cmd)].spdifin.u32F0d_param, cmd, u8Offset);
     return VINF_SUCCESS;
 }
@@ -1213,5 +1213,5 @@
     if (CODEC_NID(cmd) == 1 /* AFG */)
     {
-        *pResp = pState->pNodes[CODEC_NID(cmd)].afg.u32F20_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].afg.u32F20_param;
     }
     return VINF_SUCCESS;
@@ -1229,5 +1229,5 @@
     uint32_t *pu32Reg = NULL;
     if (CODEC_NID(cmd) == 0x1 /* AFG */)
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].afg.u32F20_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].afg.u32F20_param;
     Assert((pu32Reg));
     if (pu32Reg)
@@ -1273,5 +1273,5 @@
         for (i = 0; i < pState->cTotalNodes; ++i)
         {
-            pState->pfnCodecNodeReset(pState, i, &pState->pNodes[i]);
+            pState->pfnCodecNodeReset(pState, i, &pState->paNodes[i]);
         }
         pState->fInReset = false;
@@ -1294,17 +1294,17 @@
     *pResp = 0;
     if (CODEC_NID(cmd) == 1 /* AFG */)
-        *pResp = pState->pNodes[CODEC_NID(cmd)].afg.u32F05_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].afg.u32F05_param;
     else if (codecIsDacNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].dac.u32F05_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].dac.u32F05_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F05_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digin.u32F05_param;
     else if (codecIsAdcNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].adc.u32F05_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].adc.u32F05_param;
     else if (codecIsSpdifOutNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].spdifout.u32F05_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].spdifout.u32F05_param;
     else if (codecIsSpdifInNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].spdifin.u32F05_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].spdifin.u32F05_param;
     else if (codecIsReservedNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].reserved.u32F05_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].reserved.u32F05_param;
     return VINF_SUCCESS;
 }
@@ -1335,17 +1335,17 @@
     *pResp = 0;
     if (CODEC_NID(cmd) == 1 /* AFG */)
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].afg.u32F05_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].afg.u32F05_param;
     else if (codecIsDacNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].dac.u32F05_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].dac.u32F05_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digin.u32F05_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digin.u32F05_param;
     else if (codecIsAdcNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].adc.u32F05_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].adc.u32F05_param;
     else if (codecIsSpdifOutNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].spdifout.u32F05_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].spdifout.u32F05_param;
     else if (codecIsSpdifInNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].spdifin.u32F05_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].spdifin.u32F05_param;
     else if (codecIsReservedNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].reserved.u32F05_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].reserved.u32F05_param;
     Assert((pu32Reg));
     if (!pu32Reg)
@@ -1361,5 +1361,5 @@
          */
         *pu32Reg = CODEC_MAKE_F05(fReset, fStopOk, 0,
-                                  CODEC_F05_ACT(pState->pNodes[1].afg.u32F05_param),
+                                  CODEC_F05_ACT(pState->paNodes[1].afg.u32F05_param),
                                   CODEC_F05_SET(cmd));
     }
@@ -1367,5 +1367,5 @@
     /* Propagate next power state only if AFG is on or verb modifies AFG power state */
     if (   CODEC_NID(cmd) == 1 /* AFG */
-        || !CODEC_F05_ACT(pState->pNodes[1].afg.u32F05_param))
+        || !CODEC_F05_ACT(pState->paNodes[1].afg.u32F05_param))
     {
         *pu32Reg = CODEC_MAKE_F05(fReset, fStopOk, 0, CODEC_F05_SET(cmd), CODEC_F05_SET(cmd));
@@ -1376,13 +1376,13 @@
             const uint8_t *pu8NodeIndex = &pState->au8Dacs[0];
             while (*(++pu8NodeIndex))
-                codecPropogatePowerState(&pState->pNodes[*pu8NodeIndex].dac.u32F05_param);
+                codecPropogatePowerState(&pState->paNodes[*pu8NodeIndex].dac.u32F05_param);
 
             pu8NodeIndex = &pState->au8Adcs[0];
             while (*(++pu8NodeIndex))
-                codecPropogatePowerState(&pState->pNodes[*pu8NodeIndex].adc.u32F05_param);
+                codecPropogatePowerState(&pState->paNodes[*pu8NodeIndex].adc.u32F05_param);
 
             pu8NodeIndex = &pState->au8DigInPins[0];
             while (*(++pu8NodeIndex))
-                codecPropogatePowerState(&pState->pNodes[*pu8NodeIndex].digin.u32F05_param);
+                codecPropogatePowerState(&pState->paNodes[*pu8NodeIndex].digin.u32F05_param);
         }
     }
@@ -1401,13 +1401,13 @@
     *pResp = 0;
     if (codecIsDacNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].dac.u32F06_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].dac.u32F06_param;
     else if (codecIsAdcNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].adc.u32F06_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].adc.u32F06_param;
     else if (codecIsSpdifInNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].spdifin.u32F06_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].spdifin.u32F06_param;
     else if (codecIsSpdifOutNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].spdifout.u32F06_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].spdifout.u32F06_param;
     else if (CODEC_NID(cmd) == 0x1A)
-        *pResp = pState->pNodes[CODEC_NID(cmd)].reserved.u32F06_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].reserved.u32F06_param;
     return VINF_SUCCESS;
 }
@@ -1425,13 +1425,13 @@
     *pResp = 0;
     if (codecIsDacNode(pState, CODEC_NID(cmd)))
-        pu32addr = &pState->pNodes[CODEC_NID(cmd)].dac.u32F06_param;
+        pu32addr = &pState->paNodes[CODEC_NID(cmd)].dac.u32F06_param;
     else if (codecIsAdcNode(pState, CODEC_NID(cmd)))
-        pu32addr = &pState->pNodes[CODEC_NID(cmd)].adc.u32F06_param;
+        pu32addr = &pState->paNodes[CODEC_NID(cmd)].adc.u32F06_param;
     else if (codecIsSpdifOutNode(pState, CODEC_NID(cmd)))
-        pu32addr = &pState->pNodes[CODEC_NID(cmd)].spdifout.u32F06_param;
+        pu32addr = &pState->paNodes[CODEC_NID(cmd)].spdifout.u32F06_param;
     else if (codecIsSpdifInNode(pState, CODEC_NID(cmd)))
-        pu32addr = &pState->pNodes[CODEC_NID(cmd)].spdifin.u32F06_param;
+        pu32addr = &pState->paNodes[CODEC_NID(cmd)].spdifin.u32F06_param;
     else if (codecIsReservedNode(pState, CODEC_NID(cmd)))
-        pu32addr = &pState->pNodes[CODEC_NID(cmd)].reserved.u32F06_param;
+        pu32addr = &pState->paNodes[CODEC_NID(cmd)].reserved.u32F06_param;
     Assert((pu32addr));
     if (pu32addr)
@@ -1451,11 +1451,11 @@
     *pResp = 0;
     if (codecIsDacNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].dac.u32A_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].dac.u32A_param;
     else if (codecIsAdcNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].adc.u32A_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].adc.u32A_param;
     else if (codecIsSpdifOutNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].spdifout.u32A_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].spdifout.u32A_param;
     else if (codecIsSpdifInNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].spdifin.u32A_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].spdifin.u32A_param;
     return VINF_SUCCESS;
 }
@@ -1472,11 +1472,11 @@
     *pResp = 0;
     if (codecIsDacNode(pState, CODEC_NID(cmd)))
-        codecSetRegisterU16(&pState->pNodes[CODEC_NID(cmd)].dac.u32A_param, cmd, 0);
+        codecSetRegisterU16(&pState->paNodes[CODEC_NID(cmd)].dac.u32A_param, cmd, 0);
     else if (codecIsAdcNode(pState, CODEC_NID(cmd)))
-        codecSetRegisterU16(&pState->pNodes[CODEC_NID(cmd)].adc.u32A_param, cmd, 0);
+        codecSetRegisterU16(&pState->paNodes[CODEC_NID(cmd)].adc.u32A_param, cmd, 0);
     else if (codecIsSpdifOutNode(pState, CODEC_NID(cmd)))
-        codecSetRegisterU16(&pState->pNodes[CODEC_NID(cmd)].spdifout.u32A_param, cmd, 0);
+        codecSetRegisterU16(&pState->paNodes[CODEC_NID(cmd)].spdifout.u32A_param, cmd, 0);
     else if (codecIsSpdifInNode(pState, CODEC_NID(cmd)))
-        codecSetRegisterU16(&pState->pNodes[CODEC_NID(cmd)].spdifin.u32A_param, cmd, 0);
+        codecSetRegisterU16(&pState->paNodes[CODEC_NID(cmd)].spdifin.u32A_param, cmd, 0);
     return VINF_SUCCESS;
 }
@@ -1494,9 +1494,9 @@
     *pResp = 0;
     if (codecIsAdcVolNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].adcvol.u32F0c_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].adcvol.u32F0c_param;
     else if (codecIsDacNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].dac.u32F0c_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].dac.u32F0c_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F0c_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digin.u32F0c_param;
     return VINF_SUCCESS;
 }
@@ -1515,9 +1515,9 @@
     uint32_t *pu32Reg = NULL;
     if (codecIsAdcVolNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].adcvol.u32F0c_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].adcvol.u32F0c_param;
     else if (codecIsDacNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].dac.u32F0c_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].dac.u32F0c_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digin.u32F0c_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digin.u32F0c_param;
     *pResp = 0;
     Assert((pu32Reg));
@@ -1539,5 +1539,5 @@
     *pResp = 0;
     if (codecIsVolKnobNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].volumeKnob.u32F0f_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].volumeKnob.u32F0f_param;
     return VINF_SUCCESS;
 }
@@ -1556,5 +1556,5 @@
     *pResp = 0;
     if (codecIsVolKnobNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].volumeKnob.u32F0f_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].volumeKnob.u32F0f_param;
     Assert((pu32Reg));
     if (pu32Reg)
@@ -1576,5 +1576,5 @@
     /* note: this is true for ALC885 */
     if (CODEC_NID(cmd) == 0x1 /* AFG */)
-        *pResp = pState->pNodes[1].afg.u32F17_param;
+        *pResp = pState->paNodes[1].afg.u32F17_param;
     return VINF_SUCCESS;
 }
@@ -1593,5 +1593,5 @@
     *pResp = 0;
     if (CODEC_NID(cmd) == 1 /* AFG */)
-        pu32Reg = &pState->pNodes[1].afg.u32F17_param;
+        pu32Reg = &pState->paNodes[1].afg.u32F17_param;
     Assert((pu32Reg));
     if (pu32Reg)
@@ -1612,15 +1612,15 @@
     *pResp = 0;
     if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].port.u32F1c_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].port.u32F1c_param;
     else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digout.u32F1c_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digout.u32F1c_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F1c_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].digin.u32F1c_param;
     else if (codecIsPcbeepNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].pcbeep.u32F1c_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].pcbeep.u32F1c_param;
     else if (codecIsCdNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].cdnode.u32F1c_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].cdnode.u32F1c_param;
     else if (codecIsReservedNode(pState, CODEC_NID(cmd)))
-        *pResp = pState->pNodes[CODEC_NID(cmd)].reserved.u32F1c_param;
+        *pResp = pState->paNodes[CODEC_NID(cmd)].reserved.u32F1c_param;
     return VINF_SUCCESS;
 }
@@ -1636,15 +1636,15 @@
     uint32_t *pu32Reg = NULL;
     if (codecIsPortNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].port.u32F1c_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].port.u32F1c_param;
     else if (codecIsDigInPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digin.u32F1c_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digin.u32F1c_param;
     else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digout.u32F1c_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].digout.u32F1c_param;
     else if (codecIsCdNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].cdnode.u32F1c_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].cdnode.u32F1c_param;
     else if (codecIsPcbeepNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].pcbeep.u32F1c_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].pcbeep.u32F1c_param;
     else if (codecIsReservedNode(pState, CODEC_NID(cmd)))
-        pu32Reg = &pState->pNodes[CODEC_NID(cmd)].reserved.u32F1c_param;
+        pu32Reg = &pState->paNodes[CODEC_NID(cmd)].reserved.u32F1c_param;
     Assert((pu32Reg));
     if (pu32Reg)
@@ -1832,10 +1832,10 @@
     AssertRC(rc);
     /* common root node initializers */
-    pState->pNodes[0].node.au32F00_param[0] = CODEC_MAKE_F00_00(pState->u16VendorId, pState->u16DeviceId);
-    pState->pNodes[0].node.au32F00_param[4] = CODEC_MAKE_F00_04(0x1, 0x1);
+    pState->paNodes[0].node.au32F00_param[0] = CODEC_MAKE_F00_00(pState->u16VendorId, pState->u16DeviceId);
+    pState->paNodes[0].node.au32F00_param[4] = CODEC_MAKE_F00_04(0x1, 0x1);
     /* common AFG node initializers */
-    pState->pNodes[1].node.au32F00_param[4] = CODEC_MAKE_F00_04(0x2, pState->cTotalNodes - 2);
-    pState->pNodes[1].node.au32F00_param[5] = CODEC_MAKE_F00_05(1, CODEC_F00_05_AFG);
-    pState->pNodes[1].afg.u32F20_param = CODEC_MAKE_F20(pState->u16VendorId, pState->u8BSKU, pState->u8AssemblyId);
+    pState->paNodes[1].node.au32F00_param[4] = CODEC_MAKE_F00_04(0x2, pState->cTotalNodes - 2);
+    pState->paNodes[1].node.au32F00_param[5] = CODEC_MAKE_F00_05(1, CODEC_F00_05_AFG);
+    pState->paNodes[1].afg.u32F20_param = CODEC_MAKE_F20(pState->u16VendorId, pState->u8BSKU, pState->u8AssemblyId);
 
     //** @todo r=michaln: Was this meant to be 'HDA' or something like that? (AC'97 was on ICH0)
@@ -1848,19 +1848,19 @@
     as.endianness = 0;
 
-    pState->pNodes[1].node.au32F00_param[0xA] = CODEC_F00_0A_16_BIT;
+    pState->paNodes[1].node.au32F00_param[0xA] = CODEC_F00_0A_16_BIT;
     codecOpenVoice(pState, PI_INDEX, &as);
     codecOpenVoice(pState, PO_INDEX, &as);
-    pState->pNodes[1].node.au32F00_param[0xA] |= CODEC_F00_0A_44_1KHZ;
+    pState->paNodes[1].node.au32F00_param[0xA] |= CODEC_F00_0A_44_1KHZ;
 
     uint8_t i;
-    Assert(pState->pNodes);
+    Assert(pState->paNodes);
     Assert(pState->pfnCodecNodeReset);
     for (i = 0; i < pState->cTotalNodes; ++i)
     {
-        pState->pfnCodecNodeReset(pState, i, &pState->pNodes[i]);
-    }
-
-    codecToAudVolume(&pState->pNodes[pState->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME);
-    codecToAudVolume(&pState->pNodes[pState->u8AdcVolsLineIn].adcvol.B_params, AUD_MIXER_LINE_IN);
+        pState->pfnCodecNodeReset(pState, i, &pState->paNodes[i]);
+    }
+
+    codecToAudVolume(&pState->paNodes[pState->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME);
+    codecToAudVolume(&pState->paNodes[pState->u8AdcVolsLineIn].adcvol.B_params, AUD_MIXER_LINE_IN);
 
     /* If no host voices were created, then fallback to nul audio. */
@@ -1906,5 +1906,6 @@
 int codecDestruct(CODECState *pCodecState)
 {
-    RTMemFree(pCodecState->pNodes);
+    RTMemFree(pCodecState->paNodes);
+    pCodecState->paNodes = NULL;
     return VINF_SUCCESS;
 }
@@ -1916,5 +1917,5 @@
     SSMR3PutU32(pSSM, pCodecState->cTotalNodes);
     for (unsigned idxNode = 0; idxNode < pCodecState->cTotalNodes; ++idxNode)
-        SSMR3PutStructEx(pSSM, &pCodecState->pNodes[idxNode].SavedState, sizeof(pCodecState->pNodes[idxNode].SavedState),
+        SSMR3PutStructEx(pSSM, &pCodecState->paNodes[idxNode].SavedState, sizeof(pCodecState->paNodes[idxNode].SavedState),
                          0 /*fFlags*/, g_aCodecNodeFields, NULL /*pvUser*/);
     return VINF_SUCCESS;
@@ -1961,12 +1962,12 @@
     for (unsigned idxNode = 0; idxNode < pCodecState->cTotalNodes; ++idxNode)
     {
-        uint8_t idOld = pCodecState->pNodes[idxNode].SavedState.Core.id;
-        int rc = SSMR3GetStructEx(pSSM, &pCodecState->pNodes[idxNode].SavedState,
-                                  sizeof(pCodecState->pNodes[idxNode].SavedState),
+        uint8_t idOld = pCodecState->paNodes[idxNode].SavedState.Core.id;
+        int rc = SSMR3GetStructEx(pSSM, &pCodecState->paNodes[idxNode].SavedState,
+                                  sizeof(pCodecState->paNodes[idxNode].SavedState),
                                   fFlags, pFields, NULL);
         if (RT_FAILURE(rc))
             return rc;
-        AssertLogRelMsgReturn(idOld == pCodecState->pNodes[idxNode].SavedState.Core.id,
-                              ("loaded %#x, expected \n", pCodecState->pNodes[idxNode].SavedState.Core.id, idOld),
+        AssertLogRelMsgReturn(idOld == pCodecState->paNodes[idxNode].SavedState.Core.id,
+                              ("loaded %#x, expected \n", pCodecState->paNodes[idxNode].SavedState.Core.id, idOld),
                               VERR_SSM_DATA_UNIT_FORMAT_CHANGED);
     }
@@ -1976,10 +1977,10 @@
      */
     if (codecIsDacNode(pCodecState, pCodecState->u8DacLineOut))
-        codecToAudVolume(&pCodecState->pNodes[pCodecState->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME);
+        codecToAudVolume(&pCodecState->paNodes[pCodecState->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME);
     else if (codecIsSpdifOutNode(pCodecState, pCodecState->u8DacLineOut))
-        codecToAudVolume(&pCodecState->pNodes[pCodecState->u8DacLineOut].spdifout.B_params, AUD_MIXER_VOLUME);
-    codecToAudVolume(&pCodecState->pNodes[pCodecState->u8AdcVolsLineIn].adcvol.B_params, AUD_MIXER_LINE_IN);
-
-    return VINF_SUCCESS;
-}
-
+        codecToAudVolume(&pCodecState->paNodes[pCodecState->u8DacLineOut].spdifout.B_params, AUD_MIXER_VOLUME);
+    codecToAudVolume(&pCodecState->paNodes[pCodecState->u8AdcVolsLineIn].adcvol.B_params, AUD_MIXER_LINE_IN);
+
+    return VINF_SUCCESS;
+}
+
Index: trunk/src/VBox/Devices/Audio/DevCodec.h
===================================================================
--- trunk/src/VBox/Devices/Audio/DevCodec.h	(revision 44637)
+++ trunk/src/VBox/Devices/Audio/DevCodec.h	(revision 44639)
@@ -488,5 +488,5 @@
     PCODECEMU               pCodecBackend;
 #endif
-    PCODECNODE               pNodes;
+    PCODECNODE              paNodes;
     QEMUSoundCard           card;
     /** PCM in */
Index: trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp	(revision 44637)
+++ trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp	(revision 44639)
@@ -437,4 +437,6 @@
 typedef struct INTELHDLinkState
 {
+    /** The PCI device structure. */
+    PCIDevice               PciDev;
     /** Pointer to the device instance. */
     PPDMDEVINSR3            pDevIns;
@@ -469,7 +471,11 @@
     uint64_t                u64BaseTS;
 } INTELHDLinkState, *PINTELHDLinkState;
+/** ICH Intel HD Audio Controller state. */
+typedef INTELHDLinkState HDASTATE;
+/** Pointer to the ICH Intel HD Audio Controller state. */
+typedef HDASTATE *PHDASTATE;
 
 #define ICH6_HDASTATE_2_DEVINS(pINTELHD)   ((pINTELHD)->pDevIns)
-#define PCIDEV_2_ICH6_HDASTATE(pPciDev) ((PCIINTELHDLinkState *)(pPciDev))
+#define PCIDEV_2_ICH6_HDASTATE(pPciDev) ((PHDASTATE)(pPciDev))
 
 #define ISD0FMT_TO_AUDIO_SELECTOR(pState) (AUDIO_FORMAT_SELECTOR(&(pState)->Codec, In,     \
@@ -477,11 +483,4 @@
 #define OSD0FMT_TO_AUDIO_SELECTOR(pState) (AUDIO_FORMAT_SELECTOR(&(pState)->Codec, Out,     \
                 SDFMT_BASE_RATE(pState, 4), SDFMT_MULT(pState, 4), SDFMT_DIV(pState, 4)))
-
-
-typedef struct PCIINTELHDLinkState
-{
-    PCIDevice dev;
-    INTELHDLinkState hda;
-} PCIINTELHDLinkState;
 
 
@@ -1920,11 +1919,11 @@
 PDMBOTHCBDECL(int) hdaMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
-    uint32_t    offReg = GCPhysAddr - pThis->hda.addrMMReg;
-    int         idxReg = hdaMMIORegLookup(&pThis->hda, offReg);
+    PHDASTATE   pThis  = PDMINS_2_DATA(pDevIns, PHDASTATE);
+    uint32_t    offReg = GCPhysAddr - pThis->addrMMReg;
+    int         idxReg = hdaMMIORegLookup(pThis, offReg);
     int         rc;
     Assert(!(offReg & 3)); Assert(cb == 4);
 
-    if (pThis->hda.fInReset && idxReg != ICH6_HDA_REG_GCTL)
+    if (pThis->fInReset && idxReg != ICH6_HDA_REG_GCTL)
         Log(("hda: access to registers except GCTL is blocked while reset\n"));
 
@@ -1934,5 +1933,5 @@
     if (idxReg != -1)
     {
-        rc = g_aIchIntelHDRegMap[idxReg].pfnRead(&pThis->hda, offReg, idxReg, (uint32_t *)pv);
+        rc = g_aIchIntelHDRegMap[idxReg].pfnRead(pThis, offReg, idxReg, (uint32_t *)pv);
         Log(("hda: read %s[%x/%x]\n", g_aIchIntelHDRegMap[idxReg].abbrev, *(uint32_t *)pv));
     }
@@ -1951,11 +1950,11 @@
 PDMBOTHCBDECL(int) hdaMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void const *pv, unsigned cb)
 {
-    PCIINTELHDLinkState    *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
-    uint32_t    offReg = GCPhysAddr - pThis->hda.addrMMReg;
-    int         idxReg = hdaMMIORegLookup(&pThis->hda, offReg);
+    PHDASTATE   pThis  = PDMINS_2_DATA(pDevIns, PHDASTATE);
+    uint32_t    offReg = GCPhysAddr - pThis->addrMMReg;
+    int         idxReg = hdaMMIORegLookup(pThis, offReg);
     int         rc;
     Assert(!(offReg & 3)); Assert(cb == 4);
 
-    if (pThis->hda.fInReset && idxReg != ICH6_HDA_REG_GCTL)
+    if (pThis->fInReset && idxReg != ICH6_HDA_REG_GCTL)
         Log(("hda: access to registers except GCTL is blocked while reset\n"));
 
@@ -1963,9 +1962,9 @@
     {
 #ifdef LOG_ENABLED
-        uint32_t const u32CurValue = pThis->hda.au32Regs[idxReg];
+        uint32_t const u32CurValue = pThis->au32Regs[idxReg];
 #endif
-        rc = g_aIchIntelHDRegMap[idxReg].pfnWrite(&pThis->hda, offReg, idxReg, *(uint32_t const *)pv);
+        rc = g_aIchIntelHDRegMap[idxReg].pfnWrite(pThis, offReg, idxReg, *(uint32_t const *)pv);
         Log(("hda: write %s:(%x) %x => %x\n", g_aIchIntelHDRegMap[idxReg].abbrev, *(uint32_t const *)pv,
-             u32CurValue, pThis->hda.au32Regs[idxReg]));
+             u32CurValue, pThis->au32Regs[idxReg]));
     }
     else
@@ -1985,10 +1984,11 @@
  * @callback_method_impl{FNPCIIOREGIONMAP}
  */
-static DECLCALLBACK(int) hdaMap(PPCIDEVICE pPciDev, int iRegion, RTGCPHYS GCPhysAddress, uint32_t cb, PCIADDRESSSPACE enmType)
+static DECLCALLBACK(int) hdaPciIoRegionMap(PPCIDEVICE pPciDev, int iRegion, RTGCPHYS GCPhysAddress, uint32_t cb,
+                                           PCIADDRESSSPACE enmType)
 {
     int         rc;
     PPDMDEVINS  pDevIns = pPciDev->pDevIns;
     RTIOPORT    Port = (RTIOPORT)GCPhysAddress;
-    PCIINTELHDLinkState *pThis = PCIDEV_2_ICH6_HDASTATE(pPciDev);
+    PHDASTATE pThis = PCIDEV_2_ICH6_HDASTATE(pPciDev);
 
     /* 18.2 of the ICH6 datasheet defines the valid access widths as byte, word, and double word */
@@ -2001,5 +2001,5 @@
         return rc;
 
-    pThis->hda.addrMMReg = GCPhysAddress;
+    pThis->addrMMReg = GCPhysAddress;
     return VINF_SUCCESS;
 }
@@ -2013,17 +2013,17 @@
 static DECLCALLBACK(int) hdaSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
+    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     /* Save Codec nodes states */
-    codecSaveState(&pThis->hda.Codec, pSSM);
+    codecSaveState(&pThis->Codec, pSSM);
 
     /* Save MMIO registers */
-    AssertCompile(RT_ELEMENTS(pThis->hda.au32Regs) == 112);
-    SSMR3PutU32(pSSM, RT_ELEMENTS(pThis->hda.au32Regs));
-    SSMR3PutMem(pSSM, pThis->hda.au32Regs, sizeof(pThis->hda.au32Regs));
+    AssertCompile(RT_ELEMENTS(pThis->au32Regs) == 112);
+    SSMR3PutU32(pSSM, RT_ELEMENTS(pThis->au32Regs));
+    SSMR3PutMem(pSSM, pThis->au32Regs, sizeof(pThis->au32Regs));
 
     /* Save HDA dma counters */
-    SSMR3PutStructEx(pSSM, &pThis->hda.stOutBdle, sizeof(pThis->hda.stOutBdle), 0 /*fFlags*/, g_aHdaBDLEDescFields, NULL);
-    SSMR3PutStructEx(pSSM, &pThis->hda.stMicBdle, sizeof(pThis->hda.stMicBdle), 0 /*fFlags*/, g_aHdaBDLEDescFields, NULL);
-    SSMR3PutStructEx(pSSM, &pThis->hda.stInBdle,  sizeof(pThis->hda.stInBdle),  0 /*fFlags*/, g_aHdaBDLEDescFields, NULL);
+    SSMR3PutStructEx(pSSM, &pThis->stOutBdle, sizeof(pThis->stOutBdle), 0 /*fFlags*/, g_aHdaBDLEDescFields, NULL);
+    SSMR3PutStructEx(pSSM, &pThis->stMicBdle, sizeof(pThis->stMicBdle), 0 /*fFlags*/, g_aHdaBDLEDescFields, NULL);
+    SSMR3PutStructEx(pSSM, &pThis->stInBdle,  sizeof(pThis->stInBdle),  0 /*fFlags*/, g_aHdaBDLEDescFields, NULL);
     return VINF_SUCCESS;
 }
@@ -2035,5 +2035,5 @@
 static DECLCALLBACK(int) hdaLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
+    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
 
     Assert(uPass == SSM_PASS_FINAL); NOREF(uPass);
@@ -2042,5 +2042,5 @@
      * Load Codec nodes states.
      */
-    int rc = codecLoadState(&pThis->hda.Codec, pSSM, uVersion);
+    int rc = codecLoadState(&pThis->Codec, pSSM, uVersion);
     if (RT_FAILURE(rc))
         return rc;
@@ -2070,11 +2070,11 @@
         case HDA_SSM_VERSION_3:
             cRegs = 112;
-            AssertCompile(RT_ELEMENTS(pThis->hda.au32Regs) == 112);
+            AssertCompile(RT_ELEMENTS(pThis->au32Regs) == 112);
             break;
 
         case HDA_SSM_VERSION:
             rc = SSMR3GetU32(pSSM, &cRegs); AssertRCReturn(rc, rc);
-            AssertLogRelMsgReturn(cRegs == RT_ELEMENTS(pThis->hda.au32Regs),
-                                  ("cRegs is %d, expected %d\n", cRegs, RT_ELEMENTS(pThis->hda.au32Regs)),
+            AssertLogRelMsgReturn(cRegs == RT_ELEMENTS(pThis->au32Regs),
+                                  ("cRegs is %d, expected %d\n", cRegs, RT_ELEMENTS(pThis->au32Regs)),
                                   VERR_SSM_DATA_UNIT_FORMAT_CHANGED);
             break;
@@ -2084,13 +2084,13 @@
     }
 
-    if (cRegs >= RT_ELEMENTS(pThis->hda.au32Regs))
-    {
-        SSMR3GetMem(pSSM, pThis->hda.au32Regs, sizeof(pThis->hda.au32Regs));
-        SSMR3Skip(pSSM, sizeof(uint32_t) * (cRegs - RT_ELEMENTS(pThis->hda.au32Regs)));
+    if (cRegs >= RT_ELEMENTS(pThis->au32Regs))
+    {
+        SSMR3GetMem(pSSM, pThis->au32Regs, sizeof(pThis->au32Regs));
+        SSMR3Skip(pSSM, sizeof(uint32_t) * (cRegs - RT_ELEMENTS(pThis->au32Regs)));
     }
     else
     {
-        RT_ZERO(pThis->hda.au32Regs);
-        SSMR3GetMem(pSSM, pThis->hda.au32Regs, sizeof(uint32_t) * cRegs);
+        RT_ZERO(pThis->au32Regs);
+        SSMR3GetMem(pSSM, pThis->au32Regs, sizeof(uint32_t) * cRegs);
     }
 
@@ -2100,7 +2100,7 @@
     uint32_t   fFlags   = uVersion <= HDA_SSM_VERSION_2 ? SSMSTRUCT_FLAGS_MEM_BAND_AID_RELAXED : 0;
     PCSSMFIELD paFields = uVersion <= HDA_SSM_VERSION_2 ? g_aHdaBDLEDescFieldsOld              : g_aHdaBDLEDescFields;
-    SSMR3GetStructEx(pSSM, &pThis->hda.stOutBdle, sizeof(pThis->hda.stOutBdle), fFlags, paFields, NULL);
-    SSMR3GetStructEx(pSSM, &pThis->hda.stMicBdle, sizeof(pThis->hda.stMicBdle), fFlags, paFields, NULL);
-    rc = SSMR3GetStructEx(pSSM, &pThis->hda.stInBdle, sizeof(pThis->hda.stInBdle), fFlags, paFields, NULL);
+    SSMR3GetStructEx(pSSM, &pThis->stOutBdle, sizeof(pThis->stOutBdle), fFlags, paFields, NULL);
+    SSMR3GetStructEx(pSSM, &pThis->stMicBdle, sizeof(pThis->stMicBdle), fFlags, paFields, NULL);
+    rc = SSMR3GetStructEx(pSSM, &pThis->stInBdle, sizeof(pThis->stInBdle), fFlags, paFields, NULL);
     AssertRCReturn(rc, rc);
 
@@ -2108,10 +2108,10 @@
      * Update stuff after the state changes.
      */
-    AUD_set_active_in(pThis->hda.Codec.SwVoiceIn, SDCTL(&pThis->hda, 0) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN));
-    AUD_set_active_out(pThis->hda.Codec.SwVoiceOut, SDCTL(&pThis->hda, 4) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN));
-
-    pThis->hda.u64CORBBase = RT_MAKE_U64(CORBLBASE(&pThis->hda), CORBUBASE(&pThis->hda));
-    pThis->hda.u64RIRBBase = RT_MAKE_U64(RIRLBASE(&pThis->hda), RIRUBASE(&pThis->hda));
-    pThis->hda.u64DPBase   = RT_MAKE_U64(DPLBASE(&pThis->hda), DPUBASE(&pThis->hda));
+    AUD_set_active_in(pThis->Codec.SwVoiceIn, SDCTL(pThis, 0) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN));
+    AUD_set_active_out(pThis->Codec.SwVoiceOut, SDCTL(pThis, 4) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN));
+
+    pThis->u64CORBBase = RT_MAKE_U64(CORBLBASE(pThis), CORBUBASE(pThis));
+    pThis->u64RIRBBase = RT_MAKE_U64(RIRLBASE(pThis), RIRUBASE(pThis));
+    pThis->u64DPBase   = RT_MAKE_U64(DPLBASE(pThis), DPUBASE(pThis));
     return VINF_SUCCESS;
 }
@@ -2234,12 +2234,11 @@
 static DECLCALLBACK(void) hdaInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
-    INTELHDLinkState *hda = &pThis->hda;
-    int iHdaRegisterIndex = hdaLookUpRegisterByName(hda, pszArgs);
+    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
+    int iHdaRegisterIndex = hdaLookUpRegisterByName(pThis, pszArgs);
     if (iHdaRegisterIndex != -1)
-        hdaDbgPrintRegister(hda, pHlp, iHdaRegisterIndex);
+        hdaDbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
     else
         for(iHdaRegisterIndex = 0; (unsigned int)iHdaRegisterIndex < HDA_NREGS; ++iHdaRegisterIndex)
-            hdaDbgPrintRegister(hda, pHlp, iHdaRegisterIndex);
+            hdaDbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
 }
 
@@ -2270,12 +2269,11 @@
 static DECLCALLBACK(void) hdaInfoStream(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
-    INTELHDLinkState *hda = &pThis->hda;
-    int iHdaStrmIndex = hdaLookUpStreamIndex(hda, pszArgs);
+    PHDASTATE   pThis         = PDMINS_2_DATA(pDevIns, PHDASTATE);
+    int         iHdaStrmIndex = hdaLookUpStreamIndex(pThis, pszArgs);
     if (iHdaStrmIndex != -1)
-        hdaDbgPrintStream(hda, pHlp, iHdaStrmIndex);
+        hdaDbgPrintStream(pThis, pHlp, iHdaStrmIndex);
     else
         for(iHdaStrmIndex = 0; iHdaStrmIndex < 7; ++iHdaStrmIndex)
-            hdaDbgPrintStream(hda, pHlp, iHdaStrmIndex);
+            hdaDbgPrintStream(pThis, pHlp, iHdaStrmIndex);
 }
 
@@ -2285,8 +2283,7 @@
 static DECLCALLBACK(void) hdaInfoCodecNodes(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
-    INTELHDLinkState *hda = &pThis->hda;
-    if (hda->Codec.pfnCodecDbgListNodes)
-        hda->Codec.pfnCodecDbgListNodes(&hda->Codec, pHlp, pszArgs);
+    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
+    if (pThis->Codec.pfnCodecDbgListNodes)
+        pThis->Codec.pfnCodecDbgListNodes(&pThis->Codec, pHlp, pszArgs);
     else
         pHlp->pfnPrintf(pHlp, "Codec implementation doesn't provide corresponding callback.\n");
@@ -2299,8 +2296,7 @@
 static DECLCALLBACK(void) hdaInfoCodecSelector(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
-    INTELHDLinkState *hda = &pThis->hda;
-    if (hda->Codec.pfnCodecDbgSelector)
-        hda->Codec.pfnCodecDbgSelector(&hda->Codec, pHlp, pszArgs);
+    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
+    if (pThis->Codec.pfnCodecDbgSelector)
+        pThis->Codec.pfnCodecDbgSelector(&pThis->Codec, pHlp, pszArgs);
     else
         pHlp->pfnPrintf(pHlp, "Codec implementation doesn't provide corresponding callback.\n");
@@ -2315,8 +2311,8 @@
 static DECLCALLBACK(void *) hdaQueryInterface(struct PDMIBASE *pInterface, const char *pszIID)
 {
-    PCIINTELHDLinkState *pThis = RT_FROM_MEMBER(pInterface, PCIINTELHDLinkState, hda.IBase);
-    Assert(&pThis->hda.IBase == pInterface);
-
-    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThis->hda.IBase);
+    PHDASTATE pThis = RT_FROM_MEMBER(pInterface, HDASTATE, IBase);
+    Assert(&pThis->IBase == pInterface);
+
+    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThis->IBase);
     return NULL;
 }
@@ -2336,31 +2332,31 @@
 static DECLCALLBACK(void)  hdaReset(PPDMDEVINS pDevIns)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
-    GCAP(&pThis->hda) = HDA_MAKE_GCAP(4,4,0,0,1); /* see 6.2.1 */
-    VMIN(&pThis->hda) = 0x00;       /* see 6.2.2 */
-    VMAJ(&pThis->hda) = 0x01;       /* see 6.2.3 */
-    VMAJ(&pThis->hda) = 0x01;       /* see 6.2.3 */
-    OUTPAY(&pThis->hda) = 0x003C;   /* see 6.2.4 */
-    INPAY(&pThis->hda)  = 0x001D;   /* see 6.2.5 */
-    pThis->hda.au32Regs[ICH6_HDA_REG_CORBSIZE] = 0x42; /* see 6.2.1 */
-    pThis->hda.au32Regs[ICH6_HDA_REG_RIRBSIZE] = 0x42; /* see 6.2.1 */
-    CORBRP(&pThis->hda) = 0x0;
-    RIRBWP(&pThis->hda) = 0x0;
+    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
+    GCAP(pThis) = HDA_MAKE_GCAP(4,4,0,0,1); /* see 6.2.1 */
+    VMIN(pThis) = 0x00;       /* see 6.2.2 */
+    VMAJ(pThis) = 0x01;       /* see 6.2.3 */
+    VMAJ(pThis) = 0x01;       /* see 6.2.3 */
+    OUTPAY(pThis) = 0x003C;   /* see 6.2.4 */
+    INPAY(pThis)  = 0x001D;   /* see 6.2.5 */
+    pThis->au32Regs[ICH6_HDA_REG_CORBSIZE] = 0x42; /* see 6.2.1 */
+    pThis->au32Regs[ICH6_HDA_REG_RIRBSIZE] = 0x42; /* see 6.2.1 */
+    CORBRP(pThis) = 0x0;
+    RIRBWP(pThis) = 0x0;
 
     Log(("hda: inter HDA reset.\n"));
-    pThis->hda.cbCorbBuf = 256 * sizeof(uint32_t);
-
-    if (pThis->hda.pu32CorbBuf)
-        memset(pThis->hda.pu32CorbBuf, 0, pThis->hda.cbCorbBuf);
+    pThis->cbCorbBuf = 256 * sizeof(uint32_t);
+
+    if (pThis->pu32CorbBuf)
+        memset(pThis->pu32CorbBuf, 0, pThis->cbCorbBuf);
     else
-        pThis->hda.pu32CorbBuf = (uint32_t *)RTMemAllocZ(pThis->hda.cbCorbBuf);
-
-    pThis->hda.cbRirbBuf = 256 * sizeof(uint64_t);
-    if (pThis->hda.pu64RirbBuf)
-        memset(pThis->hda.pu64RirbBuf, 0, pThis->hda.cbRirbBuf);
+        pThis->pu32CorbBuf = (uint32_t *)RTMemAllocZ(pThis->cbCorbBuf);
+
+    pThis->cbRirbBuf = 256 * sizeof(uint64_t);
+    if (pThis->pu64RirbBuf)
+        memset(pThis->pu64RirbBuf, 0, pThis->cbRirbBuf);
     else
-        pThis->hda.pu64RirbBuf = (uint64_t *)RTMemAllocZ(pThis->hda.cbRirbBuf);
-
-    pThis->hda.u64BaseTS = PDMDevHlpTMTimeVirtGetNano(pDevIns);
+        pThis->pu64RirbBuf = (uint64_t *)RTMemAllocZ(pThis->cbRirbBuf);
+
+    pThis->u64BaseTS = PDMDevHlpTMTimeVirtGetNano(pDevIns);
 
     HDABDLEDESC stEmptyBdle;
@@ -2370,7 +2366,7 @@
         PHDABDLEDESC pBdle = NULL;
         if (u8Strm == 0)
-            pBdle = &pThis->hda.stInBdle;
+            pBdle = &pThis->stInBdle;
         else if(u8Strm == 4)
-            pBdle = &pThis->hda.stOutBdle;
+            pBdle = &pThis->stOutBdle;
         else
         {
@@ -2378,12 +2374,12 @@
             pBdle = &stEmptyBdle;
         }
-        hdaInitTransferDescriptor(&pThis->hda, pBdle, u8Strm, &StreamDesc);
+        hdaInitTransferDescriptor(pThis, pBdle, u8Strm, &StreamDesc);
         /* hdaStreamReset prevents changing the SRST bit, so we force it to zero here. */
-        HDA_STREAM_REG2(&pThis->hda, CTL, u8Strm) = 0;
-        hdaStreamReset(&pThis->hda, pBdle, &StreamDesc, u8Strm);
+        HDA_STREAM_REG2(pThis, CTL, u8Strm) = 0;
+        hdaStreamReset(pThis, pBdle, &StreamDesc, u8Strm);
     }
 
     /* emulation of codec "wake up" (HDA spec 5.5.1 and 6.5)*/
-    STATESTS(&pThis->hda) = 0x1;
+    STATESTS(pThis) = 0x1;
 
     Log(("hda: reset finished\n"));
@@ -2396,12 +2392,15 @@
 static DECLCALLBACK(int) hdaDestruct(PPDMDEVINS pDevIns)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
-
-    int rc = codecDestruct(&pThis->hda.Codec);
+    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
+
+    int rc = codecDestruct(&pThis->Codec);
     AssertRC(rc);
-    if (pThis->hda.pu32CorbBuf)
-        RTMemFree(pThis->hda.pu32CorbBuf);
-    if (pThis->hda.pu64RirbBuf)
-        RTMemFree(pThis->hda.pu64RirbBuf);
+
+    RTMemFree(pThis->pu32CorbBuf);
+    pThis->pu32CorbBuf = NULL;
+
+    RTMemFree(pThis->pu64RirbBuf);
+    pThis->pu64RirbBuf = NULL;
+
     return VINF_SUCCESS;
 }
@@ -2412,7 +2411,6 @@
 static DECLCALLBACK(int) hdaConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfgHandle)
 {
-    PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *);
-    INTELHDLinkState    *s     = &pThis->hda;
-    int               rc;
+    PHDASTATE   pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
+    int         rc;
 
     Assert(iInstance == 0);
@@ -2427,35 +2425,35 @@
 
     // ** @todo r=michaln: This device may need R0/RC enabling, especially if guests
-    // poll some register(s).
+    // poll some register(pThis).
 
     /*
      * Initialize data (most of it anyway).
      */
-    s->pDevIns                  = pDevIns;
+    pThis->pDevIns                  = pDevIns;
     /* IBase */
-    s->IBase.pfnQueryInterface  = hdaQueryInterface;
+    pThis->IBase.pfnQueryInterface  = hdaQueryInterface;
 
     /* PCI Device */
-    PCIDevSetVendorId           (&pThis->dev, HDA_PCI_VENDOR_ID); /* nVidia */
-    PCIDevSetDeviceId           (&pThis->dev, HDA_PCI_DEICE_ID); /* HDA */
-
-    PCIDevSetCommand            (&pThis->dev, 0x0000); /* 04 rw,ro - pcicmd. */
-    PCIDevSetStatus             (&pThis->dev, VBOX_PCI_STATUS_CAP_LIST); /* 06 rwc?,ro? - pcists. */
-    PCIDevSetRevisionId         (&pThis->dev, 0x01);   /* 08 ro - rid. */
-    PCIDevSetClassProg          (&pThis->dev, 0x00);   /* 09 ro - pi. */
-    PCIDevSetClassSub           (&pThis->dev, 0x03);   /* 0a ro - scc; 03 == HDA. */
-    PCIDevSetClassBase          (&pThis->dev, 0x04);   /* 0b ro - bcc; 04 == multimedia. */
-    PCIDevSetHeaderType         (&pThis->dev, 0x00);   /* 0e ro - headtyp. */
-    PCIDevSetBaseAddress        (&pThis->dev, 0,       /* 10 rw - MMIO */
+    PCIDevSetVendorId           (&pThis->PciDev, HDA_PCI_VENDOR_ID); /* nVidia */
+    PCIDevSetDeviceId           (&pThis->PciDev, HDA_PCI_DEICE_ID); /* HDA */
+
+    PCIDevSetCommand            (&pThis->PciDev, 0x0000); /* 04 rw,ro - pcicmd. */
+    PCIDevSetStatus             (&pThis->PciDev, VBOX_PCI_STATUS_CAP_LIST); /* 06 rwc?,ro? - pcists. */
+    PCIDevSetRevisionId         (&pThis->PciDev, 0x01);   /* 08 ro - rid. */
+    PCIDevSetClassProg          (&pThis->PciDev, 0x00);   /* 09 ro - pi. */
+    PCIDevSetClassSub           (&pThis->PciDev, 0x03);   /* 0a ro - scc; 03 == HDA. */
+    PCIDevSetClassBase          (&pThis->PciDev, 0x04);   /* 0b ro - bcc; 04 == multimedia. */
+    PCIDevSetHeaderType         (&pThis->PciDev, 0x00);   /* 0e ro - headtyp. */
+    PCIDevSetBaseAddress        (&pThis->PciDev, 0,       /* 10 rw - MMIO */
                                  false /* fIoSpace */, false /* fPrefetchable */, true /* f64Bit */, 0x00000000);
-    PCIDevSetInterruptLine      (&pThis->dev, 0x00);   /* 3c rw. */
-    PCIDevSetInterruptPin       (&pThis->dev, 0x01);   /* 3d ro - INTA#. */
+    PCIDevSetInterruptLine      (&pThis->PciDev, 0x00);   /* 3c rw. */
+    PCIDevSetInterruptPin       (&pThis->PciDev, 0x01);   /* 3d ro - INTA#. */
 
 #if defined(HDA_AS_PCI_EXPRESS)
-    PCIDevSetCapabilityList     (&pThis->dev, 0x80);
+    PCIDevSetCapabilityList     (&pThis->PciDev, 0x80);
 #elif defined(VBOX_WITH_MSI_DEVICES)
-    PCIDevSetCapabilityList     (&pThis->dev, 0x60);
+    PCIDevSetCapabilityList     (&pThis->PciDev, 0x60);
 #else
-    PCIDevSetCapabilityList     (&pThis->dev, 0x50);   /* ICH6 datasheet 18.1.16 */
+    PCIDevSetCapabilityList     (&pThis->PciDev, 0x50);   /* ICH6 datasheet 18.1.16 */
 #endif
 
@@ -2463,52 +2461,52 @@
     /// of these values needs to be properly documented!
     /* HDCTL off 0x40 bit 0 selects signaling mode (1-HDA, 0 - Ac97) 18.1.19 */
-    PCIDevSetByte(&pThis->dev, 0x40, 0x01);
+    PCIDevSetByte(&pThis->PciDev, 0x40, 0x01);
 
     /* Power Management */
-    PCIDevSetByte(&pThis->dev, 0x50 + 0, VBOX_PCI_CAP_ID_PM);
-    PCIDevSetByte(&pThis->dev, 0x50 + 1, 0x0); /* next */
-    PCIDevSetWord(&pThis->dev, 0x50 + 2, VBOX_PCI_PM_CAP_DSI | 0x02 /* version, PM1.1 */ );
+    PCIDevSetByte(&pThis->PciDev, 0x50 + 0, VBOX_PCI_CAP_ID_PM);
+    PCIDevSetByte(&pThis->PciDev, 0x50 + 1, 0x0); /* next */
+    PCIDevSetWord(&pThis->PciDev, 0x50 + 2, VBOX_PCI_PM_CAP_DSI | 0x02 /* version, PM1.1 */ );
 
 #ifdef HDA_AS_PCI_EXPRESS
     /* PCI Express */
-    PCIDevSetByte(&pThis->dev, 0x80 + 0, VBOX_PCI_CAP_ID_EXP); /* PCI_Express */
-    PCIDevSetByte(&pThis->dev, 0x80 + 1, 0x60); /* next */
+    PCIDevSetByte(&pThis->PciDev, 0x80 + 0, VBOX_PCI_CAP_ID_EXP); /* PCI_Express */
+    PCIDevSetByte(&pThis->PciDev, 0x80 + 1, 0x60); /* next */
     /* Device flags */
-    PCIDevSetWord(&pThis->dev, 0x80 + 2,
+    PCIDevSetWord(&pThis->PciDev, 0x80 + 2,
                    /* version */ 0x1     |
                    /* Root Complex Integrated Endpoint */ (VBOX_PCI_EXP_TYPE_ROOT_INT_EP << 4) |
                    /* MSI */ (100) << 9 );
     /* Device capabilities */
-    PCIDevSetDWord(&pThis->dev, 0x80 + 4, VBOX_PCI_EXP_DEVCAP_FLRESET);
+    PCIDevSetDWord(&pThis->PciDev, 0x80 + 4, VBOX_PCI_EXP_DEVCAP_FLRESET);
     /* Device control */
-    PCIDevSetWord( &pThis->dev, 0x80 + 8, 0);
+    PCIDevSetWord( &pThis->PciDev, 0x80 + 8, 0);
     /* Device status */
-    PCIDevSetWord( &pThis->dev, 0x80 + 10, 0);
+    PCIDevSetWord( &pThis->PciDev, 0x80 + 10, 0);
     /* Link caps */
-    PCIDevSetDWord(&pThis->dev, 0x80 + 12, 0);
+    PCIDevSetDWord(&pThis->PciDev, 0x80 + 12, 0);
     /* Link control */
-    PCIDevSetWord( &pThis->dev, 0x80 + 16, 0);
+    PCIDevSetWord( &pThis->PciDev, 0x80 + 16, 0);
     /* Link status */
-    PCIDevSetWord( &pThis->dev, 0x80 + 18, 0);
+    PCIDevSetWord( &pThis->PciDev, 0x80 + 18, 0);
     /* Slot capabilities */
-    PCIDevSetDWord(&pThis->dev, 0x80 + 20, 0);
+    PCIDevSetDWord(&pThis->PciDev, 0x80 + 20, 0);
     /* Slot control */
-    PCIDevSetWord( &pThis->dev, 0x80 + 24, 0);
+    PCIDevSetWord( &pThis->PciDev, 0x80 + 24, 0);
     /* Slot status */
-    PCIDevSetWord( &pThis->dev, 0x80 + 26, 0);
+    PCIDevSetWord( &pThis->PciDev, 0x80 + 26, 0);
     /* Root control */
-    PCIDevSetWord( &pThis->dev, 0x80 + 28, 0);
+    PCIDevSetWord( &pThis->PciDev, 0x80 + 28, 0);
     /* Root capabilities */
-    PCIDevSetWord( &pThis->dev, 0x80 + 30, 0);
+    PCIDevSetWord( &pThis->PciDev, 0x80 + 30, 0);
     /* Root status */
-    PCIDevSetDWord(&pThis->dev, 0x80 + 32, 0);
+    PCIDevSetDWord(&pThis->PciDev, 0x80 + 32, 0);
     /* Device capabilities 2 */
-    PCIDevSetDWord(&pThis->dev, 0x80 + 36, 0);
+    PCIDevSetDWord(&pThis->PciDev, 0x80 + 36, 0);
     /* Device control 2 */
-    PCIDevSetQWord(&pThis->dev, 0x80 + 40, 0);
+    PCIDevSetQWord(&pThis->PciDev, 0x80 + 40, 0);
     /* Link control 2 */
-    PCIDevSetQWord(&pThis->dev, 0x80 + 48, 0);
+    PCIDevSetQWord(&pThis->PciDev, 0x80 + 48, 0);
     /* Slot control 2 */
-    PCIDevSetWord( &pThis->dev, 0x80 + 56, 0);
+    PCIDevSetWord( &pThis->PciDev, 0x80 + 56, 0);
 #endif
 
@@ -2516,9 +2514,9 @@
      * Register the PCI device.
      */
-    rc = PDMDevHlpPCIRegister(pDevIns, &pThis->dev);
+    rc = PDMDevHlpPCIRegister(pDevIns, &pThis->PciDev);
     if (RT_FAILURE(rc))
         return rc;
 
-    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaMap);
+    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaPciIoRegionMap);
     if (RT_FAILURE(rc))
         return rc;
@@ -2534,5 +2532,5 @@
     {
         LogRel(("Chipset cannot do MSI: %Rrc\n", rc));
-        PCIDevSetCapabilityList(&pThis->dev, 0x50);
+        PCIDevSetCapabilityList(&pThis->PciDev, 0x50);
     }
 #endif
@@ -2545,5 +2543,5 @@
      * Attach driver.
      */
-    rc = PDMDevHlpDriverAttach(pDevIns, 0, &s->IBase, &s->pDrvBase, "Audio Driver Port");
+    rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->IBase, &pThis->pDrvBase, "Audio Driver Port");
     if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
         Log(("hda: No attached driver!\n"));
@@ -2554,8 +2552,6 @@
     }
 
-
-
-    pThis->hda.Codec.pvHDAState = (void *)&pThis->hda;
-    rc = codecConstruct(pDevIns, &pThis->hda.Codec, pCfgHandle);
+    pThis->Codec.pvHDAState = pThis;
+    rc = codecConstruct(pDevIns, &pThis->Codec, pCfgHandle);
     if (RT_FAILURE(rc))
         AssertRCReturn(rc, rc);
@@ -2563,13 +2559,13 @@
     /* ICH6 datasheet defines 0 values for SVID and SID (18.1.14-15), which together with values returned for
        verb F20 should provide device/codec recognition. */
-    Assert(pThis->hda.Codec.u16VendorId);
-    Assert(pThis->hda.Codec.u16DeviceId);
-    PCIDevSetSubSystemVendorId  (&pThis->dev, pThis->hda.Codec.u16VendorId); /* 2c ro - intel.) */
-    PCIDevSetSubSystemId        (&pThis->dev, pThis->hda.Codec.u16DeviceId); /* 2e ro. */
+    Assert(pThis->Codec.u16VendorId);
+    Assert(pThis->Codec.u16DeviceId);
+    PCIDevSetSubSystemVendorId(&pThis->PciDev, pThis->Codec.u16VendorId); /* 2c ro - intel.) */
+    PCIDevSetSubSystemId(      &pThis->PciDev, pThis->Codec.u16DeviceId); /* 2e ro. */
 
     hdaReset(pDevIns);
-    pThis->hda.Codec.id = 0;
-    pThis->hda.Codec.pfnTransfer = hdaTransfer;
-    pThis->hda.Codec.pfnReset = hdaCodecReset;
+    pThis->Codec.id = 0;
+    pThis->Codec.pfnTransfer = hdaTransfer;
+    pThis->Codec.pfnReset = hdaCodecReset;
 
     /*
@@ -2577,6 +2573,6 @@
      * hdaReset shouldn't affects these registers.
      */
-    WAKEEN(&pThis->hda) = 0x0;
-    STATESTS(&pThis->hda) = 0x0;
+    WAKEEN(pThis) = 0x0;
+    STATESTS(pThis) = 0x0;
 
     /*
@@ -2626,5 +2622,5 @@
     1,
     /* cbInstance */
-    sizeof(PCIINTELHDLinkState),
+    sizeof(HDASTATE),
     /* pfnConstruct */
     hdaConstruct,
