Changeset 64966 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Dec 20, 2016 11:38:55 AM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r64925 r64966 2643 2643 2644 2644 /** 2645 * A callback used by PHY to indicate that the link needs to be updated due to 2646 * reset of PHY. 2647 * 2648 * @param pPhy A pointer to phy member of the device state structure. 2649 * @thread any 2650 */ 2651 void e1kPhyLinkResetCallback(PPHY pPhy) 2652 { 2653 /* PHY is aggregated into e1000, get pThis from pPhy. */ 2654 PE1KSTATE pThis = RT_FROM_MEMBER(pPhy, E1KSTATE, phy); 2655 /* Make sure we have cable connected and MAC can talk to PHY */ 2656 if (pThis->fCableConnected && (CTRL & CTRL_SLU)) 2657 e1kArmTimer(pThis, pThis->CTX_SUFF(pLUTimer), E1K_INIT_LINKUP_DELAY_US); 2658 } 2659 2660 /** 2645 2661 * Write handler for Device Control register. 2646 2662 * … … 7649 7665 /* Initialize internal PHY. */ 7650 7666 Phy::init(&pThis->phy, iInstance, pThis->eChip == E1K_CHIP_82543GC ? PHY_EPID_M881000 : PHY_EPID_M881011); 7651 Phy::setLinkStatus(&pThis->phy, pThis->fCableConnected);7652 7667 7653 7668 /* Initialize critical sections. We do our own locking. */ -
trunk/src/VBox/Devices/Network/DevE1000Phy.cpp
r64925 r64966 47 47 48 48 #define REG(x) pPhy->au16Regs[x##_IDX] 49 50 51 /* External callback declaration */ 52 void e1kPhyLinkResetCallback(PPHY pPhy); 49 53 50 54 … … 300 304 { 301 305 pPhy->iInstance = iNICInstance; 302 /* Make sure the link is down */303 REG(PSTATUS) = 0;304 306 /* The PHY identifier composed of bits 3 through 18 of the OUI */ 305 307 /* (Organizationally Unique Identifier). OUI is 0x05043. */ … … 352 354 { 353 355 PhyLog(("PHY#%d Soft reset\n", pPhy->iInstance)); 356 357 REG(PCTRL) = REG(PCTRL) & (PCTRL_SPDSELM | PCTRL_DUPMOD | PCTRL_ANEG | PCTRL_SPDSELL); 354 358 /* 355 359 * 100 and 10 FD/HD, Extended Status, MF Preamble Suppression, … … 357 361 */ 358 362 REG(PSTATUS) = 0x7949; 359 REG(PSSTAT) = 0x0000;363 REG(PSSTAT) &= 0xe001; 360 364 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)); 365 366 e1kPhyLinkResetCallback(pPhy); 362 367 } 363 368 … … 384 389 if (fLinkIsUp) 385 390 { 386 REG(PSSTAT) |= PSSTAT_LINK ;387 REG(PSTATUS) |= PSTATUS_NEGCOMP; 391 REG(PSSTAT) |= PSSTAT_LINK_ALL; 392 REG(PSTATUS) |= PSTATUS_NEGCOMP; /* PSTATUS_LNKSTAT is latched low */ 388 393 } 389 394 else 390 395 { 391 REG(PSSTAT) &= ~PSSTAT_LINK ;392 REG(PSTATUS) &= ~ PSTATUS_LNKSTAT;396 REG(PSSTAT) &= ~PSSTAT_LINK_ALL; 397 REG(PSTATUS) &= ~(PSTATUS_LNKSTAT | PSTATUS_NEGCOMP); 393 398 } 394 399 PhyLog(("PHY#%d setLinkStatus: PSTATUS=%04x PSSTAT=%04x\n", pPhy->iInstance, REG(PSTATUS), REG(PSSTAT))); -
trunk/src/VBox/Devices/Network/DevE1000Phy.h
r64925 r64966 38 38 * Receive Pause Enable 39 39 */ 40 #define PSSTAT_LINK 0xBC08 40 #define PSSTAT_LINK_ALL 0xBC08 41 #define PSSTAT_LINK 0x0400 41 42 42 43 namespace Phy
Note:
See TracChangeset
for help on using the changeset viewer.