Lines Matching defs:pci_dev
155 static int pci_set_default_subsystem_id(PCIDevice *pci_dev)
159 id = (void*)(&pci_dev->config[PCI_SUBVENDOR_ID]);
242 static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
255 pci_dev->bus = bus;
256 pci_dev->devfn = devfn;
257 pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
258 memset(pci_dev->irq_state, 0, sizeof(pci_dev->irq_state));
259 pci_set_default_subsystem_id(pci_dev);
265 pci_dev->config_read = config_read;
266 pci_dev->config_write = config_write;
267 bus->devices[devfn] = pci_dev;
268 pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
269 return pci_dev;
277 PCIDevice *pci_dev;
279 pci_dev = qemu_mallocz(instance_size);
280 pci_dev = do_pci_register_device(pci_dev, bus, name, devfn,
282 return pci_dev;
289 static void pci_unregister_io_regions(PCIDevice *pci_dev)
295 r = &pci_dev->io_regions[i];
308 int pci_unregister_device(PCIDevice *pci_dev)
312 if (pci_dev->unregister)
313 ret = pci_dev->unregister(pci_dev);
317 pci_unregister_io_regions(pci_dev);
319 qemu_free_irqs(pci_dev->irq);
320 pci_dev->bus->devices[pci_dev->devfn] = NULL;
321 qdev_free(&pci_dev->qdev);
325 void pci_register_bar(PCIDevice *pci_dev, int region_num,
341 r = &pci_dev->io_regions[region_num];
351 *(uint32_t *)(pci_dev->config + addr) = cpu_to_le32(type);
577 PCIDevice *pci_dev;
589 pci_dev = s->devices[(addr >> 8) & 0xff];
590 if (!pci_dev)
595 pci_dev->name, config_addr, val, len);
597 pci_dev->config_write(pci_dev, config_addr, val, len);
603 PCIDevice *pci_dev;
612 pci_dev = s->devices[(addr >> 8) & 0xff];
613 if (!pci_dev) {
630 val = pci_dev->config_read(pci_dev, config_addr, len);
633 pci_dev->name, config_addr, val, len);
649 PCIDevice *pci_dev = (PCIDevice *)opaque;
653 change = level - pci_dev->irq_state[irq_num];
657 pci_dev->irq_state[irq_num] = level;
659 bus = pci_dev->bus;
660 irq_num = bus->map_irq(pci_dev, irq_num);
663 pci_dev = bus->parent_dev;
909 PCIDevice *pci_dev = (PCIDevice *)qdev;
916 pci_dev = do_pci_register_device(pci_dev, bus, "FIXME", devfn,
918 assert(pci_dev);
919 info->init(pci_dev);