VirtualBox

Ignore:
Timestamp:
Feb 5, 2010 7:00:45 PM (15 years ago)
Author:
vboxsync
Message:

pdmnetif.h & users: sketched out a new interface that is intended to be similar to the ring-0 and raw-mode context interfaces (working on driver allocated buffers during xmit).

File:
1 edited

Legend:

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

    r26300 r26305  
    115115 * @extends     PCIDEVICE
    116116 * @implements  PDMIBASE
    117  * @implements  PDMINETWORKPORT
     117 * @implements  PDMINETWORKDOWN
    118118 * @implements  PDMINETWORKCONFIG
    119119 * @implements  PDMILEDPORTS
     
    204204    PTMTIMERR3                          pTimerRestore;
    205205    /** Pointer to the connector of the attached network driver. */
    206     R3PTRTYPE(PPDMINETWORKCONNECTOR)    pDrv;
     206    R3PTRTYPE(PPDMINETWORKUP)    pDrv;
    207207    /** Pointer to the attached network driver. */
    208208    R3PTRTYPE(PPDMIBASE)                pDrvBase;
     
    210210    PDMIBASE                            IBase;
    211211    /** LUN\#0: The network port interface. */
    212     PDMINETWORKPORT                     INetworkPort;
     212    PDMINETWORKDOWN                     INetworkDown;
    213213    /** LUN\#0: The network config port interface. */
    214214    PDMINETWORKCONFIG                   INetworkConfig;
     
    21642164        pThis->Led.Asserted.s.fWriting = pThis->Led.Actual.s.fWriting = 1;
    21652165
    2166     pThis->pDrv->pfnSend(pThis->pDrv, pThis->pvSendFrame, pThis->cbSendFrame);
     2166    pThis->pDrv->pfnSendDeprecated(pThis->pDrv, pThis->pvSendFrame, pThis->cbSendFrame);
    21672167    STAM_REL_COUNTER_ADD(&pThis->StatTransmitBytes, pThis->cbSendFrame);
    21682168    pThis->Led.Actual.s.fWriting = 0;
     
    44884488    Assert(&pThis->IBase == pInterface);
    44894489    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThis->IBase);
    4490     PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKPORT, &pThis->INetworkPort);
     4490    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKDOWN, &pThis->INetworkDown);
    44914491    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONFIG, &pThis->INetworkConfig);
    44924492    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
     
    44944494}
    44954495
    4496 /** Converts a pointer to PCNetState::INetworkPort to a PCNetState pointer. */
    4497 #define INETWORKPORT_2_DATA(pInterface)  ( (PCNetState *)((uintptr_t)pInterface - RT_OFFSETOF(PCNetState, INetworkPort)) )
     4496/** Converts a pointer to PCNetState::INetworkDown to a PCNetState pointer. */
     4497#define INETWORKPORT_2_DATA(pInterface)  ( (PCNetState *)((uintptr_t)pInterface - RT_OFFSETOF(PCNetState, INetworkDown)) )
    44984498
    44994499
     
    45354535 *
    45364536 */
    4537 static DECLCALLBACK(int) pcnetWaitReceiveAvail(PPDMINETWORKPORT pInterface, RTMSINTERVAL cMillies)
     4537static DECLCALLBACK(int) pcnetWaitReceiveAvail(PPDMINETWORKDOWN pInterface, RTMSINTERVAL cMillies)
    45384538{
    45394539    PCNetState *pThis = INETWORKPORT_2_DATA(pInterface);
     
    45834583 * @thread  EMT
    45844584 */
    4585 static DECLCALLBACK(int) pcnetReceive(PPDMINETWORKPORT pInterface, const void *pvBuf, size_t cb)
     4585static DECLCALLBACK(int) pcnetReceive(PPDMINETWORKDOWN pInterface, const void *pvBuf, size_t cb)
    45864586{
    45874587    PCNetState *pThis = INETWORKPORT_2_DATA(pInterface);
     
    48204820#endif
    48214821        }
    4822         pThis->pDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONNECTOR);
    4823         AssertMsgStmt(pThis->pDrv, ("Failed to obtain the PDMINETWORKCONNECTOR interface!\n"),
     4822        pThis->pDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKUP);
     4823        AssertMsgStmt(pThis->pDrv, ("Failed to obtain the PDMINETWORKUP interface!\n"),
    48244824                      rc = VERR_PDM_MISSING_INTERFACE_BELOW);
    48254825    }
     
    50105010    pThis->IBase.pfnQueryInterface          = pcnetQueryInterface;
    50115011    /* INeworkPort */
    5012     pThis->INetworkPort.pfnWaitReceiveAvail = pcnetWaitReceiveAvail;
    5013     pThis->INetworkPort.pfnReceive          = pcnetReceive;
     5012    pThis->INetworkDown.pfnWaitReceiveAvail = pcnetWaitReceiveAvail;
     5013    pThis->INetworkDown.pfnReceive          = pcnetReceive;
    50145014    /* INetworkConfig */
    50155015    pThis->INetworkConfig.pfnGetMac         = pcnetGetMac;
     
    52015201#endif
    52025202        }
    5203         pThis->pDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONNECTOR);
    5204         AssertMsgReturn(pThis->pDrv, ("Failed to obtain the PDMINETWORKCONNECTOR interface!\n"),
     5203        pThis->pDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKUP);
     5204        AssertMsgReturn(pThis->pDrv, ("Failed to obtain the PDMINETWORKUP interface!\n"),
    52055205                        VERR_PDM_MISSING_INTERFACE_BELOW);
    52065206    }
Note: See TracChangeset for help on using the changeset viewer.

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