mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-08 17:22:28 +00:00
commit
f7a21100e5
1 changed files with 17 additions and 16 deletions
|
|
@ -10,7 +10,7 @@ namespace Cosmos.HAL.Drivers.PCI.Network
|
||||||
{
|
{
|
||||||
public class AMDPCNetII : NetworkDevice
|
public class AMDPCNetII : NetworkDevice
|
||||||
{
|
{
|
||||||
protected PCIDeviceNormal pciCard;
|
protected PCIDevice pciCard;
|
||||||
protected AMDPCNetIIIOGroup io;
|
protected AMDPCNetIIIOGroup io;
|
||||||
protected MACAddress mac;
|
protected MACAddress mac;
|
||||||
protected bool mInitDone;
|
protected bool mInitDone;
|
||||||
|
|
@ -24,7 +24,7 @@ namespace Cosmos.HAL.Drivers.PCI.Network
|
||||||
protected Queue<byte[]> mTransmitBuffer;
|
protected Queue<byte[]> mTransmitBuffer;
|
||||||
private int mNextTXDesc;
|
private int mNextTXDesc;
|
||||||
|
|
||||||
public AMDPCNetII(PCIDeviceNormal device)
|
public AMDPCNetII(PCIDevice device)
|
||||||
: base()
|
: base()
|
||||||
{
|
{
|
||||||
if (device == null)
|
if (device == null)
|
||||||
|
|
@ -33,10 +33,10 @@ namespace Cosmos.HAL.Drivers.PCI.Network
|
||||||
}
|
}
|
||||||
|
|
||||||
this.pciCard = device;
|
this.pciCard = device;
|
||||||
// this.pciCard.Claimed = true;
|
//this.pciCard.Claimed = true;
|
||||||
//this.pciCard.EnableDevice();
|
//this.pciCard.EnableDevice();
|
||||||
|
|
||||||
//this.io = new AMDPCNetIIIOGroup((ushort) this.pciCard.BaseAddresses[0].BaseAddress());
|
this.io = new AMDPCNetIIIOGroup((ushort) this.pciCard.BaseAddressBar[0].BaseAddress);
|
||||||
this.io.RegisterData.DWord = 0;
|
this.io.RegisterData.DWord = 0;
|
||||||
|
|
||||||
// Get the EEPROM MAC Address and set it as the devices MAC
|
// Get the EEPROM MAC Address and set it as the devices MAC
|
||||||
|
|
@ -134,17 +134,18 @@ namespace Cosmos.HAL.Drivers.PCI.Network
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void FindAll()
|
public static void FindAll()
|
||||||
{
|
{
|
||||||
Console.WriteLine("Scanning for AMD PCNetII cards...");
|
Console.WriteLine("Scanning for AMD PCNetII cards...");
|
||||||
// PCIDevice device = Cosmos.HAL.PCI.GetDevice(0x1022, 0x2000);
|
PCIDevice device;
|
||||||
// if (device != null)
|
device = HAL.PCI.GetDevice(0x1022, 0x2000);
|
||||||
// {
|
if (device != null)
|
||||||
// AMDPCNetII nic = new AMDPCNetII((PCIDeviceNormal) device);
|
{
|
||||||
//
|
AMDPCNetII nic = new AMDPCNetII(device);
|
||||||
// Console.WriteLine("Found AMD PCNetII NIC on PCI " + device.bus + ":" + device.slot + ":" +
|
|
||||||
// device.function);
|
//Console.WriteLine("Found AMD PCNetII NIC on PCI " + device.bus + ":" + device.slot + ":" +
|
||||||
// Console.WriteLine("NIC IRQ: " + device.InterruptLine);
|
// device.function);
|
||||||
// Console.WriteLine("NIC MAC Address: " + nic.MACAddress.ToString());
|
//Console.WriteLine("NIC IRQ: " + device.InterruptLine);
|
||||||
// }
|
Console.WriteLine("NIC MAC Address: " + nic.MACAddress.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Register Access Properties
|
#region Register Access Properties
|
||||||
|
|
@ -345,4 +346,4 @@ namespace Cosmos.HAL.Drivers.PCI.Network
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue