Lines Matching defs:virtfn

113 static void pci_read_vf_config_common(struct pci_dev *virtfn)
115 struct pci_dev *physfn = virtfn->physfn;
126 pci_read_config_dword(virtfn, PCI_CLASS_REVISION,
128 pci_read_config_byte(virtfn, PCI_HEADER_TYPE,
130 pci_read_config_word(virtfn, PCI_SUBSYSTEM_VENDOR_ID,
132 pci_read_config_word(virtfn, PCI_SUBSYSTEM_ID,
137 struct pci_dev *virtfn, int id)
142 sprintf(buf, "virtfn%u", id);
143 rc = sysfs_create_link(&dev->dev.kobj, &virtfn->dev.kobj, buf);
146 rc = sysfs_create_link(&virtfn->dev.kobj, &dev->dev.kobj, "physfn");
150 kobject_uevent(&virtfn->dev.kobj, KOBJ_CHANGE);
165 struct pci_dev *virtfn;
174 virtfn = pci_alloc_dev(bus);
175 if (!virtfn)
178 virtfn->devfn = pci_iov_virtfn_devfn(dev, id);
179 virtfn->vendor = dev->vendor;
180 virtfn->device = iov->vf_device;
181 virtfn->is_virtfn = 1;
182 virtfn->physfn = pci_dev_get(dev);
183 virtfn->no_command_memory = 1;
186 pci_read_vf_config_common(virtfn);
188 rc = pci_setup_device(virtfn);
192 virtfn->dev.parent = dev->dev.parent;
193 virtfn->multifunction = 0;
199 virtfn->resource[i].name = pci_name(virtfn);
200 virtfn->resource[i].flags = res->flags;
202 virtfn->resource[i].start = res->start + size * id;
203 virtfn->resource[i].end = virtfn->resource[i].start + size - 1;
204 rc = request_resource(res, &virtfn->resource[i]);
208 pci_device_add(virtfn, virtfn->bus);
209 rc = pci_iov_sysfs_link(dev, virtfn, id);
213 pci_bus_add_device(virtfn);
218 pci_stop_and_remove_bus_device(virtfn);
230 struct pci_dev *virtfn;
232 virtfn = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus),
235 if (!virtfn)
238 sprintf(buf, "virtfn%u", id);
241 * pci_stop_dev() could have been called for this virtfn already,
242 * so the directory for the virtfn may have been removed before.
245 if (virtfn->dev.kobj.sd)
246 sysfs_remove_link(&virtfn->dev.kobj, "physfn");
248 pci_stop_and_remove_bus_device(virtfn);
249 virtfn_remove_bus(dev->bus, virtfn->bus);
252 pci_dev_put(virtfn);