diff --git a/source/Cosmos.Driver.RTL8139/Cosmos.Driver.RTL8139.csproj b/source/Cosmos.Driver.RTL8139/Cosmos.Driver.RTL8139.csproj
deleted file mode 100644
index 16a2cb2b6..000000000
--- a/source/Cosmos.Driver.RTL8139/Cosmos.Driver.RTL8139.csproj
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.21022
- 2.0
- {1F7ACC2A-EA38-4B10-AB87-9450BBCC8D6F}
- Library
- Properties
- Cosmos.Driver.RTL8139
- Cosmos.Driver.RTL8139
- v3.5
- 512
- SAK
- SAK
- SAK
- SAK
-
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- x86
- true
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\Cosmos\Cosmos.Kernel\bin\Debug\Cosmos.Kernel.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755}
- Cosmos.Hardware
-
-
-
-
-
\ No newline at end of file
diff --git a/source/Cosmos.Driver.RTL8139/Cosmos.Driver.RTL8139.csproj.vspscc b/source/Cosmos.Driver.RTL8139/Cosmos.Driver.RTL8139.csproj.vspscc
deleted file mode 100644
index feffdecaa..000000000
--- a/source/Cosmos.Driver.RTL8139/Cosmos.Driver.RTL8139.csproj.vspscc
+++ /dev/null
@@ -1,10 +0,0 @@
-""
-{
-"FILE_VERSION" = "9237"
-"ENLISTMENT_CHOICE" = "NEVER"
-"PROJECT_FILE_RELATIVE_PATH" = ""
-"NUMBER_OF_EXCLUDED_FILES" = "0"
-"ORIGINAL_PROJECT_FILE_PATH" = ""
-"NUMBER_OF_NESTED_PROJECTS" = "0"
-"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
-}
diff --git a/source/Cosmos.Driver.RTL8139/Misc/BinaryHelper.cs b/source/Cosmos.Driver.RTL8139/Misc/BinaryHelper.cs
deleted file mode 100644
index 739c89c61..000000000
--- a/source/Cosmos.Driver.RTL8139/Misc/BinaryHelper.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Cosmos.Driver.RTL8139.Misc
-{
- ///
- /// Contains various helpermethods to make bitfiddling easier.
- ///
- public class BinaryHelper
- {
- ///
- /// Bitwise checks it the given bit is set in the data.
- ///
- /// The zero-based position of a bit. I.e. bit 1 is the second bit.
- /// Returns TRUE if bit is set.
- public static bool CheckBit(UInt16 data, ushort bit)
- {
- //A single bit is LEFT SHIFTED the number a given number of bits.
- //and bitwise AND'ed together with the data.
- //So the initial value is : 0000 0000.
- //Left shifting a bit 3 bits: 0000 0100
- //And'ed together with the data: 0101 0101 AND 0000 01000 => 0000 0100 (which is greater than zero - so bit is set).
-
- ushort mask = (ushort)(1 << (ushort)bit);
- return (data & mask) != 0;
- }
-
- public static bool CheckBit(UInt32 data, ushort bit)
- {
- UInt32 mask = (UInt32)(1 << (int)bit);
- return (data & mask) != 0;
- }
-
- ///
- /// Changes the value in the given position. Either from low to high, or high to low.
- /// Returns the same byte, but with one bit changed.
- ///
- public static byte FlipBit(byte data, ushort bit)
- {
- throw new NotImplementedException();
- }
-
-
- ///
- /// Retrieves a byte of data from somewhere inside a 32 bit number. An offset is used to indicate where in
- /// the 32 bit number to start extracting 8 bits.
- ///
- ///
- ///
- ///
- public static byte GetByteFrom32bit(UInt32 data, byte offset)
- {
- if (offset > 24)
- throw new ArgumentException("Offset can not move outside the 32 bit range");
-
- data = data >> offset;
- return (byte)data;
- }
-
- ///
- /// Returns the HEX value of a given bitnumber
- ///
- public enum BitPos : uint
- {
- BIT0 = 0x1,
- BIT1 = 0x2,
- BIT2 = 0x4,
- BIT3 = 0x8,
- BIT4 = 0x10,
- BIT5 = 0x20,
- BIT6 = 0x40,
- BIT7 = 0x80,
- BIT8 = 0x100,
- BIT9 = 0x200,
- BIT10 = 0x400,
- BIT11 = 0x800,
- BIT12 = 0x1000,
- BIT13 = 0x2000,
- BIT14 = 0x4000,
- BIT15 = 0x8000,
- BIT16 = 0x10000,
- BIT17 = 0x20000,
- BIT18 = 0x40000,
- BIT19 = 0x80000,
- BIT20 = 0x100000,
- BIT21 = 0x200000,
- BIT22 = 0x400000,
- BIT23 = 0x800000,
- BIT24 = 0x1000000,
- BIT25 = 0x2000000,
- BIT26 = 0x4000000,
- BIT27 = 0x8000000,
- BIT28 = 0x10000000,
- BIT29 = 0x20000000,
- BIT30 = 0x40000000,
- BIT31 = 0x80000000
- }
- }
-}
diff --git a/source/Cosmos.Driver.RTL8139/Packet.cs b/source/Cosmos.Driver.RTL8139/Packet.cs
deleted file mode 100644
index 52e5d6ce7..000000000
--- a/source/Cosmos.Driver.RTL8139/Packet.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Cosmos.Driver.RTL8139
-{
- ///
- /// A network Packet used when transferring data over a network.
- /// Consists of a body (with the data) and a head (with info about the packet)
- ///
- public class Packet
- {
- private PacketHeader head;
- private byte[] body;
- public PacketHeader Head { get; private set; }
-
- public Packet(PacketHeader newhead, byte[] data)
- {
- head = newhead;
- body = data;
- }
-
- public byte[] PacketBody
- {
- get
- {
- return body;
- }
- //return new byte[10]; //TODO: Redo this completely! Hardcoded to some bogus value now.
- }
- }
-}
diff --git a/source/Cosmos.Driver.RTL8139/PacketHeader.cs b/source/Cosmos.Driver.RTL8139/PacketHeader.cs
deleted file mode 100644
index 55b2dcceb..000000000
--- a/source/Cosmos.Driver.RTL8139/PacketHeader.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Cosmos.Driver.RTL8139.Misc;
-
-namespace Cosmos.Driver.RTL8139
-{
- ///
- /// The packethead consists of two bytes (i.e. 16 bits).
- /// A PacketHead contains information about a network Packet, and its transfer.
- ///
- public class PacketHeader
- {
- private UInt16 head;
-
- public PacketHeader(UInt16 data)
- {
- head = data;
- }
-
- public ushort PacketLength
- {
- get {return 2048;} //TODO: Get from packet?
- //private set;
- }
-
- public bool IsReceiveOk()
- {
- return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.ROK);
- }
-
- public bool IsFrameAlignmentError()
- {
- return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.FAE);
- }
-
- public bool IsCRCError()
- {
- return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.CRC);
- }
-
- public bool IsLongPacket()
- {
- return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.LONG);
- }
-
- public bool IsRuntPacket()
- {
- return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.RUNT);
- }
-
- public bool IsInvalidSymbolError()
- {
- return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.ISE);
- }
-
- public bool IsBroadcastAddress()
- {
- return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.BAR);
- }
-
- public bool IsPhysicalAddressMatch()
- {
- return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.PAM);
- }
-
- public bool IsMulticastAddress()
- {
- return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.MAR);
- }
-
- private enum PacketHeadBit : ushort
- {
- ROK = 0x00, //Receive OK
- FAE = 0x01, //Frame Alignment Error
- CRC = 0x02, //CRC Error
- LONG = 0x03,//Long packet - set to 1 when packet over 4k bytes
- RUNT = 0x04,//Runt packet received (smaller than 64 bytes)
- ISE = 0x05, //Invalid Symbol Error (Only 100BASE-TX).
- BAR = 0x0D, //Broadcast Address Received
- PAM = 0x0E, //Physical Address Matched
- MAR = 0x0F //Multicast Address Received
- }
- }
-}
\ No newline at end of file
diff --git a/source/Cosmos.Driver.RTL8139/Properties/AssemblyInfo.cs b/source/Cosmos.Driver.RTL8139/Properties/AssemblyInfo.cs
deleted file mode 100644
index 6750c4f78..000000000
--- a/source/Cosmos.Driver.RTL8139/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Cosmos.Driver.RTL8139")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Cosmos.Driver.RTL8139")]
-[assembly: AssemblyCopyright("Copyright © 2008")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("c18ed28a-23cc-4374-832d-87aeaa37c267")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/source/Cosmos.Driver.RTL8139/RTL8139.cs b/source/Cosmos.Driver.RTL8139/RTL8139.cs
deleted file mode 100644
index fce286d87..000000000
--- a/source/Cosmos.Driver.RTL8139/RTL8139.cs
+++ /dev/null
@@ -1,369 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Cosmos.Hardware.Network;
-using Cosmos.Hardware.PC.Bus;
-using Cosmos.Hardware;
-using Cosmos.Driver.RTL8139.Register;
-
-namespace Cosmos.Driver.RTL8139
-{
- ///
- /// Driver for networkcards using the RTL8139 chip.
- /// Some documentation can be found at: http://www.osdev.org/wiki/RTL8139
- ///
- public class RTL8139 : NetworkDevice //, DeviceDriver interface
- {
- ///
- /// Retrieve all Realtek 8139 network cards found on computer.
- ///
- ///
- public static List FindRTL8139Devices()
- {
- List found = new List();
-
- foreach (PCIDevice device in Cosmos.Hardware.PC.Bus.PCIBus.Devices)
- {
- //Console.WriteLine("VendorID: " + device.VendorID + " - DeviceID: " + device.DeviceID);
- if (device.VendorID == 0x10EC && device.DeviceID == 0x8139)
- found.Add(new RTL8139(device));
- }
-
- return found;
- }
-
- private PCIDevice pciCard;
- private MemoryAddressSpace mem;
- private Register.MainRegister regs;
- private byte[] TxBuffer0;
- private byte[] TxBuffer1;
- private byte[] TxBuffer2;
- private byte[] TxBuffer3;
- private byte[] RxBuffer;
- //private byte[] RxBuffer2 = new byte[2048];
- //private byte[] RxBuffer3 = new byte[2048];
- //private byte[] RxBuffer4 = new byte[2048];
-
-
-
- public RTL8139(PCIDevice device)
- {
- pciCard = device;
- mem = device.GetAddressSpace(1) as MemoryAddressSpace;
- regs = new MainRegister(mem);
- }
-
- public PCIDevice PCICard { get { return pciCard; } private set { ;} }
-
- #region NetworkDevice members
- public override MACAddress MACAddress
- {
- get
- {
- //Polls the PCI device for the MAC address
- /*byte[] bytes = new byte[6];
- for (int i = 0; i < 6; i++)
- {
- uint address = (uint)(pciCard.BaseAddress1 + i);
- bytes[i] = IOSpace.Read8(address);
- }
-
- MACAddress mac = new MACAddress(bytes);
- return mac;
- * */
-
- return regs.Mac;
- }
- }
-
- public string GetHardwareRevision()
- {
- TransmitConfigurationRegister tcr = TransmitConfigurationRegister.Load(pciCard);
- return TransmitConfigurationRegister.GetHardwareRevision(tcr.GetHWVERID());
- }
-
- ///
- /// Performs additional hardware initilization
- ///
- public void InitializeDriver()
- {
- //Turn on Tx and Rx
- EnableTransmit();
- EnableRecieve();
-
- //Initialize buffers
- InitTransmitBuffer();
- InitReceiveBuffer();
-
- //Setting Transmit configuration
- TransmitConfigurationRegister tcr = TransmitConfigurationRegister.Load(pciCard);
- tcr.Init();
-
- //Setting Receive configuration
- ReceiveConfigurationRegister rcr = ReceiveConfigurationRegister.Load(pciCard);
- rcr.Init();
-
- //Enable IRQ Interrupt
- SetIRQMaskRegister();
- Console.WriteLine("PCI should raise IRQ" + pciCard.InterruptLine);
- Cosmos.Hardware.PC.Interrupts.IRQ11 = new Cosmos.Hardware.PC.Interrupts.InterruptDelegate(HandleNetworkInterrupt);
- }
-
- ///
- /// Changes the Loopback mode.
- ///
- /// True to enable Loopback. False for normal operation.
- public void SetLoopbackMode(bool value)
- {
- TransmitConfigurationRegister tcr = TransmitConfigurationRegister.Load(pciCard);
- tcr.LoopbackMode = value;
- }
-
- public bool GetLoopbackMode()
- {
- TransmitConfigurationRegister tcr = TransmitConfigurationRegister.Load(pciCard);
- return tcr.LoopbackMode;
- }
-
- public override bool QueueBytes(byte[] buffer, int offset, int length)
- {
- throw new NotImplementedException();
- }
-
- public override bool RecieveBytes(byte[] buffer, int offset, int max)
- {
- throw new NotImplementedException();
- }
-
- public override int BytesAvailable()
- {
- throw new NotImplementedException();
- }
-
- public override bool IsSendBufferFull()
- {
- throw new NotImplementedException();
- }
-
- public override bool IsRecieveBufferFull()
- {
- throw new NotImplementedException();
- }
- #endregion
-
- public override string Name
- {
- get { return "Generic RTL8139 Network device"; }
- }
-
- public override bool Enable()
- {
- //Writes 0x00 to CONFIG_1 registers to enable card
- regs.Config1 = 0x00;
- return true;
- }
-
- ///
- /// Performs an internal system hardware reset of the network card.
- ///
- public void SoftReset()
- {
- Console.WriteLine("Performing software reset of RTL8139");
-
- //Tell RTL chip to issue a Reset`
- regs.ChipCmd = MainRegister.ChipCommandFlags.RST;
-
- //Wait while RST bit is active
- while (regs.ChipCmdTest(MainRegister.ChipCommandFlags.RST))
- {
- Console.WriteLine("Reset in progress...");
- }
-
- Console.WriteLine("Reset Complete!");
- }
-
- ///
- /// (Should be) Called when the PCI network card raises an Interrupt.
- ///
- public static void HandleNetworkInterrupt()
- {
- Console.WriteLine("Network IRQ raised! Indicates data received...");
- }
-
- ///
- /// The IRQMaskRegister
- ///
- private void SetIRQMaskRegister()
- {
- byte mask = (byte)
- (Register.InterruptMaskRegister.Bit.ROK &
- Register.InterruptMaskRegister.Bit.TOK &
- Register.InterruptMaskRegister.Bit.RER &
- Register.InterruptMaskRegister.Bit.TER
- );
-
- //Note; The reference driver from Realtek sets mask = 0x7F (all bits high).
- //mask = 0x7F;
-
- UInt32 address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.IntrMask;
- IOSpace.Write8(address, mask);
- }
-
- ///
- /// This register indicates the source of an interrupt when the INTA pin goes active.
- /// Enabling the corresponding bits in the Interrupt Mask Register (IMR) allows bits in this register to produce an interrupt.
- /// When an interrupt is active, one of more bits in this register are set to a “1”.
- /// The interrupt Status Register reflects all current pending interrupts, regardless of the state of the corresponding mask bit in the IMR.
- /// Reading the ISR clears all interrupts. Writing to the ISR has no effect.
- ///
- private void GetIRQServiceRegister()
- {
- //Could perhaps be used to raise events?
- throw new NotImplementedException();
- }
-
- ///
- /// Enable the NIC to be able to Recieve data.
- ///
- public void EnableRecieve()
- {
- regs.ChipCmd = MainRegister.ChipCommandFlags.TE;
- }
-
- ///
- /// Enable the NIC to be able to Transmit data.
- ///
- public void EnableTransmit()
- {
- regs.ChipCmd = MainRegister.ChipCommandFlags.TE;
- }
-
- ///
- /// A general purpose timer. Writing to this will reset timer. NB: Timer does not work in Qemu.
- ///
- public UInt32 TimerCount
- {
- get
- {
- return IOSpace.Read32(pciCard.BaseAddress1 + (byte)MainRegister.Bit.Timer);
- }
- set
- {
- UInt32 address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.Timer;
- IOSpace.Write32(address, 0x00); //Resets timer
- }
- }
-
- ///
- /// The Early TX Threshold specifies the threshold level in Tx FIFO register before transmission begins.
- /// The bytecount should not exceed 2048(2k bytes).
- /// The bytecount also needs to be dividable by 32.
- /// If bytecount 0 is set then NIC will use 8 bytes as threshold
- ///
- /// Number zero or a number dividable by 32.
- public void SetEarlyTxThreshold(uint bytecount)
- {
- //TODO: This method should be in TransmitStatusDescriptos.cs
- if (bytecount != 0 & (bytecount % 32 > 0))
- throw new ArgumentException("Early TX Threshold must be 0 or dividable by 32");
-
- //Each of the four Transmit Status Descriptors (TSD) has its own EarlyTxThreshold.
-
- UInt32 address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.RxEarlyCnt;
- IOSpace.Write8(address, (byte)bytecount);
- }
-
- ///
- /// Initialize the Receive Buffer. The RBSTART register consists of 4 bytes (0x30h to 0x33h) which should contain
- /// the address of a buffer to save incoming data to.
- ///
- public void InitReceiveBuffer()
- {
- //Prepare a buffer area
-
- RxBuffer = new byte[2048];
-
- UInt32 address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.RxBuf;
-
- //Write the address of the buffer area to the RBSTART
- WriteAddressToPCI(ref RxBuffer, address);
-
- Console.WriteLine("RxBuffer address: " + address);
- Console.WriteLine("RxBuffer contains address: " + IOSpace.Read32(address));
- }
-
- public void InitTransmitBuffer()
- {
- //Initialize Tx Buffers
-
- TxBuffer0 = new byte[2048];
- TxBuffer1 = new byte[2048];
- TxBuffer2 = new byte[2048];
- TxBuffer3 = new byte[2048];
-
- WriteAddressToPCI(ref TxBuffer0, pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSAD0);
- WriteAddressToPCI(ref TxBuffer1, pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSAD1);
- WriteAddressToPCI(ref TxBuffer2, pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSAD2);
- WriteAddressToPCI(ref TxBuffer3, pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSAD3);
- }
-
- ///
- /// Takes a byte array, and a memory address.
- /// The memoryaddress of the begining of the bytearray is written to the memory address.
- ///
- ///
- ///
- private unsafe void WriteAddressToPCI(ref byte[] bytearray, uint address)
- {
-
- /* The data in the bytearray contains the actual bytes we want to transfer to the network.
- * This bytearray must be in a continous memoryarea on the computer.
- * We then write the address of this memoryarea to the network card.
- * The address is stored in the Transmit Start Address which corresponds to the Transmit Status Descriptor we are currently using (0-3).
- */
-
-
- fixed (byte* bodystart = &bytearray[0])
- {
- IntPtr bodyAddress = (IntPtr)bodystart;
- IOSpace.Write32(address, (uint)bodyAddress);
- Console.WriteLine("Address where buffer is stored: " + (uint)bodyAddress);
- }
- }
-
- ///
- /// Transmits the given Packet
- ///
- ///
- public unsafe bool Transmit(Packet packet)
- {
- //Put the packet into the correct TxBuffer
- TxBuffer1 = packet.PacketBody;
-
- //Cosmos.Hardware.PC.Global.Sleep(300);
-
- //Console.Write("Data in Transmit Status Descriptor " + TransmitStatusDescriptor.GetCurrentTSDescriptor() + ":");
- //Console.WriteLine(IOSpace.Read32(address));
- //At this point the TSDA0 should contain the address of the data.
- //Console.WriteLine("The Data pointed to: " + IOSpace.Read32(IOSpace.Read32(address)));
-
- //Set the transmit status - which enables the transmit.
- TransmitStatusDescriptor tsd = TransmitStatusDescriptor.Load(pciCard);
- tsd.Size = packet.PacketBody.Length;
- Console.WriteLine("Told NIC to send " + tsd.Size + " bytes.");
-
- //Print packet
- /*for (int i = 0; i < tsd.Size; i++)
- {
- Console.Write(TxBuffer1[i] + ":");
- }*/
-
- SetEarlyTxThreshold(1024);
- Console.WriteLine("Sending...");
- tsd.ClearOWNBit();
- TransmitStatusDescriptor.IncrementTSDescriptor();
-
- return true;
- }
- }
-}
diff --git a/source/Cosmos.Driver.RTL8139/Register/CommandRegister.cs b/source/Cosmos.Driver.RTL8139/Register/CommandRegister.cs
deleted file mode 100644
index 6330aefd3..000000000
--- a/source/Cosmos.Driver.RTL8139/Register/CommandRegister.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Cosmos.Driver.RTL8139.Misc;
-using Cosmos.Hardware;
-using Cosmos.Hardware.PC.Bus;
-
-namespace Cosmos.Driver.RTL8139.Register
-{
- ///
- /// The CommandRegister is used for issuing commands to the RTL8139.
- /// Used for performing Software Reset, or enabling transmitter and receiver.
- /// 1 Byte wide. Only one 4 bits used. (Bit 1, 5, 6, 7 not used)
- /// Offset 0x37h from the base memory.
- ///
- public class CommandRegister
- {
- //private byte cmd;
-
- private PCIDevice pcicard = null;
- private UInt32 address = 0;
-
- public static CommandRegister Load(PCIDevice pci)
- {
- //pcicard = pci;
- UInt32 address = GetCmdAddress(pci);
- return new CommandRegister(pci, address);
- }
-
- private CommandRegister(PCIDevice pci, UInt32 adr)
- {
- pcicard = pci;
- address = adr;
- }
-
- public byte GetCmdRegister()
- {
- return IOSpace.Read8(GetCmdAddress());
- }
-
- public UInt32 GetCmdAddress()
- {
- return pcicard.BaseAddress1 + (byte)MainRegister.Bit.ChipCmd;
- }
-
- public static UInt32 GetCmdAddress(PCIDevice pci)
- {
- return pci.BaseAddress1 + (byte)MainRegister.Bit.ChipCmd;
- }
-
- ///
- /// Bits used to issue commands to the RTL. Used in conjunction with register CHIPCMD (0x37h)
- ///
- public enum BitPosition : byte
- {
- BUFE = 0x00, //Buffer Empty, read-only
- TE = 0x02, //Transmitter Enable
- RE = 0x03, //Receiver Enable
- RST = 0x04 //Software Reset
- }
-
- public enum BitValue : byte
- {
- BUFE = 1,
- TE = 4,
- RE = 8,
- RST = 16
- }
-
- public bool IsResetStatus()
- {
- byte cmd = GetCmdRegister();
- return BinaryHelper.CheckBit(cmd, (byte)BitPosition.RST);
- }
-
- }
-}
diff --git a/source/Cosmos.Driver.RTL8139/Register/EarlyRxStatusRegister.cs b/source/Cosmos.Driver.RTL8139/Register/EarlyRxStatusRegister.cs
deleted file mode 100644
index 1ba6ed8ca..000000000
--- a/source/Cosmos.Driver.RTL8139/Register/EarlyRxStatusRegister.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Cosmos.Driver.RTL8139.Misc;
-
-namespace Cosmos.Driver.RTL8139.Register
-{
- ///
- /// The Early Receive Status Register (ERSR) is used as an indicator when incoming data is received.
- /// Is 1 byte wide, but only 4 bits used.
- /// Offset 0x36h from main memory.
- ///
- public class EarlyRxStatusRegister
- {
- private byte ersr;
- public EarlyRxStatusRegister(byte data)
- {
- ersr = data;
- }
-
- public bool IsEarlyRXOkay()
- {
- return BinaryHelper.CheckBit((ushort)ersr, (ushort)Bit.EROK);
- }
-
- public bool IsEarlyRXOverwrite()
- {
- return BinaryHelper.CheckBit((ushort)ersr, (ushort)Bit.EROVW);
- }
-
- public bool IsEarlyRXBadPacket()
- {
- return BinaryHelper.CheckBit((ushort)ersr, (ushort)Bit.ERBAD);
- }
-
- public bool IsEarlyRXGoodPacket()
- {
- return BinaryHelper.CheckBit((ushort)ersr, (ushort)Bit.ERGOOD);
- }
-
- public enum Bit : ushort
- {
- ///
- /// Early RX OK. Initial value 0. Set when Rx byte count exceeds Rx threshold.
- /// When whole packet is received the ROK or RER is set in ISR, and this bit is cleared.
- ///
- EROK = 0x00,
- ///
- /// Early Rx Overwrite. Set when local address pointer is equal to CAPR. In the early mode
- /// this is different from buffer overflow.
- ///
- EROVW = 0x01,
- ///
- /// Set when a packet is completely received, but the packet is bad.
- ///
- ERBAD = 0x02,
- ///
- /// Set when packet is completely received, and the packet is good.
- ///
- ERGOOD = 0x03
- }
- }
-}
diff --git a/source/Cosmos.Driver.RTL8139/Register/InterruptMaskRegister.cs b/source/Cosmos.Driver.RTL8139/Register/InterruptMaskRegister.cs
deleted file mode 100644
index 7995678b5..000000000
--- a/source/Cosmos.Driver.RTL8139/Register/InterruptMaskRegister.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Cosmos.Driver.RTL8139.Register
-{
- ///
- /// This register masks the interrupts that can be generated from the InterruptStatusRegister (ISR).
- /// Setting a bit to 1 will enable a corresponding bit in ISR to cause an interrupt.
- /// During a hardware reset all bits are set to 0.
- /// Offset 0x3C - 0x3D from base memory.
- /// 16 bit wide.
- ///
- class InterruptMaskRegister
- {
- public enum Bit : byte
- {
- ROK = 0x00, //Receive (Rx) OK
- RER = 0x01, //Receive (Rx) Error
- TOK = 0x02, //Transmit (Tx) OK
- TER = 0x03, //Transmit (Tx) Error
- RXOVW = 0x04, //Rx Buffer Overflow
- PUNLC = 0x05, //Packed Underrun/Link Change
- FOVW = 0x06, //FIFO Overflow
- LENCHG = 0x0D, //Cable Length Changed
- TIMEOUT = 0x0E, //Raised when TCTR register matches TimeInt register
- SERR = 0x0F //System Error. Might cause a reset.
- }
-
- }
-}
diff --git a/source/Cosmos.Driver.RTL8139/Register/MainRegister.cs b/source/Cosmos.Driver.RTL8139/Register/MainRegister.cs
deleted file mode 100644
index 0d7c95546..000000000
--- a/source/Cosmos.Driver.RTL8139/Register/MainRegister.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Cosmos.Hardware.PC.Bus;
-using Cosmos.Hardware.Network;
-
-namespace Cosmos.Driver.RTL8139.Register
-{
- class MainRegister
- {
- private MemoryAddressSpace mem;
- public MainRegister(MemoryAddressSpace mem)
- {
- this.mem = mem;
- }
-
- public MACAddress Mac
- {
- get
- {
- byte[] b = new byte[6];
-
- for (byte i = 0; i < 6; i++)
- b[i] = mem.Read8Unchecked((UInt32)Bit.MAC0 + i);
-
- return new MACAddress(b);
- }
- set
- {
- for (byte b=0; b<6; b++)
- mem.Write8Unchecked((UInt32)Bit.MAC0 + b, value.bytes[b]);
- }
- }
-
-
- public byte[] Mar
- {
- get
- {
- byte[] b = new byte[6];
-
- for (byte i = 0; i < 6; i++)
- b[i] = mem.Read8Unchecked((UInt32)Bit.MAR0 + i);
-
- return b;
- }
- set
- {
- for (byte b = 0; b < 6; b++)
- mem.Write8Unchecked((UInt32)Bit.MAR0 + b, value[b]);
- }
- }
-
- public byte Config0
- {
- get
- {
- return mem.Read8Unchecked((UInt32)Bit.Config0);
- }
- set
- {
- mem.Write8Unchecked((UInt32)Bit.Config0, value);
- }
- }
- public byte Config1
- {
- get
- {
- return mem.Read8Unchecked((UInt32)Bit.Config1);
- }
- set
- {
- mem.Write8Unchecked((UInt32)Bit.Config1, value);
- }
- }
-
- public UInt32 TxConfig
- {
- get
- {
- return mem.Read32((UInt32)Bit.TxConfig);
- }
- set
- {
- mem.Write32((UInt32)Bit.TxConfig, value);
- }
- }
-
- public ChipCommandFlags ChipCmd
- {
- get
- {
- return (ChipCommandFlags)mem.Read8Unchecked((UInt32)Bit.ChipCmd);
- }
- set
- {
- mem.Write8Unchecked((UInt32)Bit.ChipCmd, (byte)value);
- }
- }
- public bool ChipCmdTest(ChipCommandFlags mask)
- {
- return (ChipCmd & mask) == mask;
- }
-
- [Flags]
- public enum ChipCommandFlags : byte
- {
- BUFE = 1,
- TE = 4,
- RE = 8,
- RST = 16
- }
-
- ///
- /// The RTL8139 contains 64 x 16 bit EEPROM registers.
- ///
- public enum Bit : byte
- {
- MAC0 = 0x00, // Ethernet hardware address
- MAR0 = 0x08, // Multicast filter
- TSD0 = 0x10, // Transmit status (Four 32bit registers)
- TSD1 = 0x14,
- TSD2 = 0x18,
- TSD3 = 0x1C,
- TSAD0 = 0x20, // Tx descriptors (also four 32bit)
- TSAD1 = 0x24,
- TSAD2 = 0x28,
- TSAD3 = 0x2C,
- RxBuf = 0x30,
- RxEarlyCnt = 0x34,
- RxEarlyStatus = 0x36,
- ChipCmd = 0x37,
- RxBufPtr = 0x38,
- RxBufAddr = 0x3A,
- IntrMask = 0x3C,
- IntrStatus = 0x3E,
- TxConfig = 0x40,
- RxConfig = 0x44,
- Timer = 0x48, // A general-purpose counter
- RxMissed = 0x4C, // 24 bits valid, write clears
- Cfg9346 = 0x50,
- Config0 = 0x51,
- Config1 = 0x52,
- FlashReg = 0x54,
- GPPinData = 0x58,
- GPPinDir = 0x59,
- MII_SMI = 0x5A,
- HltClk = 0x5B,
- MultiIntr = 0x5C,
- TxSummary = 0x60,
- MII_BMCR = 0x62,
- MII_BMSR = 0x64,
- NWayAdvert = 0x66,
- NWayLPAR = 0x68,
- NWayExpansion = 0x6A
- }
-
- }
-}
diff --git a/source/Cosmos.Driver.RTL8139/Register/ReceiveConfigurationRegister.cs b/source/Cosmos.Driver.RTL8139/Register/ReceiveConfigurationRegister.cs
deleted file mode 100644
index ee6c1e3af..000000000
--- a/source/Cosmos.Driver.RTL8139/Register/ReceiveConfigurationRegister.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Cosmos.Hardware;
-using Cosmos.Hardware.PC.Bus;
-using Cosmos.Driver.RTL8139.Misc;
-
-namespace Cosmos.Driver.RTL8139.Register
-{
- ///
- /// Receive Configuration Register is used to set receive configuration.
- /// Offset 44h from main memory.
- ///
- public class ReceiveConfigurationRegister
- {
- private PCIDevice pci;
- private UInt32 rcrAddress;
-
- public static ReceiveConfigurationRegister Load(PCIDevice pcicard)
- {
- UInt32 address = pcicard.BaseAddress1 + (byte)MainRegister.Bit.RxConfig;
- return new ReceiveConfigurationRegister(pcicard, address);
- }
-
- public ReceiveConfigurationRegister(PCIDevice hw, UInt32 adr)
- {
- pci = hw;
- rcrAddress = adr;
- }
-
- public void Init()
- {
- UInt32 data = (UInt32)(BitValue.RBLEN0 | BitValue.MXDMA0 | BitValue.MXDMA1 | BitValue.AB | BitValue.AM | BitValue.APM);
- Console.WriteLine("Data in INIT for RX is: " + data);
- IOSpace.Write32(rcrAddress, data);
- }
-
- public UInt32 RCR
- {
- get
- {
- return IOSpace.Read32(rcrAddress);
- }
- private set { ;}
- }
-
- public enum BitValue : uint
- {
- ///
- /// Accept Physical Address Packets. 0 rejects, 1 accepts.
- ///
- AAP = BinaryHelper.BitPos.BIT0,
- ///
- /// Accept Physical Match Packets. 0 rejects, 1 accepts.
- ///
- APM = BinaryHelper.BitPos.BIT1,
- ///
- /// Accept Multicast Packets. 0 rejects, 1 accepts.
- ///
- AM = BinaryHelper.BitPos.BIT2,
- ///
- /// Accept Broadcast Packets. 0 rejects, 1 accepts.
- ///
- AB = BinaryHelper.BitPos.BIT3,
- ///
- /// Accept Runt Packets (packets smaller than 64 bytes - but over 8 bytes.)
- ///
- AR = BinaryHelper.BitPos.BIT4,
- ///
- /// Accept Error Packets (Packets with CRC error, alignment error and/or collided fragments).
- ///
- AER = BinaryHelper.BitPos.BIT5,
- ///
- /// EEPROM used. 0 = 9346, 1 = 9356.
- ///
- EEPROM = BinaryHelper.BitPos.BIT6,
- ///
- /// (Only C mode) 0: Wrap incoming packet to beginning of next RxBuffer.
- /// 1: Overflow packet even after coming to end of buffer.
- ///
- WRAP = BinaryHelper.BitPos.BIT7,
- ///
- /// Three bits wide.
- /// Max DMA Burst Size per Rx DMA Burst. 010 = 64 bytes, 011 = 128 bytes, 100 = 256 bytes.
- ///
- MXDMA0 = BinaryHelper.BitPos.BIT8,
- MXDMA1 = BinaryHelper.BitPos.BIT9,
- MXDMA2 = BinaryHelper.BitPos.BIT10,
- ///
- /// RxBuffer Length.
- /// 00 = 8k + 16 byte
- /// 01 = 16k + 16 byte
- /// 10 = 32k + 16 byte
- /// 11 = 64k + 16 byte
- ///
- RBLEN0 = BinaryHelper.BitPos.BIT11,
- RBLEN1 = BinaryHelper.BitPos.BIT12,
- ///
- /// Rx FIFO Threshold. Three bits wide.
- /// When recieved byte count matches this level the incoming data will
- /// be transferred from FIFO to host memory.
- /// See 8139C+ specs for valid values.
- ///
- RXFTH0 = BinaryHelper.BitPos.BIT13,
- ///
- /// Receive Error Packets Larger than 8 bytes. Yes if 1. If 0 (default) then
- /// 64-byte error packets are received. Also depends on AER or AR bits.
- ///
- RER8 = BinaryHelper.BitPos.BIT16,
- ///
- /// Multiple Early Interrupt Select. 1 bit wide.
- ///
- MULERINT = BinaryHelper.BitPos.BIT17,
- ///
- /// Early Rx Threshold. 4 bits wide.
- ///
- ERTH0 = BinaryHelper.BitPos.BIT24
- }
- }
-}
diff --git a/source/Cosmos.Driver.RTL8139/Register/TransmitConfigurationRegister.cs b/source/Cosmos.Driver.RTL8139/Register/TransmitConfigurationRegister.cs
deleted file mode 100644
index 57ce498ae..000000000
--- a/source/Cosmos.Driver.RTL8139/Register/TransmitConfigurationRegister.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Cosmos.Hardware;
-using Cosmos.Hardware.PC.Bus;
-using Cosmos.Driver.RTL8139.Misc;
-
-namespace Cosmos.Driver.RTL8139.Register
-{
- ///
- /// The TransmitConfigurationRegister (TCR) defines transmit configuration. It controls functions as
- /// loopback, heartbeat, auto transmit padding, Programmable Interframe Gap, Fill and Drain thresholds
- /// and maximum DMS burst size.
- /// Is 32 bits wide. Offset 0x40h-0x43h from main memory.
- ///
- public class TransmitConfigurationRegister
- {
- private UInt32 tcr;
- private PCIDevice pci;
- private UInt32 tcrAddress;
- private TransmitConfigurationRegister(UInt32 data, PCIDevice hw, UInt32 adr)
- {
- tcr = data;
- pci = hw;
- tcrAddress = adr;
- }
-
- public static TransmitConfigurationRegister Load(PCIDevice pcicard)
- {
- UInt32 address = pcicard.BaseAddress1 + (byte)MainRegister.Bit.TxConfig;
- UInt32 foundbytes = IOSpace.Read32(address);
- return new TransmitConfigurationRegister(foundbytes, pcicard, address);
- }
-
- public void Init()
- {
- //Set Interframe Gap and Max Burst Size (to 128 bytes)
- UInt32 data = (UInt32)(BitValue.IFG0 | BitValue.IFG1 | BitValue.MAXDMA0 | BitValue.MAXDMA1);
- //Console.WriteLine("Data in INIT for TX:" + data);
- IOSpace.Write32(tcrAddress, data);
- }
-
- ///
- /// Retrieves 6 bits
- ///
- ///
- public byte GetHWVERID()
- {
- byte mask = 249; // 1111 1001
- byte hwverid = Misc.BinaryHelper.GetByteFrom32bit(tcr, (byte)(23));
- return (byte)(mask & hwverid);
- }
-
- //internal void SetLoopBack(bool value)
- //{
- // //Change bits LBK0 and LBK1 to HIGH for Loopback, or LOW for Normal mode.
- // if (value)
-
-
-
- //}
-
- public bool LoopbackMode
- {
- get
- {
- UInt32 data = IOSpace.Read32(tcrAddress);
- bool low = BinaryHelper.CheckBit(data, 17);
- bool high = BinaryHelper.CheckBit(data, 18);
-
- if (low != high)
- Console.WriteLine("Warning: Loopback bits should always be the same!");
-
- if (low && high)
- return true;
- else
- return false;
- }
- set
- {
- UInt32 data = IOSpace.Read32(tcrAddress);
- if (value) //turn ON
- data = (UInt32)(data | (uint)BitValue.LBK0 | (uint)BitValue.LBK1);
- else //turn OFF
- data = (UInt32)(data & (uint)~BitValue.LBK0 & (uint)~BitValue.LBK1);
-
- IOSpace.Write32(tcrAddress, data);
- }
- }
-
- public enum BitValue : uint
- {
- ///
- /// Setting to 1 will cause RTL8139 to retransmit packet. Only allowed in transmit abort state.
- ///
- CLRABT = BinaryHelper.BitPos.BIT0,
- ///
- /// Tx Retry Count - 4 bits wide. Tx retry count in multiple of 16. Retries = 16 + (TXRR * 16) times.
- ///
- TXRR = BinaryHelper.BitPos.BIT4,
- ///
- /// Max DMA Burst Size per Tx DMA Burst. Se documentation for value details.
- ///
- MAXDMA0 = BinaryHelper.BitPos.BIT8,
- MAXDMA1 = BinaryHelper.BitPos.BIT9,
- MAXDMA2 = BinaryHelper.BitPos.BIT10,
- ///
- /// Append CRC. 0 = CRC is appended. 1 = CRC not appended.
- ///
- CRC = BinaryHelper.BitPos.BIT16,
- ///
- /// Loopback test. 00 is normal. 11 is loopback mode.
- ///
- LBK0 = BinaryHelper.BitPos.BIT17,
- LBK1 = BinaryHelper.BitPos.BIT18,
- ///
- /// Revisision. If this bit is 1 then the network card is RTL8139 rev.G. All other revisions have bit set to 0.
- ///
- REVG = BinaryHelper.BitPos.BIT23,
- ///
- /// Interframe Gap Time. Adjusts time between frames. 9.6 micro sec for 10Mbps. 0,96 micro sec for 100Mbps.
- /// Only 0xFF is valid according to IEEE 802.3 standard. Two bits wide.
- ///
- IFG0 = BinaryHelper.BitPos.BIT24,
- IFG1 = BinaryHelper.BitPos.BIT25,
- ///
- /// Hardware Version ID. 5 bits wide (6 with bit 23). See separate method to convert to string.
- ///
- HWVERID = BinaryHelper.BitPos.BIT26
- }
-
- ///
- /// Get the hardware revision. F.instance RTL8139A or RTL8139C+.
- ///
- /// Must be the byte from bit 23 to bit 30 in the TCR! Bit 24 and 25 must be 0.
- ///
- public static string GetHardwareRevision(byte hwverid)
- {
- switch (hwverid)
- {
- case 192: //11000000
- return "RTL8139";
- case 224: //11100000
- return "RTL8139A";
- case 225: //11100001
- return "RTL8139A-G";
- case 232: //11101000
- return "RTL8139C";
- case 233: //11101001
- return "RTL8139C+";
- case 240: //11110000
- return "RTL8139B";
- case 248: //11111000
- return "RTL8130";
- default:
- return "Unknown RTL813xxx revision (" + hwverid + ")";
- }
-
- }
-
-
- }
-}
diff --git a/source/Cosmos.Driver.RTL8139/Register/TransmitStatusDescriptor.cs b/source/Cosmos.Driver.RTL8139/Register/TransmitStatusDescriptor.cs
deleted file mode 100644
index 05032caf8..000000000
--- a/source/Cosmos.Driver.RTL8139/Register/TransmitStatusDescriptor.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Cosmos.Hardware;
-using Cosmos.Hardware.PC.Bus;
-using Cosmos.Driver.RTL8139.Register;
-using Cosmos.Driver.RTL8139.Misc;
-
-
-namespace Cosmos.Driver.RTL8139.Register
-{
- ///
- /// Transmit Status Register is used to describe how the process of transmitting data is going/gone.
- /// The RTL8139 contains four of these descriptors.
- /// Located at 0x10h, 0x14h, 0x18h and 0x1Ch, each is 4 bytes wide.
- ///
- public class TransmitStatusDescriptor
- {
- private PCIDevice pci;
- private UInt32 tdsAddress;
- public static TransmitStatusDescriptor Load(PCIDevice pciCard)
- {
- //Retrieve the 32 bits from the PCI card
- //and create a TSD object
- UInt32 address = 0;
- switch (GetCurrentTSDescriptor())
- {
- case 0:
- address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSD0;
- break;
- case 1:
- address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSD1;
- break;
- case 2:
- address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSD2;
- break;
- case 3:
- address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSD3;
- break;
- default:
- Console.WriteLine("Illegal TSDescriptor in RTL driver!");
- break;
- }
-
- return new TransmitStatusDescriptor(pciCard, address);
- }
-
- private TransmitStatusDescriptor(PCIDevice hw, UInt32 adr)
- {
- pci = hw;
- tdsAddress = adr;
- }
-
- ///
- /// Used to get the 32 bit value stored in the TransmitStatusDescriptor.
- ///
- private UInt32 TSD
- {
- get
- {
- return IOSpace.Read32(tdsAddress);
- }
- }
-
- ///
- /// Clears the OWN bit in the Transmit Status Descriptor. This starts poring the data from the
- /// buffer into the FIFO buffer on the PCI card. The data then moves from the FIFO to the network cable.
- ///
- public void ClearOWNBit()
- {
- //Read byte from register
- byte offset = 8;
- byte data = BinaryHelper.GetByteFrom32bit(this.TSD, offset);
-
-
- Console.WriteLine("OWN data before: " + BinaryHelper.CheckBit(this.TSD, 13));
-
- //Turn off single OWN bit
- //data &= (byte)~(1 << (byte)(BitValue.OWN - offset));
- data &= (byte)~(1 << (byte)(13 - offset));
-
- //TODO, change to this instead...
-// if (BinaryHelper.CheckBit(data, 13 - offset)) //OWN bit is HIGH
- // BinaryHelper.FlipBit(data, 13 - offset);
-
- //Write all 8 bits back
- IOSpace.Write8(tdsAddress + offset, data);
-
- Console.WriteLine("OWN data after: " + BinaryHelper.CheckBit(this.TSD, 13));
- }
-
- ///
- /// The total size in bytes of the data in the descriptor. Must not be longer then 1792 bytes (0x700h), this
- /// will set Tx queue invalid.
- ///
- public int Size
- {
- get
- {
- byte offset = 0;
- //return (int)IOSpace.Read8(this.TSD + offset);
- //return (int)IOSpace.Read8(
- Console.WriteLine("TSD is: " + this.TSD);
- Console.WriteLine("First 8 bits: " + (byte)BinaryHelper.GetByteFrom32bit(this.TSD, offset));
- return (int)BinaryHelper.GetByteFrom32bit(this.TSD, offset);
- }
- set
- {
- //TODO: Check this - the register contains 12 bits. We only write 8 bits here.
- byte offset = 0;
- IOSpace.Write16(tdsAddress + offset, (UInt16)value);
- //Console.WriteLine("Wrote value " + (UInt16)value + " to TDSAddress: " + tdsAddress);
- //Console.WriteLine("Read again: " + IOSpace.Read8(tdsAddress + offset));
- }
- }
-
- public enum BitValue : uint
- {
- SIZE = BinaryHelper.BitPos.BIT0, //12 bit long. Must not contain value over 0x700h
- OWN = BinaryHelper.BitPos.BIT13, //Set to 1 when transmit complete. Defaults to 1.
- TUN = BinaryHelper.BitPos.BIT14, //Transmit FIFO Underrun. Is set to 1 if TxFIFO was exhausted during transmition.
- TOK = BinaryHelper.BitPos.BIT15, //Transmit OK.
- ERTXTH0 = BinaryHelper.BitPos.BIT16, //Early TX Threshold 0-5
- ERTXTH1 = BinaryHelper.BitPos.BIT17,
- ERTXTH2 = BinaryHelper.BitPos.BIT18,
- ERTXTH3 = BinaryHelper.BitPos.BIT19,
- ERTXTH4 = BinaryHelper.BitPos.BIT20,
- ERTXTH5 = BinaryHelper.BitPos.BIT21,
- NCC0 = BinaryHelper.BitPos.BIT24, //Number of Collision Count 0-3
- NCC1 = BinaryHelper.BitPos.BIT25,
- NCC2 = BinaryHelper.BitPos.BIT26,
- NCC3 = BinaryHelper.BitPos.BIT27,
- CDH = BinaryHelper.BitPos.BIT28, //CD Heart Beat. Cleared in 100Mbps mode.
- OWC = BinaryHelper.BitPos.BIT29, //Out of Window Collision
- TABT = BinaryHelper.BitPos.BIT30, //Transmition aborted
- CRS = BinaryHelper.BitPos.BIT31 //Carrier Sense Lost
- }
-
- private static byte currentTSDescriptor = 0;
- ///
- /// Increments to the next Transmit Status Descriptor to use.
- /// There are four TSD's which are used in round-robin.
- ///
- ///
- public static void IncrementTSDescriptor()
- {
- const byte NumberOfDescriptors = 4;
- if (currentTSDescriptor == (NumberOfDescriptors - 1))
- currentTSDescriptor = 0;
- else
- currentTSDescriptor++;
- }
-
- public static byte GetCurrentTSDescriptor()
- {
- return currentTSDescriptor;
- }
-
-
- }
-}
diff --git a/source/Cosmos.Hardware.PC.x86/Cosmos.Hardware.PC.x86.csproj b/source/Cosmos.Hardware.PC.x86/Cosmos.Hardware.PC.x86.csproj
deleted file mode 100644
index 72ac4f9f3..000000000
--- a/source/Cosmos.Hardware.PC.x86/Cosmos.Hardware.PC.x86.csproj
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.21022
- 2.0
- {A62F41F4-A759-40FA-90AA-CF8A3C9AC72A}
- Library
- Properties
- Cosmos.Hardware.PC.x86
- Cosmos.Hardware.PC.x86
- v3.5
- 512
- SAK
- SAK
- SAK
- SAK
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
- 3.5
-
-
- 3.5
-
-
- 3.5
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/Cosmos.Hardware.PC.x86/Cosmos.Hardware.PC.x86.csproj.vspscc b/source/Cosmos.Hardware.PC.x86/Cosmos.Hardware.PC.x86.csproj.vspscc
deleted file mode 100644
index feffdecaa..000000000
--- a/source/Cosmos.Hardware.PC.x86/Cosmos.Hardware.PC.x86.csproj.vspscc
+++ /dev/null
@@ -1,10 +0,0 @@
-""
-{
-"FILE_VERSION" = "9237"
-"ENLISTMENT_CHOICE" = "NEVER"
-"PROJECT_FILE_RELATIVE_PATH" = ""
-"NUMBER_OF_EXCLUDED_FILES" = "0"
-"ORIGINAL_PROJECT_FILE_PATH" = ""
-"NUMBER_OF_NESTED_PROJECTS" = "0"
-"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
-}
diff --git a/source/Cosmos.Hardware.PC.x86/Properties/AssemblyInfo.cs b/source/Cosmos.Hardware.PC.x86/Properties/AssemblyInfo.cs
deleted file mode 100644
index 950cb0440..000000000
--- a/source/Cosmos.Hardware.PC.x86/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Cosmos.Hardware.PC.x86")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Chad Z. Hower")]
-[assembly: AssemblyProduct("Cosmos.Hardware.PC.x86")]
-[assembly: AssemblyCopyright("Copyright © Chad Z. Hower 2008")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("411d2b0b-d9d0-485a-a06c-c106c2aba25a")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/source/Cosmos.Hardware.PC/Cosmos.Hardware.PC.csproj b/source/Cosmos.Hardware.PC/Cosmos.Hardware.PC.csproj
deleted file mode 100644
index 2d4c06e14..000000000
--- a/source/Cosmos.Hardware.PC/Cosmos.Hardware.PC.csproj
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.21022
- 2.0
- {B024FADF-EF04-4602-A0F4-49016D68B2AF}
- Library
- Properties
- Cosmos.Hardware.PC
- Cosmos.Hardware.PC
- v3.5
- 512
- SAK
- SAK
- SAK
- SAK
- true
- Cosmos.snk
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- true
-
-
-
-
- 3.5
-
-
- 3.5
-
-
- 3.5
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755}
- Cosmos.Hardware
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/Cosmos.Hardware.PC/Cosmos.Hardware.PC.csproj.vspscc b/source/Cosmos.Hardware.PC/Cosmos.Hardware.PC.csproj.vspscc
deleted file mode 100644
index feffdecaa..000000000
--- a/source/Cosmos.Hardware.PC/Cosmos.Hardware.PC.csproj.vspscc
+++ /dev/null
@@ -1,10 +0,0 @@
-""
-{
-"FILE_VERSION" = "9237"
-"ENLISTMENT_CHOICE" = "NEVER"
-"PROJECT_FILE_RELATIVE_PATH" = ""
-"NUMBER_OF_EXCLUDED_FILES" = "0"
-"ORIGINAL_PROJECT_FILE_PATH" = ""
-"NUMBER_OF_NESTED_PROJECTS" = "0"
-"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
-}
diff --git a/source/Cosmos.Hardware.PC/Cosmos.snk b/source/Cosmos.Hardware.PC/Cosmos.snk
deleted file mode 100644
index 68808d392..000000000
Binary files a/source/Cosmos.Hardware.PC/Cosmos.snk and /dev/null differ
diff --git a/source/Cosmos.Hardware.PC/Properties/AssemblyInfo.cs b/source/Cosmos.Hardware.PC/Properties/AssemblyInfo.cs
deleted file mode 100644
index 947b15de9..000000000
--- a/source/Cosmos.Hardware.PC/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Cosmos.Hardware.PC")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Chad Z. Hower")]
-[assembly: AssemblyProduct("Cosmos.Hardware.PC")]
-[assembly: AssemblyCopyright("Copyright © Chad Z. Hower 2008")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("e2b5a184-1d28-45b6-b574-23977738d1ba")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet.RTL8139/Cosmos.Hardware.Network.Ethernet.RTL8139.csproj b/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet.RTL8139/Cosmos.Hardware.Network.Ethernet.RTL8139.csproj
deleted file mode 100644
index 46f600723..000000000
--- a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet.RTL8139/Cosmos.Hardware.Network.Ethernet.RTL8139.csproj
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.21022
- 2.0
- {289839F2-263E-4B79-B63B-8CB8BF0788E1}
- Library
- Properties
- Cosmos.Hardware.Network.Ethernet.RTL8139
- Cosmos.Hardware.Network.Ethernet.RTL8139
- v3.5
- 512
- SAK
- SAK
- SAK
- SAK
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
- 3.5
-
-
- 3.5
-
-
- 3.5
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet.RTL8139/Cosmos.Hardware.Network.Ethernet.RTL8139.csproj.vspscc b/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet.RTL8139/Cosmos.Hardware.Network.Ethernet.RTL8139.csproj.vspscc
deleted file mode 100644
index feffdecaa..000000000
--- a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet.RTL8139/Cosmos.Hardware.Network.Ethernet.RTL8139.csproj.vspscc
+++ /dev/null
@@ -1,10 +0,0 @@
-""
-{
-"FILE_VERSION" = "9237"
-"ENLISTMENT_CHOICE" = "NEVER"
-"PROJECT_FILE_RELATIVE_PATH" = ""
-"NUMBER_OF_EXCLUDED_FILES" = "0"
-"ORIGINAL_PROJECT_FILE_PATH" = ""
-"NUMBER_OF_NESTED_PROJECTS" = "0"
-"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
-}
diff --git a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet.RTL8139/Properties/AssemblyInfo.cs b/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet.RTL8139/Properties/AssemblyInfo.cs
deleted file mode 100644
index d87437c65..000000000
--- a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet.RTL8139/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Cosmos.Hardware.Network.Ethernet.RTL8139")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Chad Z. Hower")]
-[assembly: AssemblyProduct("Cosmos.Hardware.Network.Ethernet.RTL8139")]
-[assembly: AssemblyCopyright("Copyright © Chad Z. Hower 2008")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("46cc9611-2abc-4bac-bcc6-33b21d290252")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet/Cosmos.Hardware.Network.Ethernet.csproj b/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet/Cosmos.Hardware.Network.Ethernet.csproj
deleted file mode 100644
index 7df0fec07..000000000
--- a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet/Cosmos.Hardware.Network.Ethernet.csproj
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.21022
- 2.0
- {00494BF0-8629-4D18-993B-224441E460D1}
- Library
- Properties
- Cosmos.Hardware.Network.Ethernet
- Cosmos.Hardware.Network.Ethernet
- v3.5
- 512
- SAK
- SAK
- SAK
- SAK
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
- 3.5
-
-
- 3.5
-
-
- 3.5
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet/Cosmos.Hardware.Network.Ethernet.csproj.vspscc b/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet/Cosmos.Hardware.Network.Ethernet.csproj.vspscc
deleted file mode 100644
index feffdecaa..000000000
--- a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet/Cosmos.Hardware.Network.Ethernet.csproj.vspscc
+++ /dev/null
@@ -1,10 +0,0 @@
-""
-{
-"FILE_VERSION" = "9237"
-"ENLISTMENT_CHOICE" = "NEVER"
-"PROJECT_FILE_RELATIVE_PATH" = ""
-"NUMBER_OF_EXCLUDED_FILES" = "0"
-"ORIGINAL_PROJECT_FILE_PATH" = ""
-"NUMBER_OF_NESTED_PROJECTS" = "0"
-"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
-}
diff --git a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet/Properties/AssemblyInfo.cs b/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet/Properties/AssemblyInfo.cs
deleted file mode 100644
index b10c01c44..000000000
--- a/source/Drivers/Ethernet/Cosmos.Hardware.Network.Ethernet/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Cosmos.Hardware.Network.Ethernet")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Chad Z. Hower")]
-[assembly: AssemblyProduct("Cosmos.Hardware.Network.Ethernet")]
-[assembly: AssemblyCopyright("Copyright © Chad Z. Hower 2008")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("148b2fe3-790a-42a9-bb91-e7913c5de580")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]