VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/DrvDedicatedNic.cpp@ 62632

最後變更 在這個檔案從62632是 62632,由 vboxsync 提交於 9 年 前

Devices: unused parameter warnings.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 18.2 KB
 
1/* $Id: DrvDedicatedNic.cpp 62632 2016-07-28 15:58:14Z vboxsync $ */
2/** @file
3 * DrvDedicatedNic - Experimental network driver for using a dedicated (V)NIC.
4 */
5
6/*
7 * Copyright (C) 2010-2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*********************************************************************************************************************************
20* Header Files *
21*********************************************************************************************************************************/
22#define LOG_GROUP LOG_GROUP_DEFAULT
23#include <VBox/log.h>
24#include <VBox/vmm/pdmcritsect.h>
25#include <VBox/vmm/pdmdrv.h>
26#include <VBox/vmm/pdmnetifs.h>
27#include <VBox/vmm/pdmnetinline.h>
28#include <VBox/intnet.h>
29#include <VBox/intnetinline.h>
30
31#include <iprt/asm.h>
32#include <iprt/assert.h>
33#include <iprt/mem.h>
34#include <iprt/path.h>
35#include <iprt/string.h>
36#include <iprt/thread.h>
37#include <iprt/uuid.h>
38
39#include "VBoxDD.h"
40
41
42/*********************************************************************************************************************************
43* Structures and Typedefs *
44*********************************************************************************************************************************/
45/**
46 * Instance data for the dedicated (V)NIC driver.
47 *
48 * @implements PDMINETWORKUP
49 */
50typedef struct DRVDEDICATEDNIC
51{
52 /** The network interface. */
53 PDMINETWORKUP INetworkUpR3;
54 /** The network interface. */
55 R3PTRTYPE(PPDMINETWORKDOWN) pIAboveNet;
56 /** The network config interface.
57 * Can (in theory at least) be NULL. */
58 R3PTRTYPE(PPDMINETWORKCONFIG) pIAboveConfigR3;
59 /** Pointer to the driver instance. */
60 PPDMDRVINSR3 pDrvInsR3;
61 /** Ring-3 base interface for the ring-0 context. */
62 PDMIBASER0 IBaseR0;
63 /** Ring-3 base interface for the raw-mode context. */
64 PDMIBASERC IBaseRC;
65 RTR3PTR R3PtrAlignment;
66
67
68 /** The network interface for the ring-0 context. */
69 PDMINETWORKUPR0 INetworkUpR0;
70 /** Pointer to the driver instance. */
71 PPDMDRVINSR0 pDrvInsR0;
72 RTR0PTR R0PtrAlignment;
73
74 /** The interface we're talking to. */
75 R0PTRTYPE(PINTNETTRUNKIFPORT) pIfPortR0;
76 /** Set if the link is up, clear if its down. */
77 bool fLinkDown;
78 /** Set if the current transmit operation is done the XMIT thread. If clear,
79 * we assume its an EMT. */
80 bool fXmitOnXmitThread;
81 /** The name of the interface that we're connected to. */
82 char szIfName[128 + 8 - 2];
83
84 /** Critical section serializing transmission. */
85 PDMCRITSECT XmitLock;
86 /** The transmit scatter gather buffer (ring-3 -> ring-0). */
87 PDMSCATTERGATHER XmitSg;
88 /** The transmit GSO context (when applicable). */
89 PDMNETWORKGSO XmitGso;
90 /** The transmit buffer (ring-3 -> ring-0). */
91 uint8_t abXmitBuf[_64K];
92
93 /** The receive scatter gather buffer. */
94 PDMSCATTERGATHER RecvSg;
95 /** The receive buffer (ring-0 -> ring-3). */
96 uint8_t abRecvBuf[_64K];
97
98} DRVDEDICATEDNIC;
99/** Pointer to the instance data for the dedicated (V)NIC driver. */
100typedef DRVDEDICATEDNIC *PDRVDEDICATEDNIC;
101
102/**
103 * Ring-0 operations.
104 */
105typedef enum DRVDEDICATEDNICR0OP
106{
107 /** Invalid zero value.. */
108 DRVDEDICATEDNICR0OP_INVALID = 0,
109 /** Initialize the connection to the NIC. */
110 DRVDEDICATEDNICR0OP_INIT,
111 /** Terminate the connection to the NIC. */
112 DRVDEDICATEDNICR0OP_TERM,
113 /** Suspend the operation. */
114 DRVDEDICATEDNICR0OP_SUSPEND,
115 /** Resume the operation. */
116 DRVDEDICATEDNICR0OP_RESUME,
117 /** Wait for and do receive work.
118 * We do this in ring-0 instead of ring-3 to save 1-2 buffer copies and
119 * unnecessary context switching. */
120 DRVDEDICATEDNICR0OP_RECV,
121 /** Wait for and do transmit work.
122 * We do this in ring-0 instead of ring-3 to save 1-2 buffer copies and
123 * unnecessary context switching. */
124 DRVDEDICATEDNICR0OP_SEND,
125 /** Changes the promiscuousness of the interface (guest point of view). */
126 DRVDEDICATEDNICR0OP_PROMISC,
127 /** End of the valid operations. */
128 DRVDEDICATEDNICR0OP_END,
129 /** The usual 32-bit hack. */
130 DRVDEDICATEDNICR0OP_32BIT_HACK = 0x7fffffff
131} DRVDEDICATEDNICR0OP;
132
133
134
135#ifdef IN_RING0
136
137/**
138 * @interface_method_impl{FNPDMDRVREQHANDLERR0}
139 */
140PDMBOTHCBDECL(int) drvR0DedicatedNicReqHandler(PPDMDRVINS pDrvIns, uint32_t uOperation, uint64_t u64Arg)
141{
142 RT_NOREF_PV(pDrvIns); RT_NOREF_PV(u64Arg);
143 switch ((DRVDEDICATEDNICR0OP)uOperation)
144 {
145 case DRVDEDICATEDNICR0OP_INIT:
146 return VERR_NOT_IMPLEMENTED;//drvR0DedicatedNicReqInit(pDrvIns, u64Arg);
147
148 case DRVDEDICATEDNICR0OP_TERM:
149 return VERR_NOT_IMPLEMENTED;//drvR0DedicatedNicReqTerm(pDrvIns);
150
151 case DRVDEDICATEDNICR0OP_SUSPEND:
152 return VERR_NOT_IMPLEMENTED;//drvR0DedicatedNicReqSuspend(pDrvIns);
153
154 case DRVDEDICATEDNICR0OP_RESUME:
155 return VERR_NOT_IMPLEMENTED;//drvR0DedicatedNicReqResume(pDrvIns);
156
157 case DRVDEDICATEDNICR0OP_RECV:
158 return VERR_NOT_IMPLEMENTED;//drvR0DedicatedNicReqRecv(pDrvIns);
159
160 case DRVDEDICATEDNICR0OP_SEND:
161 return VERR_NOT_IMPLEMENTED;//drvR0DedicatedNicReqSend(pDrvIns);
162
163 case DRVDEDICATEDNICR0OP_PROMISC:
164 return VERR_NOT_IMPLEMENTED;//drvR0DedicatedNicReqPromisc(pDrvIns, !!u64Arg);
165
166 case DRVDEDICATEDNICR0OP_END:
167 default:
168 return VERR_INVALID_FUNCTION;
169 }
170}
171
172#endif /* IN_RING0 */
173
174
175
176/* -=-=-=-=- PDMINETWORKUP -=-=-=-=- */
177
178/**
179 * @interface_method_impl{PDMINETWORKUP,pfnBeginXmit}
180 */
181PDMBOTHCBDECL(int) drvDedicatedNicUp_BeginXmit(PPDMINETWORKUP pInterface, bool fOnWorkerThread)
182{
183 PDRVDEDICATEDNIC pThis = RT_FROM_MEMBER(pInterface, DRVDEDICATEDNIC, CTX_SUFF(INetworkUp));
184 int rc = PDMCritSectTryEnter(&pThis->XmitLock);
185 if (RT_SUCCESS(rc))
186 ASMAtomicUoWriteBool(&pThis->fXmitOnXmitThread, fOnWorkerThread);
187 return rc;
188}
189
190
191/**
192 * @interface_method_impl{PDMINETWORKUP,pfnAllocBuf}
193 */
194PDMBOTHCBDECL(int) drvDedicatedNicUp_AllocBuf(PPDMINETWORKUP pInterface, size_t cbMin,
195 PCPDMNETWORKGSO pGso, PPPDMSCATTERGATHER ppSgBuf)
196{
197 PDRVDEDICATEDNIC pThis = RT_FROM_MEMBER(pInterface, DRVDEDICATEDNIC, CTX_SUFF(INetworkUp));
198 Assert(PDMCritSectIsOwner(&pThis->XmitLock));
199
200 /*
201 * If the net is down, we can return immediately.
202 */
203 if (pThis->fLinkDown)
204 return VERR_NET_DOWN;
205
206#ifdef IN_RING0
207 /** @todo Ask the driver for a buffer, atomically if we're called on EMT. */
208 RT_NOREF_PV(cbMin); RT_NOREF_PV(pGso); RT_NOREF_PV(ppSgBuf);
209 return VERR_TRY_AGAIN;
210
211#else /* IN_RING3 */
212 /*
213 * Are we busy or is the request too big?
214 */
215 if (RT_UNLIKELY((pThis->XmitSg.fFlags & PDMSCATTERGATHER_FLAGS_MAGIC_MASK) == PDMSCATTERGATHER_FLAGS_MAGIC))
216 return VERR_TRY_AGAIN;
217 if (cbMin > sizeof(pThis->abXmitBuf))
218 return VERR_NO_MEMORY;
219
220 /*
221 * Initialize the S/G buffer and return.
222 */
223 pThis->XmitSg.fFlags = PDMSCATTERGATHER_FLAGS_MAGIC | PDMSCATTERGATHER_FLAGS_OWNER_1;
224 pThis->XmitSg.cbUsed = 0;
225 pThis->XmitSg.cbAvailable = sizeof(pThis->abXmitBuf);
226 pThis->XmitSg.pvAllocator = NULL;
227 if (!pGso)
228 {
229 pThis->XmitSg.pvUser = NULL;
230 pThis->XmitGso.u8Type = PDMNETWORKGSOTYPE_INVALID;
231 }
232 else
233 {
234 pThis->XmitSg.pvUser = &pThis->XmitGso;
235 pThis->XmitGso = *pGso;
236 }
237 pThis->XmitSg.cSegs = 1;
238 pThis->XmitSg.aSegs[0].cbSeg = pThis->XmitSg.cbAvailable;
239 pThis->XmitSg.aSegs[0].pvSeg = &pThis->abXmitBuf[0];
240
241# if 0 /* poison */
242 memset(pThis->XmitSg.aSegs[0].pvSeg, 'F', pThis->XmitSg.aSegs[0].cbSeg);
243# endif
244
245 *ppSgBuf = &pThis->XmitSg;
246 return VINF_SUCCESS;
247#endif /* IN_RING3 */
248}
249
250
251/**
252 * @interface_method_impl{PDMINETWORKUP,pfnFreeBuf}
253 */
254PDMBOTHCBDECL(int) drvDedicatedNicUp_FreeBuf(PPDMINETWORKUP pInterface, PPDMSCATTERGATHER pSgBuf)
255{
256#ifdef VBOX_STRICT
257 PDRVDEDICATEDNIC pThis = RT_FROM_MEMBER(pInterface, DRVDEDICATEDNIC, CTX_SUFF(INetworkUp));
258 Assert(pSgBuf->fFlags == (PDMSCATTERGATHER_FLAGS_MAGIC | PDMSCATTERGATHER_FLAGS_OWNER_1));
259 Assert(pSgBuf->cbUsed <= pSgBuf->cbAvailable);
260 Assert(PDMCritSectIsOwner(&pThis->XmitLock));
261#else
262 RT_NOREF1(pInterface);
263#endif
264
265 if (pSgBuf)
266 {
267#ifdef IN_RING0
268 // ...
269#else
270 Assert(pSgBuf == &pThis->XmitSg);
271 Assert((pSgBuf->fFlags & PDMSCATTERGATHER_FLAGS_MAGIC_MASK) == PDMSCATTERGATHER_FLAGS_MAGIC);
272 pSgBuf->fFlags = 0;
273#endif
274 }
275
276 return VINF_SUCCESS;
277}
278
279
280/**
281 * @interface_method_impl{PDMINETWORKUP,pfnSendBuf}
282 */
283PDMBOTHCBDECL(int) drvDedicatedNicUp_SendBuf(PPDMINETWORKUP pInterface, PPDMSCATTERGATHER pSgBuf, bool fOnWorkerThread)
284{
285 PDRVDEDICATEDNIC pThis = RT_FROM_MEMBER(pInterface, DRVDEDICATEDNIC, CTX_SUFF(INetworkUp));
286 STAM_PROFILE_START(&pThis->StatTransmit, a);
287
288 AssertPtr(pSgBuf);
289 Assert(pSgBuf->fFlags == (PDMSCATTERGATHER_FLAGS_MAGIC | PDMSCATTERGATHER_FLAGS_OWNER_1));
290 Assert(pSgBuf->cbUsed <= pSgBuf->cbAvailable);
291#ifdef IN_RING0
292 Assert(pSgBuf == &pThis->XmitSg);
293#endif
294 Assert(PDMCritSectIsOwner(&pThis->XmitLock));
295
296#ifdef IN_RING0
297 /*
298 * Tell the driver to send the packet.
299 */
300 RT_NOREF_PV(pThis); RT_NOREF_PV(pSgBuf); RT_NOREF_PV(fOnWorkerThread);
301 return VERR_INTERNAL_ERROR_4;
302
303#else /* IN_RING3 */
304 /*
305 * Call ring-0 to start the transfer.
306 */
307 int rc = PDMDrvHlpCallR0(pThis->pDrvInsR3, DRVDEDICATEDNICR0OP_SEND, pSgBuf->cbUsed);
308 if (RT_FAILURE(rc) && rc != VERR_NET_DOWN)
309 rc = VERR_NET_NO_BUFFER_SPACE;
310 pSgBuf->fFlags = 0;
311 return rc;
312#endif /* IN_RING3 */
313}
314
315
316/**
317 * @interface_method_impl{PDMINETWORKUP,pfnEndXmit}
318 */
319PDMBOTHCBDECL(void) drvDedicatedNicUp_EndXmit(PPDMINETWORKUP pInterface)
320{
321 PDRVDEDICATEDNIC pThis = RT_FROM_MEMBER(pInterface, DRVDEDICATEDNIC, CTX_SUFF(INetworkUp));
322 ASMAtomicUoWriteBool(&pThis->fXmitOnXmitThread, false);
323 PDMCritSectLeave(&pThis->XmitLock);
324}
325
326
327/**
328 * @interface_method_impl{PDMINETWORKUP,pfnSetPromiscuousMode}
329 */
330PDMBOTHCBDECL(void) drvDedicatedNicUp_SetPromiscuousMode(PPDMINETWORKUP pInterface, bool fPromiscuous)
331{
332 PDRVDEDICATEDNIC pThis = RT_FROM_MEMBER(pInterface, DRVDEDICATEDNIC, CTX_SUFF(INetworkUp));
333 /** @todo enable/disable promiscuous mode (should be easy) */
334 NOREF(pThis); RT_NOREF_PV(fPromiscuous);
335}
336
337#ifdef IN_RING3
338
339/**
340 * @interface_method_impl{PDMINETWORKUP,pfnNotifyLinkChanged}
341 */
342static DECLCALLBACK(void) drvR3DedicatedNicUp_NotifyLinkChanged(PPDMINETWORKUP pInterface, PDMNETWORKLINKSTATE enmLinkState)
343{
344 PDRVDEDICATEDNIC pThis = RT_FROM_MEMBER(pInterface, DRVDEDICATEDNIC, CTX_SUFF(INetworkUp));
345 bool fLinkDown;
346 switch (enmLinkState)
347 {
348 case PDMNETWORKLINKSTATE_DOWN:
349 case PDMNETWORKLINKSTATE_DOWN_RESUME:
350 fLinkDown = true;
351 break;
352 default:
353 AssertMsgFailed(("enmLinkState=%d\n", enmLinkState));
354 case PDMNETWORKLINKSTATE_UP:
355 fLinkDown = false;
356 break;
357 }
358 LogFlow(("drvR3DedicatedNicUp_NotifyLinkChanged: enmLinkState=%d %d->%d\n", enmLinkState, pThis->fLinkDown, fLinkDown));
359 ASMAtomicWriteBool(&pThis->fLinkDown, fLinkDown);
360}
361
362
363/* -=-=-=-=- PDMIBASER0 -=-=-=-=- */
364
365/**
366 * @interface_method_impl{PDMIBASER0,pfnQueryInterface}
367 */
368static DECLCALLBACK(RTR0PTR) drvR3DedicatedNicIBaseR0_QueryInterface(PPDMIBASER0 pInterface, const char *pszIID)
369{
370 PDRVDEDICATEDNIC pThis = RT_FROM_MEMBER(pInterface, DRVDEDICATEDNIC, IBaseR0);
371 PDMIBASER0_RETURN_INTERFACE(pThis->pDrvInsR3, pszIID, PDMINETWORKUP, &pThis->INetworkUpR0);
372 return NIL_RTR0PTR;
373}
374
375
376/* -=-=-=-=- PDMIBASE -=-=-=-=- */
377
378/**
379 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
380 */
381static DECLCALLBACK(void *) drvR3DedicatedNicIBase_QueryInterface(PPDMIBASE pInterface, const char *pszIID)
382{
383 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
384 PDRVDEDICATEDNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVDEDICATEDNIC);
385
386 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
387 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASER0, &pThis->IBaseR0);
388 PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKUP, &pThis->INetworkUpR3);
389 return NULL;
390}
391
392
393/* -=-=-=-=- PDMDRVREG -=-=-=-=- */
394
395/**
396 * @interface_method_impl{PDMDRVREG,pfnPowerOff}
397 */
398static DECLCALLBACK(void) drvR3DedicatedNicPowerOff(PPDMDRVINS pDrvIns)
399{
400 LogFlow(("drvR3DedicatedNicPowerOff\n"));
401 PDRVDEDICATEDNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVDEDICATEDNIC);
402
403 int rc = PDMDrvHlpCallR0(pDrvIns, DRVDEDICATEDNICR0OP_SUSPEND, 0);
404 AssertRC(rc);
405}
406
407
408/**
409 * @interface_method_impl{PDMDRVREG,pfnResume}
410 */
411static DECLCALLBACK(void) drvR3DedicatedNicResume(PPDMDRVINS pDrvIns)
412{
413 LogFlow(("drvR3DedicatedNicPowerResume\n"));
414 PDRVDEDICATEDNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVDEDICATEDNIC);
415
416 int rc = PDMDrvHlpCallR0(pDrvIns, DRVDEDICATEDNICR0OP_RESUME, 0);
417 AssertRC(rc);
418}
419
420
421/**
422 * @interface_method_impl{PDMDRVREG,pfnSuspend}
423 */
424static DECLCALLBACK(void) drvR3DedicatedNicSuspend(PPDMDRVINS pDrvIns)
425{
426 LogFlow(("drvR3DedicatedNicPowerSuspend\n"));
427 PDRVDEDICATEDNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVDEDICATEDNIC);
428
429 int rc = PDMDrvHlpCallR0(pDrvIns, DRVDEDICATEDNICR0OP_SUSPEND, 0);
430 AssertRC(rc);
431}
432
433
434/**
435 * @interface_method_impl{PDMDRVREG,pfnPowerOn}
436 */
437static DECLCALLBACK(void) drvR3DedicatedNicPowerOn(PPDMDRVINS pDrvIns)
438{
439 LogFlow(("drvR3DedicatedNicPowerOn\n"));
440 PDRVDEDICATEDNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVDEDICATEDNIC);
441
442 int rc = PDMDrvHlpCallR0(pDrvIns, DRVDEDICATEDNICR0OP_RESUME, 0);
443 AssertRC(rc);
444}
445
446
447/**
448 * @interface_method_impl{PDMDRVREG,pfnDestruct}
449 */
450static DECLCALLBACK(void) drvR3DedicatedNicDestruct(PPDMDRVINS pDrvIns)
451{
452 LogFlow(("drvR3DedicatedNicDestruct\n"));
453 PDRVDEDICATEDNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVDEDICATEDNIC);
454 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
455
456 if (pThis->pIfPortR0)
457 {
458 int rc = PDMDrvHlpCallR0(pDrvIns, DRVDEDICATEDNICR0OP_TERM, 0);
459 AssertRC(rc);;
460 }
461}
462
463
464/**
465 * @interface_method_impl{PDMDRVREG,pfnConstruct}
466 */
467static DECLCALLBACK(int) drvR3DedicatedNicConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
468{
469 PDRVDEDICATEDNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVDEDICATEDNIC);
470 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
471
472 /*
473 * Init the static parts.
474 */
475 pThis->pDrvInsR3 = pDrvIns;
476 pThis->pDrvInsR0 = PDMDRVINS_2_R0PTR(pDrvIns);
477#if 0
478 pThis->hRecvThread = NIL_RTTHREAD;
479 pThis->hRecvEvt = NIL_RTSEMEVENT;
480 pThis->pXmitThread = NULL;
481 pThis->hXmitEvt = NIL_SUPSEMEVENT;
482 pThis->pSupDrvSession = PDMDrvHlpGetSupDrvSession(pDrvIns);
483 pThis->hSgCache = NIL_RTMEMCACHE;
484 pThis->enmRecvState = RECVSTATE_SUSPENDED;
485 pThis->fActivateEarlyDeactivateLate = false;
486 /* IBase* */
487 pDrvIns->IBase.pfnQueryInterface = drvR3DedicatedNicIBase_QueryInterface;
488 pThis->IBaseR0.pfnQueryInterface = drvR3DedicatedNicIBaseR0_QueryInterface;
489 pThis->IBaseRC.pfnQueryInterface = drvR3DedicatedNicIBaseRC_QueryInterface;
490 /* INetworkUp */
491 pThis->INetworkUpR3.pfnBeginXmit = drvDedicatedNic_BeginXmit;
492 pThis->INetworkUpR3.pfnAllocBuf = drvDedicatedNic_AllocBuf;
493 pThis->INetworkUpR3.pfnFreeBuf = drvDedicatedNic_FreeBuf;
494 pThis->INetworkUpR3.pfnSendBuf = drvDedicatedNic_SendBuf;
495 pThis->INetworkUpR3.pfnEndXmit = drvDedicatedNic_EndXmit;
496 pThis->INetworkUpR3.pfnSetPromiscuousMode = drvDedicatedNic_SetPromiscuousMode;
497 pThis->INetworkUpR3.pfnNotifyLinkChanged = drvR3DedicatedNicUp_NotifyLinkChanged;
498#endif
499
500 /** @todo
501 * Need to create a generic way of calling into the ring-0 side of the driver so
502 * we can initialize the thing as well as send and receive. Hmm ... the
503 * sending could be done more efficiently from a ring-0 kernel thread actually
504 * (saves context switching and 1-2 copy operations). Ditto for receive, except
505 * we need to tie the thread to the process or we cannot access the guest ram so
506 * easily.
507 */
508
509 return VERR_NOT_IMPLEMENTED;
510}
511
512
513
514/**
515 * Internal networking transport driver registration record.
516 */
517const PDMDRVREG g_DrvDedicatedNic =
518{
519 /* u32Version */
520 PDM_DRVREG_VERSION,
521 /* szName */
522 "DedicatedNic",
523 /* szRCMod */
524 "",
525 /* szR0Mod */
526 "VBoxDDR0.r0",
527 /* pszDescription */
528 "Dedicated (V)NIC Driver",
529 /* fFlags */
530 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT | PDM_DRVREG_FLAGS_R0,
531 /* fClass. */
532 PDM_DRVREG_CLASS_NETWORK,
533 /* cMaxInstances */
534 ~0U,
535 /* cbInstance */
536 sizeof(DRVDEDICATEDNIC),
537 /* pfnConstruct */
538 drvR3DedicatedNicConstruct,
539 /* pfnDestruct */
540 drvR3DedicatedNicDestruct,
541 /* pfnRelocate */
542 NULL,
543 /* pfnIOCtl */
544 NULL,
545 /* pfnPowerOn */
546 drvR3DedicatedNicPowerOn,
547 /* pfnReset */
548 NULL,
549 /* pfnSuspend */
550 drvR3DedicatedNicSuspend,
551 /* pfnResume */
552 drvR3DedicatedNicResume,
553 /* pfnAttach */
554 NULL,
555 /* pfnDetach */
556 NULL,
557 /* pfnPowerOff */
558 drvR3DedicatedNicPowerOff,
559 /* pfnSoftReset */
560 NULL,
561 /* u32EndVersion */
562 PDM_DRVREG_VERSION
563};
564
565#endif /* IN_RING3 */
566
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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