drivers/pci/hotplug/shpchp_sysfs.c

Source file repositories/reference/linux-study-clean/drivers/pci/hotplug/shpchp_sysfs.c

File Facts

System
Linux kernel
Corpus path
drivers/pci/hotplug/shpchp_sysfs.c
Extension
.c
Size
2499 bytes
Lines
87
Domain
Representative Device Path
Bucket
PCIe NVMe Storage Path
Inferred role
Representative Device Path: implementation source
Status
source implementation candidate

Why This File Exists

Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.

Dependency Surface

Detected Declarations

Annotated Snippet

if (res && (res->flags & IORESOURCE_IO)) {
			len += sysfs_emit_at(buf, len,
					     "start = %8.8llx, length = %8.8llx\n",
					     (unsigned long long)res->start,
					     (unsigned long long)resource_size(res));
		}
	}
	len += sysfs_emit_at(buf, len, "Free resources: bus numbers\n");
	for (busnr = bus->busn_res.start; busnr <= bus->busn_res.end; busnr++) {
		if (!pci_find_bus(pci_domain_nr(bus), busnr))
			break;
	}
	if (busnr < bus->busn_res.end)
		len += sysfs_emit_at(buf, len,
				     "start = %8.8x, length = %8.8x\n",
				     busnr, (int)(bus->busn_res.end - busnr));

	return len;
}
static DEVICE_ATTR(ctrl, S_IRUGO, show_ctrl, NULL);

int shpchp_create_ctrl_files(struct controller *ctrl)
{
	return device_create_file(&ctrl->pci_dev->dev, &dev_attr_ctrl);
}

void shpchp_remove_ctrl_files(struct controller *ctrl)
{
	device_remove_file(&ctrl->pci_dev->dev, &dev_attr_ctrl);
}

Annotation

Implementation Notes