Пример #1
0
 public C6678DSP_Device Get(WD_PCI_SLOT slot)
 {
     foreach(C6678DSP_Device device in this)
     {
         if(device.IsMySlot(ref slot))
             return device;
     }
     return null;
 }
Пример #2
0
        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);
        }
Пример #3
0
 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);
 }
Пример #4
0
 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();
 }
Пример #5
0
 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();
 }
Пример #6
0
        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);
        }
Пример #7
0
 /* constructors & destructors */
 internal protected PCI_0228_Device(WD_PCI_SLOT slot) : this(0, 0, slot)
 {
 }
Пример #8
0
 /* constructors & destructors */
 public PCIE_Device(WD_PCI_SLOT slot) : this(0, 0, slot)
 {
 }
Пример #9
0
 /* constructors & destructors */
 internal protected C6678DSP_Device(WD_PCI_SLOT slot) : this(0, 0, slot)
 {
 }