void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id,

                         void (*func)(QPCIDevice *dev, int devfn, void *data),

                         void *data)

{

    int slot;



    for (slot = 0; slot < 32; slot++) {

        int fn;



        for (fn = 0; fn < 8; fn++) {

            QPCIDevice *dev;



            dev = qpci_device_find(bus, QPCI_DEVFN(slot, fn));

            if (!dev) {

                continue;

            }



            if (vendor_id != -1 &&

                qpci_config_readw(dev, PCI_VENDOR_ID) != vendor_id) {


                continue;

            }



            if (device_id != -1 &&

                qpci_config_readw(dev, PCI_DEVICE_ID) != device_id) {


                continue;

            }



            func(dev, QPCI_DEVFN(slot, fn), data);

        }

    }

}
void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id,

                         void (*func)(QPCIDevice *dev, int devfn, void *data),

                         void *data)

{

    int slot;



    for (slot = 0; slot < 32; slot++) {

        int fn;



        for (fn = 0; fn < 8; fn++) {

            QPCIDevice *dev;



            dev = qpci_device_find(bus, QPCI_DEVFN(slot, fn));

            if (!dev) {

                continue;

            }



            if (vendor_id != -1 &&

                qpci_config_readw(dev, PCI_VENDOR_ID) != vendor_id) {


                continue;

            }



            if (device_id != -1 &&

                qpci_config_readw(dev, PCI_DEVICE_ID) != device_id) {


                continue;

            }



            func(dev, QPCI_DEVFN(slot, fn), data);

        }

    }

}
void FUNC_0(QPCIBus *VAR_0, int VAR_1, int VAR_2,

                         void (*VAR_3)(QPCIDevice *VAR_4, int VAR_5, void *VAR_7),

                         void *VAR_7)

{

    int VAR_7;



    for (VAR_7 = 0; VAR_7 < 32; VAR_7++) {

        int VAR_8;



        for (VAR_8 = 0; VAR_8 < 8; VAR_8++) {

            QPCIDevice *VAR_4;



            VAR_4 = qpci_device_find(VAR_0, QPCI_DEVFN(VAR_7, VAR_8));

            if (!VAR_4) {

                continue;

            }



            if (VAR_1 != -1 &&

                qpci_config_readw(VAR_4, PCI_VENDOR_ID) != VAR_1) {


                continue;

            }



            if (VAR_2 != -1 &&

                qpci_config_readw(VAR_4, PCI_DEVICE_ID) != VAR_2) {


                continue;

            }



            VAR_3(VAR_4, QPCI_DEVFN(VAR_7, VAR_8), VAR_7);

        }

    }

}
void FUNC_0(QPCIBus *VAR_0, int VAR_1, int VAR_2,
void (*VAR_3)(QPCIDevice *VAR_4, int VAR_5, void *VAR_7),
void *VAR_7)
{ int VAR_7; for (VAR_7 = 0; VAR_7 < 32; VAR_7++) { int VAR_8; for (VAR_8 = 0; VAR_8 < 8; VAR_8++) { QPCIDevice *VAR_4; VAR_4 = qpci_device_find(VAR_0, QPCI_DEVFN(VAR_7, VAR_8)); if (!VAR_4) { continue; } if (VAR_1 != -1 &&
qpci_config_readw(VAR_4, PCI_VENDOR_ID) != VAR_1) { continue; } if (VAR_2 != -1 &&
qpci_config_readw(VAR_4, PCI_DEVICE_ID) != VAR_2) { continue; } VAR_3(VAR_4, QPCI_DEVFN(VAR_7, VAR_8), VAR_7); } } }