thunderbolt: Add support for XDomain discovery protocol
When two hosts are connected over a Thunderbolt cable, there is a protocol they can use to communicate capabilities supported by the host. The discovery protocol uses automatically configured control channel (ring 0) and is build on top of request/response transactions using special XDomain primitives provided by the Thunderbolt base protocol. The capabilities consists of a root directory block of basic properties used for identification of the host, and then there can be zero or more directories each describing a Thunderbolt service and its capabilities. Once both sides have discovered what is supported the two hosts can setup high-speed DMA paths and transfer data to the other side using whatever protocol was agreed based on the properties. The software protocol used to communicate which DMA paths to enable is service specific. This patch adds support for the XDomain discovery protocol to the Thunderbolt bus. We model each remote host connection as a Linux XDomain device. For each Thunderbolt service found supported on the XDomain device, we create Linux Thunderbolt service device which Thunderbolt service drivers can then bind to based on the protocol identification information retrieved from the property directory describing the service. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet <michael.jamet@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e69b71f845
commit
d1ff70241a
@@ -171,11 +171,11 @@ static int nvm_authenticate_host(struct tb_switch *sw)
|
||||
|
||||
/*
|
||||
* Root switch NVM upgrade requires that we disconnect the
|
||||
* existing PCIe paths first (in case it is not in safe mode
|
||||
* existing paths first (in case it is not in safe mode
|
||||
* already).
|
||||
*/
|
||||
if (!sw->safe_mode) {
|
||||
ret = tb_domain_disconnect_pcie_paths(sw->tb);
|
||||
ret = tb_domain_disconnect_all_paths(sw->tb);
|
||||
if (ret)
|
||||
return ret;
|
||||
/*
|
||||
@@ -1363,6 +1363,9 @@ void tb_switch_remove(struct tb_switch *sw)
|
||||
if (sw->ports[i].remote)
|
||||
tb_switch_remove(sw->ports[i].remote->sw);
|
||||
sw->ports[i].remote = NULL;
|
||||
if (sw->ports[i].xdomain)
|
||||
tb_xdomain_remove(sw->ports[i].xdomain);
|
||||
sw->ports[i].xdomain = NULL;
|
||||
}
|
||||
|
||||
if (!sw->is_unplugged)
|
||||
|
Reference in New Issue
Block a user