Changeset 20521 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 12, 2009 3:28:26 PM (16 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile.kmk
r20501 r20521 286 286 Serial/DevSerial.cpp \ 287 287 Parallel/DevParallel.cpp 288 289 ifdef VBOX_DYNAMIC_NET_ATTACH 290 DevicesR3_DEFS += VBOX_DYNAMIC_NET_ATTACH 291 endif 288 292 289 293 ifdef VBOX_WITH_E1000 … … 466 470 Parallel/DevParallel.cpp 467 471 472 ifdef VBOX_DYNAMIC_NET_ATTACH 473 VBoxDDGC_DEFS += VBOX_DYNAMIC_NET_ATTACH 474 endif 475 468 476 ifdef VBOX_WITH_E1000 469 477 VBoxDDGC_DEFS += VBOX_WITH_E1000 … … 548 556 Serial/DevSerial.cpp \ 549 557 Parallel/DevParallel.cpp 558 559 ifdef VBOX_DYNAMIC_NET_ATTACH 560 VBoxDDR0_DEFS += VBOX_DYNAMIC_NET_ATTACH 561 endif 550 562 551 563 ifdef VBOX_WITH_E1000 -
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r20374 r20521 4651 4651 4652 4652 4653 #ifdef VBOX_DYNAMIC_NET_ATTACH 4654 /** 4655 * Detach notification. 4656 * 4657 * One network card at one port has been unplugged. 4658 * The VM is suspended at this point. 4659 * 4660 * @param pDevIns The device instance. 4661 * @param iLUN The logical unit which is being detached. 4662 */ 4663 static DECLCALLBACK(void) pcnetDetach(PPDMDEVINS pDevIns, unsigned iLUN) 4664 { 4665 PCNetState *pThis = PDMINS_2_DATA(pDevIns, PCNetState *); 4666 4667 Log(("%s:\n", __FUNCTION__)); 4668 4669 int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 4670 AssertReleaseRC(rc); 4671 4672 /* @todo: r=pritesh still need to check if i missed 4673 * to clean something in this function 4674 */ 4675 4676 /* 4677 * Zero some important members. 4678 */ 4679 pThis->pDrvBase = NULL; 4680 pThis->pDrv = NULL; 4681 4682 PDMCritSectLeave(&pThis->CritSect); 4683 } 4684 4685 4686 /** 4687 * Attach the Network attachment. 4688 * 4689 * @returns VBox status code. 4690 * @param pDevIns The device instance. 4691 * @param iLUN The logical unit which is being detached. 4692 */ 4693 static DECLCALLBACK(int) pcnetAttach(PPDMDEVINS pDevIns, unsigned iLUN) 4694 { 4695 PCNetState *pThis = PDMINS_2_DATA(pDevIns, PCNetState *); 4696 int rc = VINF_SUCCESS; 4697 4698 Log(("%s:\n", __FUNCTION__)); 4699 4700 rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 4701 AssertReleaseRC(rc); 4702 4703 rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->IBase, &pThis->pDrvBase, "Network Port"); 4704 if (RT_SUCCESS(rc)) 4705 { 4706 if (rc == VINF_NAT_DNS) 4707 { 4708 #ifdef RT_OS_LINUX 4709 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "NoDNSforNAT", 4710 N_("A Domain Name Server (DNS) for NAT networking could not be determined. Please check your /etc/resolv.conf for <tt>nameserver</tt> entries. Either add one manually (<i>man resolv.conf</i>) or ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so")); 4711 #else 4712 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "NoDNSforNAT", 4713 N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so")); 4714 #endif 4715 } 4716 pThis->pDrv = (PPDMINETWORKCONNECTOR) 4717 pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_NETWORK_CONNECTOR); 4718 if (!pThis->pDrv) 4719 { 4720 AssertMsgFailed(("Failed to obtain the PDMINTERFACE_NETWORK_CONNECTOR interface!\n")); 4721 return VERR_PDM_MISSING_INTERFACE_BELOW; 4722 } 4723 } 4724 else if (rc == VERR_PDM_NO_ATTACHED_DRIVER) 4725 Log(("No attached driver!\n")); 4726 else 4727 return rc; 4728 4729 /* 4730 * Temporary set the link down if it was up so that the guest 4731 * will know that we have change the configuration of the 4732 * network card 4733 */ 4734 if (pThis->fLinkUp) 4735 { 4736 pThis->fLinkTempDown = true; 4737 pThis->cLinkDownReported = 0; 4738 pThis->aCSR[0] |= RT_BIT(15) | RT_BIT(13); /* ERR | CERR (this is probably wrong) */ 4739 pThis->Led.Asserted.s.fError = pThis->Led.Actual.s.fError = 1; 4740 TMTimerSetMillies(pThis->pTimerRestore, 20000); 4741 } 4742 PDMCritSectLeave(&pThis->CritSect); 4743 4744 return rc; 4745 4746 } 4747 #endif /* VBOX_DYNAMIC_NET_ATTACH */ 4748 4749 4653 4750 /** 4654 4751 * @copydoc FNPDMDEVSUSPEND … … 5163 5260 /* pfnResume */ 5164 5261 NULL, 5262 #ifdef VBOX_DYNAMIC_NET_ATTACH 5263 /* pfnAttach */ 5264 pcnetAttach, 5265 /* pfnDetach */ 5266 pcnetDetach, 5267 #else /* !VBOX_DYNAMIC_NET_ATTACH */ 5165 5268 /* pfnAttach */ 5166 5269 NULL, 5167 5270 /* pfnDetach */ 5168 5271 NULL, 5272 #endif /* !VBOX_DYNAMIC_NET_ATTACH */ 5169 5273 /* pfnQueryInterface. */ 5170 5274 NULL,
Note:
See TracChangeset
for help on using the changeset viewer.