mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-13 11:41:44 +00:00
Add Network Card verifying
This commit is contained in:
parent
a88a42ef31
commit
c0ea8f6f07
1 changed files with 15 additions and 1 deletions
|
|
@ -148,6 +148,20 @@ namespace Cosmos.HAL.Drivers.PCI.Network
|
|||
// }
|
||||
//}
|
||||
|
||||
public static bool NetworkCardAvailable()
|
||||
{
|
||||
PCIDevice device;
|
||||
device = HAL.PCI.GetDevice(0x1022, 0x2000);
|
||||
if (device != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get MAC Address String
|
||||
/// </summary>
|
||||
|
|
@ -155,7 +169,7 @@ namespace Cosmos.HAL.Drivers.PCI.Network
|
|||
{
|
||||
PCIDevice device;
|
||||
device = HAL.PCI.GetDevice(0x1022, 0x2000);
|
||||
if (device != null)
|
||||
if (NetworkCardAvailable())
|
||||
{
|
||||
AMDPCNetII nic = new AMDPCNetII(device);
|
||||
return nic.MACAddress.ToString();
|
||||
|
|
|
|||
Loading…
Reference in a new issue