public C6678DSP_Device Get(WD_PCI_SLOT slot) { foreach(C6678DSP_Device device in this) { if(device.IsMySlot(ref slot)) return device; } return null; }
public bool IsMySlot(ref WD_PCI_SLOT slot) { if (m_wdcDevice.slot.pciSlot.dwBus == slot.dwBus && m_wdcDevice.slot.pciSlot.dwSlot == slot.dwSlot && m_wdcDevice.slot.pciSlot.dwFunction == slot.dwFunction) { return(true); } return(false); }
public PCI_0228_Device Get(WD_PCI_SLOT slot) { foreach (PCI_0228_Device device in this) { if (device.IsMySlot(ref slot)) { return(device); } } return(null); }
internal protected PCIE_Device(DWORD dwVendorId, DWORD dwDeviceId,//构造函数 WD_PCI_SLOT slot) { m_wdcDevice = new WDC_DEVICE(); m_wdcDevice.id.pciId.dwVendorId = dwVendorId; m_wdcDevice.id.pciId.dwDeviceId = dwDeviceId; m_wdcDevice.slot.pciSlot = slot; m_wdcDeviceMarshaler = new MarshalWdcDevice(); m_eventHandler = new EVENT_HANDLER_DOTNET(PCIE_EventHandler); m_regs = new PCIE_Regs(); SetDescription(); }
public PCIE_Device(DWORD dwVendorId, DWORD dwDeviceId, WD_PCI_SLOT slot) { m_wdcDevice = new WDC_DEVICE(); m_wdcDevice.id.pciId.dwVendorId = dwVendorId; m_wdcDevice.id.pciId.dwDeviceId = dwDeviceId; m_wdcDevice.slot.pciSlot = slot; m_wdcDeviceMarshaler = new MarshalWdcDevice(); m_eventHandler = new EVENT_HANDLER_DOTNET(NEWAMD86_EventHandler); m_regs = new PCIE_Regs(); SetDescription(); m_dmaMarshaler = new MarshalWdDma(); }
private DWORD Populate() { DWORD dwStatus; WDC_PCI_SCAN_RESULT scanResult = new WDC_PCI_SCAN_RESULT(); dwStatus = wdc_lib_decl.WDC_PciScanDevices(PCI_0228_DEFAULT_VENDOR_ID, PCI_0228_DEFAULT_DEVICE_ID, scanResult); if ((DWORD)wdc_err.WD_STATUS_SUCCESS != dwStatus) { Log.ErrLog("PCI_0228_DeviceList.Populate: Failed scanning " + "the PCI bus. Error 0x" + dwStatus.ToString("X") + utils.Stat2Str(dwStatus)); return(dwStatus); } if (scanResult.dwNumDevices == 0) { Log.ErrLog("PCI_0228_DeviceList.Populate: No matching PCI " + "device was found for search criteria " + PCI_0228_DEFAULT_VENDOR_ID.ToString("X") + ", " + PCI_0228_DEFAULT_DEVICE_ID.ToString("X")); return((DWORD)wdc_err.WD_INVALID_PARAMETER); } for (int i = 0; i < scanResult.dwNumDevices; ++i) { PCI_0228_Device device; WD_PCI_SLOT slot = scanResult.deviceSlot[i]; device = new PCI_0228_Device(scanResult.deviceId[i].dwVendorId, scanResult.deviceId[i].dwDeviceId, slot); this.Add(device); } return((DWORD)wdc_err.WD_STATUS_SUCCESS); }
/* constructors & destructors */ internal protected PCI_0228_Device(WD_PCI_SLOT slot) : this(0, 0, slot) { }
/* constructors & destructors */ public PCIE_Device(WD_PCI_SLOT slot) : this(0, 0, slot) { }
/* constructors & destructors */ internal protected C6678DSP_Device(WD_PCI_SLOT slot) : this(0, 0, slot) { }