thunderbolt: Discover preboot PCIe paths the boot firmware established
In Apple Macs the boot firmware (EFI) connects all devices automatically when the system is started, before it hands over to the OS. Instead of ignoring we discover all those PCIe tunnels and record them using our internal structures, just like we do when a device is connected after the OS is already up. By doing this we can properly tear down tunnels when devices are disconnected. Also this allows us to resume the existing tunnels after system suspend/resume cycle. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
@@ -730,6 +730,20 @@ struct tb_port *tb_next_port_on_path(struct tb_port *start, struct tb_port *end,
|
||||
return next;
|
||||
}
|
||||
|
||||
/**
|
||||
* tb_pci_port_is_enabled() - Is the PCIe adapter port enabled
|
||||
* @port: PCIe port to check
|
||||
*/
|
||||
bool tb_pci_port_is_enabled(struct tb_port *port)
|
||||
{
|
||||
u32 data;
|
||||
|
||||
if (tb_port_read(port, &data, TB_CFG_PORT, port->cap_adap, 1))
|
||||
return false;
|
||||
|
||||
return !!(data & TB_PCI_EN);
|
||||
}
|
||||
|
||||
/**
|
||||
* tb_pci_port_enable() - Enable PCIe adapter port
|
||||
* @port: PCIe port to enable
|
||||
|
Reference in New Issue
Block a user