Lines Matching refs:zdev
132 struct zpci_dev *zdev = to_zpci(pdev);
138 if (zdev->vfn) {
139 zpci_iov_setup_virtfn(zdev->zbus, pdev, zdev->vfn);
144 static int zpci_bus_add_device(struct zpci_bus *zbus, struct zpci_dev *zdev)
156 pdev = pci_get_slot(bus, zdev->devfn);
163 rc = zpci_init_slot(zdev);
166 zdev->has_hp_slot = 1;
173 pdev = pci_scan_single_device(bus, zdev->devfn);
193 int zpci_bus_device_register(struct zpci_dev *zdev, struct pci_ops *ops)
200 zdev->fid, ZPCI_NR_DEVICES);
205 if (zdev->devfn >= ZPCI_FUNCTIONS_PER_BUS)
208 if (!s390_pci_no_rid && zdev->rid_available)
209 zbus = zpci_bus_get(zdev->pchid);
212 zbus = zpci_bus_alloc(zdev->pchid);
217 zdev->zbus = zbus;
218 if (zbus->function[zdev->devfn]) {
219 pr_err("devfn %04x is already assigned\n", zdev->devfn);
222 zbus->function[zdev->devfn] = zdev;
224 zpci_setup_bus_resources(zdev, &zbus->resources);
231 if (!zdev->rid_available) {
235 rc = zpci_bus_add_device(zbus, zdev);
238 } else if (zdev->devfn == 0) {
239 if (zbus->multifunction && !zdev->rid_available) {
243 rc = zpci_bus_scan(zbus, (u16)zdev->uid, ops);
247 rc = zpci_init_slot(zdev);
250 zdev->has_hp_slot = 1;
251 zbus->multifunction = zdev->rid_available;
252 zbus->max_bus_speed = zdev->max_bus_speed;
261 zbus->function[zdev->devfn] = NULL;
263 pr_err("Adding PCI function %08x failed\n", zdev->fid);
268 void zpci_bus_device_unregister(struct zpci_dev *zdev)
270 struct zpci_bus *zbus = zdev->zbus;
273 zbus->function[zdev->devfn] = NULL;