///////////////////////////////////////////////////////////////////////
        //
        // Buffer Operations, should only be called when a lock is held
        // this ring buffer.
        //
        private void LockedPushRecvBuffer(int length)
        {
            // (ARM only, not x86) PlatformService.InvalidateDCache(packetVirtAddr, (UIntPtr)length);

            ulong controlBits = (ulong)ByteOrder.HostToLittleEndian(length);

            rxRingBuffer.Push(controlBits);
        }
示例#2
0
        ///////////////////////////////////////////////////////////////////////
        //
        // Buffer Operations, should only be called when a lock is held
        // this ring buffer.
        //
        private void _LockedPushTsmtBuffer(Packet packet)
        {
            // (ARM only, not x86) PlatformService.CleanAndInvalidateDCache(packetVirtAddr, (UIntPtr)length);
            int length = packet.GetLength();

            ulong controlBits = (ulong)ByteOrder.HostToLittleEndian(length);

            // set necessary command fields
            controlBits |= (TxCmdFields.END_OF_PACKET | TxCmdFields.INSERT_FCS |
                            TxCmdFields.REPORT_STATUS);

            DmaMemory mem = txRingBuffer.PeekHead();

            packet.CopyToBytes(mem.BytesRef());
            txRingBuffer.Push(controlBits);
        }