2008-11-17 18:29:00 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
2008-03-05 09:52:00 -05:00
|
|
|
//
|
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
//
|
2008-11-17 18:29:00 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
2008-03-05 09:52:00 -05:00
|
|
|
|
2008-11-17 18:29:00 -05:00
|
|
|
///
|
|
|
|
// Microsoft Research, Cambridge
|
|
|
|
//
|
2008-03-05 09:52:00 -05:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Collections;
|
|
|
|
|
|
|
|
using Drivers.Net;
|
|
|
|
|
|
|
|
namespace NetStack.Common
|
|
|
|
{
|
|
|
|
// An Adapter interface, should exist in any environment
|
|
|
|
// can be implemented by a driver, simulator or whatever.
|
|
|
|
public interface IAdapter
|
|
|
|
{
|
|
|
|
string DriverName { get; }
|
|
|
|
string DriverVersion { get; }
|
|
|
|
EthernetAddress HardwareAddress { get; }
|
|
|
|
uint LinkSpeed { get; }
|
|
|
|
|
|
|
|
WaitHandle GetReadHandle();
|
|
|
|
WaitHandle GetWriteHandle();
|
|
|
|
|
|
|
|
// get the received packets from the adapter
|
|
|
|
void GetReceivedPackets(Queue! outQueue);
|
|
|
|
|
|
|
|
// called when received packet has been process and can
|
|
|
|
// be returned to the device.
|
|
|
|
void PopulateRxRing(NetPacket! packet);
|
|
|
|
|
|
|
|
// get the number of transmitted packets just completed transmission
|
|
|
|
uint GetTransmittedPackets();
|
|
|
|
|
|
|
|
// populate the adapter's transmit ring with new NetPackets
|
|
|
|
void PopulateTxRing(NetPacket[]! txPackets, uint txPacketCount);
|
|
|
|
|
|
|
|
// get the free space at the txRing
|
|
|
|
int TxSlotsFree { get; }
|
|
|
|
}
|
|
|
|
} // namespace Drivers.Net
|