third_party/virtualbox/src/VBox/Devices/Network/DevE1000.cpp
/**
 * Dump transmit descriptor to debug log.
 *
 * @param   pThis       The device state structure.
 * @param   pDesc       Pointer to descriptor union.
 * @param   pszDir      A string denoting direction of descriptor transfer
 * @thread  E1000_TX
 */
Dump transmit descriptor to debug log.
@param   pThis       The device state structure.
@param   pDesc       Pointer to descriptor union.
@param   pszDir      A string denoting direction of descriptor transfer
@thread  E1000_TX
Dump transmit descriptor to debug log . @param pThis The device state structure . @param pDesc Pointer to descriptor union . @param pszDir A string denoting direction of descriptor transfer @thread E1000_TX
static void e1kPrintTDesc(PE1KSTATE pThis, E1KTXDESC *pDesc, const char *pszDir,
                          unsigned uLevel = RTLOGGRPFLAGS_LEVEL_2)
{
    RT_NOREF4(pThis, pDesc, pszDir, uLevel);
    switch (e1kGetDescType(pDesc))
    {
        case E1K_DTYP_CONTEXT:
            E1kLogX(uLevel, ("%s %s Context Transmit Descriptor %s\n",
                    pThis->szPrf, pszDir, pszDir));
            E1kLogX(uLevel, ("        IPCSS=%02X IPCSO=%02X IPCSE=%04X TUCSS=%02X TUCSO=%02X TUCSE=%04X\n",
                    pDesc->context.ip.u8CSS, pDesc->context.ip.u8CSO, pDesc->context.ip.u16CSE,
                    pDesc->context.tu.u8CSS, pDesc->context.tu.u8CSO, pDesc->context.tu.u16CSE));
            E1kLogX(uLevel, ("        TUCMD:%s%s%s %s %s PAYLEN=%04x HDRLEN=%04x MSS=%04x STA: %s\n",
                    pDesc->context.dw2.fIDE ? " IDE":"",
                    pDesc->context.dw2.fRS  ? " RS" :"",
                    pDesc->context.dw2.fTSE ? " TSE":"",
                    pDesc->context.dw2.fIP  ? "IPv4":"IPv6",
                    pDesc->context.dw2.fTCP ?  "TCP":"UDP",
                    pDesc->context.dw2.u20PAYLEN,
                    pDesc->context.dw3.u8HDRLEN,
                    pDesc->context.dw3.u16MSS,
                    pDesc->context.dw3.fDD?"DD":""));
            break;
        case E1K_DTYP_DATA:
            E1kLogX(uLevel, ("%s %s Data Transmit Descriptor (%d bytes) %s\n",
                    pThis->szPrf, pszDir, pDesc->data.cmd.u20DTALEN, pszDir));
            E1kLogX(uLevel, ("        Address=%16LX DTALEN=%05X\n",
                    pDesc->data.u64BufAddr,
                    pDesc->data.cmd.u20DTALEN));
            E1kLogX(uLevel, ("        DCMD:%s%s%s%s%s%s%s STA:%s%s%s POPTS:%s%s SPECIAL:%s VLAN=%03x PRI=%x\n",
                    pDesc->data.cmd.fIDE ? " IDE" :"",
                    pDesc->data.cmd.fVLE ? " VLE" :"",
                    pDesc->data.cmd.fRPS ? " RPS" :"",
                    pDesc->data.cmd.fRS  ? " RS"  :"",
                    pDesc->data.cmd.fTSE ? " TSE" :"",
                    pDesc->data.cmd.fIFCS? " IFCS":"",
                    pDesc->data.cmd.fEOP ? " EOP" :"",
                    pDesc->data.dw3.fDD  ? " DD"  :"",
                    pDesc->data.dw3.fEC  ? " EC"  :"",
                    pDesc->data.dw3.fLC  ? " LC"  :"",
                    pDesc->data.dw3.fTXSM? " TXSM":"",
                    pDesc->data.dw3.fIXSM? " IXSM":"",
                    E1K_SPEC_CFI(pDesc->data.dw3.u16Special) ? "CFI" :"cfi",
                    E1K_SPEC_VLAN(pDesc->data.dw3.u16Special),
                    E1K_SPEC_PRI(pDesc->data.dw3.u16Special)));
            break;
        case E1K_DTYP_LEGACY:
            E1kLogX(uLevel, ("%s %s Legacy Transmit Descriptor (%d bytes) %s\n",
                    pThis->szPrf, pszDir, pDesc->legacy.cmd.u16Length, pszDir));
            E1kLogX(uLevel, ("        Address=%16LX DTALEN=%05X\n",
                    pDesc->data.u64BufAddr,
                    pDesc->legacy.cmd.u16Length));
            E1kLogX(uLevel, ("        CMD:%s%s%s%s%s%s%s STA:%s%s%s CSO=%02x CSS=%02x SPECIAL:%s VLAN=%03x PRI=%x\n",
                    pDesc->legacy.cmd.fIDE ? " IDE" :"",
                    pDesc->legacy.cmd.fVLE ? " VLE" :"",
                    pDesc->legacy.cmd.fRPS ? " RPS" :"",
                    pDesc->legacy.cmd.fRS  ? " RS"  :"",
                    pDesc->legacy.cmd.fIC  ? " IC"  :"",
                    pDesc->legacy.cmd.fIFCS? " IFCS":"",
                    pDesc->legacy.cmd.fEOP ? " EOP" :"",
                    pDesc->legacy.dw3.fDD  ? " DD"  :"",
                    pDesc->legacy.dw3.fEC  ? " EC"  :"",
                    pDesc->legacy.dw3.fLC  ? " LC"  :"",
                    pDesc->legacy.cmd.u8CSO,
                    pDesc->legacy.dw3.u8CSS,
                    E1K_SPEC_CFI(pDesc->legacy.dw3.u16Special) ? "CFI" :"cfi",
                    E1K_SPEC_VLAN(pDesc->legacy.dw3.u16Special),
                    E1K_SPEC_PRI(pDesc->legacy.dw3.u16Special)));
            break;
        default:
            E1kLog(("%s %s Invalid Transmit Descriptor %s\n",
                    pThis->szPrf, pszDir, pszDir));
            break;
    }
}
static void e1kPrintTDesc ( PE1KSTATE pThis , E1KTXDESC * pDesc , const char * pszDir , unsigned uLevel = RTLOGGRPFLAGS_LEVEL_2 ) { RT_NOREF4 ( pThis , pDesc , pszDir , uLevel ) ; switch ( e1kGetDescType ( pDesc ) ) { case E1K_DTYP_CONTEXT : E1kLogX ( uLevel , ( " \n " , pThis -> szPrf , pszDir , pszDir ) ) ; E1kLogX ( uLevel , ( " \n " , pDesc -> context . ip . u8CSS , pDesc -> context . ip . u8CSO , pDesc -> context . ip . u16CSE , pDesc -> context . tu . u8CSS , pDesc -> context . tu . u8CSO , pDesc -> context . tu . u16CSE ) ) ; E1kLogX ( uLevel , ( " \n " , pDesc -> context . dw2 . fIDE ? " " : " " , pDesc -> context . dw2 . fRS ? " " : " " , pDesc -> context . dw2 . fTSE ? " " : " " , pDesc -> context . dw2 . fIP ? " " : " " , pDesc -> context . dw2 . fTCP ? " " : " " , pDesc -> context . dw2 . u20PAYLEN , pDesc -> context . dw3 . u8HDRLEN , pDesc -> context . dw3 . u16MSS , pDesc -> context . dw3 . fDD ? " " : " " ) ) ; break ; case E1K_DTYP_DATA : E1kLogX ( uLevel , ( " \n " , pThis -> szPrf , pszDir , pDesc -> data . cmd . u20DTALEN , pszDir ) ) ; E1kLogX ( uLevel , ( " \n " , pDesc -> data . u64BufAddr , pDesc -> data . cmd . u20DTALEN ) ) ; E1kLogX ( uLevel , ( " \n " , pDesc -> data . cmd . fIDE ? " " : " " , pDesc -> data . cmd . fVLE ? " " : " " , pDesc -> data . cmd . fRPS ? " " : " " , pDesc -> data . cmd . fRS ? " " : " " , pDesc -> data . cmd . fTSE ? " " : " " , pDesc -> data . cmd . fIFCS ? " " : " " , pDesc -> data . cmd . fEOP ? " " : " " , pDesc -> data . dw3 . fDD ? " " : " " , pDesc -> data . dw3 . fEC ? " " : " " , pDesc -> data . dw3 . fLC ? " " : " " , pDesc -> data . dw3 . fTXSM ? " " : " " , pDesc -> data . dw3 . fIXSM ? " " : " " , E1K_SPEC_CFI ( pDesc -> data . dw3 . u16Special ) ? " " : " " , E1K_SPEC_VLAN ( pDesc -> data . dw3 . u16Special ) , E1K_SPEC_PRI ( pDesc -> data . dw3 . u16Special ) ) ) ; break ; case E1K_DTYP_LEGACY : E1kLogX ( uLevel , ( " \n " , pThis -> szPrf , pszDir , pDesc -> legacy . cmd . u16Length , pszDir ) ) ; E1kLogX ( uLevel , ( " \n " , pDesc -> data . u64BufAddr , pDesc -> legacy . cmd . u16Length ) ) ; E1kLogX ( uLevel , ( " \n " , pDesc -> legacy . cmd . fIDE ? " " : " " , pDesc -> legacy . cmd . fVLE ? " " : " " , pDesc -> legacy . cmd . fRPS ? " " : " " , pDesc -> legacy . cmd . fRS ? " " : " " , pDesc -> legacy . cmd . fIC ? " " : " " , pDesc -> legacy . cmd . fIFCS ? " " : " " , pDesc -> legacy . cmd . fEOP ? " " : " " , pDesc -> legacy . dw3 . fDD ? " " : " " , pDesc -> legacy . dw3 . fEC ? " " : " " , pDesc -> legacy . dw3 . fLC ? " " : " " , pDesc -> legacy . cmd . u8CSO , pDesc -> legacy . dw3 . u8CSS , E1K_SPEC_CFI ( pDesc -> legacy . dw3 . u16Special ) ? " " : " " , E1K_SPEC_VLAN ( pDesc -> legacy . dw3 . u16Special ) , E1K_SPEC_PRI ( pDesc -> legacy . dw3 . u16Special ) ) ) ; break ; default : E1kLog ( ( " \n " , pThis -> szPrf , pszDir , pszDir ) ) ; break ; } }
Dump transmit descriptor to debug log.
Dump transmit descriptor to debug log .
/*
     * Unfortunately we cannot use our format handler here, we want R0 logging
     * as well.
     */