mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 04:18:43 +00:00
Merge pull request #1594 from geomtech/impl-get-device
Add GetDevice function with bus, slot, function informations
This commit is contained in:
commit
6ae8a0d65a
1 changed files with 21 additions and 0 deletions
|
|
@ -164,6 +164,27 @@ namespace Cosmos.HAL
|
|||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get device.
|
||||
/// </summary>
|
||||
/// <param name="bus">Bus ID.</param>
|
||||
/// <param name="slot">Slot position ID.</param>
|
||||
/// <param name="function">Function ID.</param>
|
||||
/// <returns></returns>
|
||||
public static PCIDevice GetDevice(uint bus, uint slot, uint function)
|
||||
{
|
||||
foreach (var xDevice in Devices)
|
||||
{
|
||||
if (xDevice.bus == bus &&
|
||||
xDevice.slot == slot &&
|
||||
xDevice.function == function)
|
||||
{
|
||||
return xDevice;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static PCIDevice GetDeviceClass(ClassID Class, SubclassID SubClass)
|
||||
{
|
||||
foreach (var xDevice in Devices)
|
||||
|
|
|
|||
Loading…
Reference in a new issue