Lines Matching refs:pdev

41 	struct pci_dev *pdev;						\
43 pdev = to_pci_dev(dev); \
44 return sysfs_emit(buf, format_string, pdev->field); \
59 struct pci_dev *pdev = to_pci_dev(dev);
66 if (pdev->msi_enabled)
67 return sysfs_emit(buf, "%u\n", pci_irq_vector(pdev, 0));
70 return sysfs_emit(buf, "%u\n", pdev->irq);
78 struct pci_dev *pdev = to_pci_dev(dev);
79 return sysfs_emit(buf, "%u\n", pdev->broken_parity_status);
86 struct pci_dev *pdev = to_pci_dev(dev);
92 pdev->broken_parity_status = !!val;
152 struct pci_dev *pdev = to_pci_dev(dev);
154 return sysfs_emit(buf, "%s\n", pci_power_name(pdev->current_state));
188 struct pci_dev *pdev = to_pci_dev(dev);
191 pci_speed_string(pcie_get_speed_cap(pdev)));
198 struct pci_dev *pdev = to_pci_dev(dev);
200 return sysfs_emit(buf, "%u\n", pcie_get_width_cap(pdev));
295 struct pci_dev *pdev = to_pci_dev(dev);
310 result = pci_enable_device(pdev);
311 else if (pci_is_enabled(pdev))
312 pci_disable_device(pdev);
323 struct pci_dev *pdev;
325 pdev = to_pci_dev(dev);
326 return sysfs_emit(buf, "%u\n", atomic_read(&pdev->enable_cnt));
335 struct pci_dev *pdev = to_pci_dev(dev);
351 pci_alert(pdev, FW_BUG "Overriding NUMA node to %d. Contact your vendor for updates.",
369 struct pci_dev *pdev = to_pci_dev(dev);
371 return sysfs_emit(buf, "%d\n", fls64(pdev->dma_mask));
386 struct pci_dev *pdev = to_pci_dev(dev);
387 struct pci_bus *subordinate = pdev->subordinate;
391 : !pdev->no_msi);
397 struct pci_dev *pdev = to_pci_dev(dev);
398 struct pci_bus *subordinate = pdev->subordinate;
413 pdev->no_msi = !val;
414 pci_info(pdev, "MSI/MSI-X %s for future drivers\n",
467 struct pci_dev *pdev = to_pci_dev(dev);
474 pci_rescan_bus(pdev->bus);
525 struct pci_dev *pdev = to_pci_dev(dev);
531 pdev->d3cold_allowed = !!val;
532 pci_bridge_d3_update(pdev);
542 struct pci_dev *pdev = to_pci_dev(dev);
543 return sysfs_emit(buf, "%u\n", pdev->d3cold_allowed);
552 struct pci_dev *pdev = to_pci_dev(dev);
553 struct device_node *np = pci_device_to_OF_node(pdev);
566 struct pci_dev *pdev = to_pci_dev(dev);
569 ret = driver_set_override(dev, &pdev->driver_override, buf, count);
579 struct pci_dev *pdev = to_pci_dev(dev);
583 len = sysfs_emit(buf, "%s\n", pdev->driver_override);
654 struct pci_dev *pdev = to_pci_dev(dev);
658 return sysfs_emit(buf, "%u\n", (pdev == vga_dev));
661 !!(pdev->resource[PCI_ROM_RESOURCE].flags &
820 struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
823 if (pdev->cfg_size > PCI_CFG_SPACE_SIZE)
1009 int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vma,
1015 if (pci_resource_len(pdev, resno) == 0)
1019 size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1;
1021 pci_resource_to_user(pdev, resno, &pdev->resource[resno],
1043 struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
1046 struct resource *res = &pdev->resource[bar];
1056 if (!pci_mmap_fits(pdev, bar, vma, PCI_MMAP_SYSFS))
1061 return pci_mmap_resource_range(pdev, bar, vma, mmap_type, write_combine);
1083 struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
1087 port += pci_resource_start(pdev, bar);
1089 if (port > pci_resource_end(pdev, bar))
1092 if (port + count - 1 > pci_resource_end(pdev, bar))
1143 * @pdev: dev to cleanup
1145 * If we created resource files for @pdev, remove them from sysfs and
1148 static void pci_remove_resource_files(struct pci_dev *pdev)
1155 res_attr = pdev->res_attr[i];
1157 sysfs_remove_bin_file(&pdev->dev.kobj, res_attr);
1161 res_attr = pdev->res_attr_wc[i];
1163 sysfs_remove_bin_file(&pdev->dev.kobj, res_attr);
1169 static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine)
1189 if (pci_resource_flags(pdev, num) & IORESOURCE_IO) {
1202 res_attr->size = pci_resource_len(pdev, num);
1204 retval = sysfs_create_bin_file(&pdev->dev.kobj, res_attr);
1211 pdev->res_attr_wc[num] = res_attr;
1213 pdev->res_attr[num] = res_attr;
1220 * @pdev: dev in question
1222 * Walk the resources in @pdev creating files for each resource available.
1224 static int pci_create_resource_files(struct pci_dev *pdev)
1233 if (!pci_resource_len(pdev, i))
1236 retval = pci_create_attr(pdev, i, 0);
1239 pdev->resource[i].flags & IORESOURCE_PREFETCH)
1240 retval = pci_create_attr(pdev, i, 1);
1242 pci_remove_resource_files(pdev);
1268 struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
1271 pdev->rom_attr_enabled = 0;
1273 pdev->rom_attr_enabled = 1;
1294 struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
1298 if (!pdev->rom_attr_enabled)
1301 rom = pci_map_rom(pdev, &size); /* size starts out as PCI window size */
1313 pci_unmap_rom(pdev, rom);
1327 struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
1331 rom_size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
1348 struct pci_dev *pdev = to_pci_dev(dev);
1359 result = pci_reset_function(pdev);
1376 struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
1378 if (!pci_reset_supported(pdev))
1394 struct pci_dev *pdev = to_pci_dev(dev); \
1397 pci_config_pm_runtime_get(pdev); \
1400 (u64)pci_rebar_get_possible_sizes(pdev, n)); \
1402 pci_config_pm_runtime_put(pdev); \
1411 struct pci_dev *pdev = to_pci_dev(dev); \
1425 pci_config_pm_runtime_get(pdev); \
1427 if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA) { \
1428 ret = aperture_remove_conflicting_pci_devices(pdev, \
1434 pci_read_config_word(pdev, PCI_COMMAND, &cmd); \
1435 pci_write_config_word(pdev, PCI_COMMAND, \
1438 flags = pci_resource_flags(pdev, n); \
1440 pci_remove_resource_files(pdev); \
1443 if (pci_resource_len(pdev, i) && \
1444 pci_resource_flags(pdev, i) == flags) \
1445 pci_release_resource(pdev, i); \
1448 ret = pci_resize_resource(pdev, n, size); \
1450 pci_assign_unassigned_bus_resources(pdev->bus); \
1452 if (pci_create_resource_files(pdev)) \
1453 pci_warn(pdev, "Failed to recreate resource files after BAR resizing\n");\
1455 pci_write_config_word(pdev, PCI_COMMAND, cmd); \
1457 pci_config_pm_runtime_put(pdev); \
1485 struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
1487 return pci_rebar_get_current_size(pdev, n) < 0 ? 0 : a->mode;
1495 int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev)
1500 return pci_create_resource_files(pdev);
1505 * @pdev: device whose entries we should free
1507 * Cleanup when @pdev is removed from sysfs.
1509 void pci_remove_sysfs_dev_files(struct pci_dev *pdev)
1514 pci_remove_resource_files(pdev);
1519 struct pci_dev *pdev = NULL;
1524 for_each_pci_dev(pdev) {
1525 retval = pci_create_sysfs_dev_files(pdev);
1527 pci_dev_put(pdev);
1548 struct pci_dev *pdev = to_pci_dev(dev);
1551 if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
1567 struct pci_dev *pdev = to_pci_dev(dev);
1569 if (pdev->is_virtfn)
1579 struct pci_dev *pdev = to_pci_dev(dev);
1581 if (pci_is_bridge(pdev))
1591 struct pci_dev *pdev = to_pci_dev(dev);
1593 if (pci_is_pcie(pdev))