Lines Matching refs:dev
37 field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
41 pdev = to_pci_dev(dev); \
54 static ssize_t broken_parity_status_show(struct device *dev,
58 struct pci_dev *pdev = to_pci_dev(dev);
62 static ssize_t broken_parity_status_store(struct device *dev,
66 struct pci_dev *pdev = to_pci_dev(dev);
78 static ssize_t pci_dev_show_local_cpu(struct device *dev, bool list,
84 mask = (dev_to_node(dev) == -1) ? cpu_online_mask :
85 cpumask_of_node(dev_to_node(dev));
87 mask = cpumask_of_pcibus(to_pci_dev(dev)->bus);
92 static ssize_t local_cpus_show(struct device *dev,
95 return pci_dev_show_local_cpu(dev, false, attr, buf);
99 static ssize_t local_cpulist_show(struct device *dev,
102 return pci_dev_show_local_cpu(dev, true, attr, buf);
109 static ssize_t cpuaffinity_show(struct device *dev,
112 const struct cpumask *cpumask = cpumask_of_pcibus(to_pci_bus(dev));
118 static ssize_t cpulistaffinity_show(struct device *dev,
121 const struct cpumask *cpumask = cpumask_of_pcibus(to_pci_bus(dev));
128 static ssize_t resource_show(struct device *dev, struct device_attribute *attr,
131 struct pci_dev *pci_dev = to_pci_dev(dev);
154 static ssize_t max_link_speed_show(struct device *dev,
157 struct pci_dev *pdev = to_pci_dev(dev);
164 static ssize_t max_link_width_show(struct device *dev,
167 struct pci_dev *pdev = to_pci_dev(dev);
173 static ssize_t current_link_speed_show(struct device *dev,
176 struct pci_dev *pci_dev = to_pci_dev(dev);
191 static ssize_t current_link_width_show(struct device *dev,
194 struct pci_dev *pci_dev = to_pci_dev(dev);
207 static ssize_t secondary_bus_number_show(struct device *dev,
211 struct pci_dev *pci_dev = to_pci_dev(dev);
223 static ssize_t subordinate_bus_number_show(struct device *dev,
227 struct pci_dev *pci_dev = to_pci_dev(dev);
239 static ssize_t ari_enabled_show(struct device *dev,
243 struct pci_dev *pci_dev = to_pci_dev(dev);
249 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
252 struct pci_dev *pci_dev = to_pci_dev(dev);
262 static ssize_t enable_store(struct device *dev, struct device_attribute *attr,
265 struct pci_dev *pdev = to_pci_dev(dev);
276 device_lock(dev);
277 if (dev->driver)
285 device_unlock(dev);
290 static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
295 pdev = to_pci_dev(dev);
301 static ssize_t numa_node_store(struct device *dev,
305 struct pci_dev *pdev = to_pci_dev(dev);
325 dev->numa_node = node;
329 static ssize_t numa_node_show(struct device *dev, struct device_attribute *attr,
332 return sprintf(buf, "%d\n", dev->numa_node);
337 static ssize_t dma_mask_bits_show(struct device *dev,
340 struct pci_dev *pdev = to_pci_dev(dev);
346 static ssize_t consistent_dma_mask_bits_show(struct device *dev,
350 return sprintf(buf, "%d\n", fls64(dev->coherent_dma_mask));
354 static ssize_t msi_bus_show(struct device *dev, struct device_attribute *attr,
357 struct pci_dev *pdev = to_pci_dev(dev);
365 static ssize_t msi_bus_store(struct device *dev, struct device_attribute *attr,
368 struct pci_dev *pdev = to_pci_dev(dev);
395 dev_info(&subordinate->dev, "MSI/MSI-X %s for future drivers of devices on this bus\n",
433 static ssize_t dev_rescan_store(struct device *dev,
438 struct pci_dev *pdev = to_pci_dev(dev);
453 static ssize_t remove_store(struct device *dev, struct device_attribute *attr,
461 if (val && device_remove_file_self(dev, attr))
462 pci_stop_and_remove_bus_device_locked(to_pci_dev(dev));
468 static ssize_t bus_rescan_store(struct device *dev,
473 struct pci_bus *bus = to_pci_bus(dev);
492 static ssize_t d3cold_allowed_store(struct device *dev,
496 struct pci_dev *pdev = to_pci_dev(dev);
505 pm_runtime_resume(dev);
510 static ssize_t d3cold_allowed_show(struct device *dev,
513 struct pci_dev *pdev = to_pci_dev(dev);
520 static ssize_t devspec_show(struct device *dev,
523 struct pci_dev *pdev = to_pci_dev(dev);
533 static ssize_t driver_override_store(struct device *dev,
537 struct pci_dev *pdev = to_pci_dev(dev);
552 device_lock(dev);
560 device_unlock(dev);
567 static ssize_t driver_override_show(struct device *dev,
570 struct pci_dev *pdev = to_pci_dev(dev);
573 device_lock(dev);
575 device_unlock(dev);
641 static ssize_t boot_vga_show(struct device *dev, struct device_attribute *attr,
644 struct pci_dev *pdev = to_pci_dev(dev);
660 struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
667 size = dev->cfg_size;
668 else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
680 pci_config_pm_runtime_get(dev);
684 pci_user_read_config_byte(dev, off, &val);
692 pci_user_read_config_word(dev, off, &val);
701 pci_user_read_config_dword(dev, off, &val);
713 pci_user_read_config_word(dev, off, &val);
722 pci_user_read_config_byte(dev, off, &val);
728 pci_config_pm_runtime_put(dev);
737 struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
747 if (off > dev->cfg_size)
749 if (off + count > dev->cfg_size) {
750 size = dev->cfg_size - off;
754 pci_config_pm_runtime_get(dev);
757 pci_user_write_config_byte(dev, off, data[off - init_off]);
765 pci_user_write_config_word(dev, off, val);
775 pci_user_write_config_dword(dev, off, val);
783 pci_user_write_config_word(dev, off, val);
789 pci_user_write_config_byte(dev, off, data[off - init_off]);
794 pci_config_pm_runtime_put(dev);
930 error = device_create_bin_file(&b->dev, b->legacy_io);
942 error = device_create_bin_file(&b->dev, b->legacy_mem);
949 device_remove_bin_file(&b->dev, b->legacy_io);
954 dev_warn(&b->dev, "could not create legacy I/O port and ISA memory resources in sysfs\n");
960 device_remove_bin_file(&b->dev, b->legacy_io);
961 device_remove_bin_file(&b->dev, b->legacy_mem);
1099 * @pdev: dev to cleanup
1113 sysfs_remove_bin_file(&pdev->dev.kobj, res_attr);
1119 sysfs_remove_bin_file(&pdev->dev.kobj, res_attr);
1158 retval = sysfs_create_bin_file(&pdev->dev.kobj, res_attr);
1173 * pci_create_resource_files - create resource files in sysfs for @dev
1174 * @pdev: dev in question
1203 int __weak pci_create_resource_files(struct pci_dev *dev) { return 0; }
1204 void __weak pci_remove_resource_files(struct pci_dev *dev) { return; }
1292 static ssize_t reset_store(struct device *dev, struct device_attribute *attr,
1295 struct pci_dev *pdev = to_pci_dev(dev);
1305 pm_runtime_get_sync(dev);
1307 pm_runtime_put(dev);
1316 static int pci_create_capabilities_sysfs(struct pci_dev *dev)
1320 pcie_vpd_create_sysfs_dev_files(dev);
1322 if (dev->reset_fn) {
1323 retval = device_create_file(&dev->dev, &dev_attr_reset);
1330 pcie_vpd_remove_sysfs_dev_files(dev);
1344 retval = sysfs_create_bin_file(&pdev->dev.kobj, &pcie_config_attr);
1346 retval = sysfs_create_bin_file(&pdev->dev.kobj, &pci_config_attr);
1368 retval = sysfs_create_bin_file(&pdev->dev.kobj, attr);
1387 sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr);
1395 sysfs_remove_bin_file(&pdev->dev.kobj, &pcie_config_attr);
1397 sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
1402 static void pci_remove_capabilities_sysfs(struct pci_dev *dev)
1404 pcie_vpd_remove_sysfs_dev_files(dev);
1405 if (dev->reset_fn) {
1406 device_remove_file(&dev->dev, &dev_attr_reset);
1407 dev->reset_fn = 0;
1425 sysfs_remove_bin_file(&pdev->dev.kobj, &pcie_config_attr);
1427 sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
1432 sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr);
1466 struct device *dev = kobj_to_dev(kobj);
1467 struct pci_dev *pdev = to_pci_dev(dev);
1485 struct device *dev = kobj_to_dev(kobj);
1486 struct pci_dev *pdev = to_pci_dev(dev);
1497 struct device *dev = kobj_to_dev(kobj);
1498 struct pci_dev *pdev = to_pci_dev(dev);
1509 struct device *dev = kobj_to_dev(kobj);
1510 struct pci_dev *pdev = to_pci_dev(dev);