Example #1
0
NDIS_STATUS
Hvl11RegisterVNic(
    _In_  PHVL    pHvl,
    _In_  PVNIC   pVNic               
    )
{
    NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS;
    PHVL_CONTEXT pCtx = NULL;
    
    do
    {
        HvlLock(pHvl);

        // add it to the HVL's list of VNICs
        InsertTailList(&pHvl->VNiclist, &pVNic->VNicLink);
        
        HvlAssignVNicToContext(pHvl, pVNic, &pCtx);
        
        /*
            Initially make it part of the inactive context list. It will be picked up whenever we
            next context switch to it
            */
        InsertTailList(&pHvl->InactiveContextList, &pCtx->Link);

        HvlUnlock(pHvl);

        // notify it of any existing cached notifications
        if (pHvl->CachedChannelNotification.Header.pSourceVNic)
        {
            VNic11Notify(pVNic, &pHvl->CachedChannelNotification);
        }
    } while (FALSE);

    return ndisStatus;
}
Example #2
0
/*
    Split the VNIC into a separate context
    */
VOID
HvlPerformCtxSplit(
    PHVL pHvl,
    PVNIC pVNic
    )
{
    PHVL_CONTEXT pCtx = pVNic->pHvlCtx, pNewCtx = NULL;
    
    if (pCtx->ulNumVNics > 1)
    {
        HvlRemoveVNicFromCtx(pHvl, pVNic);

        HvlAssignVNicToContext(pHvl, pVNic, &pNewCtx);

        /*
            Make the new context part of the inactive context list. It will be picked up whenever 
            we next context switch to it
            */
        InsertTailList(&pHvl->InactiveContextList, &pNewCtx->Link);

        MpTrace(COMP_HVL, DBG_NORMAL, ("Splitted VNIC (%d, context = %p) into a separate context %p", VNIC_PORT_NO, pCtx, pNewCtx));
    }
    else
    {
        // there is nothing to be done
    }        
}
Example #3
0
NDIS_STATUS
Hvl11RegisterHelperPort(
    _In_  PHVL    pHvl,
    _In_  PVNIC   pVNic               
    )
{
    NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS;
    PHVL_CONTEXT pCtx = NULL;

    do
    {
        HvlLock(pHvl);

        HvlAssignVNicToContext(pHvl, pVNic, &pCtx);
        pHvl->pHelperPortCtx = pCtx;
        
        HvlUnlock(pHvl);
    } while (FALSE);

    return ndisStatus;
}