sculpt: distinguish devices,pci_devices in /report

This patch reflects both the pci_decode results and the platform
driver's aggregated device information in Sculpt's /report/drivers/ in
the form of pci_devices and devices files respectively.
This commit is contained in:
Norman Feske 2022-10-07 09:57:03 +02:00 committed by Christian Helmuth
parent 3841ee1d51
commit add4990044
2 changed files with 18 additions and 14 deletions

View File

@ -42,15 +42,16 @@
<policy label="pci_decode -> system" report="acpi_drv -> acpi"/>
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
<policy label="rom_filter -> pci_devices" report="pci_decode -> devices"/>
<policy label="driver_manager -> pci_devices" report="platform_drv -> devices"/>
<policy label="usb_drv -> config" report="driver_manager -> usb_drv.config"/>
<policy label="dynamic -> config" report="driver_manager -> init.config"/>
<policy label="driver_manager -> devices" report="platform_drv -> devices"/>
<policy label="driver_manager -> usb_devices" report="usb_drv -> devices"/>
<policy label="driver_manager -> dynamic_state" report="dynamic -> state"/>
<policy label="dynamic -> config" report="driver_manager -> init.config"/>
<policy label="driver_manager -> ahci_ports" report="dynamic -> ahci_ports"/>
<policy label="driver_manager -> nvme_ns" report="dynamic -> nvme_ns"/>
<policy label="rom_reporter -> acpi" report="acpi_drv -> acpi"/>
<policy label="rom_reporter -> pci_devices" report="platform_drv -> devices"/>
<policy label="rom_reporter -> devices" report="platform_drv -> devices"/>
<policy label="rom_reporter -> pci_devices" report="pci_decode -> devices"/>
<policy label="rom_reporter -> usb_devices" report="usb_drv -> devices"/>
<policy label="rom_reporter -> dynamic_state" report="dynamic -> state"/>
<policy label="usb_hid_drv -> report" report="usb_drv -> devices"/>
@ -63,16 +64,19 @@
<config>
<rom label="acpi"/>
<rom label="pci_devices"/>
<rom label="devices"/>
<rom label="usb_devices"/>
<rom label="dynamic_state"/>
</config>
<route>
<service name="ROM" label="acpi"> <child name="report_rom"/> </service>
<service name="ROM" label="pci_devices"> <child name="report_rom"/> </service>
<service name="ROM" label="devices"> <child name="report_rom"/> </service>
<service name="ROM" label="usb_devices"> <child name="report_rom"/> </service>
<service name="ROM" label="dynamic_state"> <child name="report_rom"/> </service>
<service name="Report" label="acpi"> <parent label="acpi"/> </service>
<service name="Report" label="pci_devices"> <parent label="pci_devices"/> </service>
<service name="Report" label="devices"> <parent label="devices"/> </service>
<service name="Report" label="usb_devices"> <parent label="usb_devices"/> </service>
<service name="Report" label="dynamic_state"> <parent label="dynamic -> state"/> </service>
<service name="LOG"> <parent/> </service>
@ -256,7 +260,7 @@
<service name="Report" label="usb_drv.config"> <child name="report_rom"/> </service>
<service name="Report" label="block_devices"> <parent label="block_devices"/> </service>
<service name="ROM" label="usb_devices"> <child name="report_rom"/> </service>
<service name="ROM" label="pci_devices"> <child name="report_rom"/> </service>
<service name="ROM" label="devices"> <child name="report_rom"/> </service>
<service name="ROM" label="ahci_ports"> <child name="report_rom"/> </service>
<service name="ROM" label="nvme_ns"> <child name="report_rom"/> </service>
<service name="ROM" label="dynamic_state"> <child name="report_rom"/> </service>

View File

@ -358,7 +358,7 @@ struct Driver_manager::Main : private Block_devices_generator
Attached_rom_dataspace _platform { _env, "platform_info" };
Attached_rom_dataspace _usb_devices { _env, "usb_devices" };
Attached_rom_dataspace _usb_policy { _env, "usb_policy" };
Attached_rom_dataspace _pci_devices { _env, "pci_devices" };
Attached_rom_dataspace _devices { _env, "devices" };
Attached_rom_dataspace _ahci_ports { _env, "ahci_ports" };
Attached_rom_dataspace _nvme_ns { _env, "nvme_ns" };
Attached_rom_dataspace _dynamic_state { _env, "dynamic_state" };
@ -384,10 +384,10 @@ struct Driver_manager::Main : private Block_devices_generator
return Boot_fb_driver::Mode();
}
void _handle_pci_devices_update();
void _handle_devices_update();
Signal_handler<Main> _pci_devices_update_handler {
_env.ep(), *this, &Main::_handle_pci_devices_update };
Signal_handler<Main> _devices_update_handler {
_env.ep(), *this, &Main::_handle_devices_update };
void _handle_usb_devices_update();
@ -434,7 +434,7 @@ struct Driver_manager::Main : private Block_devices_generator
_usb_drv_config.enabled(true);
_block_devices.enabled(true);
_pci_devices .sigh(_pci_devices_update_handler);
_devices .sigh(_devices_update_handler);
_usb_policy .sigh(_usb_policy_update_handler);
_ahci_ports .sigh(_ahci_ports_update_handler);
_nvme_ns .sigh(_nvme_ns_update_handler);
@ -442,19 +442,19 @@ struct Driver_manager::Main : private Block_devices_generator
_generate_init_config(_init_config);
_handle_pci_devices_update();
_handle_devices_update();
_handle_ahci_ports_update();
_handle_nvme_ns_update();
}
};
void Driver_manager::Main::_handle_pci_devices_update()
void Driver_manager::Main::_handle_devices_update()
{
_pci_devices.update();
_devices.update();
/* decide about fb not before the first valid pci report is available */
if (!_pci_devices.valid())
if (!_devices.valid())
return;
bool has_vga = false;
@ -464,7 +464,7 @@ void Driver_manager::Main::_handle_pci_devices_update()
Boot_fb_driver::Mode const boot_fb_mode = _boot_fb_mode();
_pci_devices.xml().for_each_sub_node([&] (Xml_node device) {
_devices.xml().for_each_sub_node([&] (Xml_node device) {
device.with_optional_sub_node("pci-config", [&] (Xml_node pci) {
uint16_t const vendor_id = (uint16_t)pci.attribute_value("vendor_id", 0U);