Esempio n. 1
0
NTSTATUS
NICSendPacket(
    IN  PFDO_DATA              FdoData,
    IN  PMP_TCB                pMpTcb,
    IN  PSCATTER_GATHER_LIST   ScatterGather
    )
/*++
Routine Description:

    NIC specific send handler

    Assumption: This function is called with the Send SPINLOCK held.

Arguments:

    FdoData     Pointer to our FdoData
    pMpTcb      Pointer to MP_TCB
    ScatterGather   The pointer to the frag list to be filled

Return Value:

    NTSTATUS code

--*/
{
    NTSTATUS    status;
    ULONG       index;
    UCHAR       TbdCount = 0;

    PULONG      pHwTcb = pMpTcb->HwTcb;
    PULONG   pHwTbd = pMpTcb->HwTbd;

    TraceEvents(TRACE_LEVEL_VERBOSE, DBG_WRITE, "--> NICSendPacket\n");

    for (index = 0; index < ScatterGather->NumberOfElements; index++)
    {
        if (ScatterGather->Elements[index].Length)
        {
			//FIXME: restructure these
            //pHwTbd->TbdBufferAddress =
            //    ScatterGather->Elements[index].Address.LowPart;

            //pHwTbd->TbdCount = ScatterGather->Elements[index].Length;

            pHwTbd++;
            TbdCount++;
        }
    }

    //pHwTcb->TxCbTbdPointer = pMpTcb->HwTbdPhys;
    //pHwTcb->TxCbTbdNumber = TbdCount;
    //pHwTcb->TxCbCount = 0;
    //pHwTcb->TxCbThreshold = (UCHAR) FdoData->AiThreshold;


    status = NICStartSend(FdoData, pMpTcb);

    if(!NT_SUCCESS(status)){
        TraceEvents(TRACE_LEVEL_ERROR, DBG_WRITE,
                   "NICStartSend returned error %x\n", status);
    }

    TraceEvents(TRACE_LEVEL_VERBOSE, DBG_WRITE, "<-- NICSendPacket\n");

    return status;
}
Esempio n. 2
0
NTSTATUS
NICSendPacket(
    __in  PFDO_DATA     FdoData,
    __in  PMP_TCB         pMpTcb,
    PSCATTER_GATHER_LIST   pFragList
    )
/*++
Routine Description:

    NIC specific send handler
    Assumption: Send spinlock has been acquired

Arguments:

    FdoData     Pointer to our FdoData
    pMpTcb      Pointer to MP_TCB
    pFragList   The pointer to the frag list to be filled

Return Value:

    NTSTATUS code

--*/
{
    NTSTATUS    status;
    ULONG       index;
    UCHAR       TbdCount = 0;

    PHW_TCB      pHwTcb = pMpTcb->HwTcb;
    PTBD_STRUC   pHwTbd = pMpTcb->HwTbd;

    DebugPrint(TRACE, DBG_WRITE, "--> NICSendPacket\n");

    for (index = 0; index < pFragList->NumberOfElements; index++)
    {
        if (pFragList->Elements[index].Length)
        {
            pHwTbd->TbdBufferAddress = pFragList->Elements[index].Address.LowPart;
            pHwTbd->TbdCount = pFragList->Elements[index].Length;

            pHwTbd++;
            TbdCount++;
        }
    }

    pHwTcb->TxCbHeader.CbStatus = 0;
    pHwTcb->TxCbHeader.CbCommand = CB_S_BIT | CB_TRANSMIT | CB_TX_SF_BIT;

    pHwTcb->TxCbTbdPointer = pMpTcb->HwTbdPhys;
    pHwTcb->TxCbTbdNumber = TbdCount;
    pHwTcb->TxCbCount = 0;
    pHwTcb->TxCbThreshold = (UCHAR) FdoData->AiThreshold;


    status = NICStartSend(FdoData, pMpTcb);
    if(!NT_SUCCESS(status)){
        DebugPrint(ERROR, DBG_WRITE, "NICStartSend returned error %x\n", status);
    }

    DebugPrint(TRACE, DBG_WRITE, "<-- NICSendPacket\n");

    return status;
}