VirtualBox

Changeset 64925 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Dec 16, 2016 7:28:31 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112338
Message:

Dev/E1000: (bugref:8624) Bring the link up in 2 seconds, PHY soft reset implemented partially.

Location:
trunk/src/VBox/Devices/Network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r64836 r64925  
    7070 * in init (see @bugref{8624}).
    7171 */
    72 //#define E1K_INIT_LINKUP_DELAY (500 * 1000)
     72#define E1K_INIT_LINKUP_DELAY_US (2000 * 1000)
    7373/** @def E1K_IMS_INT_DELAY_NS
    7474 * E1K_IMS_INT_DELAY_NS prevents interrupt storms in Windows guests on enabling
     
    26782678            && !(STATUS & STATUS_LU))
    26792679        {
    2680 #ifdef E1K_INIT_LINKUP_DELAY
    2681             /*
    2682              * The driver indicates that we should bring up the link. Our default 5-second delay is too long,
    2683              * as Linux guests detect Tx hang after 2 seconds. Let's use 500 ms delay instead. */
    2684             e1kArmTimer(pThis, pThis->CTX_SUFF(pLUTimer), E1K_INIT_LINKUP_DELAY);
    2685 #else /* !E1K_INIT_LINKUP_DELAY */
    2686             /* Bring up the link immediately, no need for an interrupt though. */
    2687             STATUS |= STATUS_LU;
    2688             Phy::setLinkStatus(&pThis->phy, true);
    2689 #endif /* !E1K_INIT_LINKUP_DELAY */
     2680            /* It should take about 2 seconds for the link to come up */
     2681            e1kArmTimer(pThis, pThis->CTX_SUFF(pLUTimer), E1K_INIT_LINKUP_DELAY_US);
    26902682        }
    26912683        if (value & CTRL_VME)
  • trunk/src/VBox/Devices/Network/DevE1000Phy.cpp

    r63369 r64925  
    320320    REG(PCTRL) = PCTRL_SPDSELM | PCTRL_DUPMOD | PCTRL_ANEG;
    321321    /*
    322      * 100 and 10 FD/HD, MF Preamble Suppression, Auto-Negotiation Complete,
     322     * 100 and 10 FD/HD, Extended Status, MF Preamble Suppression,
    323323     * AUTO NEG AB, EXT CAP
    324324     */
    325     REG(PSTATUS)  = (REG(PSTATUS) & ~PSTATUS_LNKSTAT) | 0x7969;
     325    REG(PSTATUS)  = 0x7949;
    326326    REG(ANA)      = 0x01E1;
    327327    /* No flow control by our link partner, all speeds */
     
    351351static void Phy::softReset(PPHY pPhy)
    352352{
    353     RT_NOREF1(pPhy);
    354     PhyLog(("PHY#%d Soft reset is not yet implemented!\n", pPhy->iInstance));
     353    PhyLog(("PHY#%d Soft reset\n", pPhy->iInstance));
     354    /*
     355     * 100 and 10 FD/HD, Extended Status, MF Preamble Suppression,
     356     * AUTO NEG AB, EXT CAP
     357     */
     358    REG(PSTATUS)  = 0x7949;
     359    REG(PSSTAT)   = 0x0000;
     360    PhyLog(("PHY#%d PSTATUS=%04x PSSTAT=%04x\n", pPhy->iInstance, REG(PSTATUS), REG(PSSTAT)));
     361    PhyLog(("PHY#%d Soft reset is not yet fully implemented!\n", pPhy->iInstance));
    355362}
    356363
     
    376383{
    377384    if (fLinkIsUp)
     385    {
    378386        REG(PSSTAT)  |= PSSTAT_LINK;
     387        REG(PSTATUS) |= PSTATUS_NEGCOMP;
     388    }
    379389    else
    380390    {
     
    382392        REG(PSTATUS) &= ~PSTATUS_LNKSTAT;
    383393    }
     394    PhyLog(("PHY#%d setLinkStatus: PSTATUS=%04x PSSTAT=%04x\n", pPhy->iInstance, REG(PSTATUS), REG(PSSTAT)));
    384395}
    385396
  • trunk/src/VBox/Devices/Network/DevE1000Phy.h

    r62511 r64925  
    2828
    2929#define PSTATUS_LNKSTAT 0x0004
     30#define PSTATUS_NEGCOMP 0x0020
    3031
    3132/*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette