- Timestamp:
- Oct 22, 2009 1:21:46 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevVirtioNet.cpp
r23970 r23979 197 197 PDMBOTHCBDECL(int) vnetSetConfig(void *pState, uint32_t port, uint32_t cb, void *data); 198 198 PDMBOTHCBDECL(void) vnetReset(void *pState); 199 PDMBOTHCBDECL(void) vnetReady(void *pState); 199 200 #ifdef DEBUG 200 201 static const char *vnetGetQueueName(void *pvState, PVQUEUE pQueue); … … 220 221 int (*pfnSetConfig)(void *pvState, uint32_t port, uint32_t cb, void *data); 221 222 void (*pfnReset)(void *pvState); 223 void (*pfnReady)(void *pvState); 222 224 #ifdef DEBUG 223 225 const char *(*pfnGetQueueName)(void *pvState, PVQUEUE pQueue); … … 229 231 0x1AF4, 0x1000, 0x1AF4, 1 + VIRTIO_NET_ID, 0x0200, 3, "virtio-net", "vnet%d", 230 232 vnetGetHostFeatures, vnetGetHostMinimalFeatures, vnetSetHostFeatures, 231 vnetGetConfig, vnetSetConfig, vnetReset 233 vnetGetConfig, vnetSetConfig, vnetReset, vnetReady 232 234 #ifdef DEBUG 233 235 , vnetGetQueueName … … 236 238 { /* Virtio Block Device */ 237 239 0x1AF4, 0x1001, 0x1AF4, 1 + VIRTIO_BLK_ID, 0x0180, 2, "virtio-blk", "vblk%d", 238 NULL, NULL, NULL, NULL, NULL, NULL 240 NULL, NULL, NULL, NULL, NULL, NULL, NULL 239 241 #ifdef DEBUG 240 242 , NULL … … 654 656 int rc = VINF_SUCCESS; 655 657 const char *szInst = INSTANCE(pState); 658 bool fHasBecomeReady; 656 659 STAM_PROFILE_ADV_START(&pState->CTXSUFF(StatIOWrite), a); 657 660 … … 665 668 if (VPCI_F_BAD_FEATURE & u32) 666 669 { 667 Log(("%s Guest failed to negotiate properly!(guest=%x)\n",670 Log(("%s WARNING! Guest failed to negotiate properly (guest=%x)\n", 668 671 INSTANCE(pState), u32)); 669 672 pState->uGuestFeatures = g_VPCIDevices[pState->enmDevType].pfnGetHostMinimalFeatures(pState); … … 720 723 Assert(cb == 1); 721 724 u32 &= 0xFF; 725 fHasBecomeReady = !(pState->uStatus & VPCI_STATUS_DRV_OK) && (u32 & VPCI_STATUS_DRV_OK); 722 726 pState->uStatus = u32; 723 727 /* Writing 0 to the status port triggers device reset. */ 724 728 if (u32 == 0) 725 729 g_VPCIDevices[pState->enmDevType].pfnReset(pState); 730 else if (fHasBecomeReady) 731 g_VPCIDevices[pState->enmDevType].pfnReady(pState); 726 732 break; 727 733 … … 1111 1117 R3PTRTYPE(PPDMINETWORKCONNECTOR) pDrv; /**< Connector of attached network driver. */ 1112 1118 1119 R3PTRTYPE(PPDMQUEUE) pCanRxQueueR3; /**< Rx wakeup signaller - R3. */ 1120 R0PTRTYPE(PPDMQUEUE) pCanRxQueueR0; /**< Rx wakeup signaller - R0. */ 1121 RCPTRTYPE(PPDMQUEUE) pCanRxQueueRC; /**< Rx wakeup signaller - RC. */ 1122 1113 1123 PTMTIMERR3 pLinkUpTimer; /**< Link Up(/Restore) Timer. */ 1114 1124 … … 1288 1298 1289 1299 #endif /* IN_RING3 */ 1300 1301 /** 1302 * This function is called when the driver becomes ready. 1303 * 1304 * @param pState The device state structure. 1305 */ 1306 PDMBOTHCBDECL(void) vnetReady(void *pvState) 1307 { 1308 VNETSTATE *pState = (VNETSTATE*)pvState; 1309 Log(("%s Driver became ready, waking up RX thread...\n", INSTANCE(pState))); 1310 #ifdef IN_RING3 1311 vnetWakeupReceive(pState->VPCI.CTX_SUFF(pDevIns)); 1312 #else 1313 PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pState->CTX_SUFF(pCanRxQueue)); 1314 if (pItem) 1315 PDMQueueInsert(pState->CTX_SUFF(pCanRxQueue), pItem); 1316 #endif 1317 } 1290 1318 1291 1319 … … 1699 1727 return rc;*/ 1700 1728 1729 /* Create the RX notifier signaller. */ 1730 rc = PDMDevHlpPDMQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 1, 0, 1731 vnetCanRxQueueConsumer, true, "VNet-Rcv", &pState->pCanRxQueueR3); 1732 if (RT_FAILURE(rc)) 1733 return rc; 1734 pState->pCanRxQueueR0 = PDMQueueR0Ptr(pState->pCanRxQueueR3); 1735 pState->pCanRxQueueRC = PDMQueueRCPtr(pState->pCanRxQueueR3); 1701 1736 1702 1737 /* Create Link Up Timer */ … … 1793 1828 VNETSTATE* pState = PDMINS_2_DATA(pDevIns, VNETSTATE*); 1794 1829 vpciRelocate(pDevIns, offDelta); 1830 pState->pCanRxQueueRC = PDMQueueRCPtr(pState->pCanRxQueueR3); 1795 1831 // TBD 1796 1832 }
Note:
See TracChangeset
for help on using the changeset viewer.