diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2017-06-06 15:25:00 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-09 11:42:41 +0200 |
commit | 9d3cce0b613689ee849a505ffac179af0ae9fff2 (patch) | |
tree | abe7bda188831abb170c39ebfc4d0765c77f6b02 /drivers/thunderbolt/tunnel_pci.c | |
parent | c9843ebbb83a120094aa3a55bc0190d285e8384a (diff) | |
download | op-kernel-dev-9d3cce0b613689ee849a505ffac179af0ae9fff2.zip op-kernel-dev-9d3cce0b613689ee849a505ffac179af0ae9fff2.tar.gz |
thunderbolt: Introduce thunderbolt bus and connection manager
Thunderbolt fabric consists of one or more switches. This fabric is
called domain and it is controlled by an entity called connection
manager. The connection manager can be either internal (driven by a
firmware running on the host controller) or external (software driver).
This driver currently implements support for the latter.
In order to manage switches and their properties more easily we model
this domain structure as a Linux bus. Each host controller adds a domain
device to this bus, and these devices are named as domainN where N
stands for index or id of the current domain.
We then abstract connection manager specific operations into a new
structure tb_cm_ops and convert the existing tb.c to fill those
accordingly. This makes it easier to add support for the internal
connection manager in subsequent patches.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Michael Jamet <michael.jamet@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andreas Noever <andreas.noever@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt/tunnel_pci.c')
-rw-r--r-- | drivers/thunderbolt/tunnel_pci.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/thunderbolt/tunnel_pci.c b/drivers/thunderbolt/tunnel_pci.c index f4ce984..ca44759 100644 --- a/drivers/thunderbolt/tunnel_pci.c +++ b/drivers/thunderbolt/tunnel_pci.c @@ -194,19 +194,13 @@ err: */ int tb_pci_activate(struct tb_pci_tunnel *tunnel) { - int res; if (tunnel->path_to_up->activated || tunnel->path_to_down->activated) { tb_tunnel_WARN(tunnel, "trying to activate an already activated tunnel\n"); return -EINVAL; } - res = tb_pci_restart(tunnel); - if (res) - return res; - - list_add(&tunnel->list, &tunnel->tb->tunnel_list); - return 0; + return tb_pci_restart(tunnel); } @@ -227,6 +221,5 @@ void tb_pci_deactivate(struct tb_pci_tunnel *tunnel) tb_path_deactivate(tunnel->path_to_down); if (tunnel->path_to_up->activated) tb_path_deactivate(tunnel->path_to_up); - list_del_init(&tunnel->list); } |